diff --git a/smash/web/forms/worker_form.py b/smash/web/forms/worker_form.py index 296256805043bcbe3cf45f6e4f8d981154a5b6c4..8ceeacd7c53312247f2493eb76d03da137543a19 100644 --- a/smash/web/forms/worker_form.py +++ b/smash/web/forms/worker_form.py @@ -57,6 +57,10 @@ class WorkerForm(ModelForm): del self.fields['user'] if worker_type == WORKER_STAFF: + if instance.user is not None: + self.fields['Superuser'] = forms.BooleanField(label='Is Superuser?', disabled=True, required=False, + help_text='Super users have all permissions. This is a read only field.') + self.fields['Superuser'].initial = instance.user.is_superuser del self.fields['voucher_types'] del self.fields['name'] else: diff --git a/smash/web/templates/doctors/edit.html b/smash/web/templates/doctors/edit.html index fb689494e717f705c657633b0dc42508d0968e22..40217781f9abb8c425bec1583485298060d82c45 100644 --- a/smash/web/templates/doctors/edit.html +++ b/smash/web/templates/doctors/edit.html @@ -37,6 +37,9 @@ <div class="col-md-6 form-group {% if field.errors %}has-error{% endif %} {{ field.field.widget.attrs.class }}"> <label for="{# TODO #}" class="col-sm-4 control-label"> {{ field.label }} + {% if field.help_text %} + <i class="fa fa-info-circle" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="{{field.help_text}}"></i> + {% endif %} </label> <div class="col-sm-8">