Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Shows a warning if a page contains no lead #103
Browse files Browse the repository at this point in the history
  • Loading branch information
msom committed Nov 16, 2015
1 parent adf00d4 commit cecac6d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
5 changes: 4 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Unreleased
- Adds links to contact page and opening hours page.
[msom]

- Visualize contrast ration of primary color with meter.
- Visualizes the contrast ratio of the primary color with a meter.
[msom]

- Shows a warning if a page contains no lead.
[msom]

0.7.1 (2015-10-26)
Expand Down
5 changes: 4 additions & 1 deletion onegov/town/locale/de_ch/LC_MESSAGES/onegov.town.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2015-11-09 14:53+0100\n"
"POT-Creation-Date: 2015-11-16 10:17+0100\n"
"PO-Revision-Date: 2015-10-15 09:42+0200\n"
"Last-Translator: Denis Krienbühl <denis.krienbuehl@seantis.ch>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -791,6 +791,9 @@ msgstr ""
"Diese Seite ist nicht öffentlich. Bearbeiten Sie diese Seite und entfernen "
"Sie das Häckchen im Feld \"Vor der Öffentlichkeit verstecken\"."

msgid "This site contains no lead."
msgstr "Diese Seite hat keine Einleitung."

msgid "Closed"
msgstr "Abgeschlossen"

Expand Down
14 changes: 13 additions & 1 deletion onegov/town/templates/macros.pt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@
</tal:block>
</metal:hidden_page_hint>

<metal:empty_lead_hint define-macro="empty_page_lead_hint" i18n:domain="onegov.town">
<tal:block condition="item.text and not item.lead and request.is_logged_in|nothing">
<div class="row">
<div class="small-12 columns">
<div class="panel callout">
<p i18n:translate>This site contains no lead.</p>
</div>
</div>
</div>
</tal:block>
</metal:empty_lead_hint>

<metal:page_content define-macro="page_content" i18n:domain="onegov.town">
<div class="row">
<tal:block condition="not: people or contact">
Expand Down Expand Up @@ -445,4 +457,4 @@
</li>
</ul>
</div>
</metal:atoz>
</metal:atoz>
5 changes: 3 additions & 2 deletions onegov/town/templates/page.pt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<tal:block metal:fill-slot="content">
<metal:hint use-macro="layout.macros['hidden_from_public_hint_long']" tal:define="item page"/>

<metal:hint use-macro="layout.macros['empty_page_lead_hint']" tal:define="item page"/>

<tal:block condition="page.trait == 'page'">

<tal:block metal:use-macro="layout.macros.page_content"
Expand Down Expand Up @@ -52,4 +53,4 @@
</div>
</tal:block>
</tal:block>
</div>
</div>

0 comments on commit cecac6d

Please sign in to comment.