Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72473de

Browse files
authored
Revert "Allow to inject arbitrary components into the <head>" (#1504)
1 parent803739d commit72473de

File tree

4 files changed

+2
-46
lines changed

4 files changed

+2
-46
lines changed

‎pgml-dashboard/src/components/layouts/head/mod.rs‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use pgml_components::{component,Component};
1+
use pgml_components::component;
22
use sailfish::TemplateOnce;
33

44
#[derive(TemplateOnce,Default,Clone)]
@@ -10,7 +10,6 @@ pub struct Head {
1010
pubpreloads:Vec<String>,
1111
pubcontext:Option<String>,
1212
pubcanonical:Option<String>,
13-
pubadditional_components:Vec<Component>,
1413
}
1514

1615
implHead{
@@ -59,25 +58,6 @@ impl Head {
5958
self.context = context.to_owned();
6059
self
6160
}
62-
63-
/// Add a component to `<head>`.
64-
///
65-
/// This can be anything, e.g. a `<script>` tag or a `<meta>` or just some HTML or text.
66-
///
67-
/// # Example
68-
///
69-
/// ```
70-
/// use pgml_components::Component;
71-
/// use pgml_components::layouts::Head;
72-
///
73-
/// let head = Head::new()
74-
/// .add_component(Component::from("<script>console.log('hello');</script>"));
75-
/// ```
76-
///
77-
pubfnadd_component(mutself,component:Component) ->Self{
78-
self.additional_components.push(component);
79-
self
80-
}
8161
}
8262

8363
component!(Head);

‎pgml-dashboard/src/components/layouts/head/template.html‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,4 @@
9797
};
9898
</script>
9999
<% } %>
100-
101-
<% for component in additional_components { %>
102-
<%+ component %>
103-
<% } %>
104100
</head>

‎pgml-dashboard/src/components/layouts/marketing/base/mod.rs‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::components::notifications::marketing::AlertBanner;
33
usecrate::guards::Cluster;
44
usecrate::models::User;
55
usecrate::Notification;
6-
use pgml_components::{component,Component};
6+
use pgml_components::component;
77
use sailfish::TemplateOnce;
88
use std::fmt;
99

@@ -72,15 +72,6 @@ impl Base {
7272
rsp
7373
}
7474

75-
/// Add a component to the `<head>`.
76-
///
77-
/// See [`Head::add_component`](crate::components::layouts::Head::add_component) for more information.
78-
///
79-
pubfnadd_head_component(mutself,component:Component) ->Self{
80-
self.head =self.head.add_component(component);
81-
self
82-
}
83-
8475
pubfnfooter(mutself,footer:String) ->Self{
8576
self.footer =Some(footer);
8677
self

‎pgml-dashboard/src/templates/mod.rs‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,6 @@ impl<'a> WebAppBase<'a> {
163163
self
164164
}
165165

166-
/// Add a component to head (`<head>`).
167-
///
168-
/// # Arguments
169-
///
170-
/// * `component` - The component to add to the head.
171-
///
172-
pubfnadd_head_component(&mutself,component:Component) ->&mutSelf{
173-
self.head =self.head.clone().add_component(component);
174-
self
175-
}
176-
177166
pubfnrender<T>(&mutself,template:T) ->String
178167
where
179168
T: sailfish::TemplateOnce,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp