mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 12:29:50 -04:00
Add in anchor link, and update link in notification history.
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import dateutil
|
import dateutil
|
||||||
|
import urllib
|
||||||
from flask import (Flask, session, Markup, escape, render_template, make_response, current_app)
|
from flask import (Flask, session, Markup, escape, render_template, make_response, current_app)
|
||||||
from flask._compat import string_types
|
from flask._compat import string_types
|
||||||
from flask_login import LoginManager
|
from flask_login import LoginManager
|
||||||
@@ -75,6 +76,7 @@ def create_app(config_name, config_overrides=None):
|
|||||||
application.add_template_filter(format_time)
|
application.add_template_filter(format_time)
|
||||||
application.add_template_filter(syntax_highlight_json)
|
application.add_template_filter(syntax_highlight_json)
|
||||||
application.add_template_filter(valid_phone_number)
|
application.add_template_filter(valid_phone_number)
|
||||||
|
application.add_template_filter(linkable_name)
|
||||||
|
|
||||||
application.after_request(useful_headers_after_request)
|
application.after_request(useful_headers_after_request)
|
||||||
register_errorhandlers(application)
|
register_errorhandlers(application)
|
||||||
@@ -139,6 +141,10 @@ def nl2br(value):
|
|||||||
return Markup(result)
|
return Markup(result)
|
||||||
|
|
||||||
|
|
||||||
|
def linkable_name(value):
|
||||||
|
return urllib.parse.quote_plus(value)
|
||||||
|
|
||||||
|
|
||||||
def syntax_highlight_json(code):
|
def syntax_highlight_json(code):
|
||||||
return Markup(highlight(code, JavascriptLexer(), HtmlFormatter(noclasses=True)))
|
return Markup(highlight(code, JavascriptLexer(), HtmlFormatter(noclasses=True)))
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{% if name %}
|
{% if name %}
|
||||||
<h3 class="sms-message-name">
|
<h3 class="sms-message-name">
|
||||||
{% if edit_link %}
|
{% if edit_link %}
|
||||||
<a href="{{ edit_link }}">{{ name }}</a>
|
<a name="{{ name|linkable_name }}" href="{{ edit_link }}">{{ name }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ name }}
|
{{ name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
{{ item.to }}
|
{{ item.to }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call field() %}
|
{% call field() %}
|
||||||
<a href="{{ url_for(".edit_service_template", service_id=service_id, template_id=item.template.id) }}">{{ item.template.name }}</a>
|
<a href="{{ url_for(".choose_template", service_id=service_id, template_type=item.template.template_type, _anchor=item.template.name|linkable_name) }}">{{ item.template.name }}</a>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call field() %}
|
{% call field() %}
|
||||||
{{ item.template.template_type }}
|
{{ item.template.template_type }}
|
||||||
|
|||||||
Reference in New Issue
Block a user