diff --git a/resources/templates/account_base.html b/resources/templates/account_base.html index 9cbebdf..28edb33 100644 --- a/resources/templates/account_base.html +++ b/resources/templates/account_base.html @@ -2,7 +2,7 @@ {% block body %}
-
+
Manage Account diff --git a/resources/templates/changepassword.html b/resources/templates/changepassword.html index 3874900..593b272 100644 --- a/resources/templates/changepassword.html +++ b/resources/templates/changepassword.html @@ -5,10 +5,10 @@ {% block accountbody %}
-
-
-
-
- +
+
+
+
+
{% endblock %} diff --git a/resources/templates/login.html b/resources/templates/login.html index 446db77..280a9b9 100644 --- a/resources/templates/login.html +++ b/resources/templates/login.html @@ -1,14 +1,14 @@ -{% extends "layout.html" %} +{% extends "login_base.html" %} {% block title %}Kawari - Login{% endblock %} -{% block body %} +{% block loginbody %}
-
-
-
-
- +
+
+
+
+
{% endblock %} diff --git a/resources/templates/login_base.html b/resources/templates/login_base.html new file mode 100644 index 0000000..0cefe64 --- /dev/null +++ b/resources/templates/login_base.html @@ -0,0 +1,9 @@ +{% extends "layout.html" %} + +{% block body %} +
+
+ {% block loginbody %}{% endblock %} +
+
+{% endblock %} diff --git a/resources/templates/register.html b/resources/templates/register.html index af99de7..a99e0b2 100644 --- a/resources/templates/register.html +++ b/resources/templates/register.html @@ -1,13 +1,13 @@ -{% extends "layout.html" %} +{% extends "login_base.html" %} {% block title %}Kawari - Register{% endblock %} -{% block body %} +{% block loginbody %}
-
-
-
-
- +
+
+
+
+
{% endblock %} diff --git a/resources/templates/web.html b/resources/templates/web.html index 8f3f92f..9a87bc3 100644 --- a/resources/templates/web.html +++ b/resources/templates/web.html @@ -1,11 +1,9 @@ -{% extends "layout.html" %} +{% extends "web_base.html" %} {% block title %}Kawari{% endblock %} -{% block body %} -

Welcome to Kawari!

- -Login -Signup -World Status +{% block webbody %} +
+

Welcome to Kawari!

+
{% endblock %} diff --git a/resources/templates/web_base.html b/resources/templates/web_base.html new file mode 100644 index 0000000..367bf17 --- /dev/null +++ b/resources/templates/web_base.html @@ -0,0 +1,25 @@ +{% extends "layout.html" %} + +{% block body %} + +
+ {% block webbody %}{% endblock %} +
+{% endblock %} diff --git a/resources/templates/worldstatus.html b/resources/templates/worldstatus.html index 26baa04..e7116ff 100644 --- a/resources/templates/worldstatus.html +++ b/resources/templates/worldstatus.html @@ -1,8 +1,10 @@ -{% extends "layout.html" %} +{% extends "web_base.html" %} {% block title %}Kawari - World Status{% endblock %} -{% block body %} -

Worlds open: {{ worlds_open }}

-

Login open: {{ login_open }}

+{% block webbody %} +
+

Worlds open: {{ worlds_open }}

+

Login open: {{ login_open }}

+
{% endblock %} diff --git a/src/bin/kawari-login.rs b/src/bin/kawari-login.rs index 400bca8..2bacd3c 100644 --- a/src/bin/kawari-login.rs +++ b/src/bin/kawari-login.rs @@ -28,6 +28,12 @@ fn setup_default_environment() -> Environment<'static> { .expect("Failed to find template!"), ) .unwrap(); + env.add_template_owned( + "login_base.html", + std::fs::read_to_string("resources/templates/login_base.html") + .expect("Failed to find template!"), + ) + .unwrap(); env.add_template_owned( "login.html", std::fs::read_to_string("resources/templates/login.html") diff --git a/src/bin/kawari-web.rs b/src/bin/kawari-web.rs index ba0a387..2b28b7e 100644 --- a/src/bin/kawari-web.rs +++ b/src/bin/kawari-web.rs @@ -14,6 +14,12 @@ fn setup_default_environment() -> Environment<'static> { .expect("Failed to find template!"), ) .unwrap(); + env.add_template_owned( + "web_base.html", + std::fs::read_to_string("resources/templates/web_base.html") + .expect("Failed to find template!"), + ) + .unwrap(); env.add_template_owned( "web.html", std::fs::read_to_string("resources/templates/web.html").expect("Failed to find template!"),