diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 4b9c7df..f72741e 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -105,16 +105,22 @@ -->
  • - +
  • -
  • - +
  • + +
  • diff --git a/users/forms.py b/users/forms.py index 6c7d454..1195ed0 100644 --- a/users/forms.py +++ b/users/forms.py @@ -66,17 +66,11 @@ class RegisterUserForm(Validation): fields = ['email', 'username', 'last_name', 'social_name', 'image', 'show_email', ] class ProfileForm(Validation): - password = forms.CharField(label=_('Password'), widget = forms.PasswordInput, required = False) - password2 = forms.CharField(label = _('Confirm Password'), widget = forms.PasswordInput, required = False) - is_edit = True def save(self, commit=True): super(ProfileForm, self).save(commit=False) - if len(self.cleaned_data['password']) > 0: - self.instance.set_password(self.cleaned_data['password']) - self.instance.save() return self.instance diff --git a/users/models.py b/users/models.py index d6355da..0f6587a 100644 --- a/users/models.py +++ b/users/models.py @@ -43,7 +43,7 @@ class User(AbstractBaseUser, PermissionsMixin): verbose_name_plural = _('Users') def __str__(self): - return self.social_name or self.username + return self.social_name or (self.username + " " + self.last_name) def get_short_name(self): return str(self) @@ -54,3 +54,18 @@ class User(AbstractBaseUser, PermissionsMixin): return self.image.url else: return static('img/no_image.jpg') + + def is_admin(self): + if self.is_staff: + return _('Yes') + + return _('Is not an admin') + + def is_coordinator(self): + return _('Is not a coordinator') + + def is_professor(self): + return _('Is not a professor') + + def is_student(self): + return _('Is not a student') diff --git a/users/templates/users/profile.html b/users/templates/users/profile.html index c87237b..6dda048 100644 --- a/users/templates/users/profile.html +++ b/users/templates/users/profile.html @@ -32,27 +32,32 @@ +

    {{ user }}

    +

    {{ user.email }}

    - {% trans 'Name' %}: {{ user.username }}
    - {% trans 'Last Name' %}: {{ user.last_name }}
    - {% trans 'Social Name' %}: {% if user.social_name is None %}{% trans 'Not informed' %}{% else %}{{ user.social_name }}{% endif %}
    - {% trans 'User since' %}: {{ user.date_created|date }}
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    - {{ user.description|linebreaks }} -
    -
    -
    -
    - - {% trans 'Edit Profile' %} - - - {% trans 'Delete Account' %} - + {{ user.description|default:_("Not Informed")|linebreaks }}
    -- libgit2 0.21.2