Commit 53aaeaab50cb95338e9fad91b8c13f3fe78e3466

Authored by fbormann
1 parent 6a84d856

#187 modified profile page and added cpf as a required item

users/models.py
... ... @@ -34,7 +34,7 @@ class User(AbstractBaseUser, PermissionsMixin):
34 34 is_active = models.BooleanField(_('Active'), default = True)
35 35  
36 36 USERNAME_FIELD = 'username'
37   - REQUIRED_FIELDS = ['email']
  37 + REQUIRED_FIELDS = ['email', 'cpf']
38 38  
39 39 objects = UserManager()
40 40  
... ...
users/templates/users/profile.html
... ... @@ -14,7 +14,7 @@
14 14 {% block sidebar %}
15 15 <div class="panel panel-primary navigation">
16 16 <div class="panel-heading">
17   - <h4>Menu</h4>
  17 + <h4>{% trans "Menu" %}</h4>
18 18 </div>
19 19 <div class="panel-body">
20 20 <ul class="nav nav-pills nav-stacked">
... ... @@ -50,19 +50,19 @@
50 50 <table class="table table-hover table-edited">
51 51 <tbody>
52 52 <tr>
53   - <td>Status:</td>
54   - <td>Offline</td>
  53 + <td>{% trans "Status" %}:</td>
  54 + <td></td>
55 55 </tr>
56 56 <tr>
57   - <td>Nome:</td>
  57 + <td>{% trans "Nome" %}:</td>
58 58 <td>{{user}}</td>
59 59 </tr>
60 60 <tr>
61   - <td>Login:</td>
  61 + <td>{% trans "Login" %}</td>
62 62 <td>{{user.username}}</td>
63 63 </tr>
64 64 <tr>
65   - <td>Email:</td>
  65 + <td>{% trans "Email" %}:</td>
66 66 <td>{{user.email}}</td>
67 67 </tr>
68 68 </tbody>
... ... @@ -74,44 +74,71 @@
74 74 <table class="table table-hover table-edited">
75 75 <tbody>
76 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 84 </tr>
80 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 94 </tr>
84 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 103 </tr>
88 104 <tr>
89   - <td>Sexo:</td>
  105 + <td>{% trans "Gender" %}:</td>
90 106 <td>{{user.gender}}</td>
91 107 </tr>
92 108 <tr>
93   - <td>Data de Nascimento:</td>
  109 + <td>{% trans "Birth Date" %}:</td>
94 110 <td>{{user.birth_date}}</td>
95 111 </tr>
96 112 <tr>
97   - <td>Estado e Cidade:</td>
  113 + <td>{% trans "State and City" %}:</td>
98 114 <td>{{user.state}} - {{user.city}}</td>
99 115 </tr>
100 116 <tr>
101   - <td>Titulação:</td>
102   - <td>Mestrado</td>
  117 + <td>{% trans "Title" %}:</td>
  118 + <td>{{user.titration}}</td>
103 119 </tr>
104 120 <tr>
105   - <td>Ano:</td>
106   - <td>2012</td>
  121 + <td>{% trans "Year" %}:</td>
  122 + <td>{{user.year_titration}}</td>
107 123 </tr>
108 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 133 </tr>
112 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 142 </tr>
116 143 </tbody>
117 144 </table>
... ...