From 67d86e287400146449836c8cc8a4dd6756b10a8d Mon Sep 17 00:00:00 2001 From: glyph Date: Sat, 13 Nov 2021 10:53:35 +0200 Subject: [PATCH] replace flash and noscript with snippets --- peach-web/templates/device.html.tera | 9 +------- peach-web/templates/login.html.tera | 12 +--------- peach-web/templates/messages.html.tera | 15 +++--------- peach-web/templates/network_add.html.tera | 20 +++------------- peach-web/templates/network_card.html.tera | 24 ++------------------ peach-web/templates/network_detail.html.tera | 12 +--------- peach-web/templates/network_modify.html.tera | 12 +--------- peach-web/templates/network_usage.html.tera | 12 +--------- peach-web/templates/peers.html.tera | 9 -------- peach-web/templates/profile.html.tera | 9 +------- peach-web/templates/shutdown.html.tera | 17 +++----------- 11 files changed, 17 insertions(+), 134 deletions(-) diff --git a/peach-web/templates/device.html.tera b/peach-web/templates/device.html.tera index 35556ca4..9b313331 100644 --- a/peach-web/templates/device.html.tera +++ b/peach-web/templates/device.html.tera @@ -126,14 +126,7 @@

Uptime data unavailable

{%- endif %} - - {%- if flash_msg and flash_name == "success" -%} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" -%} - -
{{ flash_msg }}.
- {%- endif %} + {% include "snippets/flash_message" %} {%- endblock card %} diff --git a/peach-web/templates/login.html.tera b/peach-web/templates/login.html.tera index 3e667916..072e5fb4 100644 --- a/peach-web/templates/login.html.tera +++ b/peach-web/templates/login.html.tera @@ -14,17 +14,7 @@ - - {% if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif -%} + {% include "snippets/flash_message" %}
Forgot Password? diff --git a/peach-web/templates/messages.html.tera b/peach-web/templates/messages.html.tera index 36f6fed2..394f0b02 100644 --- a/peach-web/templates/messages.html.tera +++ b/peach-web/templates/messages.html.tera @@ -4,18 +4,9 @@
- - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif %} - - + {% include "snippets/flash_message" %} + + {% include "snippets/noscript" %}
{%- endblock card -%} diff --git a/peach-web/templates/network_add.html.tera b/peach-web/templates/network_add.html.tera index e73a5d29..aaa47ad6 100644 --- a/peach-web/templates/network_add.html.tera +++ b/peach-web/templates/network_add.html.tera @@ -14,23 +14,9 @@
- - {% if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif -%} - - + {% include "snippets/flash_message" %} + + {% include "snippets/noscript" %} diff --git a/peach-web/templates/network_card.html.tera b/peach-web/templates/network_card.html.tera index 2fdf6fc7..aac40c4e 100644 --- a/peach-web/templates/network_card.html.tera +++ b/peach-web/templates/network_card.html.tera @@ -33,17 +33,7 @@ View Data Usage - - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}
- {%- endif %} + {% include "snippets/flash_message" %}
@@ -124,17 +114,7 @@ Configure Admin
- - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}
- {%- endif %} + {% include "snippets/flash_message" %}
diff --git a/peach-web/templates/network_detail.html.tera b/peach-web/templates/network_detail.html.tera index 89b84935..c58b5ded 100644 --- a/peach-web/templates/network_detail.html.tera +++ b/peach-web/templates/network_detail.html.tera @@ -66,17 +66,7 @@ Cancel
- - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}
- {%- endif -%} + {% include "snippets/flash_message" %}
diff --git a/peach-web/templates/network_modify.html.tera b/peach-web/templates/network_modify.html.tera index 4c9e5ef0..3c9b18c3 100644 --- a/peach-web/templates/network_modify.html.tera +++ b/peach-web/templates/network_modify.html.tera @@ -14,17 +14,7 @@ - - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif -%} + {% include "snippets/flash_message" %} diff --git a/peach-web/templates/network_usage.html.tera b/peach-web/templates/network_usage.html.tera index db876202..2c0ac65b 100644 --- a/peach-web/templates/network_usage.html.tera +++ b/peach-web/templates/network_usage.html.tera @@ -41,17 +41,7 @@ Cancel - - {% if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "info" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif -%} + {% include "snippets/flash_message" %} {%- endblock card %} diff --git a/peach-web/templates/peers.html.tera b/peach-web/templates/peers.html.tera index 8a61b4f7..b78906f8 100644 --- a/peach-web/templates/peers.html.tera +++ b/peach-web/templates/peers.html.tera @@ -10,15 +10,6 @@ Followers Blocks - - - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif %} {%- endblock card -%} diff --git a/peach-web/templates/profile.html.tera b/peach-web/templates/profile.html.tera index ff6b97c1..aac58f0f 100644 --- a/peach-web/templates/profile.html.tera +++ b/peach-web/templates/profile.html.tera @@ -27,13 +27,6 @@ Private Message - - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif %} + {% include "snippets/flash_message" %} {%- endblock card -%} diff --git a/peach-web/templates/shutdown.html.tera b/peach-web/templates/shutdown.html.tera index f2c8c50f..12b450cd 100644 --- a/peach-web/templates/shutdown.html.tera +++ b/peach-web/templates/shutdown.html.tera @@ -10,20 +10,9 @@ Cancel - - {%- if flash_msg and flash_name == "success" %} - -
{{ flash_msg }}.
- {%- elif flash_msg and flash_name == "error" %} - -
{{ flash_msg }}.
- {%- endif %} - - + {% include "snippets/flash_message" %} + + {% include "snippets/noscript" %}