From 080b925ce13242d69bf0af9e7ca5300173b94785 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 7 Dec 2021 16:18:27 +0300 Subject: Migrate to Rust 2021 --- src/frontend/templates/mod.rs | 8 ++++---- src/frontend/templates/onboarding.rs | 40 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/frontend/templates') diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs index e6dec51..bf30fa1 100644 --- a/src/frontend/templates/mod.rs +++ b/src/frontend/templates/mod.rs @@ -46,18 +46,18 @@ markup::define! { } body { // TODO Somehow compress headerbar into a menu when the screen space is tight - nav#headerbar { + nav #headerbar { ul { - li { a#homepage[href="/"] { @blog_name } } + li { a #homepage[href="/"] { @blog_name } } @for feed in feeds.iter() { li { a[href=&feed.uid] { @feed.name } } } li.shiftright { @if user.is_none() { - a#login[href="/login"] { "Sign in" } + a #login[href="/login"] { "Sign in" } } else { span { - @user.as_ref().unwrap() " - " a#logout[href="/logout"] { "Sign out" } + @user.as_ref().unwrap() " - " a #logout[href="/logout"] { "Sign out" } } } } diff --git a/src/frontend/templates/onboarding.rs b/src/frontend/templates/onboarding.rs index ebf8881..0dfb462 100644 --- a/src/frontend/templates/onboarding.rs +++ b/src/frontend/templates/onboarding.rs @@ -31,13 +31,13 @@ markup::define! { hr; p { "In other words: " b { "please enable JavaScript for this page to work properly." } small { "sorry T__T" } } } - ul#progressbar[style="display: none"] { - li#intro { "Introduction" } - li#hcard { "Your profile" } - li#settings { "Your website" } - li#firstpost { "Your first post" } + ul #progressbar[style="display: none"] { + li #intro { "Introduction" } + li #hcard { "Your profile" } + li #settings { "Your website" } + li #firstpost { "Your first post" } } - fieldset#intro[style="display: none"] { + fieldset #intro[style="display: none"] { legend { "Introduction" } p { "Kittybox is a CMS that can act as a member of the IndieWeb. " @@ -52,7 +52,7 @@ markup::define! { } } - fieldset#hcard[style="display: none"] { + fieldset #hcard[style="display: none"] { legend { "Your profile" } p { "An h-card is an IndieWeb social profile, and we're gonna make you one!" } p { "Thanks to some clever markup, it will be readable by both humans and machines looking at your homepage."} @@ -63,7 +63,7 @@ markup::define! { div.form_group { label[for="hcard_name"] { "Your name" } - input#hcard_name[name="hcard_name", placeholder="Your name"]; + input #hcard_name[name="hcard_name", placeholder="Your name"]; small { "No need to write the name as in your passport, this is not a legal document " "- just write how you want to be called on the network. This name will be also " @@ -73,9 +73,9 @@ markup::define! { div.form_group { label[for="pronouns"] { "Your pronouns" } - div.multi_input#pronouns { + div.multi_input #pronouns { template { - input#hcard_pronouns[name="hcard_pronouns", placeholder="they/them?"]; + input #hcard_pronouns[name="hcard_pronouns", placeholder="they/them?"]; } button.add_more[type="button", "aria-label"="Add more"] { "[+] Add more" } } @@ -87,9 +87,9 @@ markup::define! { div.form_group { label[for="urls"] { "Links to other pages of you" } - div.multi_input#urls { + div.multi_input #urls { template { - input#hcard_url[name="hcard_url", placeholder="https://example.com/"]; + input #hcard_url[name="hcard_url", placeholder="https://example.com/"]; } button.add_more[type="button", "aria-label"="Add more"] { "[+] Add more" } } @@ -101,7 +101,7 @@ markup::define! { div.form_group { label[for="hcard_note"] { "A little about yourself" } - textarea#hcard_note[name="hcard_note", placeholder="Loves cooking, plants, cats, dogs and racoons."] {} + textarea #hcard_note[name="hcard_note", placeholder="Loves cooking, plants, cats, dogs and racoons."] {} small { "A little bit of introduction. Just one paragraph, and note, you can't use HTML here (yet)." } // TODO: HTML e-note instead of p-note } @@ -114,14 +114,14 @@ markup::define! { } } - fieldset#settings[style="display: none"] { + fieldset #settings[style="display: none"] { legend { "Your website" } p { "Ok, it's nice to know you more. Tell me about what you'll be writing and how you want to name your blog." } // TODO: site-name, saved to settings div.form_group { label[for="blog_name"] { "Your website's name"} - input#blog_name[name="blog_name", placeholder="Kitty Box!"]; + input #blog_name[name="blog_name", placeholder="Kitty Box!"]; small { "It'll get shown in the title of your blog, in the upper left corner!" } } @@ -143,17 +143,17 @@ markup::define! { // TODO: Put a link to documentation explaining feeds in more detail. } } - div.multi_input#custom_feeds { + div.multi_input #custom_feeds { template { fieldset.feed { div.form_group { label[for="feed_name"] { "Name" } - input#feed_name[name="feed_name", placeholder="My cool feed"]; + input #feed_name[name="feed_name", placeholder="My cool feed"]; small { "This is a name that will identify this feed to the user. Make it short and descriptive!" } } div.form_group { label[for="feed_slug"] { "Slug" } - input#feed_slug[name="feed_slug", placeholder="my-cool-feed"]; + input #feed_slug[name="feed_slug", placeholder="my-cool-feed"]; small { "This will form a pretty URL for the feed. For example: https://example.com/feeds/my-cool-feed" } } } @@ -168,7 +168,7 @@ markup::define! { } } - fieldset#firstpost[style="display: none"] { + fieldset #firstpost[style="display: none"] { legend { "Your first post" } p { "Maybe you should start writing your first posts now. How about a short note?" } p { "A note is a short-form post (not unlike a tweet - but without the actual character limit) that doesn't bear a title." } @@ -180,7 +180,7 @@ markup::define! { " here to spice up your note!)" } - textarea#first_post_content[style="width: 100%; height: 8em", placeholder="Hello! I am really excited about #IndieWeb"] {} + textarea #first_post_content[style="width: 100%; height: 8em", placeholder="Hello! I am really excited about #IndieWeb"] {} div.switch_card_buttons { button.switch_card.prev_card[type="button", "data-card"="settings"] { "Previous" } -- cgit 1.4.1