Commit 9c872704 by Oláh István Gergely

dashboard: add add_user skeleton to GroupDetails

parent 345ff036
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<td><a data-groupmember-pk="{{i.pk}}" href="{% url "dashboard.views.remove-user" user_pk=i.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupmember-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr> <td><a data-groupmember-pk="{{i.pk}}" href="{% url "dashboard.views.remove-user" user_pk=i.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupmember-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
{% endfor %} {% endfor %}
<tr><td><i class="icon-plus"></i></td> <tr><td><i class="icon-plus"></i></td>
<td><input type="text" class="form-control" name="perm-new-name" <td><input type="text" class="form-control" name="list-new-name"
placeholder="{% trans "Name of user" %}"></td> placeholder="{% trans "Name of user" %}"></td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -593,9 +593,15 @@ class GroupDetailView(CheckedDetailView): ...@@ -593,9 +593,15 @@ class GroupDetailView(CheckedDetailView):
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if request.POST.get('new_name'): if request.POST.get('new_name'):
return self.__set_name(request) return self.__set_name(request)
if request.POST.get('list-new-name'):
return self.__add_user(request)
def __add_user(self, request):
self.object = self.get_object()
return redirect(reverse_lazy("dashboard.views.group-detail",
kwargs={'pk': self.object.pk}))
def __set_name(self, request): def __set_name(self, request):
self.object = self.get_object() self.object = self.get_object()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment