diff --git a/openslides/agenda/templates/beamer.html b/openslides/agenda/templates/beamer.html index e1c64cc9d..d9dbacb96 100644 --- a/openslides/agenda/templates/beamer.html +++ b/openslides/agenda/templates/beamer.html @@ -5,9 +5,12 @@ {% load tags %} + {% block title %} {% get_config 'event_name' %} {% endblock %} + {% block header %} + {% endblock %} +

{{ item.assignment.description|linebreaks }}
@@ -44,13 +49,22 @@ {% for vote in votes %} - {% for v in vote %} - {% if v %} + + {% with vote|first as candidate %} + {% if candidate.1 %} + + {% endif %} + {{ candidate.0 }} + {% 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/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 %} diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index b400f3d78..3e42d6a2a 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -71,9 +71,10 @@ 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.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 def set_elected(self, profile, value=True): diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index d30a23051..c1dc8cd34 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -145,12 +145,18 @@ {% 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 %} @@ -160,6 +166,7 @@ {% 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/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/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..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 @@ -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 @@ -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')) 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 000000000..72e363a12 Binary files /dev/null and b/openslides/static/images/icons/games-highscores-grey.png differ diff --git a/openslides/static/javascript/assignment.js b/openslides/static/javascript/assignment.js index 8a64e6c4a..eb7a4596d 100644 --- a/openslides/static/javascript/assignment.js +++ b/openslides/static/javascript/assignment.js @@ -1,5 +1,5 @@ $(function() { - $('a.iselected').parent().parent().children('td').addClass('iselected'); + $('a.elected').parent().parent().children('td').addClass('elected'); @@ -11,15 +11,14 @@ $(function() { url: line.attr('href'), dataType: 'json', success: function(data) { - if (line.hasClass('iselected') && !data.elected) { - line.removeClass('iselected') - line.parent().parent().children('td').removeClass('iselected') - } else if (!line.hasClass('iselected') && data.elected) { - line.addClass('iselected') - line.parent().parent().children('td').addClass('iselected') + if (line.hasClass('elected') && !data.elected) { + line.removeClass('elected') + line.parent().parent().children('td').removeClass('elected') + } else if (!line.hasClass('elected') && data.elected) { + line.addClass('elected') + line.parent().parent().children('td').addClass('elected') } line.attr('href', data.link); - line.text(data.text); }, error: function () { alert("Ajax Error"); diff --git a/openslides/static/styles/assignment.css b/openslides/static/styles/assignment.css index 7571ee6d8..270d7640d 100644 --- a/openslides/static/styles/assignment.css +++ b/openslides/static/styles/assignment.css @@ -1,5 +1,25 @@ -td.iselected { - background-color: green !important; +td.elected { + background-color: #BED4DE !important; } +td.elected a.election_link { + background-image: url(/static/images/icons/games-highscores.png); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + display: block; + margin-right: 5px; + float: left; +} +td a.election_link { + background-image: url(/static/images/icons/games-highscores-grey.png); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + display: block; + margin-right: 5px; + float: left; +} \ No newline at end of file