diff --git a/temba/orgs/views/base.py b/temba/orgs/views/base.py index 891ff9f813..8b289851da 100644 --- a/temba/orgs/views/base.py +++ b/temba/orgs/views/base.py @@ -58,10 +58,14 @@ def derive_queryset(self, **kwargs): class BaseDeleteModal(OrgObjPermsMixin, SmartDeleteView): - default_template = "smartmin/delete_confirm.html" submit_button_name = _("Delete") fields = ("id",) + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["submit_button_name"] = self.submit_button_name + return context + def post(self, request, *args, **kwargs): self.get_object().release(self.request.user) diff --git a/temba/orgs/views/views.py b/temba/orgs/views/views.py index 985f5e9fc7..eaddd2df10 100644 --- a/temba/orgs/views/views.py +++ b/temba/orgs/views/views.py @@ -340,7 +340,7 @@ class UserCRUDL(SmartCRUDL): actions = ( "list", "update", - "remove", + "delete", "edit", "forget", "recover", @@ -390,7 +390,7 @@ class Form(forms.ModelForm): role = forms.ChoiceField( choices=[(r.code, r.display) for r in (OrgRole.ADMINISTRATOR, OrgRole.EDITOR, OrgRole.AGENT)], required=True, - label=" ", + label=_("Role"), widget=SelectWidget(), ) @@ -413,15 +413,21 @@ def save(self, obj): self.request.org.add_user(obj, role) return obj - class Remove(OrgObjPermsMixin, SmartDeleteView): + class Delete(OrgObjPermsMixin, SmartDeleteView): permission = "orgs.user_update" fields = ("id",) + submit_button_name = _("Remove") cancel_url = "@orgs.user_list" redirect_url = "@orgs.user_list" def get_object_org(self): return self.request.org + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["submit_button_name"] = self.submit_button_name + return context + def post(self, request, *args, **kwargs): self.request.org.remove_user(self.get_object()) diff --git a/templates/orgs/user_remove.html b/templates/orgs/user_delete.html similarity index 100% rename from templates/orgs/user_remove.html rename to templates/orgs/user_delete.html diff --git a/templates/orgs/user_list.html b/templates/orgs/user_list.html index 9ddf7fff09..82f64cca22 100644 --- a/templates/orgs/user_list.html +++ b/templates/orgs/user_list.html @@ -10,17 +10,17 @@ {% endblocktrans %} {% endif %} -
- - - -
{% block pre-table %} - + {% endblock pre-table %} +
+ + + +
{% include "includes/short_pagination.html" %}
@@ -40,7 +40,7 @@
{{ obj.role.display }}