Commit 4dab0e1d95f4aa0a1ed2227c51addd3ddb2a4fb8

Authored by Ailson da Cruz
2 parents 08027c28 b8706a96

Register user #22

app/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -140,7 +140,7 @@ msgid ""
140 140 msgstr ""
141 141 "Project-Id-Version: PACKAGE VERSION\n"
142 142 "Report-Msgid-Bugs-To: \n"
143   -"POT-Creation-Date: 2016-09-03 00:18-0300\n"
  143 +"POT-Creation-Date: 2016-09-05 20:28-0300\n"
144 144 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
145 145 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
146 146 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
app/views.py
1 1 from django.shortcuts import render
2 2 from django.views.generic import TemplateView
3 3 from django.contrib.auth.mixins import LoginRequiredMixin
4   -from django.utils.decorators import decorator_from_middleware_with_args
5   -from django.utils.decorators import decorator_from_middleware
6   -from django.utils.decorators import method_decorator
  4 +from django.core.urlresolvers import reverse_lazy
7 5 from core.mixins import LogMixin
8 6  
9 7 from courses.models import Course
10 8  
11 9 class AppIndex(LoginRequiredMixin, LogMixin, TemplateView):
12 10 log_action = "Acessou home"
  11 + login_url = reverse_lazy("core:home")
  12 + redirect_field_name = 'next'
13 13 template_name = "home_professor.html"
14 14  
15 15 def render_to_response(self, context, **response_kwargs):
... ...
core/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -49,7 +49,7 @@ msgid &quot;&quot;
49 49 msgstr ""
50 50 "Project-Id-Version: PACKAGE VERSION\n"
51 51 "Report-Msgid-Bugs-To: \n"
52   -"POT-Creation-Date: 2016-09-03 00:18-0300\n"
  52 +"POT-Creation-Date: 2016-09-05 20:28-0300\n"
53 53 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
54 54 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
55 55 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
core/templates/pagination.html 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +<nav aria-label="Page navigation">
  2 + <ul class="pagination">
  3 + {% for page_number in paginator.page_range %}
  4 + <li{% if page_obj.number == page_number %} class="active"{% endif %}>
  5 + <a href="?page={{ page_number }}{{ getvars }}">{{ page_number }}</a>
  6 + </li>
  7 + {% endfor %}
  8 + </ul>
  9 +</nav>
0 10 \ No newline at end of file
... ...
core/templatetags/__init__.py 0 → 100644
core/templatetags/pagination.py 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +from django import template
  2 +
  3 +register = template.Library()
  4 +
  5 +
  6 +@register.inclusion_tag('pagination.html')
  7 +def pagination(request, paginator, page_obj):
  8 + context = {
  9 + 'request': request,
  10 + 'paginator': paginator,
  11 + 'page_obj': page_obj,
  12 + }
  13 +
  14 + getvars = request.GET.copy()
  15 +
  16 + if 'page' in getvars:
  17 + del getvars['page']
  18 +
  19 + if len(getvars) > 0:
  20 + context['getvars'] = '&%s' % getvars.urlencode()
  21 +
  22 + return context
0 23 \ No newline at end of file
... ...
courses/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -467,7 +467,7 @@ msgid &quot;&quot;
467 467 msgstr ""
468 468 "Project-Id-Version: PACKAGE VERSION\n"
469 469 "Report-Msgid-Bugs-To: \n"
470   -"POT-Creation-Date: 2016-09-03 00:18-0300\n"
  470 +"POT-Creation-Date: 2016-09-05 20:28-0300\n"
471 471 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
472 472 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
473 473 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -477,7 +477,7 @@ msgstr &quot;&quot;
477 477 "Content-Transfer-Encoding: 8bit\n"
478 478 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
479 479  
480   -#: courses/forms.py:11 courses/forms.py:25 courses/forms.py:55
  480 +#: courses/forms.py:11 courses/forms.py:25 courses/forms.py:58
481 481 #: courses/models.py:7 courses/models.py:20 courses/models.py:44
482 482 #: courses/templates/category/index.html:38
483 483 msgid "Name"
... ... @@ -563,23 +563,23 @@ msgstr &quot;&quot;
563 563 msgid "Category which the course belongs"
564 564 msgstr ""
565 565  
566   -#: courses/forms.py:56 courses/models.py:46
  566 +#: courses/forms.py:59 courses/models.py:46
567 567 msgid "Description"
568 568 msgstr ""
569 569  
570   -#: courses/forms.py:57
  570 +#: courses/forms.py:60
571 571 msgid "Is it visible?"
572 572 msgstr ""
573 573  
574   -#: courses/forms.py:60
  574 +#: courses/forms.py:63
575 575 msgid "Module's name"
576 576 msgstr ""
577 577  
578   -#: courses/forms.py:61
  578 +#: courses/forms.py:64
579 579 msgid "Modules's description"
580 580 msgstr ""
581 581  
582   -#: courses/forms.py:62
  582 +#: courses/forms.py:65
583 583 msgid "Is the module visible?"
584 584 msgstr ""
585 585  
... ... @@ -635,7 +635,7 @@ msgstr &quot;Curso&quot;
635 635 #: courses/models.py:37 courses/templates/course/create.html:16
636 636 #: courses/templates/course/delete.html:15
637 637 #: courses/templates/course/filtered.html:8
638   -#: courses/templates/course/index.html:15
  638 +#: courses/templates/course/home.html:16 courses/templates/course/index.html:15
639 639 #: courses/templates/course/update.html:16
640 640 #: courses/templates/course/view.html:15
641 641 #: courses/templates/module/create.html:17
... ... @@ -663,9 +663,9 @@ msgstr &quot;Modulos&quot;
663 663 #: courses/templates/category/update.html:8
664 664 #: courses/templates/category/view.html:7
665 665 #: courses/templates/course/create.html:8
666   -#: courses/templates/course/delete.html:7 courses/templates/course/index.html:7
667   -#: courses/templates/course/update.html:8 courses/templates/course/view.html:7
668   -#: courses/templates/module/create.html:8
  666 +#: courses/templates/course/delete.html:7 courses/templates/course/home.html:8
  667 +#: courses/templates/course/index.html:7 courses/templates/course/update.html:8
  668 +#: courses/templates/course/view.html:7 courses/templates/module/create.html:8
669 669 #: courses/templates/module/delete.html:7 courses/templates/module/index.html:7
670 670 #: courses/templates/module/update.html:8
671 671 msgid "Home"
... ... @@ -762,6 +762,12 @@ msgstr &quot;&quot;
762 762 msgid "Categories:"
763 763 msgstr ""
764 764  
  765 +#: courses/templates/course/home.html:9
  766 +#, fuzzy
  767 +#| msgid "Course"
  768 +msgid "Home Course"
  769 +msgstr "Curso"
  770 +
765 771 #: courses/templates/course/index.html:8
766 772 msgid "Manage Courses"
767 773 msgstr ""
... ...
db.sqlite3
No preview for this file type
logs/log_file_03-09-2016.txt 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +03/09/2016 20:13:26 - zambom - Entrou no sistema
  2 +03/09/2016 20:13:26 - zambom - Acessou home
  3 +03/09/2016 20:13:45 - zambom - Acessou home
... ...
logs/log_file_05-09-2016.txt
... ... @@ -42,13 +42,10 @@
42 42 05/09/2016 04:39:39 - test - Entrou no sistema
43 43 05/09/2016 04:39:39 - test - Acessou home
44 44 05/09/2016 04:40:28 - matheuslins - Acessou home
45   -05/09/2016 13:14:23 - ailson - Acessou home
46   -05/09/2016 13:17:28 - ailson - Entrou no sistema
47   -05/09/2016 13:17:38 - ailson - Entrou no sistema
48   -05/09/2016 13:18:20 - ailson - Entrou no sistema
49   -05/09/2016 13:18:57 - ailson - Entrou no sistema
50   -05/09/2016 15:04:41 - ailson - Acessou home
51   -05/09/2016 15:16:39 - ailson - Acessou home
52   -05/09/2016 15:41:52 - ailson - Acessou home
53   -05/09/2016 16:08:38 - ailson - Entrou no sistema
54   -05/09/2016 16:08:38 - ailson - Acessou home
  45 +05/09/2016 15:28:49 - zambom - Acessou home
  46 +05/09/2016 15:29:02 - zambom - Entrou no sistema
  47 +05/09/2016 15:29:02 - zambom - Acessou home
  48 +05/09/2016 15:31:13 - zambom - Entrou no sistema
  49 +05/09/2016 15:31:13 - zambom - Acessou home
  50 +05/09/2016 20:20:12 - admin - Entrou no sistema
  51 +05/09/2016 20:20:13 - admin - Acessou home
... ...
logs/log_file_06-09-2016.txt
1 1 06/09/2016 00:07:02 - teste - Entrou no sistema
2 2 06/09/2016 00:07:02 - teste - Acessou home
  3 +06/09/2016 00:08:58 - teste - Acessou home
... ...
users/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -239,7 +239,7 @@ msgid &quot;&quot;
239 239 msgstr ""
240 240 "Project-Id-Version: PACKAGE VERSION\n"
241 241 "Report-Msgid-Bugs-To: \n"
242   -"POT-Creation-Date: 2016-09-03 00:18-0300\n"
  242 +"POT-Creation-Date: 2016-09-05 20:28-0300\n"
243 243 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
244 244 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
245 245 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -261,7 +261,7 @@ msgstr &quot;Entrar&quot;
261 261 msgid ""
262 262 "Type a valid username. This fields should only contain letters, numbers and "
263 263 "the characteres: @/./+/-/_ ."
264   -msgstr ""
  264 +msgstr "Digite um nome de usuário válido. Esse campo deve conter apenas letras, números e os caracteres: @/./+/-/_ ."
265 265  
266 266 #: users/models.py:16
267 267 msgid ""
... ... @@ -271,9 +271,9 @@ msgstr &quot;&quot;
271 271  
272 272 #: users/models.py:17
273 273 msgid "Mail"
274   -msgstr ""
  274 +msgstr "Email"
275 275  
276   -#: users/models.py:18
  276 +#: users/models.py:18 users/templates/list_users.html:41
277 277 msgid "Name"
278 278 msgstr "Nome"
279 279  
... ... @@ -303,7 +303,7 @@ msgstr &quot;Imagem&quot;
303 303  
304 304 #: users/models.py:23
305 305 msgid "Birth Date"
306   -msgstr ""
  306 +msgstr "Data de nascimento"
307 307  
308 308 #: users/models.py:24
309 309 msgid "Phone"
... ... @@ -311,15 +311,15 @@ msgstr &quot;Telefone&quot;
311 311  
312 312 #: users/models.py:25 users/templates/users/profile.html:42
313 313 msgid "Cpf"
314   -msgstr ""
  314 +msgstr "Cpf"
315 315  
316 316 #: users/models.py:26
317 317 msgid "Type"
318   -msgstr ""
  318 +msgstr "Tipo"
319 319  
320 320 #: users/models.py:26
321 321 msgid "Professor"
322   -msgstr ""
  322 +msgstr "Professor"
323 323  
324 324 #: users/models.py:26
325 325 msgid "Student"
... ... @@ -327,11 +327,11 @@ msgstr &quot;Aluno&quot;
327 327  
328 328 #: users/models.py:27
329 329 msgid "Create Date"
330   -msgstr ""
  330 +msgstr "Data de criação"
331 331  
332 332 #: users/models.py:28
333 333 msgid "Administrador"
334   -msgstr ""
  334 +msgstr "Administrador"
335 335  
336 336 #: users/models.py:29
337 337 msgid "Active"
... ... @@ -345,18 +345,17 @@ msgstr &quot;Usuário&quot;
345 345 msgid "Users"
346 346 msgstr "Usuários"
347 347  
348   -#: users/templates/list_users.html:8 users/templates/list_users.html:15
349   -#: users/templates/users/index.html:8
350   -msgid "Manage Users"
351   -msgstr "Gerenciar Usuários"
352   -
353   -#: users/templates/list_users.html:14 users/templates/users/create.html:8
  348 +#: users/templates/list_users.html:9 users/templates/users/create.html:8
354 349 #: users/templates/users/edit_profile.html:8 users/templates/users/index.html:7
355 350 #: users/templates/users/profile.html:8 users/templates/users/update.html:8
356 351 #: users/templates/users/view.html:7
357 352 msgid "Home"
358 353 msgstr "Início"
359 354  
  355 +#: users/templates/list_users.html:10 users/templates/users/index.html:8
  356 +msgid "Manage Users"
  357 +msgstr "Gerenciar Usuários"
  358 +
360 359 #: users/templates/list_users.html:23
361 360 msgid "Add user"
362 361 msgstr "Adicionar usuário"
... ... @@ -365,14 +364,36 @@ msgstr &quot;Adicionar usuário&quot;
365 364 msgid "Send email"
366 365 msgstr "Enviar e-mail"
367 366  
  367 +#: users/templates/list_users.html:42
  368 +#: users/templates/users/edit_profile.html:16
  369 +#: users/templates/users/profile.html:9 users/templates/users/profile.html:16
  370 +msgid "Profile"
  371 +msgstr "Perfil"
  372 +
  373 +#: users/templates/list_users.html:43
  374 +msgid "Email"
  375 +msgstr "Email"
  376 +
  377 +#: users/templates/list_users.html:44
  378 +msgid "Contact"
  379 +msgstr "Contato"
  380 +
  381 +#: users/templates/list_users.html:46
  382 +msgid "Edit"
  383 +msgstr "Editar"
  384 +
  385 +#: users/templates/list_users.html:47
  386 +msgid "Delete"
  387 +msgstr "Apagar"
  388 +
368 389 #: users/templates/users/create.html:9
369 390 msgid "New User"
370   -msgstr ""
  391 +msgstr "Novo usuário"
371 392  
372 393 #: users/templates/users/create.html:16 users/templates/users/index.html:15
373 394 #: users/templates/users/update.html:16 users/templates/users/view.html:15
374 395 msgid "System Users"
375   -msgstr ""
  396 +msgstr "Usuários do sistema"
376 397  
377 398 #: users/templates/users/create.html:19 users/templates/users/index.html:18
378 399 #: users/templates/users/update.html:19 users/templates/users/view.html:18
... ... @@ -402,11 +423,6 @@ msgstr &quot;&quot;
402 423 msgid "Edit Profile"
403 424 msgstr ""
404 425  
405   -#: users/templates/users/edit_profile.html:16
406   -#: users/templates/users/profile.html:9 users/templates/users/profile.html:16
407   -msgid "Profile"
408   -msgstr ""
409   -
410 426 #: users/templates/users/index.html:56 users/templates/users/profile.html:32
411 427 #: users/templates/users/view.html:39
412 428 msgid "Administrator"
... ...
users/templates/list_users.html
1   -{% extends 'base.html' %}
2   -
3   -{% load i18n %}
4   -
5   -{% block breadcrumbs %}
6   - <div class="row">
7   - <div class="col-md-12">
8   - <h4>{% trans 'Manage Users' %}</h4>
9   - </div>
10   - </div>
11   - <div class="row">
12   - <div class="col-md-12">
13   - <ul class="breadcrumb" style="margin-bottom: 5px;">
14   - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li>
15   - <li class="active">{% trans 'Manage Users' %}</li>
16   - </ul>
17   - </div>
18   - </div>
19   -{% endblock %}
20   -
21   -{% block sidebar %}
22   - <div class="btn-group-vertical">
23   - <a href="{% url 'users:create' %}" class="btn btn-raised">{% trans 'Add user' %}</a>
24   - <a href="javascript:void(0)" class="btn btn-raised">{% trans 'Send email' %}</a>
25   - </div>
26   -{% endblock %}
27   -
28   -{% block content %}
29   - <input type="text" class="form-control" name="search" placeholder="search..">
30   -{% endblock %}
  1 +{% extends 'base.html' %}
  2 +
  3 +{% load i18n pagination %}
  4 +
  5 +{% block breadcrumbs %}
  6 + <div class="row">
  7 + <div class="col-md-12">
  8 + <ul class="breadcrumb" style="margin-bottom: 5px;">
  9 + <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li>
  10 + <li class="active">{% trans 'Manage Users' %}</li>
  11 + </ul>
  12 + </div>
  13 + </div>
  14 +{% endblock %}
  15 +
  16 +{% block sidebar %}
  17 + <div class="panel panel-primary navigation">
  18 + <div class="panel-heading">
  19 + <h5>Menu</h5>
  20 + </div>
  21 + <div class="panel-body">
  22 + <ul class="nav nav-pills nav-stacked">
  23 + <li><a href="{% url 'users:create' %}">{% trans 'Add user' %}</a></li>
  24 + <li><a href="javascript:void(0)">{% trans 'Send email' %}</a></li>
  25 + </ul>
  26 + </div>
  27 + </div>
  28 +{% endblock %}
  29 +
  30 +{% block content %}
  31 + <input type="text" class="form-control" name="search" placeholder="search..">
  32 +
  33 + {% if users|length > 0 %}
  34 + {% for acc in users %}
  35 + <div class="row panel panel-default">
  36 + <div class="panel-body">
  37 + <div class="col-md-4">
  38 + <img src="{{ acc.image.url }}" alt="photoUser" class="img-circle img-responsive">
  39 + </div>
  40 + <div class="col-md-8">
  41 + <p>{% trans 'Name' %}: {{ acc.name }}</p>
  42 + <p>{% trans 'Profile' %}: {{ acc.get_type_profile_display }}</p>
  43 + <p>{% trans 'Email' %}: {{ acc.email }}</p>
  44 + <p>{% trans 'Contact' %}: {{ acc.phone }}</p>
  45 + <div align="right">
  46 + <a href="javascript:void(0)" class="btn btn-raised btn-inverse">{% trans 'Edit' %}</a>
  47 + <a href="javascript:void(0)" class="btn btn-raised btn-danger">{% trans 'Delete' %}</a>
  48 + </div>
  49 + </div>
  50 + </div>
  51 + </div>
  52 + {% endfor %}
  53 + {% pagination request paginator page_obj %}
  54 + {% else %}
  55 +
  56 + {% endif %}
  57 +{% endblock %}
... ...