diff --git a/core/models.py b/core/models.py index e904603f..fdbcf19d 100644 --- a/core/models.py +++ b/core/models.py @@ -271,7 +271,7 @@ class User(AbstractBaseUser): _("dpt option"), max_length=32, blank=True, default="" ) semester = models.CharField(_("semester"), max_length=5, blank=True, default="") - quote = models.CharField(_("quote"), max_length=256, blank=True, default="") + quote = models.TextField(_("quote"), max_length=256, blank=True, default="") school = models.CharField(_("school"), max_length=80, blank=True, default="") promo = models.IntegerField( _("promo"), validators=[validate_promo], null=True, blank=True diff --git a/core/static/user/user.scss b/core/static/user/user.scss new file mode 100644 index 00000000..95ff7678 --- /dev/null +++ b/core/static/user/user.scss @@ -0,0 +1,172 @@ +.profile { + &-visible { + display: flex; + justify-content: center; + align-items: center; + gap: 5px; + + > input[type="checkbox"] { + cursor: pointer; + } + } + + &-pictures { + box-sizing: border-box; + padding: 40px 20px 20px 20px; + gap: 10px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-items: center; + + @media (max-width: 750px) { + flex-direction: column; + } + } + + &-picture { + box-sizing: border-box; + display: flex; + justify-content: center; + flex-direction: row; + flex-wrap: wrap; + gap: 20px; + width: 30%; + + @media (max-width: 750px) { + width: 100%; + } + + &-display { + display: flex; + flex-direction: column; + gap: 10px; + max-width: 200px; + + @media (max-width: 750px) { + max-width: 100%; + } + + > img { + width: 200px !important; + height: 200px; + + @media (max-width: 750px) { + width: 100% !important; + height: auto; + } + } + + > p { + text-align: left !important; + } + } + + &-edit { + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: center; + width: 40%; + + @media (max-width: 750px) { + width: 100%; + } + + > input { + font-size: .8em; + font-weight: normal; + cursor: pointer; + } + + > p { + margin-bottom: 10px; + text-align: left !important; + } + } + } + + &-fields { + padding: 20px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 10px; + justify-content: center; + + @media (max-width: 750px) { + gap: 20px; + } + } + + &-field { + display: flex; + flex-direction: row; + align-items: center; + flex-wrap: wrap; + justify-content: center; + gap: 10px; + width: 100%; + max-width: 30%; + min-width: 300px; + + @media (max-width: 750px) { + gap: 4px; + max-width: 100%; + } + + >* { + width: 100%; + max-width: 300px; + + @media (max-width: 750px) { + max-width: 100%; + } + } + + &-label { + text-align: left !important; + } + + &-content { + + >* { + box-sizing: border-box; + text-align: left !important; + line-height: 40px; + max-width: 100%; + width: 100%; + height: 40px; + margin: 0; + } + + + >textarea { + height: 120px; + min-height: 40px; + min-width: 300px; + max-width: 300px; + + @media (max-width: 750px) { + max-width: 100%; + } + } + + >input[type="file"] { + font-size: small; + line-height: 30px; + } + + >input[type="checkbox"] { + width: 20px; + height: 20px; + margin: 0; + float: left; + } + } + } +} + + + diff --git a/core/templates/core/user_edit.jinja b/core/templates/core/user_edit.jinja index 5bd692e9..53d31e18 100644 --- a/core/templates/core/user_edit.jinja +++ b/core/templates/core/user_edit.jinja @@ -1,55 +1,152 @@ -{% extends "core/base.jinja" %} +{%- extends "core/base.jinja" -%} -{% block title %} -{% trans %}Edit user{% endtrans %} -{% endblock %} +{%- block title -%} +{%- trans -%}Edit user{%- endtrans -%} +{%- endblock -%} -{% block content %} -
{%- trans -%}Current profile: {%- endtrans -%}
#} +{{ form["profile_pict"].label }}
+ {{ form["profile_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans -%}Delete{%- endtrans -%} + {%- endif -%} +{{ form["avatar_pict"].label }}
+ {{ form["avatar_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans -%}Delete{%- endtrans -%} + {%- endif -%} +{{ form["scrub_pict"].label }}
+ {{ form["scrub_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans -%}Delete{%- + endtrans -%} + {%- endif -%} ++ {%- trans -%}Change my password{%- endtrans -%} +
+ {%- elif user.is_root -%} ++ {%- trans -%}Change user password{%- endtrans -%} +
+ {%- endif -%} + ++ +
+ + +
+ {%- trans -%}Username: {%- endtrans -%} {{ form.instance.username }}
+
+ {%- if form.instance.customer -%}
+ {%- trans -%}Account number: {%- endtrans -%} {{ form.instance.customer.account_id }}
+ {%- endif -%}
+