- Notifications
You must be signed in to change notification settings - Fork328
Subscribe module#1367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Subscribe module#1367
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
5a3cbce
start
chillenberger9e90df6
subscribe use turbo frames, all unsubscribe, add module to careers page
chillenberger55dce32
Merge branch 'master' into dan-subscribe-backend
chillenberger3d200ed
fix doc landing page accordian spacing, add padding to bottom
chillenberger6912f35
fix chrome autofill color, fix subscribe small spacing
chillenbergerFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
27 changes: 25 additions & 2 deletionspgml-dashboard/src/components/cards/newsletter_subscribe/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletionspgml-dashboard/src/components/cards/newsletter_subscribe/newsletter_subscribe.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
64 changes: 51 additions & 13 deletionspgml-dashboard/src/components/cards/newsletter_subscribe/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,54 @@ | ||
<% | ||
use pgml_components::Component; | ||
let success_class = match success { | ||
Some(true) => "success", | ||
Some(false) => "error", | ||
None => "" | ||
}; | ||
let message = match success { | ||
Some(true) => "Success".to_string(), | ||
Some(false) => error_message.unwrap_or("Something went wrong".to_string()), | ||
None => String::new() | ||
}; | ||
let error_icon = match success { | ||
Some(false) => Component::from(r#"<span class="material-symbols-outlined m-auto pe-2 text-error">warning</span>"#), | ||
_ => Component::from("") | ||
}; | ||
let email_placeholder = match &email { | ||
Some(email) => email.clone().to_string(), | ||
None => { | ||
let message = match success { | ||
Some(true) => "Add Another Email".to_string(), | ||
_ => "hootareyou@email.com".to_string() | ||
}; | ||
message | ||
} | ||
}; | ||
%> | ||
<turbo-frame id="newsletter-subscribe-frame"> | ||
<div data-controller="cards-newsletter-subscribe"> | ||
<div class="d-flex flex-column flex-lg-row gap-5 justify-content-between align-items-center newsletter-subscribe-container py-5 ps-xl-5 px-3 rounded-4"> | ||
<div class="d-flex flex-column gap-4 text-center text-md-start w-100"> | ||
<h3>Subscribe to our newsletter.<br> (It’s better than you think)</h3> | ||
<p>No spam. No sales pitches. Just product updates. Keep up with all our articles and news. Join our newsletter and stay up to date!</p> | ||
</div> | ||
<div class="d-flex flex-column justify-content-center align-items-xl-end align-items-center gap-3 w-100 position-relative" style="max-width: 27rem;"> | ||
<form action="/newsletter_subscribe" class="d-flex flex-lg-row flex-column gap-3 w-100" method="post"> | ||
<div class="input-group p-1 ps-3 subscribe-input d-flex flex-row gap-1"> | ||
<input type="email" class="form-control border-0" placeholder="<%- email_placeholder %>" name="email" autocomplete="off" <% if email.is_some() {%>value="<%- email.unwrap() %><% } %>"> | ||
<%+ error_icon %> | ||
<button type="submit" class="btn btn-primary rounded-2 d-none d-md-block">Subscribe</button> | ||
</div> | ||
<button type="submit" class="btn btn-primary rounded-2 d-md-none mx-auto">Subscribe</button> | ||
</form> | ||
<p class="message <%- success_class %> position-absolute body-small-text"><%- message %></p> | ||
</div> | ||
</div> | ||
</div> | ||
</turbo-frame> |
2 changes: 1 addition & 1 deletionpgml-dashboard/src/components/layouts/docs/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionpgml-dashboard/src/components/loading/message/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletionspgml-dashboard/src/components/pages/blog/landing_page/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletionpgml-dashboard/src/components/pages/careers/landing_page/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionspgml-dashboard/src/components/pages/docs/landing_page/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletionspgml-dashboard/static/css/scss/components/_forms.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.