From 97f835eb4e5e51b90a616f3df6abb73c3bbc194e Mon Sep 17 00:00:00 2001 From: klmp200 Date: Thu, 22 Dec 2016 01:57:17 +0100 Subject: [PATCH] Convert indent with space, fix populate and add an s --- core/management/commands/populate.py | 2 +- election/models.py | 8 +- .../templates/election/election_detail.jinja | 304 +++++++++--------- 3 files changed, 157 insertions(+), 157 deletions(-) diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index 8a690eef..eb3d640a 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -346,7 +346,7 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site. date_of_birth="1942-06-12") sli.set_password("plop") sli.save() - skia.view_groups=[Group.objects.filter(name=settings.SITH_MAIN_MEMBERS_GROUP).first().id] + sli.view_groups=[Group.objects.filter(name=settings.SITH_MAIN_MEMBERS_GROUP).first().id] sli.save() sli_profile_path = os.path.join(root_path, 'core/fixtures/images/5.jpg') with open(sli_profile_path, 'rb') as f: diff --git a/election/models.py b/election/models.py index b6217403..e4c03599 100644 --- a/election/models.py +++ b/election/models.py @@ -18,10 +18,10 @@ class Election(models.Model): start_date = models.DateTimeField(_('start date'), blank=False) end_date = models.DateTimeField(_('end date'), blank=False) - edit_groups = models.ManyToManyField(Group, related_name="editable_elections", verbose_name=_("edit group"), blank=True) - view_groups = models.ManyToManyField(Group, related_name="viewable_elections", verbose_name=_("view group"), blank=True) - vote_groups = models.ManyToManyField(Group, related_name="votable_elections", verbose_name=_("vote group"), blank=True) - candidature_groups = models.ManyToManyField(Group, related_name="candidate_elections", verbose_name=_("candidature group"), blank=True) + edit_groups = models.ManyToManyField(Group, related_name="editable_elections", verbose_name=_("edit groups"), blank=True) + view_groups = models.ManyToManyField(Group, related_name="viewable_elections", verbose_name=_("view groups"), blank=True) + vote_groups = models.ManyToManyField(Group, related_name="votable_elections", verbose_name=_("vote groups"), blank=True) + candidature_groups = models.ManyToManyField(Group, related_name="candidate_elections", verbose_name=_("candidature groups"), blank=True) def __str__(self): return self.title diff --git a/election/templates/election/election_detail.jinja b/election/templates/election/election_detail.jinja index f43e8a5c..2721226c 100644 --- a/election/templates/election/election_detail.jinja +++ b/election/templates/election/election_detail.jinja @@ -8,31 +8,31 @@ {{ super() -}} {%- endblock %} {% block content %} -

{{ object.title }}

-

{{ object.description }}

-
-
-

- {% trans %}Polls close {% endtrans %} - at -

-{# {%- if object.has_voted(request.user) %} -

- {% trans %}You already have submitted your vote.{% endtrans %} -

- {%- endif %} - #}
-
- - {%- set election_lists = object.election_list.all() -%} - - - {%- for election_list in election_lists %} - - {%- endfor %} - - - {%- for role in object.role.all() %} - - - - - - {%- for election_list in election_lists %} - - {%- endfor %} - - - - {%- endfor %} -
{{election_list.title}}{% trans %}Blank vote{% endtrans %}
- {{role.title}} - {%- if role.max_choice > 1 %} - {% trans %}You may choose up to{% endtrans %} {{ role.max_choice }} {% trans %}people.{% endtrans %} - {%- endif %} -
-
    - {%- for candidature in election_list.candidature.filter(role=role) %} -
  • -
    -
    - {%- if candidature.user.profile_pict %} - {% trans %}Profile{% endtrans %} - {%- endif %} -
    -
    - {{ candidature.user.first_name }} {{candidature.user.nick_name or ''}} {{ candidature.user.last_name }} - {{ candidature.program or '' }} -
    -
    - {%- if object.is_active %} - - - {% endif %} -
  • - {%- endfor %} -
-
- {%- if object.is_active %} - - - {% endif %} -
-
-
- -
- {% trans %}Add a new list{% endtrans %} - {% trans %}Add a new role{% endtrans %} -
{{candidate_form}} - {% csrf_token %} +

{{ object.title }}

+

{{ object.description }}

+
+
+

+ {% trans %}Polls close {% endtrans %} + at +

+{# {%- if object.has_voted(request.user) %} +

+ {% trans %}You already have submitted your vote.{% endtrans %} +

+ {%- endif %} + #}
+
+ + {%- set election_lists = object.election_list.all() -%} + + + {%- for election_list in election_lists %} + + {%- endfor %} + + + {%- for role in object.role.all() %} + + + + + + {%- for election_list in election_lists %} + + {%- endfor %} + + + + {%- endfor %} +
{{election_list.title}}{% trans %}Blank vote{% endtrans %}
+ {{role.title}} + {%- if role.max_choice > 1 %} + {% trans %}You may choose up to{% endtrans %} {{ role.max_choice }} {% trans %}people.{% endtrans %} + {%- endif %} +
+
    + {%- for candidature in election_list.candidature.filter(role=role) %} +
  • +
    +
    + {%- if candidature.user.profile_pict %} + {% trans %}Profile{% endtrans %} + {%- endif %} +
    +
    + {{ candidature.user.first_name }} {{candidature.user.nick_name or ''}} {{ candidature.user.last_name }} + {{ candidature.program or '' }} +
    +
    + {%- if object.is_active %} + + + {% endif %} +
  • + {%- endfor %} +
+
+ {%- if object.is_active %} + + + {% endif %} +
+
+
+ +
+ {% trans %}Add a new list{% endtrans %} + {% trans %}Add a new role{% endtrans %} + {{candidate_form}} + {% csrf_token %}

-
-
- {{election_form.as_p()}} +
+
+ {{election_form.as_p()}}

- {% csrf_token %} -
+ {% csrf_token %} + {% endblock %} \ No newline at end of file