Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pointercrate-user-pages/src/account/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
theme::task_theme,
trp,
};
use pointercrate_core_pages::head::Script;
use pointercrate_user::{
auth::{AuthenticatedUser, NonMutating},
config,
Expand All @@ -25,11 +24,11 @@
"/static/user/js/account/profile.js".into()
}

fn additional_scripts(&self) -> Vec<Script> {

Check failure on line 27 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope

Check failure on line 27 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope
if cfg!(feature = "oauth2") {
vec![
Script::r#async("https://accounts.google.com/gsi/client"),

Check failure on line 30 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope

Check failure on line 30 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope
Script::module("/static/user/js/gsi-theme.js"),

Check failure on line 31 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope

Check failure on line 31 in pointercrate-user-pages/src/account/profile.rs

View workflow job for this annotation

GitHub Actions / container-job

cannot find type `Script` in this scope
]
} else {
Vec::new()
Expand Down Expand Up @@ -151,7 +150,7 @@
data-client_id=(config::google_client_id())
data-callback="googleOauthCallback" {}

script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) async {}
script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) defer {}
div .g_id_signin data-text="continue_with" data-theme=(task_theme().as_gsi_theme()) style="margin: 10px 0px" data-locale=(lang) {}
p.error #g-signin-error style="text-align: left" {}
}
Expand Down
14 changes: 3 additions & 11 deletions pointercrate-user-pages/src/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,15 @@ use pointercrate_core_pages::{head::HeadLike, trp_html, PageFragment};
use pointercrate_user::config;

pub fn login_page() -> PageFragment {
let mut frag = PageFragment::new(
PageFragment::new(
"Pointercrate - Login",
"Log in to an existing pointercrate account or register for a new one!",
)
.module("/static/user/js/login.js")
.module("/static/core/js/modules/form.js")
.module("/static/core/js/modules/tab.js")
.stylesheet("/static/user/css/login.css")
.body(login_page_body());

if cfg!(feature = "oauth2") {
frag = frag
.async_script("https://accounts.google.com/gsi/client")
.module("/static/user/js/gsi-theme.js");
}

frag
.body(login_page_body())
}

fn login_page_body() -> Markup {
Expand All @@ -48,7 +40,7 @@ fn login_page_body() -> Markup {
data-client_id=(config::google_client_id())
data-callback="googleOauthCallback" {}

script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) async {}
script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) defer {}
div .g_id_signin data-text="continue_with" data-theme=(task_theme().as_gsi_theme()) style="margin: 10px 0px" data-locale=(lang) {}
p.error #g-signin-error style="text-align: left" {}

Expand Down
14 changes: 3 additions & 11 deletions pointercrate-user-pages/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ use pointercrate_core_pages::{trp_html, PageFragment};
use pointercrate_user::config;

pub fn registration_page() -> PageFragment {
let mut frag = PageFragment::new("Pointercrate - Registration", "Register for a new pointercrate account!")
PageFragment::new("Pointercrate - Registration", "Register for a new pointercrate account!")
.module("/static/user/js/register.js")
.module("/static/core/js/modules/form.js")
.module("/static/core/js/modules/tab.js")
.stylesheet("/static/user/css/login.css")
.body(register_page_body());

if cfg!(feature = "oauth2") {
frag = frag
.async_script("https://accounts.google.com/gsi/client")
.module("/static/user/js/gsi-theme.js");
}

frag
.body(register_page_body())
}

fn register_page_body() -> Markup {
Expand All @@ -44,7 +36,7 @@ fn register_page_body() -> Markup {
data-client_id=(config::google_client_id())
data-callback="googleOauthRegisterCallback" {}

script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) async {}
script src=(format!("https://accounts.google.com/gsi/client?hl={}", &lang)) defer {}
div .g_id_signin data-text="signup_with" data-theme=(task_theme().as_gsi_theme()) style="margin: 10px 0px" {}
@if cfg!(feature = "legacy_accounts") {
p.or style="text-size: small; margin: 0px" { (tr("login.methods-separator")) }
Expand Down
Loading