Browse Source

Standardize title generation.

master
Ben Kurtovic 4 years ago
parent
commit
9880e8d66f
6 changed files with 15 additions and 6 deletions
  1. +1
    -1
      templates/404.mako
  2. +10
    -1
      templates/_base.mako
  3. +1
    -1
      templates/campaigns/campaign.mako
  4. +1
    -1
      templates/error.mako
  5. +1
    -1
      templates/logout.mako
  6. +1
    -1
      templates/members/members.mako

+ 1
- 1
templates/404.mako View File

@@ -1,6 +1,6 @@
<%inherit file="_base.mako"/>
<%block name="title">
404 &ndash; ${g.config.get("corp.name") | h}
${self.maketitle("404")}
</%block>
<h2>Error 404</h2>
<p>The page you asked for couldn't be found.</p>

+ 10
- 1
templates/_base.mako View File

@@ -3,7 +3,16 @@
<head>
<meta charset="utf-8">
<title>
<%block name="title">${g.config.get("corp.name") | h}</%block>
<%def name="maketitle(*parts)">
<%
if request.url_rule.endpoint == "index":
parts = ()
%>
${" | ".join(parts + (g.config.get("corp.name"),)) | h}
</%def>
<%block name="title">
${maketitle()}
</%block>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="${g.config.scheme}://${g.config.get('site.canonical')}${request.script_root}${request.path}">


+ 1
- 1
templates/campaigns/campaign.mako View File

@@ -1,6 +1,6 @@
<%inherit file="../_default.mako"/>
<%block name="title">
${campaign["title"] | h} &ndash; Campaign &ndash; ${g.config.get("corp.name") | h}
${self.maketitle(campaign["title"], "Campaign")}
</%block>
<h2><span class="understate">Campaign:</span> ${campaign["title"] | h}</h2>
<p>Hello! ...</p>

+ 1
- 1
templates/error.mako View File

@@ -1,6 +1,6 @@
<%inherit file="_base.mako"/>
<%block name="title">
Error &ndash; ${g.config.get("corp.name") | h}
${self.maketitle("Error")}
</%block>
<h2>Error!</h2>
<p>You may report the following information to the developers:</p>


+ 1
- 1
templates/logout.mako View File

@@ -1,6 +1,6 @@
<%inherit file="_base.mako"/>
<%block name="title">
Log out &ndash; ${g.config.get("corp.name") | h}
${self.maketitle("Log out")}
</%block>
<h2>Log out</h2>
<p>Use the button below to safely log out and clear your session.</p>


+ 1
- 1
templates/members/members.mako View File

@@ -1,6 +1,6 @@
<%inherit file="../_default.mako"/>
<%block name="title">
Members &ndash; ${g.config.get("corp.name") | h}
${self.maketitle("Members")}
</%block>
<h2>Members</h2>
% if members:


Loading…
Cancel
Save