From 187c84074e91992f2b1d1678cf5a6c5f8f0c7f93 Mon Sep 17 00:00:00 2001
From: Olivier PEREZ <olivier@olivierperez.fr>
Date: Thu, 18 Dec 2014 23:57:38 +0100
Subject: [PATCH] Display a different hint pane on admin page.

---
 tpl/part/poll_hint.tpl       | 11 +++++++++++
 tpl/part/poll_hint_admin.tpl |  7 +++++++
 tpl/studs.tpl                | 12 +++---------
 3 files changed, 21 insertions(+), 9 deletions(-)
 create mode 100644 tpl/part/poll_hint.tpl
 create mode 100644 tpl/part/poll_hint_admin.tpl

diff --git a/tpl/part/poll_hint.tpl b/tpl/part/poll_hint.tpl
new file mode 100644
index 00000000..341a9f1a
--- /dev/null
+++ b/tpl/part/poll_hint.tpl
@@ -0,0 +1,11 @@
+{if $active}
+    <div class="alert alert-info">
+        <p>{_("If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.")}</p>
+        <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
+    </div>
+{else}
+    <div class="alert alert-danger">
+        <p>{_("The administrator locked this poll, votes and comments are frozen, it's not possible to participate anymore.")}</p>
+        <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
+    </div>
+{/if}
\ No newline at end of file
diff --git a/tpl/part/poll_hint_admin.tpl b/tpl/part/poll_hint_admin.tpl
new file mode 100644
index 00000000..7a21be1d
--- /dev/null
+++ b/tpl/part/poll_hint_admin.tpl
@@ -0,0 +1,7 @@
+<div class="alert alert-info">
+    <p>{_('As poll administrator, you can change all the lines of this poll with this button')} <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Edit')}</span>,
+        {_(' remove a column or a line with')} <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{_('Remove')}</span>
+        {_('and add a new column with')} <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{_('Add a column')}</span>.</p>
+    <p>{_('Finally, you can change the informations of this poll like the title, the comments or your email address.')}</p>
+    <p aria-hidden="true"><strong>{_('Legend:')}</strong> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
+</div>
\ No newline at end of file
diff --git a/tpl/studs.tpl b/tpl/studs.tpl
index 879cbbdc..de89e8ad 100644
--- a/tpl/studs.tpl
+++ b/tpl/studs.tpl
@@ -12,16 +12,10 @@
 
 {* Information about voting *}
 
-{if $poll->active}
-<div class="alert alert-info">
-    <p>{_("If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.")}</p>
-    <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
-</div>
+{if $admin}
+    {include 'part/poll_hint_admin.tpl'}
 {else}
-<div class="alert alert-danger">
-    <p>{_("The administrator locked this poll, votes and comments are frozen, it's not possible to participate anymore.")}</p>
-    <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
-</div>
+    {include 'part/poll_hint.tpl' active=$poll->active}
 {/if}
 
 {* Scroll left and right *}
-- 
GitLab