Commit 53aaeaab50cb95338e9fad91b8c13f3fe78e3466
1 parent
6a84d856
Exists in
master
and in
5 other branches
#187 modified profile page and added cpf as a required item
Showing
2 changed files
with
51 additions
and
24 deletions
Show diff stats
users/models.py
@@ -34,7 +34,7 @@ class User(AbstractBaseUser, PermissionsMixin): | @@ -34,7 +34,7 @@ class User(AbstractBaseUser, PermissionsMixin): | ||
34 | is_active = models.BooleanField(_('Active'), default = True) | 34 | is_active = models.BooleanField(_('Active'), default = True) |
35 | 35 | ||
36 | USERNAME_FIELD = 'username' | 36 | USERNAME_FIELD = 'username' |
37 | - REQUIRED_FIELDS = ['email'] | 37 | + REQUIRED_FIELDS = ['email', 'cpf'] |
38 | 38 | ||
39 | objects = UserManager() | 39 | objects = UserManager() |
40 | 40 |
users/templates/users/profile.html
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | {% block sidebar %} | 14 | {% block sidebar %} |
15 | <div class="panel panel-primary navigation"> | 15 | <div class="panel panel-primary navigation"> |
16 | <div class="panel-heading"> | 16 | <div class="panel-heading"> |
17 | - <h4>Menu</h4> | 17 | + <h4>{% trans "Menu" %}</h4> |
18 | </div> | 18 | </div> |
19 | <div class="panel-body"> | 19 | <div class="panel-body"> |
20 | <ul class="nav nav-pills nav-stacked"> | 20 | <ul class="nav nav-pills nav-stacked"> |
@@ -50,19 +50,19 @@ | @@ -50,19 +50,19 @@ | ||
50 | <table class="table table-hover table-edited"> | 50 | <table class="table table-hover table-edited"> |
51 | <tbody> | 51 | <tbody> |
52 | <tr> | 52 | <tr> |
53 | - <td>Status:</td> | ||
54 | - <td>Offline</td> | 53 | + <td>{% trans "Status" %}:</td> |
54 | + <td></td> | ||
55 | </tr> | 55 | </tr> |
56 | <tr> | 56 | <tr> |
57 | - <td>Nome:</td> | 57 | + <td>{% trans "Nome" %}:</td> |
58 | <td>{{user}}</td> | 58 | <td>{{user}}</td> |
59 | </tr> | 59 | </tr> |
60 | <tr> | 60 | <tr> |
61 | - <td>Login:</td> | 61 | + <td>{% trans "Login" %}</td> |
62 | <td>{{user.username}}</td> | 62 | <td>{{user.username}}</td> |
63 | </tr> | 63 | </tr> |
64 | <tr> | 64 | <tr> |
65 | - <td>Email:</td> | 65 | + <td>{% trans "Email" %}:</td> |
66 | <td>{{user.email}}</td> | 66 | <td>{{user.email}}</td> |
67 | </tr> | 67 | </tr> |
68 | </tbody> | 68 | </tbody> |
@@ -74,44 +74,71 @@ | @@ -74,44 +74,71 @@ | ||
74 | <table class="table table-hover table-edited"> | 74 | <table class="table table-hover table-edited"> |
75 | <tbody> | 75 | <tbody> |
76 | <tr> | 76 | <tr> |
77 | - <td>Tipo de usuário:</td> | ||
78 | - <td>{{use.type_profile}}</td> | 77 | + <td>{% trans "Tipo de Usuário" %}:</td> |
78 | + {% if user.type_profile == 1 %} | ||
79 | + <td>{% trans "Teacher" %}</td> | ||
80 | + {% else %} | ||
81 | + <td>{% trans "Student" %}</td> | ||
82 | + {% endif %} | ||
83 | + | ||
79 | </tr> | 84 | </tr> |
80 | <tr> | 85 | <tr> |
81 | - <td>CPF:</td> | ||
82 | - <td>{{user.cpf}}</td> | 86 | + <td>{% trans "CPF" %}:</td> |
87 | + {% if user.cpf %} | ||
88 | + <td>{{user.cpf}}</td> | ||
89 | + | ||
90 | + {% else %} | ||
91 | + <td>{% trans "doesn't posssess CPF" %}</td> | ||
92 | + {% endif %} | ||
93 | + | ||
83 | </tr> | 94 | </tr> |
84 | <tr> | 95 | <tr> |
85 | - <td>Número de telefone:</td> | ||
86 | - <td>{{user.phone}}</td> | 96 | + <td>{% trans "Phone Number" %}:</td> |
97 | + {% if user.phone %} | ||
98 | + <td>{{user.phone}}</td> | ||
99 | + {% else %} | ||
100 | + <td>{% trans "doesn't posssess Phone" %}</td> | ||
101 | + {% endif %} | ||
102 | + | ||
87 | </tr> | 103 | </tr> |
88 | <tr> | 104 | <tr> |
89 | - <td>Sexo:</td> | 105 | + <td>{% trans "Gender" %}:</td> |
90 | <td>{{user.gender}}</td> | 106 | <td>{{user.gender}}</td> |
91 | </tr> | 107 | </tr> |
92 | <tr> | 108 | <tr> |
93 | - <td>Data de Nascimento:</td> | 109 | + <td>{% trans "Birth Date" %}:</td> |
94 | <td>{{user.birth_date}}</td> | 110 | <td>{{user.birth_date}}</td> |
95 | </tr> | 111 | </tr> |
96 | <tr> | 112 | <tr> |
97 | - <td>Estado e Cidade:</td> | 113 | + <td>{% trans "State and City" %}:</td> |
98 | <td>{{user.state}} - {{user.city}}</td> | 114 | <td>{{user.state}} - {{user.city}}</td> |
99 | </tr> | 115 | </tr> |
100 | <tr> | 116 | <tr> |
101 | - <td>Titulação:</td> | ||
102 | - <td>Mestrado</td> | 117 | + <td>{% trans "Title" %}:</td> |
118 | + <td>{{user.titration}}</td> | ||
103 | </tr> | 119 | </tr> |
104 | <tr> | 120 | <tr> |
105 | - <td>Ano:</td> | ||
106 | - <td>2012</td> | 121 | + <td>{% trans "Year" %}:</td> |
122 | + <td>{{user.year_titration}}</td> | ||
107 | </tr> | 123 | </tr> |
108 | <tr> | 124 | <tr> |
109 | - <td>Instituição:</td> | ||
110 | - <td>UFPE</td> | 125 | + <td>{% trans "Institution" %}:</td> |
126 | + {% if user.institution %} | ||
127 | + <td>{{user.institution}}</td> | ||
128 | + {% else %} | ||
129 | + <td>{% trans "Didn't inform institution" %}</td> | ||
130 | + {% endif %} | ||
131 | + | ||
132 | + | ||
111 | </tr> | 133 | </tr> |
112 | <tr> | 134 | <tr> |
113 | - <td>Currículo:</td> | ||
114 | - <td>-</td> | 135 | + <td>{% trans "Curriculum" %}:</td> |
136 | + {% if user.curriculum %} | ||
137 | + <td>{{user.curriculum}}</td> | ||
138 | + {% else %} | ||
139 | + <td>{% trans "Didn't upload any curriculum" %}</td> | ||
140 | + {% endif %} | ||
141 | + | ||
115 | </tr> | 142 | </tr> |
116 | </tbody> | 143 | </tbody> |
117 | </table> | 144 | </table> |