Skip to content
Permalink
Browse files

[bounce] Provide link to registry when displaying a list of bounces

  • Loading branch information...
lovett committed Aug 14, 2019
1 parent e09da5d commit c20a20eddd609a2dfd2274ce80c2efa1d45403e6
Showing with 13 additions and 1 deletion.
  1. +5 −1 apps/bounce/bounce.jinja.html
  2. +8 −0 apps/bounce/main.py
@@ -53,10 +53,14 @@
<shortcut-link
v-bind:index="{{ loop.index }}"
url="{{ values[0]|anonymize }}"
label="{{ values[0]|truncate(100) }}"
label="{{ values[1] }} @ {{ values[0]|truncate(100) }}"
/>
</p>
{% endfor %}

{% if registry_url %}
<p><a href="{{ registry_url }}" target="_blank">Edit</a></p>
{% endif %}
{% endif %}
</main>
{% endblock %}
@@ -81,6 +81,7 @@ def GET(self, *_args, **kwargs):
name = None
group = kwargs.get('group')
url = kwargs.get('u')
registry_url = None

if url:
host = self.url_to_host(url)
@@ -103,6 +104,12 @@ def GET(self, *_args, **kwargs):
search_key
).pop()

registry_url = cherrypy.engine.publish(
"url:internal",
"/registry",
{"q": "bounce:{}".format(group)}
).pop()

departing_from = None
if host and bounces:
# Match the current URL to a known site.
@@ -133,6 +140,7 @@ def GET(self, *_args, **kwargs):
"group": group,
"name": name,
"bounces": bounces,
"registry_url": registry_url
})
}

0 comments on commit c20a20e

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