Commits

Sam Toyer  committed 95abf89

Refactor title code, fixes #147

  • Participants
  • Parent commits be94a08

Comments (0)

Files changed (11)

File MoinMoin/apps/frontend/views.py

     refs_here = _backrefs(item_name)
     return render_template('item_link_list.html',
                            item_name=item_name,
-                           headline=_(u'Refers Here'),
+                           headline=_(u"Items which refer to '%(item_name)s'", item_name=item_name),
                            item_names=refs_here
                           )
 
             if rank == wanted_rank:
                 item_names.append(name)
     return render_template("item_link_list.html",
-                           headline=_("Items with similar names"),
+                           headline=_("Items with similar names to '%(item_name)s'", item_name=item_name),
                            item_name=item_name, # XXX no item
                            item_names=item_names)
 

File MoinMoin/templates/base.html

 
     {% block head_title %}
     <title>
-    {%- if title -%}{{ title }}{% else %}{{ item_name }}{%- endif %} -
+        {%- if title -%}
+            {{ title }}
+        {% elif title_name %}
+            {{ title_name }}
+        {% elif headline %}
+            {{ headline }}
+        {% else %}
+            {{ item_name }}
+        {%- endif %} -
     {%- if cfg.html_pagetitle -%} {{ cfg.html_pagetitle }}{% else %} {{ cfg.sitename }}{%- endif -%}
     </title>
     {% endblock %}

File MoinMoin/templates/delete.html

 {% import "forms.html" as forms %}
 {% extends theme("layout.html") %}
+
+{% set title = _("Delete '%(item_name)s'", item_name=item.name) %}
+
 {% block content %}
-<h1>{{ _("Delete '%(item_name)s'", item_name=item.name) }}</h1>
+<h1>{{ title }}</h1>
 <div class="moin-form">
 {{ gen.form.open(form, method="post", action=url_for('frontend.delete_item', item_name=item.name)) }}
   {{ forms.render_errors(form) }}

File MoinMoin/templates/destroy.html

 {% import "forms.html" as forms %}
 {% extends theme("layout.html") %}
+
+{% set title = _("DESTROY COMPLETE item '%(item_name)s'", item_name=item.name) %}
+
 {% block content %}
 {% if rev_id == None %}
-    <h1>{{ _("DESTROY COMPLETE item '%(item_name)s'", item_name=item.name) }}</h1>
+    <h1>{{ title }}</h1>
     <div class="moin-form">
     {{ gen.form.open(form, method="post", action=url_for('frontend.destroy_item', item_name=item.name)) }}
       {{ forms.render_errors(form) }}

File MoinMoin/templates/highlight.html

 {% extends theme("show.html") %}
+
+{% set title = _("Syntax highlighting for Item: %(name)s", name=item_name) %}
+
 {% block content %}
 {% block headline %}
-<h1>{{ _("Syntax highlighting for Item: %(name)s", name=item_name) }} </h1>
+<h1>{{ title }} </h1>
 {% endblock %}
 {{ data_text }}
 {% endblock %}

File MoinMoin/templates/history.html

 {% extends theme("show.html") %}
 {% import "utils.html" as utils %}
+
+{% set title = _("History of '%(item_name)s'", item_name=item_name) %}
+
 {% block content %}
     {% set (history, next_offset, previous_offset) = history_page %}
     {% if history %}
             <a href="{{ url_for('frontend.history', item_name=item_name, offset=next_offset) }}" title="{{ _("Next") }}">&raquo;</a>
         {% endif %}
     </div>
-    <h1>{{ _("History of '%(item_name)s'", item_name=item_name) }}</h1>
+    <h1>{{ title }}</h1>
     <div class="moin-clr"></div>
     <form action="{{ url_for('frontend.diff', item_name=item_name) }}" method="GET">
         <div id="moin-page-history">

File MoinMoin/templates/index.html

 {% extends theme("layout.html") %}
 {% import "forms.html" as forms %}
+
+{% if item_name %}
+    {% set title = _("Index of subitems of '%(item_name)s'", item_name=item_name) %}
+{% else %}
+    {% set title = _("Global Index") %}
+{% endif %}
+
 {% block head_scripts %}
 {{ super() }}
     <script src="{{ url_for('serve.files', name='jquery_multi_download', filename='jquery.multiDownload.js') }}"></script>
     </div>
     <div>
     {% if item_name: %}
-        <h1>{{ _("Index of subitems of '%(item_name)s'", item_name=item_name) }}</h1>
+        <h1>{{ title }}</h1>
         <div class="moin-index-path">
             <a href="{{ url_for('frontend.index') }}" title="{{ _("Global Index") }}">{{ ("..") }}</a>
             <span class="moin-path-separator">{{ ("/") }}</span>
             {% endfor %}
         </div>
     {% else %}
-        <h1>{{ _("Global Index") }}</h1>
+        <h1>{{ title }}</h1>
     {% endif %}
     </div>
     <div class='moin-clr'></div>

File MoinMoin/templates/meta.html

 {% extends theme("show.html") %}
 
+{% set title = _("Metadata of '%(item_name)s'", item_name=item_name) %}
+
 {% block rev_navigation %}
     {{ rev_navigation(view='frontend.show_item_meta') }}
 {% endblock %}
 
 {% block headline %}
 <h1>
-    {{ _("Metadata of '%(item_name)s'", item_name=item_name) }}
+    {{ title }}
     {% if show_revision %}({{ _("Revision") }} {{ rev.revid }}){% endif %}
 </h1>
 {% endblock %}

File MoinMoin/templates/modify_applet.html

 {% import "forms.html" as forms %}
 {% extends theme("layout.html") %}
+
+{% set title = _("Modifying %(item_name)s", item_name=item_name) %}
+
 {% block content %}
-<h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1>
+<h1>{{ title }}</h1>
 <div class="moin-form">
 {{ gen.form.open(form, method='post', action='', enctype='multipart/form-data') }}
 {{ forms.render_errors(form) }}

File MoinMoin/templates/rename.html

 {% import "forms.html" as forms %}
 {% extends theme("layout.html") %}
+
+{% set title = _("Rename '%(item_name)s'", item_name=item.name) %}
+
 {% block content %}
-<h1>{{ _("Rename '%(item_name)s'", item_name=item.name) }}</h1>
+<h1>{{ title }}</h1>
 <div class="moin-form">
 {{ gen.form.open(form, method="post", action=url_for('frontend.rename_item', item_name=item.name)) }}
   {{ forms.render_errors(form) }}

File MoinMoin/templates/sitemap.html

 {% extends theme("layout.html") %}
+
+{% set title = _("SiteMap of %(item_name)s", item_name=item_name) %}
+
 {% block content %}
-<h1>{{ _("SiteMap of %(item_name)s", item_name=item_name) }}</h1>
+<h1>{{ title }}</h1>
 {% for entry in sitemap recursive %}
     {% if isinstance(entry, list) %}
         <ul>