From ad02cb05aeef638863c5e5e3ffedebf040cc73f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 4 Jul 2012 00:40:25 +0200 Subject: [PATCH 1/3] Draft for vote result table on assignment view and projector. Publishing still not working. --- openslides/assignment/models.py | 2 +- .../assignment/templates/assignment/view.html | 88 ++++++----- .../templates/projector/Assignment.html | 142 +++++++++--------- 3 files changed, 120 insertions(+), 112 deletions(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index 36759b0a9..03f3ef99f 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -157,7 +157,7 @@ class Assignment(models.Model, SlideMixin): data['assignment'] = self data['title'] = self.name data['polls'] = self.poll_set.all() - data['votes'] = self.vote_results + data['vote_results'] = self.vote_results data['template'] = 'projector/Assignment.html' return data diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index 74ca2ca2b..1647a9c69 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -99,6 +99,7 @@ {% if polls %} + {% with ballotnumber=polls.count %} @@ -107,24 +108,25 @@ {% endwith %} + {% for poll in polls %} - {# if poll.published and not perms.assignment.can_manage_assignment or perms.assignment.can_manage_assignment #} + {% if poll.published or perms.assignment.can_manage_assignment %} - {# endif #} + {% endif %} {% endfor %} {% if assignment.profile.exists and perms.assignment.can_manage_assignment and assignment.status == "vot" %} {% endif %} + {% for candidate, votes in vote_results.items %} - - + - {% for vote in votes %} + {% else %} + {% if perms.assignment.can_manage_assignment %} + + {% endif %} + {% endif %} + {{ candidate }} + + {% for vote in votes %} + {% if perms.assignment.can_manage_assignment %} + {# Hier stimmt es noch nicht. Es muss rein, dass veröffentlichte Wahlergebnisse für jedermann sichtbar sind #} - {% endfor %} - {% if assignment.profile.exists and perms.assignment.can_manage_assignment and assignment.status == "vot" %} - {% endif %} - + {% endfor %} + {% if assignment.profile.exists and perms.assignment.can_manage_assignment and assignment.status == "vot" %} + + {% endif %} + {% endfor %} + {% for poll in polls %} - {% if poll.published and not perms.assignment.can_manage_assignment or perms.assignment.can_manage_assignment %} + {% if poll.published or perms.assignment.can_manage_assignment %} {% endif %} {% endfor %} @@ -183,10 +190,11 @@ {% endif %} + - + {% for poll in polls %} - {% if poll.published and not perms.assignment.can_manage_assignment or perms.assignment.can_manage_assignment %} + {% if poll.published or perms.assignment.can_manage_assignment %} {% endif %} {% endfor %} diff --git a/openslides/assignment/templates/projector/Assignment.html b/openslides/assignment/templates/projector/Assignment.html index 3d9e021e1..8d4689cba 100644 --- a/openslides/assignment/templates/projector/Assignment.html +++ b/openslides/assignment/templates/projector/Assignment.html @@ -27,88 +27,88 @@ {% block scrollcontent %} {% if not assignment.profile.exists %} -

-

{{ assignment.description|linebreaks }}
-

+

+

{{ assignment.description|linebreaks }}
+

{% endif %} {% if assignment.profile.exists and assignment.status != "fin" %} -

{% trans "Candidates" %}

-
    - {% for profile in assignment.profile.all|dictsort:"user.first_name" %} -
  1. {{ profile }}
  2. - {% empty %} -
  3. - {% trans "No candidates available." %} -
  4. - {% endfor %} -
-


+

{% trans "Candidates" %}

+
    + {% for profile in assignment.profile.all|dictsort:"user.first_name" %} +
  1. {{ profile }}
  2. + {% empty %} +
  3. + {% trans "No candidates available." %} +
  4. + {% endfor %} +
+


{% endif %} {% if polls.exists %} -

{% trans "Election results" %}

-
{% trans "Candidates" %} {{ forloop.counter }}. {% trans 'ballot' %} {% if perms.assignment.can_manage_assignment %} -
- - - - - +
+ + + + + {% endif %}
@@ -136,46 +138,51 @@
- {% if candidate in assignment.elected.all %} - {% if perms.assignment.can_manage_assignment %} - - {% else %} - - {% endif %} +
+ {% if candidate in assignment.elected.all %} + {% if perms.assignment.can_manage_assignment %} + {% else %} - {% if perms.assignment.can_manage_assignment %} - - {% endif %} + {% endif %} - {{ candidate }} - - {% if vote %} - {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} - {% if vote.Yes %}{{ vote.Yes }}{% else %}∅{% endif %}
- {% if vote.No %}{{ vote.No }}{% else %}∅{% endif %}
- {% if vote.Abstain %}{{ vote.Abstain }}{% else %}∅{% endif %}
- {% elif 'Votes' in vote %} - {% if vote.Votes %}{{ vote.Votes }}{% else %}∅{% endif %} - {% endif %} + {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} + {{ vote.Yes }}
+ {{ vote.No }}
+ {{ vote.Abstain }}
+ {% elif 'Votes' in vote %} + {{ vote.Votes }} + {% elif vote == None %} + {% trans 'was not a
candidate'%} {% else %} - – +   {% endif %}
{%trans 'Invalid votes' %} {{ poll.print_votesinvalid }}
{%trans 'Votes cast' %}{%trans 'Votes cast' %} {{ poll.print_votescast }}
- - - {% for poll in assignment.poll_set.all %} - {% if poll.published %} - - {% endif %} - {% endfor %} - - {% for vote in votes %} - - {% with vote|first as candidate %} - + + {% for poll in polls %} + {% if poll.published %} + + {% endif %} + {% endfor %} + + + + + {% for poll in polls %} + {% if poll.published %} + + {% endif %} + {% endfor %} + +
{% trans "Candidates" %}{{forloop.counter}}. {% trans "ballot" %}
- {% if candidate.1 %} - - - +

{% trans "Election results" %}

+ + + + + {% for poll in assignment.poll_set.all %} + {% if poll.published %} + {% endif %} - {{ candidate.0 }} - - {% for v in vote|last %} - + + {% for candidate, votes in vote_results.items %} + + + {% for vote in votes %} + {# Hier stimmt es noch nicht. Es muss rein, dass nur veröffentlichte Wahlergebnisse angezeigt werden sollen #} + {% endfor %} - {% endwith %} - - {% empty %} - - - - {% endfor %} - - - {% for p in polls %} - {% if p.published %} - - {% endif %} + {% endfor %} - - - - {% for p in polls %} - {% if p.published %} - - {% endif %} - {% endfor %} - -
{% trans "Candidates" %}{{forloop.counter}}. {% trans "ballot" %} - {% if v %} - {% if v|length == 3 %} - {% if v.0 %}{{ v.0 }}{% else %}∅{% endif %}
- {% if v.1 %}{{ v.1 }}{% else %}∅{% endif %}
- {% if v.2 %}{{ v.2 }}{% else %}∅{% endif %}
- {% else %} - {% if v != "-" %} - - {% endif %} - {{ v.0 }} + {% endfor %} +
+ {% if candidate in assignment.elected.all %} + + + + {% endif %} + {{ candidate }} + + {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} + {{ vote.Yes }}
+ {{ vote.No }}
+ {{ vote.Abstain }}
+ {% elif 'Votes' in vote %} + {{ vote.Votes }} + {% elif vote == None %} + {% trans 'was not a
candidate'%} + {% else %} +   {% endif %} - {% endif %}
{% trans "No ballots available." %}
{%trans 'Invalid votes' %} {{ p.print_votesinvalid }}
{%trans 'Votes cast' %} {{ p.print_votescast }}
- {% endif %} + +
{%trans 'Invalid votes' %} {{ poll.print_votesinvalid }}
{%trans 'Votes cast' %} {{ poll.print_votescast }}
+ {% elif assignment.profile.exists %} + {% trans "No ballots available." %} + {% endif %}
{% endblock %} From 32a5b61da810a4bc83c895e566f1e6e48ddb807c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 4 Jul 2012 00:55:37 +0200 Subject: [PATCH 2/3] Insert type of an related item in the agenda widget as string behind the name of the item --- openslides/agenda/templates/agenda/widget.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openslides/agenda/templates/agenda/widget.html b/openslides/agenda/templates/agenda/widget.html index 4f5d9d2ae..0a243579e 100644 --- a/openslides/agenda/templates/agenda/widget.html +++ b/openslides/agenda/templates/agenda/widget.html @@ -32,7 +32,7 @@ {% for p in item.get_ancestors %}   {% endfor %} - {{ item }} + {{ item }}{% if item.releated_sid %} ({{ item.print_releated_type }}){% endif %} {% if not item.is_leaf_node %} {% endif %} From 40c2bf481f277ea5d4fc1b1c3ba3cb9c0d7069ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 4 Jul 2012 02:10:06 +0200 Subject: [PATCH 3/3] Fix #240 --- openslides/application/templates/application/view.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openslides/application/templates/application/view.html b/openslides/application/templates/application/view.html index a1f042b77..53c9b7168 100644 --- a/openslides/application/templates/application/view.html +++ b/openslides/application/templates/application/view.html @@ -204,11 +204,13 @@ {% endif %} {% trans "Version" %} {{ version.aid }} + {% if application.public_version != application.last_version %} + ⋅ {% if version == application.public_version %} - ({% trans "Show newest Version" %}) + {% trans "This is not the newest version." %} {% trans "Go to version" %} {{ application.last_version.aid }}. {% else %} - ({% trans "Show permitted Version" %}) + {% trans "This is not the permitted version." %} {% trans "Go to version" %} {{ application.public_version.aid }}. {% endif %} {% endif %}