Commit ed800678dbb6c548af95a88b03a35b79223e52b3

Authored by Matheus Lins
1 parent 83fc54c7

conflite

app/templates/home.html
@@ -96,8 +96,26 @@ @@ -96,8 +96,26 @@
96 96
97 {% endblock %} 97 {% endblock %}
98 {% if user|has_role:'system_admin' %} 98 {% if user|has_role:'system_admin' %}
99 - <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li>  
100 - <li> <a href="{% url 'app:settings' %}">{% trans 'Settings' %}</a></li> 99 +
  100 + <li>
  101 + <a href="#menu_users" class="accordion" data-toggle="collapse">{% trans 'Users' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a>
  102 + <div id="menu_users" class="collapse">
  103 + <ul class="nav nav-pill nav-stacked accordion_list">
  104 + <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li>
  105 + <li> <a href="{% url 'users:create' %}">{% trans 'Create User' %}</a></li>
  106 + </ul>
  107 + </div>
  108 + </li>
  109 + <li>
  110 + <a href="#menu_settings" class="accordion" data-toggle="collapse">{% trans 'Settings' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a>
  111 + <div id="menu_settings" class="collapse">
  112 + <ul class="nav nav-pill nav-stacked accordion_list">
  113 + <li> <a href="{% url 'app:settings' %}">{% trans "System" %}</a></li>
  114 + <li> <a href="{% url 'app:settings' %}">{% trans "Mail Sender" %}</a></li>
  115 + <li> <a href="{% url 'app:settings' %}">{% trans "Security" %}</a></li>
  116 + </ul>
  117 + </div>
  118 + </li>
101 {% endif %} 119 {% endif %}
102 </ul> 120 </ul>
103 </div> 121 </div>
core/locale/pt_BR/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid &quot;&quot; @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 msgstr "" 8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n" 9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n" 10 "Report-Msgid-Bugs-To: \n"
11 -"POT-Creation-Date: 2016-11-16 11:23-0300\n" 11 +"POT-Creation-Date: 2016-11-19 10:24-0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,10 +23,8 @@ msgid &quot;Password&quot; @@ -23,10 +23,8 @@ msgid &quot;Password&quot;
23 msgstr "Senha" 23 msgstr "Senha"
24 24
25 #: .\forms.py:13 25 #: .\forms.py:13
26 -#, fuzzy  
27 -#| msgid "Confirm password:"  
28 msgid "Confirm Password" 26 msgid "Confirm Password"
29 -msgstr "Confirmação de senha:" 27 +msgstr "Confirme a senha:"
30 28
31 #: .\forms.py:27 29 #: .\forms.py:27
32 msgid "There is already a registered User with this e-mail" 30 msgid "There is already a registered User with this e-mail"
@@ -40,7 +38,7 @@ msgstr &quot;Por favor, insira uma data válida&quot; @@ -40,7 +38,7 @@ msgstr &quot;Por favor, insira uma data válida&quot;
40 #, fuzzy 38 #, fuzzy
41 #| msgid "There is already a registeres User with this CPF" 39 #| msgid "There is already a registeres User with this CPF"
42 msgid "There is already a registered User with this CPF" 40 msgid "There is already a registered User with this CPF"
43 -msgstr "Já existem usuários cadastrados com este CPF" 41 +msgstr "Já existe usuário cadastrado com este CPF"
44 42
45 #: .\forms.py:52 43 #: .\forms.py:52
46 #, python-format 44 #, python-format
@@ -138,7 +136,7 @@ msgstr &quot;Autor&quot; @@ -138,7 +136,7 @@ msgstr &quot;Autor&quot;
138 msgid "Notification" 136 msgid "Notification"
139 msgstr "Notificação" 137 msgstr "Notificação"
140 138
141 -#: .\models.py:99 .\templates\base.html:92 .\templates\guest.html:70 139 +#: .\models.py:99 .\templates\base.html:92
142 msgid "Notifications" 140 msgid "Notifications"
143 msgstr "Notificações" 141 msgstr "Notificações"
144 142
@@ -166,11 +164,11 @@ msgstr &quot;Logs&quot; @@ -166,11 +164,11 @@ msgstr &quot;Logs&quot;
166 msgid "Search Files (.pdf, others) and/or activities" 164 msgid "Search Files (.pdf, others) and/or activities"
167 msgstr "Pesquisar arquivos (.pdf, outros) e/ou atividades" 165 msgstr "Pesquisar arquivos (.pdf, outros) e/ou atividades"
168 166
169 -#: .\templates\base.html:98 .\templates\guest.html:77 167 +#: .\templates\base.html:98
170 msgid "See More" 168 msgid "See More"
171 msgstr "Ver Mais" 169 msgstr "Ver Mais"
172 170
173 -#: .\templates\base.html:105 .\templates\guest.html:83 171 +#: .\templates\base.html:105
174 msgid "messages" 172 msgid "messages"
175 msgstr "Mensagens" 173 msgstr "Mensagens"
176 174
@@ -196,14 +194,22 @@ msgstr &quot;Mudar senha&quot; @@ -196,14 +194,22 @@ msgstr &quot;Mudar senha&quot;
196 msgid "Remove account" 194 msgid "Remove account"
197 msgstr "Remover conta" 195 msgstr "Remover conta"
198 196
199 -#: .\templates\guest.html:97 197 +#: .\templates\guest.html:67 .\templates\index.html:67 .\views.py:115
  198 +msgid "Guest"
  199 +msgstr "Convidado"
  200 +
  201 +#: .\templates\guest.html:80
200 msgid "Menu" 202 msgid "Menu"
201 msgstr "Menu" 203 msgstr "Menu"
202 204
203 -#: .\templates\guest.html:101 .\templates\register_user.html:110 205 +#: .\templates\guest.html:84 .\templates\register_user.html:110
204 msgid "Register" 206 msgid "Register"
205 msgstr "Cadastrar" 207 msgstr "Cadastrar"
206 208
  209 +#: .\templates\guest.html:98
  210 +msgid "Search Courses"
  211 +msgstr "Pesquisar Cursos"
  212 +
207 #: .\templates\index.html:37 213 #: .\templates\index.html:37
208 msgid "Sign in with your account to continue" 214 msgid "Sign in with your account to continue"
209 msgstr "Faça login com sua conta para continuar" 215 msgstr "Faça login com sua conta para continuar"
@@ -220,10 +226,6 @@ msgstr &quot;Lembrar E-mail&quot; @@ -220,10 +226,6 @@ msgstr &quot;Lembrar E-mail&quot;
220 msgid "Log in" 226 msgid "Log in"
221 msgstr "Acessar" 227 msgstr "Acessar"
222 228
223 -#: .\templates\index.html:67  
224 -msgid "Guest"  
225 -msgstr "Convidado"  
226 -  
227 #: .\templates\index.html:72 229 #: .\templates\index.html:72
228 msgid "Forgot your password?" 230 msgid "Forgot your password?"
229 msgstr "Esqueceu sua senha?" 231 msgstr "Esqueceu sua senha?"
@@ -236,9 +238,11 @@ msgstr &quot;Cadastrar&quot; @@ -236,9 +238,11 @@ msgstr &quot;Cadastrar&quot;
236 msgid "User Register" 238 msgid "User Register"
237 msgstr "Cadastro de usuário" 239 msgstr "Cadastro de usuário"
238 240
  241 +#: .\templates\register_user.html:61
  242 +msgid "Choose your photo..."
  243 +msgstr ""
  244 +
239 #: .\templates\register_user.html:71 245 #: .\templates\register_user.html:71
240 -#, fuzzy  
241 -#| msgid "Chose your file ..."  
242 msgid "Choose the file ..." 246 msgid "Choose the file ..."
243 msgstr "Escolha o arquivo..." 247 msgstr "Escolha o arquivo..."
244 248
@@ -249,7 +253,7 @@ msgstr &quot;Entrar&quot; @@ -249,7 +253,7 @@ msgstr &quot;Entrar&quot;
249 253
250 #: .\templates\registration\passwor_reset_complete.html:19 254 #: .\templates\registration\passwor_reset_complete.html:19
251 msgid "Your password was reseted successful" 255 msgid "Your password was reseted successful"
252 -msgstr "" 256 +msgstr "Sua senha foi resetada com sucesso"
253 257
254 #: .\templates\registration\passwor_reset_confirm.html:19 258 #: .\templates\registration\passwor_reset_confirm.html:19
255 #: .\templates\registration\passwor_reset_done.html:18 259 #: .\templates\registration\passwor_reset_done.html:18
@@ -389,9 +393,6 @@ msgstr &quot;E-mail ou senha incorretos.&quot; @@ -389,9 +393,6 @@ msgstr &quot;E-mail ou senha incorretos.&quot;
389 #~ msgid "Manage Users" 393 #~ msgid "Manage Users"
390 #~ msgstr "Gerenciar usuários" 394 #~ msgstr "Gerenciar usuários"
391 395
392 -#~ msgid "Manage Courses"  
393 -#~ msgstr "Gerenciar cursos"  
394 -  
395 #~ msgid "Category" 396 #~ msgid "Category"
396 #~ msgstr "Categoria" 397 #~ msgstr "Categoria"
397 398
core/templates/guest.html
@@ -64,24 +64,7 @@ @@ -64,24 +64,7 @@
64 </div> 64 </div>
65 <div class="navbar-collapse collapse navbar-responsive-collapse"> 65 <div class="navbar-collapse collapse navbar-responsive-collapse">
66 <ul class="nav navbar-nav navbar-right notifications"> 66 <ul class="nav navbar-nav navbar-right notifications">
67 - <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications">  
68 - <a class="dropdown-toggle" data-toggle="dropdown"> <span id="notification-count" class="badge notification-count">{{notifications.count}}</span><i class="fa fa-bell" aria-hidden="true"></i></a>  
69 - <ul id="notification-dropdown" class="dropdown-menu">  
70 - <li class="dropdown-header">{% trans 'Notifications' %}</li>  
71 - {% include "notifications.html" %}  
72 -  
73 - <li>  
74 - <a onclick="getNotifications(5)">  
75 - <div id="notification-see-more" class="list-group-item">  
76 - <div class="row-content">  
77 - <p class="list-group-item-text">{% trans 'See More' %}</p>  
78 - </div>  
79 - </a>  
80 - </li>  
81 - </ul>  
82 - </li>  
83 - <li data-toggle="tooltip" data-placement="bottom" title data-original-title="{% trans 'messages' %}"> <a href="#"><i class="fa fa-comments" aria-hidden="true"></i></a> </li>  
84 - <li > <a class="link" href="{% url 'app:index' %}">{{ user }}</a></li> 67 + <li > <a class="link" href="{% url 'app:index' %}">{% trans 'Guest' %}</a></li>
85 <li data-toggle="tooltip" data-placement="bottom" title data-original-title="log out"> <a href="{% url 'app:index' %}"><i class="fa fa-sign-out" aria-hidden="true"></i></a></li> 68 <li data-toggle="tooltip" data-placement="bottom" title data-original-title="log out"> <a href="{% url 'app:index' %}"><i class="fa fa-sign-out" aria-hidden="true"></i></a></li>
86 </ul> 69 </ul>
87 </div> 70 </div>
@@ -107,21 +90,6 @@ @@ -107,21 +90,6 @@
107 </div> 90 </div>
108 <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"> 91 <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10">
109 {% block breadcrumbs %} 92 {% block breadcrumbs %}
110 -  
111 - <div class="col-md-12">  
112 - <form id="searchform" action="{% url 'course:manage' %}" method="get" accept-charset="utf-8">  
113 - <div class="input-group">  
114 - <div class="form-group is-empty">  
115 - <input type="search" class="form-control" placeholder="Search Courses" name="q" id="searchbox"></div>  
116 - <span class="input-group-btn input-group-sm">  
117 - <button type="button" class="btn btn-fab btn-fab-mini">  
118 - <i class="material-icons">search</i>  
119 - </button>  
120 - </span>  
121 - </div>  
122 - </form>  
123 - </div>  
124 -  
125 {% endblock %} 93 {% endblock %}
126 {% block render_breadcrumbs %}{% endblock %} 94 {% block render_breadcrumbs %}{% endblock %}
127 <div> 95 <div>
@@ -137,7 +105,7 @@ @@ -137,7 +105,7 @@
137 <h4 class="panel-title"> 105 <h4 class="panel-title">
138 <a class="category-course-link" data-toggle="collapse" href="#{{category.slug}}">{{category.name}}</a> 106 <a class="category-course-link" data-toggle="collapse" href="#{{category.slug}}">{{category.name}}</a>
139 </h4> 107 </h4>
140 - 108 +
141 </div> 109 </div>
142 <div id="{{category.slug}}" class="panel-collapse collapse"> 110 <div id="{{category.slug}}" class="panel-collapse collapse">
143 {% for course in category.course_category.all %} 111 {% for course in category.course_category.all %}
@@ -150,6 +118,27 @@ @@ -150,6 +118,27 @@
150 </div> 118 </div>
151 {% endfor %} 119 {% endfor %}
152 </div> 120 </div>
  121 + <div class="col-md-12">
  122 + <nav aria-label="Page navigation">
  123 + <ul class="pagination">
  124 + {% if page_obj.has_previous %}
  125 + <li>
  126 + <a href="?page={{ page_obj.previous_page_number }}"><span><<</span></a>
  127 + </li>
  128 + {% endif %}
  129 + {% for page_number in paginator.page_range %}
  130 + <li{% if page_obj.number == page_number %} class="active"{% endif %}>
  131 + <a href="?page={{ page_number }}">{{ page_number }}</a>
  132 + </li>
  133 + {% endfor %}
  134 + {% if page_obj.has_next %}
  135 + <li>
  136 + <a href="?page={{ page_obj.next_page_number }}"><span>>></span></a>
  137 + </li>
  138 + {% endif %}
  139 + </ul>
  140 + </nav>
  141 + </div>
153 {% endblock %} 142 {% endblock %}
154 </div> 143 </div>
155 </div> 144 </div>
@@ -161,4 +150,4 @@ @@ -161,4 +150,4 @@
161 {% endblock script_file %} 150 {% endblock script_file %}
162 </body> 151 </body>
163 152
164 -</html>  
165 \ No newline at end of file 153 \ No newline at end of file
  154 +</html>
core/templates/register_user.html
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 {% elif field.auto_id == 'id_image' %} 58 {% elif field.auto_id == 'id_image' %}
59 {% render_field field class='form-control' %} 59 {% render_field field class='form-control' %}
60 <div class="input-group"> 60 <div class="input-group">
61 - <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."> 61 + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}">
62 <span class="input-group-btn input-group-sm"> 62 <span class="input-group-btn input-group-sm">
63 <button type="button" class="btn btn-fab btn-fab-mini"> 63 <button type="button" class="btn btn-fab btn-fab-mini">
64 <i class="material-icons">image</i> 64 <i class="material-icons">image</i>
@@ -14,6 +14,8 @@ from core.mixins import NotificationMixin @@ -14,6 +14,8 @@ from core.mixins import NotificationMixin
14 from .models import Notification, Log 14 from .models import Notification, Log
15 from rolepermissions.shortcuts import assign_role 15 from rolepermissions.shortcuts import assign_role
16 from django.contrib.auth.decorators import login_required 16 from django.contrib.auth.decorators import login_required
  17 +from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
  18 +
17 #API REST IMPORTS 19 #API REST IMPORTS
18 from .serializers import LogSerializer 20 from .serializers import LogSerializer
19 from rest_framework import status, serializers, permissions, viewsets 21 from rest_framework import status, serializers, permissions, viewsets
@@ -103,15 +105,24 @@ class GuestView (ListView): @@ -103,15 +105,24 @@ class GuestView (ListView):
103 105
104 template_name = 'guest.html' 106 template_name = 'guest.html'
105 context_object_name = 'courses' 107 context_object_name = 'courses'
  108 + queryset = CourseCategory.objects.all()
106 paginate_by = 10 109 paginate_by = 10
107 110
108 - def get_queryset(self):  
109 - return Course.objects.filter(public=True)  
110 -  
111 -  
112 def get_context_data (self, **kwargs): 111 def get_context_data (self, **kwargs):
113 context = super(GuestView, self).get_context_data(**kwargs) 112 context = super(GuestView, self).get_context_data(**kwargs)
114 - context['categorys_courses'] = CourseCategory.objects.all() 113 + context['title'] = _("Guest")
  114 + queryset_list = CourseCategory.objects.all()
  115 +
  116 + paginator = Paginator(queryset_list, 10)
  117 + page = self.request.GET.get('page')
  118 + try:
  119 + queryset_list = paginator.page(page)
  120 + except PageNotAnInteger:
  121 + queryset_list = paginator.page(1)
  122 + except EmptyPage:
  123 + queryset_list = paginator.page(paginator.num_pages)
  124 +
  125 + context['categorys_courses'] = queryset_list
115 return context 126 return context
116 127
117 128
users/locale/pt_BR/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid &quot;&quot; @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 msgstr "" 8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n" 9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n" 10 "Report-Msgid-Bugs-To: \n"
11 -"POT-Creation-Date: 2016-10-26 14:47-0300\n" 11 +"POT-Creation-Date: 2016-11-17 09:46-0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,19 +18,19 @@ msgstr &quot;&quot; @@ -18,19 +18,19 @@ msgstr &quot;&quot;
18 "Content-Transfer-Encoding: 8bit\n" 18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20
21 -#: users/forms.py:60 21 +#: .\forms.py:60
22 msgid "Please enter a valid CPF" 22 msgid "Please enter a valid CPF"
23 msgstr "Por favor, insira um CPF válido" 23 msgstr "Por favor, insira um CPF válido"
24 24
25 -#: users/forms.py:67 25 +#: .\forms.py:66
26 msgid "Please enter a valid date" 26 msgid "Please enter a valid date"
27 msgstr "Por favor, insira uma data válida" 27 msgstr "Por favor, insira uma data válida"
28 28
29 -#: users/models.py:11 users/templates/users/profile.html:61 29 +#: .\models.py:11 .\templates\users\profile.html:64
30 msgid "Login" 30 msgid "Login"
31 msgstr "Login" 31 msgstr "Login"
32 32
33 -#: users/models.py:14 33 +#: .\models.py:14
34 msgid "" 34 msgid ""
35 "Type a valid username. This fields should only contain letters, numbers and " 35 "Type a valid username. This fields should only contain letters, numbers and "
36 "the characteres: @/./+/-/_ ." 36 "the characteres: @/./+/-/_ ."
@@ -38,361 +38,359 @@ msgstr &quot;&quot; @@ -38,361 +38,359 @@ msgstr &quot;&quot;
38 "Digite um nome de usuário válido. Esse campo deve conter apenas letras, " 38 "Digite um nome de usuário válido. Esse campo deve conter apenas letras, "
39 "números e os caracteres: @/./+/-/_ ." 39 "números e os caracteres: @/./+/-/_ ."
40 40
41 -#: users/models.py:17 41 +#: .\models.py:17
42 msgid "" 42 msgid ""
43 "A short name that will be used to identify you in the platform and to access " 43 "A short name that will be used to identify you in the platform and to access "
44 "it" 44 "it"
45 msgstr "" 45 msgstr ""
46 "Um nome curto que será usado para se identificar no acesso à plataforma" 46 "Um nome curto que será usado para se identificar no acesso à plataforma"
47 47
48 -#: users/models.py:18 48 +#: .\models.py:18
49 msgid "Mail" 49 msgid "Mail"
50 msgstr "Email" 50 msgstr "Email"
51 51
52 -#: users/models.py:19 users/templates/list_users.html:67 52 +#: .\models.py:19 .\templates\list_users.html:58
  53 +#: .\templates\users\profile.html:60
53 msgid "Name" 54 msgid "Name"
54 msgstr "Nome" 55 msgstr "Nome"
55 56
56 -#: users/models.py:20 57 +#: .\models.py:20
57 msgid "City" 58 msgid "City"
58 msgstr "Cidade" 59 msgstr "Cidade"
59 60
60 -#: users/models.py:21 61 +#: .\models.py:21
61 msgid "State" 62 msgid "State"
62 msgstr "Estado" 63 msgstr "Estado"
63 64
64 -#: users/models.py:22 users/templates/users/profile.html:105 65 +#: .\models.py:22 .\templates\users\profile.html:108
65 msgid "Gender" 66 msgid "Gender"
66 msgstr "Gênero" 67 msgstr "Gênero"
67 68
68 -#: users/models.py:22 69 +#: .\models.py:22
69 msgid "Male" 70 msgid "Male"
70 msgstr "Masculino" 71 msgstr "Masculino"
71 72
72 -#: users/models.py:22 73 +#: .\models.py:22
73 msgid "Female" 74 msgid "Female"
74 msgstr "Feminino" 75 msgstr "Feminino"
75 76
76 -#: users/models.py:23  
77 -msgid "Image"  
78 -msgstr "Imagem" 77 +#: .\models.py:23
  78 +msgid "Photo"
  79 +msgstr "Foto"
79 80
80 -#: users/models.py:24 users/templates/users/profile.html:109 81 +#: .\models.py:24 .\templates\users\profile.html:112
81 msgid "Birth Date" 82 msgid "Birth Date"
82 msgstr "Data de nascimento" 83 msgstr "Data de nascimento"
83 84
84 -#: users/models.py:25 85 +#: .\models.py:25
85 msgid "Phone" 86 msgid "Phone"
86 msgstr "Telefone" 87 msgstr "Telefone"
87 88
88 -#: users/models.py:26  
89 -msgid "Cpf" 89 +#: .\models.py:26 .\templates\users\profile.html:89
  90 +msgid "CPF"
90 msgstr "CPF" 91 msgstr "CPF"
91 92
92 -#: users/models.py:27 93 +#: .\models.py:27
93 msgid "Type" 94 msgid "Type"
94 msgstr "Tipo" 95 msgstr "Tipo"
95 96
96 -#: users/models.py:27 97 +#: .\models.py:27
97 msgid "Professor" 98 msgid "Professor"
98 msgstr "Professor" 99 msgstr "Professor"
99 100
100 -#: users/models.py:27 users/templates/users/profile.html:81 101 +#: .\models.py:27 .\templates\users\profile.html:84
101 msgid "Student" 102 msgid "Student"
102 msgstr "Aluno" 103 msgstr "Aluno"
103 104
104 -#: users/models.py:28 105 +#: .\models.py:28
105 msgid "Titration" 106 msgid "Titration"
106 msgstr "Título" 107 msgstr "Título"
107 108
108 -#: users/models.py:29 109 +#: .\models.py:29
109 msgid "Year of titration" 110 msgid "Year of titration"
110 msgstr "Ano do título" 111 msgstr "Ano do título"
111 112
112 -#: users/models.py:30  
113 -msgid "Institution where he had titration"  
114 -msgstr "Instituição o qual obteve o título" 113 +#: .\models.py:30 .\templates\users\profile.html:128
  114 +msgid "Institution"
  115 +msgstr "Instituição"
115 116
116 -#: users/models.py:31 users/templates/users/profile.html:135 117 +#: .\models.py:31 .\templates\users\profile.html:136
117 msgid "Curriculum" 118 msgid "Curriculum"
118 msgstr "Currículo" 119 msgstr "Currículo"
119 120
120 -#: users/models.py:32 121 +#: .\models.py:32
121 msgid "Create Date" 122 msgid "Create Date"
122 msgstr "Data de criação" 123 msgstr "Data de criação"
123 124
124 -#: users/models.py:33  
125 -msgid "Administrador" 125 +#: .\models.py:33 .\templates\users\index.html:46
  126 +#: .\templates\users\view.html:19
  127 +msgid "Administrator"
126 msgstr "Administrador" 128 msgstr "Administrador"
127 129
128 -#: users/models.py:34 130 +#: .\models.py:34
129 msgid "Active" 131 msgid "Active"
130 msgstr "Ativo" 132 msgstr "Ativo"
131 133
132 -#: users/models.py:42 134 +#: .\models.py:42
133 msgid "User" 135 msgid "User"
134 msgstr "Usuário" 136 msgstr "Usuário"
135 137
136 -#: users/models.py:43 138 +#: .\models.py:43
137 msgid "Users" 139 msgid "Users"
138 msgstr "Usuários" 140 msgstr "Usuários"
139 141
140 -#: users/templates/list_users.html:15 users/templates/users/profile.html:17  
141 -msgid "Menu"  
142 -msgstr "Menu"  
143 -  
144 -#: users/templates/list_users.html:19 users/templates/users/index.html:7  
145 -#: users/templates/users/view.html:7  
146 -msgid "Home"  
147 -msgstr "Início"  
148 -  
149 -#: users/templates/list_users.html:20  
150 -msgid "Add user" 142 +#: .\templates\list_users.html:14 .\templates\users\index.html:13
  143 +#: .\templates\users\profile.html:16
  144 +msgid "Add User"
151 msgstr "Adicionar usuário" 145 msgstr "Adicionar usuário"
152 146
153 -#: users/templates/list_users.html:21  
154 -msgid "Send email"  
155 -msgstr "Enviar e-mail"  
156 -  
157 -#: users/templates/list_users.html:41 147 +#: .\templates\list_users.html:32
158 msgid "Search..." 148 msgid "Search..."
159 msgstr "Pesquisar..." 149 msgstr "Pesquisar..."
160 150
161 -#: users/templates/list_users.html:45  
162 -msgid "Search"  
163 -msgstr "Pesquisar"  
164 -  
165 -#: users/templates/list_users.html:68 151 +#: .\templates\list_users.html:59
166 msgid "Profile" 152 msgid "Profile"
167 msgstr "Perfil" 153 msgstr "Perfil"
168 154
169 -#: users/templates/list_users.html:69 users/templates/users/profile.html:65 155 +#: .\templates\list_users.html:60 .\templates\users\profile.html:68
170 msgid "Email" 156 msgid "Email"
171 msgstr "Email" 157 msgstr "Email"
172 158
173 -#: users/templates/list_users.html:70 159 +#: .\templates\list_users.html:61
174 msgid "Contact" 160 msgid "Contact"
175 msgstr "Contato" 161 msgstr "Contato"
176 162
177 -#: users/templates/list_users.html:72 163 +#: .\templates\list_users.html:63
178 msgid "Edit" 164 msgid "Edit"
179 msgstr "Editar" 165 msgstr "Editar"
180 166
181 -#: users/templates/list_users.html:73 users/templates/list_users.html:91 167 +#: .\templates\list_users.html:64 .\templates\list_users.html:82
182 msgid "Delete" 168 msgid "Delete"
183 msgstr "Apagar" 169 msgstr "Apagar"
184 170
185 -#: users/templates/list_users.html:84 171 +#: .\templates\list_users.html:75
186 msgid "Confirm delete" 172 msgid "Confirm delete"
187 msgstr "Confirmar" 173 msgstr "Confirmar"
188 174
189 -#: users/templates/list_users.html:87 175 +#: .\templates\list_users.html:78
190 msgid "Are you sure you want to delete the user" 176 msgid "Are you sure you want to delete the user"
191 msgstr "Você tem certeza que deseja deletar o usuário" 177 msgstr "Você tem certeza que deseja deletar o usuário"
192 178
193 -#: users/templates/list_users.html:90  
194 -#: users/templates/users/change_password.html:47  
195 -#: users/templates/users/create.html:130  
196 -#: users/templates/users/edit_profile.html:79  
197 -#: users/templates/users/remove_account.html:35  
198 -#: users/templates/users/update.html:83 179 +#: .\templates\list_users.html:81 .\templates\users\change_password.html:47
  180 +#: .\templates\users\create.html:130 .\templates\users\edit_profile.html:102
  181 +#: .\templates\users\remove_account.html:35 .\templates\users\update.html:83
199 msgid "Cancel" 182 msgid "Cancel"
200 msgstr "Cancelar" 183 msgstr "Cancelar"
201 184
202 -#: users/templates/list_users.html:103 users/templates/users/index.html:74 185 +#: .\templates\list_users.html:94 .\templates\users\index.html:64
203 msgid "No users found" 186 msgid "No users found"
204 msgstr "Nenhum usuário encontrado" 187 msgstr "Nenhum usuário encontrado"
205 188
206 -#: users/templates/users/change_password.html:31  
207 -#, fuzzy  
208 -#| msgid "Password" 189 +#: .\templates\users\change_password.html:31
209 msgid "Current Password" 190 msgid "Current Password"
210 -msgstr "Senha" 191 +msgstr "Senha atual"
211 192
212 -#: users/templates/users/change_password.html:35 193 +#: .\templates\users\change_password.html:35
213 #, fuzzy 194 #, fuzzy
214 #| msgid "Password" 195 #| msgid "Password"
215 msgid "New Password" 196 msgid "New Password"
216 msgstr "Senha" 197 msgstr "Senha"
217 198
218 -#: users/templates/users/change_password.html:39 199 +#: .\templates\users\change_password.html:39
219 msgid "Confirmation" 200 msgid "Confirmation"
220 msgstr "Confirmação" 201 msgstr "Confirmação"
221 202
222 -#: users/templates/users/change_password.html:44  
223 -#: users/templates/users/create.html:127  
224 -#: users/templates/users/edit_profile.html:76  
225 -#: users/templates/users/update.html:80 203 +#: .\templates\users\change_password.html:44 .\templates\users\create.html:127
  204 +#: .\templates\users\edit_profile.html:99 .\templates\users\update.html:80
226 msgid "Save" 205 msgid "Save"
227 msgstr "Salvar" 206 msgstr "Salvar"
228 207
229 -#: users/templates/users/create.html:51  
230 -#: users/templates/users/edit_profile.html:39  
231 -#: users/templates/users/update.html:42 208 +#: .\templates\users\create.html:51
232 msgid "Choose your photo..." 209 msgid "Choose your photo..."
233 msgstr "Envie sua foto..." 210 msgstr "Envie sua foto..."
234 211
235 -#: users/templates/users/create.html:67 212 +#: .\templates\users\create.html:67 .\templates\users\edit_profile.html:47
  213 +#: .\templates\users\update.html:42
236 msgid "Choose your file..." 214 msgid "Choose your file..."
237 -msgstr "Envie um arquivo..."  
238 -  
239 -#: users/templates/users/index.html:8  
240 -msgid "Manage Users"  
241 -msgstr "Gerenciar Usuários"  
242 -  
243 -#: users/templates/users/index.html:15 users/templates/users/view.html:15  
244 -msgid "System Users"  
245 -msgstr "Usuários do sistema"  
246 -  
247 -#: users/templates/users/index.html:18 users/templates/users/view.html:18  
248 -msgid "New Account"  
249 -msgstr "Nova conta" 215 +msgstr "Escolha o arquivo..."
250 216
251 -#: users/templates/users/index.html:21 users/templates/users/view.html:27  
252 -msgid "Send Mail"  
253 -msgstr "Enviar email"  
254 -  
255 -#: users/templates/users/index.html:56 users/templates/users/view.html:39  
256 -msgid "Administrator"  
257 -msgstr "Administrador"  
258 -  
259 -#: users/templates/users/profile.html:21  
260 -#, fuzzy  
261 -#| msgid "Home"  
262 -msgid "Home page" 217 +#: .\templates\users\index.html:7 .\templates\users\view.html:7
  218 +msgid "Home"
263 msgstr "Início" 219 msgstr "Início"
264 220
265 -#: users/templates/users/profile.html:22  
266 -#, fuzzy  
267 -#| msgid "Edit Profile"  
268 -msgid "View Profile"  
269 -msgstr "Editar perfil"  
270 -  
271 -#: users/templates/users/profile.html:23  
272 -msgid "Edit Profile"  
273 -msgstr "Editar perfil"  
274 -  
275 -#: users/templates/users/profile.html:24  
276 -#, fuzzy  
277 -#| msgid "Password"  
278 -msgid "Change Password"  
279 -msgstr "Senha"  
280 -  
281 -#: users/templates/users/profile.html:25  
282 -#, fuzzy  
283 -#| msgid "New Account"  
284 -msgid "Remove account"  
285 -msgstr "Nova conta" 221 +#: .\templates\users\index.html:8
  222 +msgid "Manage Users"
  223 +msgstr "Gerenciar Usuários"
286 224
287 -#: users/templates/users/profile.html:53 225 +#: .\templates\users\profile.html:51
288 #, fuzzy 226 #, fuzzy
289 #| msgid "State" 227 #| msgid "State"
290 msgid "Status" 228 msgid "Status"
291 msgstr "Estado" 229 msgstr "Estado"
292 230
293 -#: users/templates/users/profile.html:77 231 +#: .\templates\users\profile.html:53
  232 +msgid "Online"
  233 +msgstr "Conectado"
  234 +
  235 +#: .\templates\users\profile.html:55
  236 +msgid "OffLine"
  237 +msgstr "Desconectado"
  238 +
  239 +#: .\templates\users\profile.html:80
294 msgid "User role" 240 msgid "User role"
295 msgstr "Tipo de usuário" 241 msgstr "Tipo de usuário"
296 242
297 -#: users/templates/users/profile.html:79 243 +#: .\templates\users\profile.html:82
298 msgid "Teacher" 244 msgid "Teacher"
299 msgstr "Professor" 245 msgstr "Professor"
300 246
301 -#: users/templates/users/profile.html:86  
302 -msgid "CPF"  
303 -msgstr "CPF"  
304 -  
305 -#: users/templates/users/profile.html:91  
306 -msgid "doesn't posssess CPF" 247 +#: .\templates\users\profile.html:94
  248 +#, fuzzy
  249 +#| msgid "doesn't posssess CPF"
  250 +msgid "doesn't possess CPF"
307 msgstr "Não possui CPF" 251 msgstr "Não possui CPF"
308 252
309 -#: users/templates/users/profile.html:96 253 +#: .\templates\users\profile.html:99
310 msgid "Phone Number" 254 msgid "Phone Number"
311 msgstr "Telefone" 255 msgstr "Telefone"
312 256
313 -#: users/templates/users/profile.html:100  
314 -msgid "doesn't posssess Phone" 257 +#: .\templates\users\profile.html:103
  258 +#, fuzzy
  259 +#| msgid "doesn't posssess Phone"
  260 +msgid "doesn't possess Phone"
315 msgstr "Não possui telefone" 261 msgstr "Não possui telefone"
316 262
317 -#: users/templates/users/profile.html:113 263 +#: .\templates\users\profile.html:116
318 msgid "State and City" 264 msgid "State and City"
319 msgstr "Estado e cidade" 265 msgstr "Estado e cidade"
320 266
321 -#: users/templates/users/profile.html:117 267 +#: .\templates\users\profile.html:120
322 msgid "Title" 268 msgid "Title"
323 msgstr "Título" 269 msgstr "Título"
324 270
325 -#: users/templates/users/profile.html:121 271 +#: .\templates\users\profile.html:124
326 msgid "Year" 272 msgid "Year"
327 msgstr "Ano" 273 msgstr "Ano"
328 274
329 -#: users/templates/users/profile.html:125  
330 -msgid "Institution"  
331 -msgstr "Instituição"  
332 -  
333 -#: users/templates/users/profile.html:129 275 +#: .\templates\users\profile.html:132
334 msgid "Didn't inform institution" 276 msgid "Didn't inform institution"
335 msgstr "Não informou a instituição" 277 msgstr "Não informou a instituição"
336 278
337 -#: users/templates/users/profile.html:139 279 +#: .\templates\users\profile.html:142
338 msgid "Didn't upload any curriculum" 280 msgid "Didn't upload any curriculum"
339 msgstr "Não enviou nenhum currículo" 281 msgstr "Não enviou nenhum currículo"
340 282
341 -#: users/templates/users/remove_account.html:28 283 +#: .\templates\users\remove_account.html:28
342 msgid "Are you sure you want delete this account?" 284 msgid "Are you sure you want delete this account?"
343 msgstr "Voce tem certeza que deseja remover esta conta?" 285 msgstr "Voce tem certeza que deseja remover esta conta?"
344 286
345 -#: users/templates/users/remove_account.html:29  
346 -msgid ""  
347 -"All data will be lost and havent how recover it."  
348 -msgstr "Todos os seus dados serão removidos e não haverá como recupera-los posteriormente." 287 +#: .\templates\users\remove_account.html:29
  288 +msgid "All data will be lost and havent how recover it."
  289 +msgstr ""
  290 +"Todos os seus dados serão removidos e não haverá como recupera-los "
  291 +"posteriormente."
349 292
350 -#: users/templates/users/remove_account.html:32 293 +#: .\templates\users\remove_account.html:32
351 msgid "Remove" 294 msgid "Remove"
352 msgstr "Remover" 295 msgstr "Remover"
353 296
354 -#: users/templates/users/view.html:21  
355 -msgid "View User Account"  
356 -msgstr "Visualizar perfil"  
357 -  
358 -#: users/templates/users/view.html:24  
359 -msgid "Edit User Account"  
360 -msgstr "Editar perfil" 297 +#: .\templates\users\search.html:131
  298 +msgid "poll"
  299 +msgstr ""
361 300
362 -#: users/templates/users/view.html:43 301 +#: .\templates\users\view.html:23
363 msgid "Mail:" 302 msgid "Mail:"
364 msgstr "E-mail" 303 msgstr "E-mail"
365 304
366 -#: users/templates/users/view.html:46 305 +#: .\templates\users\view.html:26
367 msgid "Phone:" 306 msgid "Phone:"
368 msgstr "Telefone" 307 msgstr "Telefone"
369 308
370 -#: users/templates/users/view.html:49 309 +#: .\templates\users\view.html:29
371 msgid "Cpf:" 310 msgid "Cpf:"
372 msgstr "CPF" 311 msgstr "CPF"
373 312
374 -#: users/templates/users/view.html:52 313 +#: .\templates\users\view.html:32
375 msgid "Birth date:" 314 msgid "Birth date:"
376 msgstr "Data de nascimento:" 315 msgstr "Data de nascimento:"
377 316
378 -#: users/views.py:55 317 +#: .\views.py:70
379 msgid "User created successfully!" 318 msgid "User created successfully!"
380 msgstr "Usuário criado com sucesso!" 319 msgstr "Usuário criado com sucesso!"
381 320
382 -#: users/views.py:84 321 +#: .\views.py:99
383 msgid "User edited successfully!" 322 msgid "User edited successfully!"
384 msgstr "Usuário editado com sucesso!" 323 msgstr "Usuário editado com sucesso!"
385 324
386 -#: users/views.py:101 325 +#: .\views.py:116 .\views.py:122
387 #, fuzzy 326 #, fuzzy
388 #| msgid "User edited successfully!" 327 #| msgid "User edited successfully!"
389 msgid "User deleted Successfully!" 328 msgid "User deleted Successfully!"
390 msgstr "Usuário editado com sucesso!" 329 msgstr "Usuário editado com sucesso!"
391 330
392 -#: users/views.py:126 331 +#: .\views.py:152
393 msgid "Profile edited successfully!" 332 msgid "Profile edited successfully!"
394 msgstr "Perfil editado com sucesso!" 333 msgstr "Perfil editado com sucesso!"
395 334
  335 +#~ msgid "Administrador"
  336 +#~ msgstr "Administrador"
  337 +
  338 +#~ msgid "Image"
  339 +#~ msgstr "Imagem"
  340 +
  341 +#~ msgid "Cpf"
  342 +#~ msgstr "CPF"
  343 +
  344 +#~ msgid "Institution where he had titration"
  345 +#~ msgstr "Instituição o qual obteve o título"
  346 +
  347 +#~ msgid "Menu"
  348 +#~ msgstr "Menu"
  349 +
  350 +#~ msgid "Send email"
  351 +#~ msgstr "Enviar e-mail"
  352 +
  353 +#~ msgid "Search"
  354 +#~ msgstr "Pesquisar"
  355 +
  356 +#~ msgid "System Users"
  357 +#~ msgstr "Usuários do sistema"
  358 +
  359 +#~ msgid "New Account"
  360 +#~ msgstr "Nova conta"
  361 +
  362 +#~ msgid "Send Mail"
  363 +#~ msgstr "Enviar email"
  364 +
  365 +#, fuzzy
  366 +#~| msgid "Home"
  367 +#~ msgid "Home page"
  368 +#~ msgstr "Início"
  369 +
  370 +#, fuzzy
  371 +#~| msgid "Edit Profile"
  372 +#~ msgid "View Profile"
  373 +#~ msgstr "Editar perfil"
  374 +
  375 +#~ msgid "Edit Profile"
  376 +#~ msgstr "Editar perfil"
  377 +
  378 +#, fuzzy
  379 +#~| msgid "Password"
  380 +#~ msgid "Change Password"
  381 +#~ msgstr "Senha"
  382 +
  383 +#, fuzzy
  384 +#~| msgid "New Account"
  385 +#~ msgid "Remove account"
  386 +#~ msgstr "Remover conta"
  387 +
  388 +#~ msgid "View User Account"
  389 +#~ msgstr "Visualizar perfil"
  390 +
  391 +#~ msgid "Edit User Account"
  392 +#~ msgstr "Editar perfil"
  393 +
396 #~ msgid "New User" 394 #~ msgid "New User"
397 #~ msgstr "Novo usuário" 395 #~ msgstr "Novo usuário"
398 396
users/models.py
@@ -30,7 +30,7 @@ class User(AbstractBaseUser, PermissionsMixin): @@ -30,7 +30,7 @@ class User(AbstractBaseUser, PermissionsMixin):
30 institution = models.CharField(_('Institution'), max_length = 50, blank=True, null=True) 30 institution = models.CharField(_('Institution'), max_length = 50, blank=True, null=True)
31 curriculum = models.FileField(verbose_name = _('Curriculum'), upload_to='users/curriculum/', null=True, blank=True) 31 curriculum = models.FileField(verbose_name = _('Curriculum'), upload_to='users/curriculum/', null=True, blank=True)
32 date_created = models.DateTimeField(_('Create Date'), auto_now_add = True) 32 date_created = models.DateTimeField(_('Create Date'), auto_now_add = True)
33 - is_staff = models.BooleanField(_('Administrador'), default = False) 33 + is_staff = models.BooleanField(_('Administrator'), default = False)
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'
users/templates/list_users.html
@@ -10,9 +10,6 @@ @@ -10,9 +10,6 @@
10 {% endblock %} 10 {% endblock %}
11 11
12 {% block menu %} 12 {% block menu %}
13 - {% if user|has_role:'system_admin' %}  
14 - <li> <a href="{% url 'users:create' %}">{% trans 'Add User' %}</a></li>  
15 - {% endif %}  
16 {% endblock %} 13 {% endblock %}
17 14
18 {% block content %} 15 {% block content %}
users/templates/users/create.html
@@ -38,8 +38,8 @@ @@ -38,8 +38,8 @@
38 {% else %} 38 {% else %}
39 <label for="{{ field.auto_id }}">{{ field.label }}</label> 39 <label for="{{ field.auto_id }}">{{ field.label }}</label>
40 {% endif %} 40 {% endif %}
41 - <input type="text" class="form-control input-sm date-picker" name="{{field.name}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">  
42 41
  42 + {% render_field field class='form-control date-picker' %}
43 {% elif field.auto_id == 'id_image' %} 43 {% elif field.auto_id == 'id_image' %}
44 {% if field.field.required %} 44 {% if field.field.required %}
45 <label for="{{ field.auto_id }}">{{ field.label }}<span>*</span></label> 45 <label for="{{ field.auto_id }}">{{ field.label }}<span>*</span></label>
@@ -71,10 +71,10 @@ @@ -71,10 +71,10 @@
71 </button> 71 </button>
72 </span> 72 </span>
73 </div> 73 </div>
74 - {% elif field.auto_id == 'id_is_staff' or field.auto_id == 'id_is_active' %} 74 + {% elif field.auto_id == 'id_is_staff' or field.auto_id == 'id_is_active' %}
75 <div class="checkbox"> 75 <div class="checkbox">
76 <label for="{{ field.auto_id }}"> 76 <label for="{{ field.auto_id }}">
77 - {% render_field field %}<span class="checkbox-material"><span class="check"></span></span> {{field.label}} 77 + {% render_field field %} {{field.label}}
78 </label> 78 </label>
79 </div> 79 </div>
80 {% elif field.auto_id == 'id_cpf' %} 80 {% elif field.auto_id == 'id_cpf' %}
@@ -123,10 +123,10 @@ @@ -123,10 +123,10 @@
123 {% endif %} 123 {% endif %}
124 </div> 124 </div>
125 {% endfor %} 125 {% endfor %}
126 - <div class="col-md-offset-2 col-md-2 col-sm-2 col-xs-2"> 126 + <div class="col-md-5 col-xs-6 col-sm-6 col-lg-5 text-center">
127 <input type="submit" value="{% trans 'Save' %}" class="btn btn-raised btn-success" onclick="validarCpfSemAlert(id_cpf, CPF, idElementoMensagemErro)'" /> 127 <input type="submit" value="{% trans 'Save' %}" class="btn btn-raised btn-success" onclick="validarCpfSemAlert(id_cpf, CPF, idElementoMensagemErro)'" />
128 </div> 128 </div>
129 - <div class="col-md-offset-4 col-md-2 col-sm-2 col-xs-2"> 129 + <div class="col-md-5 col-xs-6 col-sm-6 col-lg-5 text-center">
130 <a href="{% url 'users:manage' %}" class="btn btn-raised btn-danger" >{% trans 'Cancel' %}</a> 130 <a href="{% url 'users:manage' %}" class="btn btn-raised btn-danger" >{% trans 'Cancel' %}</a>
131 </div> 131 </div>
132 </form> 132 </form>
@@ -136,4 +136,11 @@ @@ -136,4 +136,11 @@
136 </br> 136 </br>
137 </br> 137 </br>
138 </br> 138 </br>
  139 +<script type="text/javascript">
  140 +var locale = navigator.language || navigator.userLanguage;
  141 +
  142 +$('.date-picker').datepicker({
  143 + language: locale,
  144 +});
  145 +</script>
139 {% endblock %} 146 {% endblock %}
users/templates/users/index.html
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 {% endblock %} 10 {% endblock %}
11 11
12 {% block menu %} 12 {% block menu %}
13 - <li> <a href="{% url 'users:create' %}">{% trans 'Add User' %}</a></li> 13 +
14 {% endblock %} 14 {% endblock %}
15 15
16 {% block content %} 16 {% block content %}
users/views.py
@@ -39,7 +39,7 @@ class UsersListView(HasRoleMixin, LoginRequiredMixin, generic.ListView): @@ -39,7 +39,7 @@ class UsersListView(HasRoleMixin, LoginRequiredMixin, generic.ListView):
39 search = self.request.GET.get('search', None) 39 search = self.request.GET.get('search', None)
40 40
41 if search is None: 41 if search is None:
42 - users = User.objects.exclude(username = self.request.user.username) 42 + users = User.objects.all().order_by('name').exclude( username = self.request.user.username)
43 else: 43 else:
44 users = User.objects.filter(Q(username = search) | Q(name = search) | Q(name__icontains = search) | Q(username__icontains = search)).exclude( username = self.request.user.username) 44 users = User.objects.filter(Q(username = search) | Q(name = search) | Q(name__icontains = search) | Q(username__icontains = search)).exclude( username = self.request.user.username)
45 45
@@ -67,9 +67,13 @@ class Create(HasRoleMixin, LoginRequiredMixin, generic.edit.CreateView): @@ -67,9 +67,13 @@ class Create(HasRoleMixin, LoginRequiredMixin, generic.edit.CreateView):
67 67
68 self.object.save() 68 self.object.save()
69 69
70 - messages.success(self.request, _('User created successfully!')) 70 + messages.success(self.request, _('User ')+self.object.name+(' created successfully!'))
71 71
72 return super(Create, self).form_valid(form) 72 return super(Create, self).form_valid(form)
  73 + def get_context_data (self, **kwargs):
  74 + context = super(Create, self).get_context_data(**kwargs)
  75 + context['title'] = _("Add User")
  76 + return context
73 77
74 class Update(HasRoleMixin, LoginRequiredMixin, generic.UpdateView): 78 class Update(HasRoleMixin, LoginRequiredMixin, generic.UpdateView):
75 79
@@ -96,7 +100,7 @@ class Update(HasRoleMixin, LoginRequiredMixin, generic.UpdateView): @@ -96,7 +100,7 @@ class Update(HasRoleMixin, LoginRequiredMixin, generic.UpdateView):
96 100
97 self.object.save() 101 self.object.save()
98 102
99 - messages.success(self.request, _('User edited successfully!')) 103 + messages.success(self.request, _('User ')+self.object.name+(' updated successfully!'))
100 104
101 return super(Update, self).form_valid(form) 105 return super(Update, self).form_valid(form)
102 106
@@ -243,4 +247,3 @@ class UserViewSet(viewsets.ModelViewSet): @@ -243,4 +247,3 @@ class UserViewSet(viewsets.ModelViewSet):
243 queryset = User.objects.all() 247 queryset = User.objects.all()
244 serializer_class = UserSerializer 248 serializer_class = UserSerializer
245 permissions_classes = (IsAuthenticatedOrReadOnly,) 249 permissions_classes = (IsAuthenticatedOrReadOnly,)
246 -