Skip to content
Permalink
Browse files

Migrate app-specific messaging to app_message block in base template

  • Loading branch information...
lovett committed Aug 10, 2019
1 parent 0772547 commit 7e8bd7c4541bfbe1be7d863f604b1dfe0ce62f66
@@ -74,7 +74,6 @@
{% endif %}
</nav>


<p {% if bookmarks %}class="hidden nothing-message"{% endif %}>Nothing found.</p>

{% if count %}
@@ -4,18 +4,21 @@
{{ macros.staticAsset('htmlhead', 'htmlhead.css') }}
{% endblock %}

{% block app_message %}
{% if failure_message %}
<section id="app-message" class="error">{{ failure_message }}</section>
{% elif status_code and status_code != 200 %}
<section id="app-message" class="error">The URL returned a {{ status_code }}</section>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}


{% block page_body %}
<main>
{{ macros.svgSymbols("search", "close", "globe") }}

{% if failure_message %}
<div class="error message">{{ failure_message }}</div>
{% endif %}

{% if status_code and status_code != 200 %}
<div class="error message">The URL returned a {{ status_code }}.</div>
{% endif %}

<header class="app-nav">
<form method="post" action="{{ app_url }}">
<div class="field">
@@ -1,13 +1,20 @@
{% extends "base.jinja.html" %}
{% import "macros.jinja.html" as macros with context -%}

{% block app_message %}
{% if error %}
<section id="app-message" class="error">{{ error }}</section>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}

{% block page_body %}
<main>
{{ macros.svgSymbols("search", "close", "globe") }}

<header class="app-nav">
<form method="get" action="/phone">
<div class="{% if not error %}hidden{% endif %} error message">{{ error }}</div>
<div class="field">
<label for="number">Number</label>
<input type="text" id="number" name="number" placeholder="enter a phone number or area code" value="{{ number }}"/>
@@ -9,13 +9,19 @@
{{ macros.vueApp('main', ('countdown', 'discardable-record', 'discard-button', '/reminder/static/reminder-form.js', '/reminder/static/reminder-template.js')) }}
{% endblock %}

{% block app_message %}
{% if error %}
<section id="app-message" class="error">{{ error }}</section>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}


{% block page_body %}
<main>
{{ macros.svgSymbols("delete") }}

<div class="{% if not error %}hidden{% endif %} error message">{{ error }}</div>

{% if upcoming %}
<header class="app-nav">
<p>Upcoming</p>
@@ -5,12 +5,18 @@
{{ macros.staticAsset('wakeup', 'wakeup.css') }}
{% endblock %}

{% block app_message %}
{% if sent %}
<section id="app-message" class="success">Ping sent!</section>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}

{% block page_body %}
<main>
{{ macros.svgSymbols("add-item") }}

<div class="{% if not sent %}hidden{% endif %} success message">Ping sent!</div>

<header class="app-nav">
<a href="{{ registry_url }}">
<svg class="icon"><use xlink:href="#add-item"></use></svg>
@@ -39,7 +39,10 @@ <h1>

<span class="focus-buffer-display"></span>
</header>
<div id="app-message" hidden></div>

{% block app_message %}
<section id="app-message" hidden></section>
{% endblock %}

{% block page_body %}{% endblock %}

@@ -188,7 +188,7 @@

{% macro queryPlan(rows) -%}
{% if rows|count > 0 %}
<section class="page-section">
<section>
<details>
<summary>Query</summary>

0 comments on commit 7e8bd7c

Please sign in to comment.
You can’t perform that action at this time.