mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-15 18:53:25 +00:00
Group: simplify GroupTemplateView and better group display
This commit is contained in:
parent
c3b88aaeb4
commit
96e33815f5
@ -16,8 +16,8 @@
|
|||||||
{{ form.users_removed.errors }}
|
{{ form.users_removed.errors }}
|
||||||
{% for user in form.users_removed %}
|
{% for user in form.users_removed %}
|
||||||
<label for="{{ user.id_for_label }}">
|
<label for="{{ user.id_for_label }}">
|
||||||
<a href="{{ url('core:user_profile', user.data.value) }}">{{ user.choice_label }}</a>
|
|
||||||
{{ user.tag() }}
|
{{ user.tag() }}
|
||||||
|
<a href="{{ url('core:user_profile', user.data.value) }}">{{ user.choice_label }}</a>
|
||||||
</label>
|
</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<input type="submit" name="submit" value="{% trans %}Delete{% endtrans %}">
|
<input type="submit" name="submit" value="{% trans %}Delete{% endtrans %}">
|
||||||
|
@ -130,12 +130,6 @@ class GroupTemplateView(CanEditMixin, DetailFormView):
|
|||||||
pk_url_kwarg = "group_id"
|
pk_url_kwarg = "group_id"
|
||||||
template_name = "core/group_detail.jinja"
|
template_name = "core/group_detail.jinja"
|
||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
|
||||||
|
|
||||||
self.users = self.get_object().users.all()
|
|
||||||
resp = super(GroupTemplateView, self).dispatch(request, *args, **kwargs)
|
|
||||||
return resp
|
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
resp = super(GroupTemplateView, self).form_valid(form)
|
resp = super(GroupTemplateView, self).form_valid(form)
|
||||||
|
|
||||||
@ -156,7 +150,7 @@ class GroupTemplateView(CanEditMixin, DetailFormView):
|
|||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
kwargs = super(GroupTemplateView, self).get_form_kwargs()
|
kwargs = super(GroupTemplateView, self).get_form_kwargs()
|
||||||
kwargs["users"] = self.users
|
kwargs["users"] = self.get_object().users.all()
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user