Skip to content
Permalink
Browse files

Populate app name from request script name

  • Loading branch information
lovett committed Dec 20, 2019
1 parent 4a00e0a commit 8cd258bb0cdc339bd8f9d5a9b47507748b322b1a
@@ -10,7 +10,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Alt URL"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "App Log"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Bookmarklets"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Bookmarks"
exposed = True
show_on_homepage = True

@@ -7,7 +7,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Bounce"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Calls"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Captures"
exposed = True
show_on_homepage = True

@@ -9,7 +9,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Grids"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Headers"
exposed = True
show_on_homepage = True

@@ -7,7 +7,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Headlines"
exposed = True
show_on_homepage = True

@@ -8,7 +8,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Homepage"
exposed = True
show_on_homepage = True

@@ -7,7 +7,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "HTML Head"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "IP"
exposed = True
show_on_homepage = True

@@ -7,7 +7,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Later"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Phone"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Redirect"
exposed = True
show_on_homepage = False

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Registry"
exposed = True
show_on_homepage = True

@@ -10,7 +10,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Reminder"
exposed = True
show_on_homepage = True

@@ -6,7 +6,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Speak"
exposed = True
show_on_homepage = True

@@ -8,7 +8,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Startpage"
exposed = True
show_on_homepage = True

@@ -8,7 +8,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Transform"
exposed = True
show_on_homepage = True

@@ -14,7 +14,6 @@ class Controller:
method-based dispatch
"""

name = "Visitors"
exposed = True
show_on_homepage = True

@@ -8,7 +8,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Wakeup"
exposed = True
show_on_homepage = True

@@ -10,7 +10,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Weather"
exposed = True
show_on_homepage = True

@@ -10,7 +10,6 @@
class Controller:
"""Dispatch application requests based on HTTP verb."""

name = "Whois"
exposed = True
show_on_homepage = True

@@ -2,11 +2,7 @@
<!DOCTYPE html>
<html>
<head>
{% if app_name == "Homepage" -%}
<title>Medley</title>
{%- else -%}
<title>{{ app_name or "Medley" }}</title>
{%- endif %}
<title>{{ (app_name or "Medley")|capitalize }}</title>

<meta
name="viewport"
@@ -36,8 +32,8 @@
<header id="page-header">
<h1>
<a href="{{ '/' | internal_url }}">Medley</a>
{% if app_url -%}
: <a href="{{ app_url }}">{{ app_name }}</a>
{% if app_name -%}
: <a href="{{ app_url }}">{{ app_name|capitalize }}</a>
{%- endif %}
</h1>

@@ -152,7 +152,7 @@ def render_html(self, body: local_types.NegotiableView) -> str:
if not values:
values = {}

values["app_name"] = cherrypy.request.app.root.name
values["app_name"] = cherrypy.request.script_name.lstrip("/")

values["app_url"] = cherrypy.engine.publish(
"url:internal"

0 comments on commit 8cd258b

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