replace flash and noscript with snippets

This commit is contained in:
glyph 2021-11-13 10:53:35 +02:00
parent 06117f377d
commit 67d86e2874
11 changed files with 17 additions and 134 deletions

View File

@ -126,14 +126,7 @@
<p class="card-text">Uptime data unavailable</p>
{%- endif %}
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" -%}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" -%}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif %}
{% include "snippets/flash_message" %}
</div>
</div>
{%- endblock card %}

View File

@ -14,17 +14,7 @@
</form>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{% if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif -%}
{% include "snippets/flash_message" %}
<div class="center-text" style="margin-top: 25px;">
<a href="/forgot_password" class="label-small link">Forgot Password?</a>

View File

@ -4,18 +4,9 @@
<div class="card center">
<div class="card-container">
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="center-text flash-message font-success" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="center-text flash-message font-failure" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- endif %}
<!-- share ux information with the user if JS is disabled -->
<noscript>
<p class="center-text flash-message">This website will be unresponsive while the device shuts down or reboots.</p>
</noscript>
{% include "snippets/flash_message" %}
<!-- NO SCRIPT FOR WHEN JS IS DISABLED -->
{% include "snippets/noscript" %}
</div>
</div>
{%- endblock card -%}

View File

@ -14,23 +14,9 @@
</div>
</form>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{% if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif -%}
<!-- share ux information with the user if JS is disabled -->
<noscript>
<div class="capsule flash-message info-border">
<p class="center-text">This website may be temporarily unresponsive while the WiFi credentials are added.</p>
</div>
</noscript>
{% include "snippets/flash_message" %}
<!-- NO SCRIPT FOR WHEN JS IS DISABLED -->
{% include "snippets/noscript" %}
</div>
</div>
<script type="text/javascript" src="/js/network_add.js"></script>

View File

@ -33,17 +33,7 @@
<a id="viewUsage" class="button button-primary center" href="/network/wifi/usage" title="View Data Usage">View Data Usage</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}</div>
{%- endif %}
{% include "snippets/flash_message" %}
<!-- CARD GRID -->
<div class="card-container">
<div class="three-grid">
@ -124,17 +114,7 @@
<a id="configureAdmin" class="button button-primary center" href="/settings/configure_admin" title="Configure Admin">Configure Admin</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div id="flashMsg" class="capsule center-text flash-message font-success">{{ flash_msg }}</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div id="flashMsg" class="capsule center-text flash-message font-info">{{ flash_msg }}</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div id="flashMsg" class="capsule center-text flash-message font-failure">{{ flash_msg }}</div>
{%- endif %}
{% include "snippets/flash_message" %}
<div id="gridDiv" class="card-container">
<!-- CARD GRID -->
<!-- row of icons representing network statistics -->

View File

@ -66,17 +66,7 @@
<a class="button button-secondary center" href="/network/wifi" title="Cancel">Cancel</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}</div>
{%- endif -%}
{% include "snippets/flash_message" %}
</div>
</div>
<script type="text/javascript" src="/js/network_detail.js"></script>

View File

@ -14,17 +14,7 @@
</div>
</form>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif -%}
{% include "snippets/flash_message" %}
</div>
</div>
<script type="text/javascript" src="/js/network_modify.js"></script>

View File

@ -41,17 +41,7 @@
<a class="button button-secondary center" href="/network" title="Cancel">Cancel</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{% if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "info" %}
<!-- display info message -->
<div class="capsule center-text flash-message font-info">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif -%}
{% include "snippets/flash_message" %}
</form>
<script type="text/javascript" src="/js/network_usage.js"></script>
{%- endblock card %}

View File

@ -10,15 +10,6 @@
<a id="followers" class="button button-primary center" href="/scuttlebutt/followers" title="List Followers">Followers</a>
<a id="blocks" class="button button-primary center" href="/scuttlebutt/blocks" title="List Blocks">Blocks</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="center-text flash-message font-success" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="center-text flash-message font-failure" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- endif %}
</div>
</div>
{%- endblock card -%}

View File

@ -27,13 +27,6 @@
<a id="privateMessage" class="button button-primary center" href="/scuttlebutt/private_message" title="Private Message">Private Message</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="center-text flash-message font-success" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="center-text flash-message font-failure" style="padding-left: 5px;">{{ flash_msg }}.</div>
{%- endif %}
{% include "snippets/flash_message" %}
</div>
{%- endblock card -%}

View File

@ -10,20 +10,9 @@
<a id="cancelBtn" class="button button-secondary center" href="/" title="Cancel">Cancel</a>
</div>
<!-- FLASH MESSAGE -->
<!-- check for flash message and display accordingly -->
{%- if flash_msg and flash_name == "success" %}
<!-- display success message -->
<div class="capsule center-text flash-message font-success">{{ flash_msg }}.</div>
{%- elif flash_msg and flash_name == "error" %}
<!-- display error message -->
<div class="capsule center-text flash-message font-failure">{{ flash_msg }}.</div>
{%- endif %}
<!-- share ux information with the user if JS is disabled -->
<noscript>
<div class="capsule flash-message info-border">
<p class="center-text">This website will be unresponsive while the device shuts down or reboots.</p>
</div>
</noscript>
{% include "snippets/flash_message" %}
<!-- NO SCRIPT FOR WHEN JS IS DISABLED -->
{% include "snippets/noscript" %}
</div>
</div>
<script type="text/javascript" src="/js/shutdown_menu.js"></script>