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

Commitee7e83e

Browse files
authored
Onboarding components fixes (#1393)
1 parent47610cb commitee7e83e

File tree

28 files changed

+329
-31
lines changed

28 files changed

+329
-31
lines changed

‎pgml-dashboard/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎pgml-dashboard/src/components/cards/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ pub mod marketing;
1111
pubmod newsletter_subscribe;
1212
pubuse newsletter_subscribe::NewsletterSubscribe;
1313

14+
// src/components/cards/primary
15+
pubmod primary;
16+
pubuse primary::Primary;
17+
1418
// src/components/cards/rgb
1519
pubmod rgb;
1620
pubuse rgb::Rgb;
21+
22+
// src/components/cards/secondary
23+
pubmod secondary;
24+
pubuse secondary::Secondary;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use pgml_components::{component,Component};
2+
use sailfish::TemplateOnce;
3+
4+
#[derive(TemplateOnce,Default)]
5+
#[template(path ="cards/primary/template.html")]
6+
pubstructPrimary{
7+
component:Component,
8+
style:String,
9+
}
10+
11+
implPrimary{
12+
pubfnnew(component:Component) ->Primary{
13+
Primary{
14+
component,
15+
style:"".into(),
16+
}
17+
}
18+
19+
pubfnz_index(mutself,index:i64) ->Self{
20+
self.style =format!("position: relative; z-index: {};", index);
21+
self
22+
}
23+
}
24+
25+
component!(Primary);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
div[data-controller="cards-primary"] {
2+
border-radius:#{$card-border-radius};
3+
padding:#{$card-spacer-y}#{$card-spacer-x};
4+
box-shadow:#{$card-box-shadow};
5+
background-color:#{$gray-800};
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<divdata-controller="cards-primary"style="<%- style %>">
2+
<%+ component %>
3+
</div>

‎pgml-dashboard/src/components/cards/rgb/mod.rs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
use pgml_components::{component,Component};
22
use sailfish::TemplateOnce;
33

4+
usecrate::components::stimulus::StimulusAction;
5+
usecrate::types::CustomOption;
6+
47
#[derive(TemplateOnce)]
58
#[template(path ="cards/rgb/template.html")]
69
pubstructRgb{
710
value:Component,
8-
active:bool,
911
link:Option<String>,
12+
link_action:CustomOption<StimulusAction>,
13+
controller_classes:Vec<String>,
14+
card_classes:Vec<String>,
15+
body_classes:Vec<String>,
1016
}
1117

1218
implDefaultforRgb{
@@ -19,20 +25,44 @@ impl Rgb {
1925
pubfnnew(value:Component) ->Rgb{
2026
Rgb{
2127
value,
22-
active:false,
2328
link:None,
29+
link_action:CustomOption::default(),
30+
controller_classes:vec![],
31+
card_classes:vec![],
32+
body_classes:vec![],
2433
}
2534
}
2635

2736
pubfnactive(mutself) ->Self{
28-
self.active =true;
37+
self.card_classes.push("active".into());
38+
self.card_classes.push("main-gradient-border-card-1".into());
39+
self
40+
}
41+
42+
pubfnis_active(mutself,active:bool) ->Self{
43+
if active{
44+
self.card_classes.push("active".into());
45+
self.card_classes.push("main-gradient-border-card-1".into());
46+
}
47+
2948
self
3049
}
3150

3251
pubfnlink(mutself,link:&str) ->Self{
3352
self.link =Some(link.to_string());
3453
self
3554
}
55+
56+
pubfnlink_action(mutself,action:StimulusAction) ->Self{
57+
self.link_action = action.into();
58+
self
59+
}
60+
61+
pubfnh_100(mutself) ->Self{
62+
self.controller_classes.push("h-100".into());
63+
self.card_classes.push("h-100".into());
64+
self
65+
}
3666
}
3767

3868
component!(Rgb);

‎pgml-dashboard/src/components/cards/rgb/template.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<% let active = if active { "main-gradient-border-card-1 active" } else { "" }; %>
2-
<divdata-controller="cards-rgb">
3-
<divclass="card <%= active %>">
4-
<divclass="card-body">
1+
<%
2+
let controller_classes = controller_classes.join(" ");
3+
let card_classes = card_classes.join(" ");
4+
let body_classes = body_classes.join(" ");
5+
%>
6+
<divdata-controller="cards-rgb"class="<%= controller_classes %>">
7+
<divclass="card <%= card_classes %>">
8+
<divclass="card-body <%= body_classes %>">
59
<%+ value %>
610
<% if let Some(link) = link { %>
7-
<ahref="<%= link %>"class="stretched-link"></a>
11+
<ahref="<%= link %>"class="stretched-link"data-action="<%= link_action %>"></a>
812
<% } %>
913
</div>
1014
</div>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use pgml_components::{component,Component};
2+
use sailfish::TemplateOnce;
3+
4+
#[derive(TemplateOnce,Default)]
5+
#[template(path ="cards/secondary/template.html")]
6+
pubstructSecondary{
7+
value:Component,
8+
}
9+
10+
implSecondary{
11+
pubfnnew(value:Component) ->Secondary{
12+
Secondary{ value}
13+
}
14+
}
15+
16+
component!(Secondary);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
div[data-controller="cards-secondary"] {
2+
.card {
3+
--bs-card-bg:transparent;
4+
--bs-card-border-color:#{$neon-tint-100};
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<divdata-controller="cards-secondary">
2+
<divclass="card">
3+
<divclass="card-body">
4+
<%+ value %>
5+
</div>
6+
</div>
7+
</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp