Commit 5d8113b1bce759039148abc3cfa53b4efd405d85
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
24 changed files
with
546 additions
and
546 deletions
Show diff stats
avaliacao/migrations/0001_initial.py
@@ -1,32 +0,0 @@ | @@ -1,32 +0,0 @@ | ||
1 | -# -*- coding: utf-8 -*- | ||
2 | -# Generated by Django 1.10 on 2016-10-05 21:02 | ||
3 | -from __future__ import unicode_literals | ||
4 | - | ||
5 | -from django.db import migrations, models | ||
6 | -import django.db.models.deletion | ||
7 | - | ||
8 | - | ||
9 | -class Migration(migrations.Migration): | ||
10 | - | ||
11 | - initial = True | ||
12 | - | ||
13 | - dependencies = [ | ||
14 | - ('courses', '0002_subject_students'), | ||
15 | - ] | ||
16 | - | ||
17 | - operations = [ | ||
18 | - migrations.CreateModel( | ||
19 | - name='Avaliacao', | ||
20 | - fields=[ | ||
21 | - ('activity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='courses.Activity')), | ||
22 | - ('name_avalicao', models.CharField(max_length=100, verbose_name='Name')), | ||
23 | - ('init_date', models.DateField(verbose_name='Begin of Avaliacao Date')), | ||
24 | - ('end_date', models.DateField(verbose_name='End of Avaliacao Date')), | ||
25 | - ], | ||
26 | - options={ | ||
27 | - 'verbose_name': 'Avaliacao', | ||
28 | - 'verbose_name_plural': 'Avaliacoes', | ||
29 | - }, | ||
30 | - bases=('courses.activity',), | ||
31 | - ), | ||
32 | - ] |
core/static/css/base/amadeus.css
@@ -321,4 +321,9 @@ body .container .jumbotron-inverse, body .container .well-inverse, body .contain | @@ -321,4 +321,9 @@ body .container .jumbotron-inverse, body .container .well-inverse, body .contain | ||
321 | background-color: #FF0000; | 321 | background-color: #FF0000; |
322 | } | 322 | } |
323 | 323 | ||
324 | +.img-list-user{ | ||
325 | + width: 150px; | ||
326 | + height: 150px; | ||
327 | +} | ||
328 | + | ||
324 | .datepicker{z-index:9999 !important} | 329 | .datepicker{z-index:9999 !important} |
325 | \ No newline at end of file | 330 | \ No newline at end of file |
30.5 KB
28.8 KB
core/templates/lembrar_senha.html
@@ -1,169 +0,0 @@ | @@ -1,169 +0,0 @@ | ||
1 | -<!DOCTYPE html> | ||
2 | -{% load static %} | ||
3 | -<!-- | ||
4 | -Copyright 2008, 2009 UFPE - Universidade Federal de Pernambuco | ||
5 | - | ||
6 | -Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS | ||
7 | - | ||
8 | -O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | ||
9 | -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. | ||
10 | - | ||
11 | -Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | ||
12 | - | ||
13 | -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
14 | ---> | ||
15 | - | ||
16 | - | ||
17 | - | ||
18 | - | ||
19 | - | ||
20 | - | ||
21 | - | ||
22 | -<html> | ||
23 | -<head> | ||
24 | - <!-- | ||
25 | -Copyright 2008, 2009 UFPE - Universidade Federal de Pernambuco | ||
26 | - | ||
27 | -Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS | ||
28 | - | ||
29 | -O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | ||
30 | -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. | ||
31 | - | ||
32 | -Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | ||
33 | - | ||
34 | -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
35 | ---> | ||
36 | - | ||
37 | - | ||
38 | - | ||
39 | - | ||
40 | - <title>Projeto Amadeus</title> | ||
41 | - | ||
42 | - <meta http-equiv="Cache-Control" content="no-cache, no-store" /> | ||
43 | - | ||
44 | - <link href="{% static 'css/css.css' %}" rel="stylesheet" type="text/css" /> | ||
45 | - <link href="{% static 'css/amadeus.css' %}" rel="stylesheet" type="text/css" /> | ||
46 | - <link href="{% static 'css/content_management.css' %}" rel="stylesheet" type="text/css" /> | ||
47 | - <link href="{% static 'css/jqueryui/smoothness/jquery-ui-1.7.1.custom.css' %}" rel="stylesheet" type="text/css" /> | ||
48 | - <link href="{% static 'imgs/favicon.ico' %}" rel="shortcut icon" /> | ||
49 | - | ||
50 | - <script type='text/javascript' src='dwr/interface/UtilDWR.js'></script> | ||
51 | - <script type='text/javascript' src='dwr/engine.js'></script> | ||
52 | - <script type='text/javascript' src='dwr/util.js'></script> | ||
53 | - <script type="text/javascript" src="{% static 'js/jqueryui/jquery-1.3.2.min.js' %}"></script> | ||
54 | - <script type="text/javascript" src="{% static 'js/jqueryui/jquery-ui-1.7.1.custom.min.js' %}"></script> | ||
55 | - <script type="text/javascript" src="{% static 'js/openid.js' %}"></script> | ||
56 | - <script type="text/javascript" src="{% static 'js/amadeus.js' %}"></script> | ||
57 | -</head> | ||
58 | -<body> | ||
59 | - <div id="pBody" class="pBody"> | ||
60 | - <div id="pHeader" class="pHeader"> | ||
61 | - <div id="login"> | ||
62 | - <dl id="formlogin"> | ||
63 | - <form name="logonForm" method="post" action="/amadeuslms/validateLogin.do"> | ||
64 | - <dt><input type="text" name="login" maxlength="15" size="15" value="" class="inputlogin"> </dt> | ||
65 | - <dt><input type="password" name="password" maxlength="15" size="15" value="" class="inputlogin"> | ||
66 | - <br /><a href="{% url 'index' %}" name="logonForm" class="button">Entrar</a></dt> | ||
67 | - </form> | ||
68 | -<script type="text/javascript" language="JavaScript"> | ||
69 | - <!-- | ||
70 | - var focusControl = document.forms["logonForm"].elements["login"]; | ||
71 | - | ||
72 | - if (focusControl.type != "hidden" && !focusControl.disabled) { | ||
73 | - focusControl.focus(); | ||
74 | - } | ||
75 | - // --> | ||
76 | -</script> | ||
77 | - | ||
78 | - </dl> | ||
79 | - </div> | ||
80 | - </div> | ||
81 | - <!-- | ||
82 | -Copyright 2008, 2009 UFPE - Universidade Federal de Pernambuco | ||
83 | - | ||
84 | -Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS | ||
85 | - | ||
86 | -O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | ||
87 | -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. | ||
88 | - | ||
89 | -Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | ||
90 | - | ||
91 | -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
92 | ---> | ||
93 | - | ||
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | ||
98 | - | ||
99 | - | ||
100 | -<div id="institutional_menu"> | ||
101 | - | ||
102 | - <span><a href="/amadeuslms/fProject.do" target="_blank">O Projeto</a></span> | ||
103 | - <span> | </span> | ||
104 | - <span><a href="/amadeuslms/fCCTE.do" target="_blank">Grupo CCTE</a></span> | ||
105 | -</div> | ||
106 | - <div id="pTitle" class="pTitle"> | ||
107 | - <h2>Lembrar senha</h2> | ||
108 | - </div> | ||
109 | - <div id="pBreadCrumbs" class="pBreadCrumbs"> | ||
110 | - <ul id="breadcrumb"> | ||
111 | - <li><a href="{% url 'home' %}">Página Inicial</a></li> | ||
112 | - <li>Lembrar senha</li> | ||
113 | - </ul> | ||
114 | - </div> | ||
115 | - <div id="pLeftMenu" class="pLeftMenu"> | ||
116 | - <div id="side_menu_1"> | ||
117 | - <ul id="menu_sessoes"> | ||
118 | - <li><a href="{% url 'create_account' %}" class="insert">Nova conta</a></li> | ||
119 | - </ul> | ||
120 | - </div> | ||
121 | - </div> | ||
122 | - <div id="pContent" class="pContent"> | ||
123 | - <dl class="insert2"> | ||
124 | - | ||
125 | - | ||
126 | - <form name="remindPasswordForm" method="post" action="/amadeuslms/remindPassword.do"> | ||
127 | - <dt>Endereço de e-mail</dt> | ||
128 | - <dd><input type="text" name="email" value="" class="formfield2" id="username"></dd> | ||
129 | - <dd class="description">Seu endereço de e-mail (exemplo@mail.com)</dd> | ||
130 | - <dt class="field"><input type="submit" name="remindPassword" value="Enviar e-mail" class="button"></dt> | ||
131 | - </form> | ||
132 | -<script type="text/javascript" language="JavaScript"> | ||
133 | - <!-- | ||
134 | - var focusControl = document.forms["remindPasswordForm"].elements["email"]; | ||
135 | - | ||
136 | - if (focusControl.type != "hidden" && !focusControl.disabled) { | ||
137 | - focusControl.focus(); | ||
138 | - } | ||
139 | - // --> | ||
140 | -</script> | ||
141 | - | ||
142 | - </dl> | ||
143 | - </div> | ||
144 | - <div id="pRightMenu" class="pRightMenu"> | ||
145 | - </div> | ||
146 | - <!-- | ||
147 | -Copyright 2008, 2009 UFPE - Universidade Federal de Pernambuco | ||
148 | - | ||
149 | -Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS | ||
150 | - | ||
151 | -O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | ||
152 | -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. | ||
153 | - | ||
154 | -Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | ||
155 | - | ||
156 | -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
157 | ---> | ||
158 | - | ||
159 | - | ||
160 | - | ||
161 | - | ||
162 | - | ||
163 | -<div id="footnote"> | ||
164 | - <dl><dd>Copyright Amadeus. Todos os direitos reservados<dd></dl> | ||
165 | -</div> | ||
166 | - | ||
167 | - </div> | ||
168 | -</body> | ||
169 | -</html> |
core/templates/registration/passwor_reset_confirm.html
1 | {% extends "index.html" %} | 1 | {% extends "index.html" %} |
2 | {% load i18n static %} | 2 | {% load i18n static %} |
3 | 3 | ||
4 | -{% block content%} | 4 | + {% block content%} |
5 | 5 | ||
6 | <div class="row"> | 6 | <div class="row"> |
7 | - <div class="col-md-4 col-md-offset-4 col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 col-lg-4 col-lg-offset-4 col-xl-4 col-xl-offset-4"> | ||
8 | - <div class="row"> | ||
9 | - <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8 col-xs-offset-2 col-xs-8 col-lg-offset-2 col-lg-8 col-xs-offset-2 col-xs-8"> | ||
10 | - </br> | ||
11 | - </br> | ||
12 | - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus"> | ||
13 | - </br> | ||
14 | - </div> | ||
15 | - </div> | ||
16 | - </div> | ||
17 | - <div class="row "> | ||
18 | - <div class="col-lg-9 col-lg-offset-2 col-xs-9 col-xs-offset-2 col-sm-9 col-sm-offset-2 col-md-9 col-md-offset-2 col-xl-9 col-xl-offset-2"> | ||
19 | - | ||
20 | - | ||
21 | - {% if validlink %} | ||
22 | - <h3>Nova Senha</h3> | ||
23 | - <form method="post"> | ||
24 | - {% csrf_token %} | ||
25 | - {{ form.new_password1.erros }} | ||
26 | - <label for="id_password1"> Nova Senha: </label> | ||
27 | - {form.new_password1} | ||
28 | - | ||
29 | - {{ form.new_password2.erros }} | ||
30 | - <label for="id_password2"> Confirmar Senha: </label> | ||
31 | - {form.new_password2} | ||
32 | - | ||
33 | - | ||
34 | - <button type="submit">Confirmar</button> | ||
35 | - </form> | ||
36 | - | ||
37 | - {% else %} | ||
38 | - <p> | ||
39 | - O link de redefinição de senha está inválido, possivelmente porque ele já foi utilizado. | ||
40 | - Por favor, solicite uma nova redefinição de senha. | ||
41 | - </p> | ||
42 | - {% endif %} | ||
43 | - | ||
44 | - </div> | 7 | + <div class="col-md-4 col-md-offset-4 col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 col-lg-4 col-lg-offset-4 col-xl-4 col-xl-offset-4"> |
8 | + <div class="row"> | ||
9 | + <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8 col-xs-offset-2 col-xs-8 col-lg-offset-2 col-lg-8 col-xs-offset-2 col-xs-8"> | ||
10 | + </br> | ||
11 | + </br> | ||
12 | + <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus"> | ||
13 | + </br> | ||
45 | </div> | 14 | </div> |
46 | -</div> | 15 | + </div> |
16 | + </div> | ||
17 | + <div class="row "> | ||
18 | + <div class="col-lg-9 col-lg-offset-2 col-xs-9 col-xs-offset-2 col-sm-9 col-sm-offset-2 col-md-9 col-md-offset-2 col-xl-9 col-xl-offset-2"> | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + {% if validlink %} | ||
23 | + | ||
24 | + <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> | ||
25 | + | ||
26 | + <form method="post">{% csrf_token %} | ||
27 | + {{ form.new_password1.errors }} | ||
28 | + <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> | ||
29 | + {{ form.new_password2.errors }} | ||
30 | + <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> | ||
31 | + <p><input type="submit" value="{% trans 'Change my password' %}" /></p> | ||
32 | + </form> | ||
33 | + | ||
34 | + {% else %} | ||
35 | + | ||
36 | + <p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p> | ||
37 | + | ||
38 | + {% endif %} | ||
47 | 39 | ||
48 | -{% endblock content %} | 40 | + {% endblock %} |
core/templates/registration/passwor_reset_email.html
@@ -2,7 +2,7 @@ To initiate the password reset process for your {{ user.get_username }} TestSite | @@ -2,7 +2,7 @@ To initiate the password reset process for your {{ user.get_username }} TestSite | ||
2 | click the link below: | 2 | click the link below: |
3 | 3 | ||
4 | {% block reset_link %} | 4 | {% block reset_link %} |
5 | -{{ protocol }}://{{ domain }}{% url 'core:passwor_reset_confirm' uidb36=uid token=token %} | 5 | +{{ protocol }}://{{ domain }}{% url 'core:password_reset_confirm' uidb64=uid token=token %} |
6 | 6 | ||
7 | {% endblock %} | 7 | {% endblock %} |
8 | 8 |
core/templates/registration/passwor_reset_form.html
1 | {% extends "index.html" %} | 1 | {% extends "index.html" %} |
2 | {% load i18n static %} | 2 | {% load i18n static %} |
3 | +{% block content%} | ||
3 | 4 | ||
4 | -{% block content %} | ||
5 | - | ||
6 | - <div class="row"> | ||
7 | - < <div class="col-md-4 col-md-offset-4 col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 col-lg-4 col-lg-offset-4 col-xl-4 col-xl-offset-4"> | ||
8 | - <div class="row"> | ||
9 | - <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8 col-xs-offset-2 col-xs-8 col-lg-offset-2 col-lg-8 col-xs-offset-2 col-xs-8"> | ||
10 | - </br> | ||
11 | - </br> | ||
12 | - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus"> | ||
13 | - </br> | ||
14 | - </div> | 5 | + <div class="row"> |
6 | + <div class="col-md-4 col-md-offset-4 col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 col-lg-4 col-lg-offset-4 col-xl-4 col-xl-offset-4"> | ||
7 | + <div class="row"> | ||
8 | + <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8 col-xs-offset-2 col-xs-8 col-lg-offset-2 col-lg-8 col-xs-offset-2 col-xs-8"> | ||
9 | + </br> | ||
10 | + </br> | ||
11 | + <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus"> | ||
12 | + </br> | ||
15 | </div> | 13 | </div> |
16 | </div> | 14 | </div> |
17 | - <div class="row "> | ||
18 | - <div class="col-lg-9 col-lg-offset-2 col-xs-9 col-xs-offset-2 col-sm-9 col-sm-offset-2 col-md-9 col-md-offset-2 col-xl-9 col-xl-offset-2"> | ||
19 | - | ||
20 | - | ||
21 | - <h3>Recuperar a senha</h3> | ||
22 | - <form method="post"> | ||
23 | - {% csrf_token %} | ||
24 | - <label for="id_email">E-mail: </label> {{ form.email }} | ||
25 | - <input type="submit" value="Enviar" /></p> | ||
26 | - </form> | ||
27 | - | ||
28 | - </div> | ||
29 | </div> | 15 | </div> |
30 | - </div> | 16 | + <div class="row "> |
17 | + <div class="col-lg-9 col-lg-offset-2 col-xs-9 col-xs-offset-2 col-sm-9 col-sm-offset-2 col-md-9 col-md-offset-2 col-xl-9 col-xl-offset-2"> | ||
18 | + {% if success %} | ||
19 | + <div class="alert alert-success alert-dismissible" role="alert"> | ||
20 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
21 | + <span aria-hidden="true">×</span> | ||
22 | + </button> | ||
23 | + <ul> | ||
24 | + <li>{{ success }}</li> | ||
25 | + </ul> | ||
26 | + </div> | ||
27 | + {% elif danger %} | ||
28 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
29 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
30 | + <span aria-hidden="true">×</span> | ||
31 | + </button> | ||
32 | + <ul> | ||
33 | + <li>{{ danger }}</li> | ||
34 | + </ul> | ||
35 | + </div> | ||
36 | + {% endif %} | ||
37 | + <div class="card"> | ||
38 | + <div class="card-block"> | ||
39 | + <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12 col-xl-12"> | ||
40 | + <form class="form-group " method="post" action=""> | ||
41 | + {% csrf_token %} | ||
42 | + <div class="form-group is-empty"> | ||
43 | + <label for="inputEmail" class="ccontrol-label"> {% trans 'E-mail' %}</label> | ||
44 | + <input name="email" type="email" class="form-control" id="inputEmail" placeholder="Email" {% if email %}value="{{form.email}}"{% endif %}> | ||
45 | + </div> | ||
46 | + <div class="col-lg-offset-4 col-lg-4 col-xs-offset-4 col-xs-4 col-sm-offset-4 col-sm-4 col-md-offset-4 col-md-4 col-xl-offset-4 col-xl-4"> | ||
47 | + <button type="submite" class="btn btn-raised btn-primary btn-block">{% trans 'Send' %}</button> | ||
48 | + | ||
49 | + </div> | ||
50 | + </form> | ||
51 | + </div> | ||
52 | + </div> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
31 | 57 | ||
32 | {% endblock content %} | 58 | {% endblock content %} |
core/templates/remember_password.html
@@ -1,62 +0,0 @@ | @@ -1,62 +0,0 @@ | ||
1 | -{% extends "index.html" %} | ||
2 | -{% load i18n static %} | ||
3 | -{% block content%} | ||
4 | - | ||
5 | - <div class="row"> | ||
6 | - <div class="col-md-4 col-md-offset-4 col-xs-4 col-xs-offset-4 col-sm-4 col-sm-offset-4 col-lg-4 col-lg-offset-4 col-xl-4 col-xl-offset-4"> | ||
7 | - <div class="row"> | ||
8 | - <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8 col-xs-offset-2 col-xs-8 col-lg-offset-2 col-lg-8 col-xs-offset-2 col-xs-8"> | ||
9 | - </br> | ||
10 | - </br> | ||
11 | - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus"> | ||
12 | - </br> | ||
13 | - </div> | ||
14 | - </div> | ||
15 | - </div> | ||
16 | - <div class="row "> | ||
17 | - <div class="col-lg-9 col-lg-offset-2 col-xs-9 col-xs-offset-2 col-sm-9 col-sm-offset-2 col-md-9 col-md-offset-2 col-xl-9 col-xl-offset-2"> | ||
18 | - {% if success %} | ||
19 | - <div class="alert alert-success alert-dismissible" role="alert"> | ||
20 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
21 | - <span aria-hidden="true">×</span> | ||
22 | - </button> | ||
23 | - <ul> | ||
24 | - <li>{{ success }}</li> | ||
25 | - </ul> | ||
26 | - </div> | ||
27 | - {% elif danger %} | ||
28 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
29 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
30 | - <span aria-hidden="true">×</span> | ||
31 | - </button> | ||
32 | - <ul> | ||
33 | - <li>{{ danger }}</li> | ||
34 | - </ul> | ||
35 | - </div> | ||
36 | - {% endif %} | ||
37 | - <div class="card"> | ||
38 | - <div class="card-block"> | ||
39 | - <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12 col-xl-12"> | ||
40 | - <form class="form-group " method="post" action=""> | ||
41 | - {% csrf_token %} | ||
42 | - <div class="form-group is-empty"> | ||
43 | - <label for="inputEmail" class="ccontrol-label"> {% trans 'E-mail' %}</label> | ||
44 | - <input name="email" type="email" class="form-control" id="inputEmail" placeholder="Email" {% if email %}value="{{email}}"{% endif %}> | ||
45 | - </div> | ||
46 | - <div class="form-group is-empty"> | ||
47 | - <label for="inputRegistration" class="control-label"> {% trans 'Registration' %} </label> | ||
48 | - <input name="registration" type="text" class="col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4 form-control" id="inputRegistration" placeholder="Registration" {% if registration %}value="{{registration}}"{% endif %}> | ||
49 | - </div> | ||
50 | - <div class="col-lg-offset-4 col-lg-4 col-xs-offset-4 col-xs-4 col-sm-offset-4 col-sm-4 col-md-offset-4 col-md-4 col-xl-offset-4 col-xl-4"> | ||
51 | - <button type="submite" class="btn btn-raised btn-primary btn-block">{% trans 'Send' %}</button> | ||
52 | - | ||
53 | - </div> | ||
54 | - </form> | ||
55 | - </div> | ||
56 | - </div> | ||
57 | - </div> | ||
58 | - </div> | ||
59 | - </div> | ||
60 | - </div> | ||
61 | - | ||
62 | -{% endblock content %} |
core/urls.py
@@ -11,13 +11,17 @@ urlpatterns = [ | @@ -11,13 +11,17 @@ urlpatterns = [ | ||
11 | url(r'^logout/$', auth_views.logout, {'next_page': 'core:home'}, name='logout'), | 11 | url(r'^logout/$', auth_views.logout, {'next_page': 'core:home'}, name='logout'), |
12 | url(r'^notification/([0-9]+)/$', views.processNotification, name='notification_read'), | 12 | url(r'^notification/([0-9]+)/$', views.processNotification, name='notification_read'), |
13 | url(r'^getNotifications/$', views.getNotifications, name='getNotifications'), | 13 | url(r'^getNotifications/$', views.getNotifications, name='getNotifications'), |
14 | -] | ||
15 | 14 | ||
16 | #Reset Password | 15 | #Reset Password |
17 | -urlpatterns += [ | ||
18 | - url(r'^password/reset/$', password_reset, {'post_reset_redirect' : 'password/reset/done/','template_name': 'registration/passwor_reset_form.html'}, name="password_reset"), | ||
19 | - url(r'^password/reset/done/$', password_reset_done, {'template_name': 'registration/passwor_reset_done.html'}), | ||
20 | - url(r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', password_reset_confirm, {'post_reset_redirect' : 'password/done/', 'template_name': 'registration/password_reset_confirm.html'}), | ||
21 | - url(r'^password/done/$', password_reset_complete,{'template_name': 'registration/passwor_reset_complete.html'}), | ||
22 | 16 | ||
17 | + url(r'^reset/$', password_reset, {'template_name':'registration/passwor_reset_form.html', | ||
18 | + 'email_template_name':'registration/passwor_reset_email.html', | ||
19 | + 'subject_template_name' :'registration/password_reset_subject.txt', | ||
20 | + 'post_reset_redirect':'done/'}, name="password_reset"), | ||
21 | + url(r'^reset/done/$', password_reset_done, {'template_name':'registration/passwor_reset_done.html'}), | ||
22 | + url(r'^reset/(?P<uidb64>[0-9A-Za-z]+)/(?P<token>.+)/$', password_reset_confirm, | ||
23 | + {'template_name':'registration/passwor_reset_confirm.html', | ||
24 | + 'post_reset_redirect' : '/done/'}, | ||
25 | + name='password_reset_confirm'), | ||
26 | + url(r'^done/$', password_reset_complete,{'template_name':'registration/passwor_reset_complete.html'}), | ||
23 | ] | 27 | ] |
courses/urls.py
@@ -26,4 +26,5 @@ urlpatterns = [ | @@ -26,4 +26,5 @@ urlpatterns = [ | ||
26 | 26 | ||
27 | url(r'^forum/', include('forum.urls', namespace = 'forum')), | 27 | url(r'^forum/', include('forum.urls', namespace = 'forum')), |
28 | url(r'^poll/', include('poll.urls', namespace = 'poll')), | 28 | url(r'^poll/', include('poll.urls', namespace = 'poll')), |
29 | + | ||
29 | ] | 30 | ] |
@@ -0,0 +1,60 @@ | @@ -0,0 +1,60 @@ | ||
1 | +<div class="panel panel-info"> | ||
2 | + <div class="panel-heading"> | ||
3 | + <h3 class="panel-title">New Exam</h3> | ||
4 | + </div> | ||
5 | + <div class="panel-body"> | ||
6 | + <form class="form-horizontal"> | ||
7 | + | ||
8 | + <div class="form-group"> | ||
9 | + <label for="examName" class="col-md-2 control-label">Exam Name</label> | ||
10 | + | ||
11 | + <div class="col-md-10"> | ||
12 | + <input type="text" class="form-control" id="examName" placeholder="Exam Name"> | ||
13 | + </div> | ||
14 | + | ||
15 | + | ||
16 | + </div> | ||
17 | + <div class="form-group"> | ||
18 | + <label for="Date" class="col-md-2 control-label">Exam Period</label> | ||
19 | + <div class="col-md-5"> | ||
20 | + <input type="date" class="form-control" id="beginDate" placeholder="Begin Date"> | ||
21 | + | ||
22 | + </div> | ||
23 | + <div class="col-md-5"> | ||
24 | + <input type="date" class="form-control" id="endDate" placeholder="End Date"> | ||
25 | + | ||
26 | + </div> | ||
27 | + </div> | ||
28 | + <div class="form-group"> | ||
29 | + <label for="deadline" class="col-md-2 control-label">Allow submissions after deadline?</label> | ||
30 | + <div class="col-md-10"> | ||
31 | + <label> | ||
32 | + <input type="checkbox"> | ||
33 | + </label> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + <div class="form-group"> | ||
37 | + <label for="questionType" class="col-md-2 control-label">Question Type</label> | ||
38 | + <div class="col-md-10"> | ||
39 | + <select id="questionType" class="form-control" onchange="showDiv (this)"> | ||
40 | + <option selected disabled>Question Type</option> | ||
41 | + <option value="0">Multiple Choice</option> | ||
42 | + <option value="1">True or False</option> | ||
43 | + <option value="2">Gap Filling</option> | ||
44 | + <option value="3">Discursive Question</option> | ||
45 | + </select> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + </form> | ||
49 | + </div> | ||
50 | +</div> | ||
51 | + | ||
52 | +<script> | ||
53 | + function showDiv (elem) { | ||
54 | + if (elem.value == 0) { | ||
55 | + document.getElementById('multipleChoice').style.display = "block"; | ||
56 | + } else if (elem.value == 1) { | ||
57 | + document.getElementById('trueOrFalse').style.display = "block"; | ||
58 | + } | ||
59 | + } | ||
60 | +</script> |
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2016-10-06 17:57 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.db import migrations, models | ||
6 | + | ||
7 | + | ||
8 | +class Migration(migrations.Migration): | ||
9 | + | ||
10 | + initial = True | ||
11 | + | ||
12 | + dependencies = [ | ||
13 | + ] | ||
14 | + | ||
15 | + operations = [ | ||
16 | + migrations.CreateModel( | ||
17 | + name='Link', | ||
18 | + fields=[ | ||
19 | + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
20 | + ('name', models.CharField(max_length=100)), | ||
21 | + ('link', models.URLField()), | ||
22 | + ('description', models.CharField(max_length=200)), | ||
23 | + ], | ||
24 | + options={ | ||
25 | + 'verbose_name_plural': 'Links', | ||
26 | + 'verbose_name': 'Link', | ||
27 | + }, | ||
28 | + ), | ||
29 | + ] |
links/models.py
1 | 1 | ||
2 | from django.db import models | 2 | from django.db import models |
3 | from courses.models import Material | 3 | from courses.models import Material |
4 | +from autoslug.fields import AutoSlugField | ||
4 | # Create your models here. | 5 | # Create your models here. |
5 | class Link(models.Model): | 6 | class Link(models.Model): |
6 | name = models.CharField(max_length=100) | 7 | name = models.CharField(max_length=100) |
@@ -0,0 +1,206 @@ | @@ -0,0 +1,206 @@ | ||
1 | +{% extends "topic/index.html" %} | ||
2 | + | ||
3 | +{% load i18n widget_tweaks dict_access static%} | ||
4 | + | ||
5 | +{% block style %} | ||
6 | + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
7 | +{% endblock %} | ||
8 | + | ||
9 | +{% block content %} | ||
10 | +<!-- Modal (remember to change the ids!!!) --> | ||
11 | +<div class="modal fade" id="poll" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
12 | + <div class="modal-dialog" role="document"> | ||
13 | + <div class="modal-content"> | ||
14 | + | ||
15 | + <!-- Modal Header --> | ||
16 | + <div class="modal-header"> | ||
17 | + | ||
18 | + {% block title_poll %} | ||
19 | + <!-- Put your title here!!! --> | ||
20 | + <h4 class="modal-title" id="myModalLabel">{% trans "Create a Poll" %}</h4> | ||
21 | + {% endblock title_poll %} | ||
22 | + </div> | ||
23 | + <!-- Modal Body --> | ||
24 | + <div class="modal-body"> | ||
25 | + | ||
26 | + {% block content_poll %} | ||
27 | + <!-- Put ONLY your content here!!! --> | ||
28 | + <div class="conteiner"> | ||
29 | + <div class="row form-group"> | ||
30 | + <div class="col-md-1"> | ||
31 | + </br> | ||
32 | + <label><span class="glyphicon glyphicon-hand-right"></span></label> | ||
33 | + </div> | ||
34 | + <div class="col-md-10"> | ||
35 | + <div class="has-success"> | ||
36 | + <input form="form" type="text" name="{{form.name.name}}" {% if form.name.value != None %}value="{{form.name.value}}" {% endif %} class="form-control" placeholder='{% trans "Question?" %}'> | ||
37 | + <span class="help-block">{% trans "A Question to be answered" %}</span> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + {% if form.name.errors %} | ||
41 | + <div class="col-md-10 not_submited"> | ||
42 | + </br> | ||
43 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
44 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
45 | + <span aria-hidden="true">×</span> | ||
46 | + </button> | ||
47 | + <ul> | ||
48 | + {% for error in form.name.errors %} | ||
49 | + <li>{{ error }}</li> | ||
50 | + {% endfor %} | ||
51 | + </ul> | ||
52 | + </div> | ||
53 | + </div> | ||
54 | + {% endif %} | ||
55 | + </div> | ||
56 | + <form id="form" class="" action="" method="post"> | ||
57 | + {% csrf_token %} | ||
58 | + {% for key in keys %} | ||
59 | + <div class="row form-group"> | ||
60 | + <div class="col-md-1"> | ||
61 | + </br> | ||
62 | + <label><span class="glyphicon glyphicon-move"></span></label> | ||
63 | + </div> | ||
64 | + <div class="col-md-10"> | ||
65 | + <div class="has-success is-empty"> | ||
66 | + <input type="text" name="{{key}}" class="form-control" placeholder='{% trans "Answer" %}' value="{{ answers|value:key }}"> | ||
67 | + <span class="help-block">{% trans "Possible answer for the question" %}</span> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + <div class="col-md-1"> | ||
71 | + </br> | ||
72 | + <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + {% empty %} | ||
76 | + <div class="row form-group"> | ||
77 | + <div class="col-md-1"> | ||
78 | + </br> | ||
79 | + <label><span class="glyphicon glyphicon-move"></span></label> | ||
80 | + </div> | ||
81 | + <div class="col-md-10"> | ||
82 | + <div class="has-success is-empty"> | ||
83 | + <input type="text" name="1" class="form-control" placeholder='{% trans "Answer" %}'> | ||
84 | + <span class="help-block">{% trans "Possible answer for the question" %}</span> | ||
85 | + </div> | ||
86 | + </div> | ||
87 | + <div class="col-md-1"> | ||
88 | + </br> | ||
89 | + <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
90 | + </div> | ||
91 | + </div> | ||
92 | + {% endfor %} | ||
93 | + </form> | ||
94 | + </br> | ||
95 | + </div> | ||
96 | + <button type="button" id="add" class="btn btn-primary btn-block btn-sm">add</button> | ||
97 | + <div class="row form-group"> | ||
98 | + <label for="{{ form.limit_date.auto_id }}">{{ form.limit_date.label }}</label> | ||
99 | + {% render_field form.limit_date class="form-control" form="form"%} | ||
100 | + {# <input form="form" class="form-control" type="date" name="{{form.limit_date.name}}" {% if form.limit_date.value != None %}value="{% if form.limit_date.value.year %}{{form.limit_date.value|date:'Y-m-d'}}{% else %}{{form.limit_date.value}}{% endif %}"{% endif %}>#} | ||
101 | + {% if form.limit_date.errors %} | ||
102 | + <div class="not_submited"> | ||
103 | + </br> | ||
104 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
105 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
106 | + <span aria-hidden="true">×</span> | ||
107 | + </button> | ||
108 | + <ul> | ||
109 | + {% for error in form.limit_date.errors %} | ||
110 | + <li>{{ error }}</li> | ||
111 | + {% endfor %} | ||
112 | + </ul> | ||
113 | + </div> | ||
114 | + </div> | ||
115 | + {% endif %} | ||
116 | + </div> | ||
117 | + | ||
118 | + <div class="row form-group"> | ||
119 | + <label for="{{ form.students.auto_id }}">{{ form.students.label }}</label> | ||
120 | + {% render_field form.students class="form-control" form="form"%} | ||
121 | + </div> | ||
122 | + <div class="row form-group"> | ||
123 | + <div class="checkbox"> | ||
124 | + <label> | ||
125 | + {% render_field form.all_students class="form-control" form="form" %}<span class="checkbox-material"><span class="check"></span></span> {{form.all_students.label }} | ||
126 | + </label> | ||
127 | + </div> | ||
128 | + {% if form.all_students.errors %} | ||
129 | + <div class="not_submited"> | ||
130 | + </br> | ||
131 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
132 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
133 | + <span aria-hidden="true">×</span> | ||
134 | + </button> | ||
135 | + <ul> | ||
136 | + {% for error in form.all_students.errors %} | ||
137 | + <li>{{ error }}</li> | ||
138 | + {% endfor %} | ||
139 | + </ul> | ||
140 | + </div> | ||
141 | + </div> | ||
142 | + {% endif %} | ||
143 | + </div> | ||
144 | + | ||
145 | + {% endblock content_poll %} | ||
146 | + </div> | ||
147 | + | ||
148 | + <!-- Modal Footer --> | ||
149 | + <div class="modal-footer"> | ||
150 | + | ||
151 | + <!-- Don't remove that!!! --> | ||
152 | + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | ||
153 | + {% block button_save %} | ||
154 | + <!-- Put curtom buttons here!!! --> | ||
155 | + <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | ||
156 | + {% endblock button_save %} | ||
157 | + </div> | ||
158 | + | ||
159 | + </div> | ||
160 | + </div> | ||
161 | +</div> | ||
162 | +<script type="text/javascript"> | ||
163 | +// Este js tem que ficar aqui se não a tag "trans" não vai funcionar | ||
164 | +$(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario | ||
165 | + if($('.not_submited').length){ | ||
166 | + $('#poll').modal('show'); | ||
167 | + } | ||
168 | +}); | ||
169 | +$( "#form" ).sortable({ // utilizado para fazer a re-organização das respostas | ||
170 | + delay: 100, | ||
171 | + distance: 5, | ||
172 | + update: function( event, ui ) { | ||
173 | + var cont = 1; | ||
174 | + $("#form div div div input").each(function(){ | ||
175 | + $(this).attr('name',cont++); | ||
176 | + }); | ||
177 | + }, | ||
178 | +}); | ||
179 | +name = 2; | ||
180 | +$("#add").click(function() { // utilizado para adicionar um novo campo de resposta | ||
181 | + //Obs: não funcionar se estiver importado no head, só funciona se estiver no final do arquivo | ||
182 | + $("#form").append('\ | ||
183 | + <div class="row form-group">\ | ||
184 | + <div class="col-md-1">\ | ||
185 | + </br>\ | ||
186 | + <label><span class="glyphicon glyphicon-move"></span></label>\ | ||
187 | + </div>\ | ||
188 | + <div class="col-md-10">\ | ||
189 | + <div class="has-success is-empty">\ | ||
190 | + <input type="text" name="1" class="form-control" placeholder="{% trans "Answer" %}">\ | ||
191 | + <span class="help-block">{% trans "Possible answer for the question" %}</span>\ | ||
192 | + </div>\ | ||
193 | + </div>\ | ||
194 | + <div class="col-md-1">\ | ||
195 | + </br>\ | ||
196 | + <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label>\ | ||
197 | + </div>\ | ||
198 | + </div>'); | ||
199 | + var cont = 1; | ||
200 | + $("#form div div div input").each(function(){ | ||
201 | + $(this).attr('name',cont++); | ||
202 | + }); | ||
203 | +}); | ||
204 | +</script> | ||
205 | +<a href="" data-toggle="modal" data-target="#poll">modal</a> | ||
206 | +{% endblock content %} |
poll/templates/poll/create_update.html
@@ -1,206 +0,0 @@ | @@ -1,206 +0,0 @@ | ||
1 | -{% extends "topic/index.html" %} | ||
2 | - | ||
3 | -{% load i18n widget_tweaks dict_access static%} | ||
4 | - | ||
5 | -{% block style %} | ||
6 | - <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
7 | -{% endblock %} | ||
8 | - | ||
9 | -{% block content %} | ||
10 | -<!-- Modal (remember to change the ids!!!) --> | ||
11 | -<div class="modal fade" id="poll" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
12 | - <div class="modal-dialog" role="document"> | ||
13 | - <div class="modal-content"> | ||
14 | - | ||
15 | - <!-- Modal Header --> | ||
16 | - <div class="modal-header"> | ||
17 | - | ||
18 | - <!-- Put your title here!!! --> | ||
19 | - <h4 class="modal-title" id="myModalLabel">{% trans "Create a Poll" %}</h4> | ||
20 | - | ||
21 | - </div> | ||
22 | - <!-- Modal Body --> | ||
23 | - <div class="modal-body"> | ||
24 | - | ||
25 | - <!-- Put ONLY your content here!!! --> | ||
26 | - <div class="conteiner"> | ||
27 | - <div class="row form-group"> | ||
28 | - <div class="col-md-1"> | ||
29 | - </br> | ||
30 | - <label><span class="glyphicon glyphicon-hand-right"></span></label> | ||
31 | - </div> | ||
32 | - <div class="col-md-10"> | ||
33 | - <div class="has-success"> | ||
34 | - <input form="form" type="text" name="{{form.name.name}}" {% if form.name.value != None %}value="{{form.name.value}}" {% endif %} class="form-control" placeholder='{% trans "Question?" %}'> | ||
35 | - <span class="help-block">{% trans "A Question to be answered" %}</span> | ||
36 | - </div> | ||
37 | - </div> | ||
38 | - {% if form.name.errors %} | ||
39 | - <div class="col-md-10 not_submited"> | ||
40 | - </br> | ||
41 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
42 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
43 | - <span aria-hidden="true">×</span> | ||
44 | - </button> | ||
45 | - <ul> | ||
46 | - {% for error in form.name.errors %} | ||
47 | - <li>{{ error }}</li> | ||
48 | - {% endfor %} | ||
49 | - </ul> | ||
50 | - </div> | ||
51 | - </div> | ||
52 | - {% endif %} | ||
53 | - </div> | ||
54 | - <form id="form" class="" action="" method="post"> | ||
55 | - {% csrf_token %} | ||
56 | - {% for key in keys %} | ||
57 | - <div class="row form-group"> | ||
58 | - <div class="col-md-1"> | ||
59 | - </br> | ||
60 | - <label><span class="glyphicon glyphicon-move"></span></label> | ||
61 | - </div> | ||
62 | - <div class="col-md-10"> | ||
63 | - <div class="has-success is-empty"> | ||
64 | - <input type="text" name="{{key}}" class="form-control" placeholder='{% trans "Answer" %}' value="{{ answers|value:key }}"> | ||
65 | - <span class="help-block">{% trans "Possible answer for the question" %}</span> | ||
66 | - </div> | ||
67 | - </div> | ||
68 | - <div class="col-md-1"> | ||
69 | - </br> | ||
70 | - <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
71 | - </div> | ||
72 | - </div> | ||
73 | - {% empty %} | ||
74 | - <div class="row form-group"> | ||
75 | - <div class="col-md-1"> | ||
76 | - </br> | ||
77 | - <label><span class="glyphicon glyphicon-move"></span></label> | ||
78 | - </div> | ||
79 | - <div class="col-md-10"> | ||
80 | - <div class="has-success is-empty"> | ||
81 | - <input type="text" name="1" class="form-control" placeholder='{% trans "Answer" %}'> | ||
82 | - <span class="help-block">{% trans "Possible answer for the question" %}</span> | ||
83 | - </div> | ||
84 | - </div> | ||
85 | - <div class="col-md-1"> | ||
86 | - </br> | ||
87 | - <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
88 | - </div> | ||
89 | - </div> | ||
90 | - {% endfor %} | ||
91 | - </form> | ||
92 | - </br> | ||
93 | - </div> | ||
94 | - <button type="button" id="add" class="btn btn-primary btn-block btn-sm">add</button> | ||
95 | - <div class="row form-group"> | ||
96 | - <label for="{{ form.limit_date.auto_id }}">{{ form.limit_date.label }}</label> | ||
97 | - {% render_field form.limit_date class="form-control" form="form"%} | ||
98 | - {# <input form="form" class="form-control" type="date" name="{{form.limit_date.name}}" {% if form.limit_date.value != None %}value="{% if form.limit_date.value.year %}{{form.limit_date.value|date:'Y-m-d'}}{% else %}{{form.limit_date.value}}{% endif %}"{% endif %}>#} | ||
99 | - {% if form.limit_date.errors %} | ||
100 | - <div class="not_submited"> | ||
101 | - </br> | ||
102 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
103 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
104 | - <span aria-hidden="true">×</span> | ||
105 | - </button> | ||
106 | - <ul> | ||
107 | - {% for error in form.limit_date.errors %} | ||
108 | - <li>{{ error }}</li> | ||
109 | - {% endfor %} | ||
110 | - </ul> | ||
111 | - </div> | ||
112 | - </div> | ||
113 | - {% endif %} | ||
114 | - </div> | ||
115 | - | ||
116 | - <div class="row form-group"> | ||
117 | - <label for="{{ form.students.auto_id }}">{{ form.students.label }}</label> | ||
118 | - {% render_field form.students class="form-control" form="form"%} | ||
119 | - </div> | ||
120 | - <div class="row form-group"> | ||
121 | - <div class="checkbox"> | ||
122 | - <label> | ||
123 | - {% render_field form.all_students class="form-control" form="form" %}<span class="checkbox-material"><span class="check"></span></span> {{form.all_students.label }} | ||
124 | - {# <input form="form" type="checkbox" name="{{form.all_students.name}}"><span class="checkbox-material"><span class="check"></span></span> {{ form.all_students.label }}#} | ||
125 | - </label> | ||
126 | - </div> | ||
127 | - {% if form.all_students.errors %} | ||
128 | - <div class="not_submited"> | ||
129 | - </br> | ||
130 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
131 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
132 | - <span aria-hidden="true">×</span> | ||
133 | - </button> | ||
134 | - <ul> | ||
135 | - {% for error in form.all_students.errors %} | ||
136 | - <li>{{ error }}</li> | ||
137 | - {% endfor %} | ||
138 | - </ul> | ||
139 | - </div> | ||
140 | - </div> | ||
141 | - {% endif %} | ||
142 | - | ||
143 | - {# <label for="{{ form.all_students.auto_id }}">{{ form.all_students.label }}</label>#} | ||
144 | - {# {% render_field form.all_students class="form-control" form="form"%}#} | ||
145 | - </div> | ||
146 | - | ||
147 | - </div> | ||
148 | - | ||
149 | - <!-- Modal Footer --> | ||
150 | - <div class="modal-footer"> | ||
151 | - | ||
152 | - <!-- Don't remove that!!! --> | ||
153 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | ||
154 | - | ||
155 | - <!-- Put curtom buttons here!!! --> | ||
156 | - <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | ||
157 | - </div> | ||
158 | - | ||
159 | - </div> | ||
160 | - </div> | ||
161 | -</div> | ||
162 | -<script type="text/javascript"> | ||
163 | -// Este js tem que ficar aqui se não a tag "trans" não vai funcionar | ||
164 | -$(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario | ||
165 | - if($('.not_submited').length){ | ||
166 | - $('#poll').modal('show'); | ||
167 | - } | ||
168 | -}); | ||
169 | -$( "#form" ).sortable({ // utilizado para fazer a re-organização das respostas | ||
170 | - delay: 100, | ||
171 | - distance: 5, | ||
172 | - update: function( event, ui ) { | ||
173 | - var cont = 1; | ||
174 | - $("#form div div div input").each(function(){ | ||
175 | - $(this).attr('name',cont++); | ||
176 | - }); | ||
177 | - }, | ||
178 | -}); | ||
179 | -name = 2; | ||
180 | -$("#add").click(function() { // utilizado para adicionar um novo campo de resposta | ||
181 | - //Obs: não funcionar se estiver importado no head, só funciona se estiver no final do arquivo | ||
182 | - $("#form").append('\ | ||
183 | - <div class="row form-group">\ | ||
184 | - <div class="col-md-1">\ | ||
185 | - </br>\ | ||
186 | - <label><span class="glyphicon glyphicon-move"></span></label>\ | ||
187 | - </div>\ | ||
188 | - <div class="col-md-10">\ | ||
189 | - <div class="has-success is-empty">\ | ||
190 | - <input type="text" name="1" class="form-control" placeholder="{% trans "Answer" %}">\ | ||
191 | - <span class="help-block">{% trans "Possible answer for the question" %}</span>\ | ||
192 | - </div>\ | ||
193 | - </div>\ | ||
194 | - <div class="col-md-1">\ | ||
195 | - </br>\ | ||
196 | - <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label>\ | ||
197 | - </div>\ | ||
198 | - </div>'); | ||
199 | - var cont = 1; | ||
200 | - $("#form div div div input").each(function(){ | ||
201 | - $(this).attr('name',cont++); | ||
202 | - }); | ||
203 | -}); | ||
204 | -</script> | ||
205 | -<a href="" data-toggle="modal" data-target="#poll">modal</a> | ||
206 | -{% endblock content %} |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +{% extends "poll/create.html" %} | ||
2 | + | ||
3 | +{% load i18n %} | ||
4 | + | ||
5 | +{% block title_poll %} | ||
6 | +<!-- Put your title here!!! --> | ||
7 | +<h4 class="modal-title" id="myModalLabel">{% trans "Delete Poll" %}</h4> | ||
8 | +{% endblock title_poll %} | ||
9 | + | ||
10 | +{% block content_poll %} | ||
11 | +<!-- Put ONLY your content here!!! --> | ||
12 | +<form action="" method="post"> | ||
13 | + {% csrf_token %} | ||
14 | + <h2>{% trans 'Are you sure you want to delete the subject' %} "{{poll}}"?</h2> | ||
15 | + <input type="submit" class="btn btn-raised btn-success btn-lg" value="{% trans 'Yes' %}" /> | ||
16 | + <a href="" class="btn btn-raised btn-danger btn-lg">{% trans 'No' %}</a> | ||
17 | +</form> | ||
18 | +{% endblock content_poll %} | ||
19 | + | ||
20 | +{% block button_save %} | ||
21 | +{% endblock button_save %} |
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +{% extends "poll/create.html" %} | ||
2 | + | ||
3 | +{% load i18n dict_access static%} | ||
4 | + | ||
5 | +{% block title_poll %} | ||
6 | +<!-- Put your title here!!! --> | ||
7 | +<h4 class="modal-title" id="myModalLabel">{% trans "Update a Poll" %}</h4> | ||
8 | +{% endblock title_poll %} | ||
9 | + | ||
10 | +{% block button_save %} | ||
11 | +<!-- Put curtom buttons here!!! --> | ||
12 | +<button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Update" %}</button> | ||
13 | +{% endblock button_save %} |
poll/urls.py
@@ -5,5 +5,8 @@ from . import views | @@ -5,5 +5,8 @@ from . import views | ||
5 | urlpatterns = [ | 5 | urlpatterns = [ |
6 | url(r'^create/(?P<slug>[\w\-_]+)/$', views.CreatePoll.as_view(), name='create_poll'), # topic slug | 6 | url(r'^create/(?P<slug>[\w\-_]+)/$', views.CreatePoll.as_view(), name='create_poll'), # topic slug |
7 | url(r'^update/(?P<slug>[\w\-_]+)/$', views.UpdatePoll.as_view(), name='update_poll'), # poll slug | 7 | url(r'^update/(?P<slug>[\w\-_]+)/$', views.UpdatePoll.as_view(), name='update_poll'), # poll slug |
8 | + url(r'^teste/(?P<slug>[\w\-_]+)/$', views.CreatePollModal.as_view(), name='teste'), # poll | ||
9 | + url(r'^mymodal/', views.MyModal.as_view(), name='mymodal'), | ||
10 | + url(r'^delete/(?P<slug>[\w\-_]+)/$', views.DeletePoll.as_view(), name='delete_poll'), # poll | ||
8 | 11 | ||
9 | ] | 12 | ] |
poll/views.py
@@ -8,6 +8,7 @@ from django.core.urlresolvers import reverse_lazy | @@ -8,6 +8,7 @@ from django.core.urlresolvers import reverse_lazy | ||
8 | from django.utils.translation import ugettext_lazy as _ | 8 | from django.utils.translation import ugettext_lazy as _ |
9 | from rolepermissions.verifications import has_role | 9 | from rolepermissions.verifications import has_role |
10 | from rolepermissions.verifications import has_object_permission | 10 | from rolepermissions.verifications import has_object_permission |
11 | +from django.db.models import Q | ||
11 | # from django.views.generic.edit import FormMixin | 12 | # from django.views.generic.edit import FormMixin |
12 | 13 | ||
13 | from .forms import PollForm | 14 | from .forms import PollForm |
@@ -23,7 +24,7 @@ class CreatePoll(LoginRequiredMixin,generic.CreateView): | @@ -23,7 +24,7 @@ class CreatePoll(LoginRequiredMixin,generic.CreateView): | ||
23 | model = Poll | 24 | model = Poll |
24 | form_class = PollForm | 25 | form_class = PollForm |
25 | context_object_name = 'poll' | 26 | context_object_name = 'poll' |
26 | - template_name = 'poll/create_update.html' | 27 | + template_name = 'poll/create.html' |
27 | success_url = reverse_lazy('core:home') | 28 | success_url = reverse_lazy('core:home') |
28 | 29 | ||
29 | def form_invalid(self, form,**kwargs): | 30 | def form_invalid(self, form,**kwargs): |
@@ -66,7 +67,7 @@ class UpdatePoll(LoginRequiredMixin,generic.UpdateView): | @@ -66,7 +67,7 @@ class UpdatePoll(LoginRequiredMixin,generic.UpdateView): | ||
66 | model = Poll | 67 | model = Poll |
67 | form_class = PollForm | 68 | form_class = PollForm |
68 | context_object_name = 'poll' | 69 | context_object_name = 'poll' |
69 | - template_name = 'poll/create_update.html' | 70 | + template_name = 'poll/update.html' |
70 | success_url = reverse_lazy('core:home') | 71 | success_url = reverse_lazy('core:home') |
71 | 72 | ||
72 | def dispatch(self, *args, **kwargs): | 73 | def dispatch(self, *args, **kwargs): |
@@ -121,3 +122,98 @@ class UpdatePoll(LoginRequiredMixin,generic.UpdateView): | @@ -121,3 +122,98 @@ class UpdatePoll(LoginRequiredMixin,generic.UpdateView): | ||
121 | context['keys'] = keys | 122 | context['keys'] = keys |
122 | 123 | ||
123 | return context | 124 | return context |
125 | + | ||
126 | +class DeletePoll(LoginRequiredMixin, generic.DeleteView): | ||
127 | + | ||
128 | + allowed_roles = ['professor', 'system_admin'] | ||
129 | + login_url = reverse_lazy("core:home") | ||
130 | + redirect_field_name = 'next' | ||
131 | + model = Poll | ||
132 | + template_name = 'poll/remove.html' | ||
133 | + | ||
134 | + # def dispatch(self, *args, **kwargs): | ||
135 | + # poll = get_object_or_404(Poll, slug = self.kwargs.get('slug')) | ||
136 | + # if(not has_object_permission('delete_subject', self.request.user, subject)): | ||
137 | + # return self.handle_no_permission() | ||
138 | + # return super(DeleteSubjectView, self).dispatch(*args, **kwargs) | ||
139 | + | ||
140 | + | ||
141 | + def get_context_data(self, **kwargs): | ||
142 | + context = super(DeletePoll, self).get_context_data(**kwargs) | ||
143 | + context['course'] = self.object.topic.subject.course | ||
144 | + context['subject'] = self.object.topic.subject | ||
145 | + context['poll'] = self.object | ||
146 | + context['subjects'] = self.object.topic.subject.course.subjects.filter(Q(visible=True) | Q(professors__in=[self.request.user])) | ||
147 | + if (has_role(self.request.user,'system_admin')): | ||
148 | + context['subjects'] = self.object.topic.subject.course.subjects.all() | ||
149 | + return context | ||
150 | + | ||
151 | + def get_success_url(self): | ||
152 | + return reverse_lazy('course:view_topic', kwargs={'slug' : self.object.topic.slug}) | ||
153 | + | ||
154 | + | ||
155 | +from django_modalview.generic.edit import ModalCreateView | ||
156 | +from django_modalview.generic.component import ModalResponse | ||
157 | + | ||
158 | +class CreatePollModal(LoginRequiredMixin,ModalCreateView): | ||
159 | + | ||
160 | + login_url = reverse_lazy("core:home") | ||
161 | + redirect_field_name = 'next' | ||
162 | + model = Poll | ||
163 | + form_class = PollForm | ||
164 | + context_object_name = 'poll' | ||
165 | + template_name = 'poll/create.html' | ||
166 | + success_url = reverse_lazy('core:home') | ||
167 | + | ||
168 | + def form_invalid(self, form,**kwargs): | ||
169 | + context = super(CreatePollModal, self).form_invalid(form) | ||
170 | + answers = {} | ||
171 | + for key in self.request.POST: | ||
172 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'limit_date' and key != 'all_students' and key != 'students'): | ||
173 | + answers[key] = self.request.POST[key] | ||
174 | + | ||
175 | + keys = sorted(answers) | ||
176 | + context.context_data['answers'] = answers | ||
177 | + context.context_data['keys'] = keys | ||
178 | + return context | ||
179 | + | ||
180 | + def form_valid(self, form): | ||
181 | + self.object = form.save(commit = False) | ||
182 | + topic = get_object_or_404(Topic, slug = self.kwargs.get('slug')) | ||
183 | + self.object.topic = topic | ||
184 | + self.object.save() | ||
185 | + | ||
186 | + for key in self.request.POST: | ||
187 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'limit_date' and key != 'all_students' and key != 'students'): | ||
188 | + answer = Answer(answer=self.request.POST[key],order=key,poll=self.object) | ||
189 | + answer.save() | ||
190 | + | ||
191 | + return super(CreatePollModal, self).form_valid(form) | ||
192 | + | ||
193 | + def get_context_data(self, **kwargs): | ||
194 | + context = super(CreatePollModal, self).get_context_data(**kwargs) | ||
195 | + topic = get_object_or_404(Topic, slug = self.kwargs.get('slug')) | ||
196 | + context['course'] = topic.subject.course | ||
197 | + context['subject'] = topic.subject | ||
198 | + context['subjects'] = topic.subject.course.subjects.all() | ||
199 | + return context | ||
200 | + | ||
201 | + | ||
202 | +from django_modalview.generic.base import ModalTemplateView | ||
203 | + | ||
204 | +class MyModal(ModalTemplateView): | ||
205 | + ''' | ||
206 | + This modal inherit of ModalTemplateView, so it just display a text without logic. | ||
207 | + ''' | ||
208 | + def __init__(self, *args, **kwargs): | ||
209 | + ''' | ||
210 | + You have to call the init method of the parent, before to overide the values: | ||
211 | + - title: The title display in the modal-header | ||
212 | + - icon: The css class that define the modal's icon | ||
213 | + - description: The content of the modal. | ||
214 | + - close_button: A button object that has several attributes.(explain below) | ||
215 | + ''' | ||
216 | + super(MyModal, self).__init__(*args, **kwargs) | ||
217 | + self.title = "My modal" | ||
218 | + self.description = "This is my description" | ||
219 | + self.icon = "icon-mymodal" |
requirements.txt
@@ -6,13 +6,18 @@ django-autoslug==1.9.3 | @@ -6,13 +6,18 @@ django-autoslug==1.9.3 | ||
6 | django-bootstrap-breadcrumbs==0.8 | 6 | django-bootstrap-breadcrumbs==0.8 |
7 | django-discover-runner==1.0 | 7 | django-discover-runner==1.0 |
8 | django-floppyforms==1.7.0 | 8 | django-floppyforms==1.7.0 |
9 | +django-modalview==0.1.5 | ||
9 | django-role-permissions==1.2.1 | 10 | django-role-permissions==1.2.1 |
10 | django-s3direct==0.4.2 | 11 | django-s3direct==0.4.2 |
11 | django-widget-tweaks==1.4.1 | 12 | django-widget-tweaks==1.4.1 |
12 | djangorestframework==3.4.6 | 13 | djangorestframework==3.4.6 |
14 | +itsdangerous==0.24 | ||
13 | Jinja2==2.8 | 15 | Jinja2==2.8 |
14 | MarkupSafe==0.23 | 16 | MarkupSafe==0.23 |
15 | Pillow==3.3.1 | 17 | Pillow==3.3.1 |
16 | psycopg2==2.6.2 | 18 | psycopg2==2.6.2 |
17 | pycpfcnpj==1.0.2 | 19 | pycpfcnpj==1.0.2 |
18 | -six==1.10.0 | ||
19 | \ No newline at end of file | 20 | \ No newline at end of file |
21 | +six==1.10.0 | ||
22 | +slugify==0.0.1 | ||
23 | +virtualenv==15.0.3 | ||
24 | +Werkzeug==0.11.11 |
users/templates/list_users.html
@@ -51,9 +51,13 @@ | @@ -51,9 +51,13 @@ | ||
51 | <div class="panel-body"> | 51 | <div class="panel-body"> |
52 | <div class="col-md-4"> | 52 | <div class="col-md-4"> |
53 | {% if acc.image %} | 53 | {% if acc.image %} |
54 | - <img src="{{ acc.image.url }}" alt="photoUser" class="img-circle img-responsive"> | 54 | + <img src="{{ acc.image.url }}" alt="photoUser" class="img-circle img-responsive img-list-user"> |
55 | {% else %} | 55 | {% else %} |
56 | - <img src="{% static 'images/avatar.png' %}" alt="Avatar" class="img-circle img-responsive"> | 56 | + {% if acc.gender == 'M' %} |
57 | + <img src="{% static 'img/male_avatar.png' %}" alt="Avatar" class="img-circle img-responsive img-list-user"> | ||
58 | + {% else %} | ||
59 | + <img src="{% static 'img/female_avatar.png' %}" alt="Avatar" class="img-circle img-responsive img-list-user"> | ||
60 | + {% endif %} | ||
57 | {% endif %} | 61 | {% endif %} |
58 | </div> | 62 | </div> |
59 | <div class="col-md-8"> | 63 | <div class="col-md-8"> |