From 35c0b50940cfd77c89311edcf06f602449950511 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 19:53:40 +0200 Subject: [PATCH 1/9] Fix redirect for user group overview. --- openslides/participant/templates/participant/group_edit.html | 2 +- openslides/participant/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openslides/participant/templates/participant/group_edit.html b/openslides/participant/templates/participant/group_edit.html index 3a34ed098..357a3e1a2 100644 --- a/openslides/participant/templates/participant/group_edit.html +++ b/openslides/participant/templates/participant/group_edit.html @@ -16,7 +16,7 @@ - + diff --git a/openslides/participant/views.py b/openslides/participant/views.py index acf57f618..35cacb025 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -174,7 +174,7 @@ def group_edit(request, group_id=None): try: group = Group.objects.get(id=group_id) except Group.DoesNotExist: - raise NameError("There is no Group %d" % group_id) + raise NameError("There is no group %d" % group_id) else: group = None From 9275acf0297b6289535ae37175bb9e3e04fd9e8c Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 20:05:23 +0200 Subject: [PATCH 2/9] Show full profile name of supmitter and supports. --- openslides/application/templates/application/view.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openslides/application/templates/application/view.html b/openslides/application/templates/application/view.html index 879636c65..c13a94136 100644 --- a/openslides/application/templates/application/view.html +++ b/openslides/application/templates/application/view.html @@ -13,8 +13,8 @@ {% endif %} - - {{ application.submitter }} + + {{ application.submitter.profile }} {% if user == application.submitter %} {% endif %} @@ -24,10 +24,11 @@ {% if application.supporter.count == 0 %} - {% else %} +
    {% for supporter in application.supporter.all %} - {{ forloop.counter }}. {{supporter }} - {% if not forloop.last %}
    {% endif %} +
  1. {{ supporter.profile }}
  2. {% endfor %} +
{% endif %} {% endif %} From fec269e4a72712f782bbb0a97205e35f9a543b5b Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 20:27:47 +0200 Subject: [PATCH 3/9] Fixed alphabetical order of candidates. --- openslides/assignment/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index b400f3d78..d68c44156 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -71,9 +71,9 @@ class Assignment(models.Model): def candidates(self): # list of candidates from poll.models import Option - candidates = set() - for option in Option.objects.filter(poll__assignment=self): - candidates.add(option.value) + candidates = [] + for option in Option.objects.filter(poll__assignment=self).order_by('user__user__first_name'): + candidates.append(option.value) return candidates def set_elected(self, profile, value=True): From 0b17ab10fed4dba118c4528f411c2d75777eb206 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 20:47:55 +0200 Subject: [PATCH 4/9] Fixed candidates order in beamer view. Some style changes. --- openslides/agenda/templates/beamer.html | 1 + .../templates/beamer/ItemAssignment.html | 15 ++++++-- openslides/agenda/views.py | 35 ++++++++----------- .../assignment/templates/assignment/view.html | 1 + 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/openslides/agenda/templates/beamer.html b/openslides/agenda/templates/beamer.html index e1c64cc9d..aa9951a66 100644 --- a/openslides/agenda/templates/beamer.html +++ b/openslides/agenda/templates/beamer.html @@ -5,6 +5,7 @@ {% load tags %} + {% block title %} {% get_config 'event_name' %} {% endblock %} diff --git a/openslides/agenda/templates/beamer/ItemAssignment.html b/openslides/agenda/templates/beamer/ItemAssignment.html index 98157b4c7..dec55d4a4 100644 --- a/openslides/agenda/templates/beamer/ItemAssignment.html +++ b/openslides/agenda/templates/beamer/ItemAssignment.html @@ -44,13 +44,24 @@ {% for vote in votes %} - {% for v in vote %} - {% if v %} + + {% with vote|first as candidate %} + {{ candidate.0 }} + {% if candidate.1 %} + {% trans 'not elected' %} + {% else %} + {% trans 'elected' %} + {% endif %} + {% endwith %} + + {% for v in vote|last %} + {% 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 }} {% endif %} {% else %}∅{% endif %} diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 57257f1c6..96696eff7 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -106,26 +106,21 @@ def beamer_edit(request, direction): def assignment_votes(item): votes = [] if item.type == "ItemAssignment": - assignment = item.cast().assignment - # list of candidates - candidates = set() - for option in Option.objects.filter(poll__assignment=assignment): - candidates.add(option.value) - # list of votes - votes = [] - for candidate in candidates: - tmplist = [] - tmplist.append(candidate) - for poll in assignment.poll_set.all(): - if candidate in poll.options_values: - option = Option.objects.filter(poll=poll).filter(user=candidate)[0] - if poll.optiondecision: - tmplist.append([option.yes, option.no, option.undesided]) - else: - tmplist.append(option.yes) - else: - tmplist.append("-") - votes.append(tmplist) + assignment = item.cast().assignment + # list of votes + votes = [] + for candidate in assignment.candidates: + tmplist = [[candidate, assignment.is_elected(candidate)], []] + for poll in assignment.poll_set.all(): + if candidate in poll.options_values: + option = Option.objects.filter(poll=poll).filter(user=candidate)[0] + if poll.optiondecision: + tmplist[1].append([option.yes, option.no, option.undesided]) + else: + tmplist[1].append(option.yes) + else: + tmplist[1].append("-") + votes.append(tmplist) return votes diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index d30a23051..d8ccb6b97 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -160,6 +160,7 @@ {% if v.1 %}{{ v.1 }}{% else %}∅{% endif %}
{% if v.2 %}{{ v.2 }}{% else %}∅{% endif %}
{% else %} + {% if v != "-" %}{% endif %} {{ v }} {% endif %} {% else %}∅{% endif %} From f412e9065a8674909e5e32a82a2ac4e176561992 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 21:40:56 +0200 Subject: [PATCH 5/9] Needs fix to group candidates by user. --- openslides/assignment/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index d68c44156..3e42d6a2a 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -72,6 +72,7 @@ class Assignment(models.Model): # list of candidates from poll.models import Option candidates = [] + #for option in Option.objects.values('user__user__profile').filter(poll__assignment=self).order_by('user__user__first_name').distinct(): for option in Option.objects.filter(poll__assignment=self).order_by('user__user__first_name'): candidates.append(option.value) return candidates From 7eac8cda5dffcb9168d0cbe3b6e5a14ab81f8198 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 21:53:15 +0200 Subject: [PATCH 6/9] Beamer: Display election status finished. --- .../agenda/templates/beamer/ItemAssignment.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openslides/agenda/templates/beamer/ItemAssignment.html b/openslides/agenda/templates/beamer/ItemAssignment.html index dec55d4a4..8af5cc814 100644 --- a/openslides/agenda/templates/beamer/ItemAssignment.html +++ b/openslides/agenda/templates/beamer/ItemAssignment.html @@ -4,16 +4,17 @@ {% trans "Election" %}:

{{ item.assignment }}

- {% if item.assignment.status == "sea" or item.assignment.status == "vot" %} + + {% if item.assignment.status == "sea" or item.assignment.status == "vot" %} +

{% trans "Number of available posts" %}:

+ {{ item.assignment.posts }} {% endif %} + +

{{ item.assignment.description|linebreaks }}
From 4fb4691f14e4cecb8e896d282be23816dae8c011 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 22:26:19 +0200 Subject: [PATCH 7/9] Added counter and message for password generation. --- openslides/participant/models.py | 3 +++ openslides/participant/views.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openslides/participant/models.py b/openslides/participant/models.py index 83665c344..e7ec19a31 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -55,8 +55,11 @@ class Profile(models.Model): ) def set_first_user_passwords(): + count = 0 for user in Profile.objects.filter(Q(firstpassword='') | Q(firstpassword__isnull=True)): + count = count + 1 user.firstpassword = gen_password() user.user.set_password(user.firstpassword) user.user.save() user.save() + return count \ No newline at end of file diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 35cacb025..d72c8e70e 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -19,7 +19,7 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import SetPasswordForm from django.contrib import messages from django.core.urlresolvers import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext as _, ungettext from participant.models import Profile, set_first_user_passwords from participant.api import gen_username @@ -287,7 +287,11 @@ def user_import(request): @permission_required('participant.can_manage_participant') def gen_passwords(request): - set_first_user_passwords() + count = set_first_user_passwords() + if count: + messages.success(request, ungettext('%s Password was successfully generated.', '%s Passwords were successfully generated.', count ) % count) + else: + messages.info(request, _('There are no participants which need a first time password. No passwords generated.') ) return redirect(reverse('user_overview')) From 8cd0ac877810a5b9624823e275581e084dc6c84c Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 5 Sep 2011 23:13:18 +0200 Subject: [PATCH 8/9] Added icon and style information for elected/not elected candidates. --- .../assignment/templates/assignment/view.html | 13 +++++++--- .../images/icons/games-highscores-grey.png | Bin 0 -> 3136 bytes openslides/static/javascript/assignment.js | 15 +++++------ openslides/static/styles/assignment.css | 24 ++++++++++++++++-- 4 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 openslides/static/images/icons/games-highscores-grey.png diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index d8ccb6b97..e3ad2ebfe 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -145,12 +145,19 @@ {% with vote|first as candidate %} - {{ candidate.0 }} {% if candidate.1 %} - {% trans 'not elected' %} + {% if perms.assignment.can_manage_assignment %} + + {% else %} + + {% endif %} {% else %} - {% trans 'elected' %} + {% if perms.assignment.can_manage_assignment %} + + {% endif %} {% endif %} + + {{ candidate.0 }} {% endwith %} {% for v in vote|last %} diff --git a/openslides/static/images/icons/games-highscores-grey.png b/openslides/static/images/icons/games-highscores-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..72e363a12b352873e12adff8a95fbf51c5a9c21e GIT binary patch literal 3136 zcmV-G48QYEX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>`#Q*^C19^CUbg)1C0k3ZW0swH; zE+i7i;s1lWP$pLZAdvvzA`<5d0gzGv$SzdK6adH=0I*ZDWC{S3003-xd_p1ssto|_ z^hrJi0NAOM+!p}Yq8zCR0F40vnJ7mj0zkU}U{!%qECRs70HCZuA}$2Lt^t5qwlYTo zfV~9(c8*w(4?ti5fSE!p%m5%b0suoE6U_r4Oaq`W(!b!TUvP!ENC5!A%azTSOVTqG zxRuZvck=My;vwR~Y_URN7by^C3FIQ2mzyIKNaq7g&I|wm8u`(|{y0C7=jP<$=4R(? z@ASo@{%i1WB0eGU-~POe0t5gMPS5Y!U*+Z218~Oyuywy{sapWrRsd+<`CT*H37}dE z(0cicc{uz)9-g64$UGe!3JVMEC1RnyFyo6p|1;rl;ER6t{6HT5+j{T-ahgDxt-zy$ z{c&M#cCJ#6=gR~_F>d$gBmT#QfBlXr(c(0*Tr3re@mPttP$EsodAU-NL?OwQ;u7h9 zGVvdl{RxwI4FIf$Pry#L2er#=z<%xl0*ek<(slqqe)BDi8VivC5N9+pdG`PSlfU_o zKq~;2Moa!tiTSO!5zH77Xo1hL_iEAz&sE_ z2IPPo3ZWR5K^auQI@koYumc*P5t`u;w81er4d>tzT!HIw7Y1M$p28Tsh6w~g$Osc* zAv%Z=Vvg7%&I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Uu=`Q(C=R&z?UQbnZ;IU-!xL z-sg{9@Vs#JBKKn3CAUkhJ+3`ResKNaNUvLO>t*-L?N>ambo5Q@JJIjcfBI^`)pOVQ z*DhV3dA;w(>>IakCfyvkCA#(acJ}QTcM9%I++BK)c(44v+WqPW`VZ=VwEnSWz-{38 zV8CF{!&wjS4he^z{*?dIhvCvk%tzHDMk9@nogW_?4H~`jWX_Y}r?RIL&&qyQ|9R_k ztLNYS;`>X_Sp3-V3;B!BzpiZu4KN?b%j)1@dbf*@)YibxlCr*0Nns19NWmlkUMKo`-;$;CAwMQjV9E(HY}g$!1y z)gVXwNbYJcANTKYYVt0>AJ6ZBSK!l7HrMw%(&*HMED34$@?N&tcF*Dw$DECsGd*Lm zcW-tl+NkD+oGy}*1l?FKbpTpaTFgjb<}n*8>DaLv0wV`**Z~b5Jn1e;Q34U22U&@UeMFrM8n*9Sggl z02a5hZc_3XXfzpWDTsYDy#coZtbh2zm3}~xf8=P=C#0u>?x^Y)e0iP3bJ*Qahu9D5v;DNn?P* a2lx*s!jYbEl#g8i0000 Date: Tue, 6 Sep 2011 07:33:13 +0200 Subject: [PATCH 9/9] Mark elected candidates in beamer view. --- openslides/agenda/templates/beamer.html | 2 ++ .../agenda/templates/beamer/ItemAssignment.html | 14 ++++++++------ .../assignment/templates/assignment/view.html | 5 ++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/openslides/agenda/templates/beamer.html b/openslides/agenda/templates/beamer.html index aa9951a66..d9dbacb96 100644 --- a/openslides/agenda/templates/beamer.html +++ b/openslides/agenda/templates/beamer.html @@ -9,6 +9,8 @@ {% block title %} {% get_config 'event_name' %} {% endblock %} + {% block header %} + {% endblock %}