mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Make a function for parsing help query param
Our templates are a littered with `request.args.get('help', '0')`.
This commit refactors these into a single helper method, which can be
used by the view functions, then passed to the template.
This makes the templates cleaner, and should make it easier to refactor
`help` out of the query parameters entirely in the future.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{% from "components/banner.html" import banner_wrapper %}
|
||||
|
||||
{% if request.args['help'] and request.args['help'] != '0' %}
|
||||
{% if help %}
|
||||
{% call banner_wrapper(type='tour') %}
|
||||
<p class="heading-medium">Try this example</p>
|
||||
<div class="grid-row bottom-gutter" {% if request.args['help'] != '1' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="grid-row bottom-gutter" {% if help != '1' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="column-one-sixth">
|
||||
<p class="heading-large" style="float: left;">1.</p>
|
||||
</div>
|
||||
@@ -13,7 +13,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-row bottom-gutter" {% if request.args['help'] != '2' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="grid-row bottom-gutter" {% if help != '2' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="column-one-sixth">
|
||||
<p class="heading-large">2.</p>
|
||||
</div>
|
||||
@@ -23,7 +23,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-row bottom-gutter" {% if request.args['help'] != '3' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="grid-row bottom-gutter" {% if help != '3' %}style="opacity: 0.6"{% endif %}>
|
||||
<div class="column-one-sixth">
|
||||
<p class="heading-large">3.</p>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
<p>
|
||||
Notify delivers the message
|
||||
</p>
|
||||
{% if request.args['help'] == '3' %}
|
||||
{% if help == '3' %}
|
||||
<a href='{{ url_for(".go_to_dashboard_after_tour", service_id=current_service.id, example_template_id=template.id) }}'>
|
||||
Now go to your dashboard
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user