Commit 9521bbb19375728c21b8a26d6b10cca9401f7923
Exists in
master
and in
5 other branches
Merge
Showing
81 changed files
with
1017 additions
and
1191 deletions
Show diff stats
Procfile
amadeus/settings.py
@@ -28,7 +28,7 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) | @@ -28,7 +28,7 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) | ||
28 | SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4' | 28 | SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4' |
29 | 29 | ||
30 | # SECURITY WARNING: don't run with debug turned on in production! | 30 | # SECURITY WARNING: don't run with debug turned on in production! |
31 | -DEBUG = False | 31 | +DEBUG = True |
32 | 32 | ||
33 | 33 | ||
34 | # Application definition | 34 | # Application definition |
@@ -0,0 +1,43 @@ | @@ -0,0 +1,43 @@ | ||
1 | +//controles do modal | ||
2 | +$(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario | ||
3 | + if($('.not_submited').length){ | ||
4 | + $('#exam').modal('show'); | ||
5 | + } | ||
6 | +}); | ||
7 | +var Answer = { | ||
8 | + init: function(url) { // utilizado para adicionar um novo campo de resposta | ||
9 | + $.get(url, function(data){ | ||
10 | + $("#form").append(data); | ||
11 | + var cont = 1; | ||
12 | + $("#form div div div input").each(function(){ | ||
13 | + $(this).attr('name',cont++); | ||
14 | + }); | ||
15 | + }); | ||
16 | + } | ||
17 | +}; | ||
18 | + | ||
19 | +var Submite = { | ||
20 | + post: function(url,dados){ | ||
21 | + $('#exam').modal('hide'); | ||
22 | + $.post(url,dados, function(data){ | ||
23 | + }).fail(function(data){ | ||
24 | + $("div.modal-backdrop.fade.in").remove(); | ||
25 | + $("#modal_exam").empty(); | ||
26 | + $("#modal_exam").append(data.responseText); | ||
27 | + }); | ||
28 | + }, | ||
29 | + remove: function(url,dados, id_li_link){ | ||
30 | + $('#exam').modal('hide'); | ||
31 | + $.post(url,dados, function(data){ | ||
32 | + $(id_li_link).remove(); | ||
33 | + $("#modal_exam").empty(); | ||
34 | + $("div.modal-backdrop.fade.in").remove(); | ||
35 | + }).fail(function(){ | ||
36 | + $("#modal_exam").empty(); | ||
37 | + $("#modal_exam").append(data); | ||
38 | + $('#exam').modal('show'); | ||
39 | + }); | ||
40 | + } | ||
41 | +} | ||
42 | + | ||
43 | +alert("essfd"); |
amadeus/urls.py
@@ -32,4 +32,5 @@ urlpatterns = [ | @@ -32,4 +32,5 @@ urlpatterns = [ | ||
32 | url(r'^summernote/', include('django_summernote.urls')), | 32 | url(r'^summernote/', include('django_summernote.urls')), |
33 | ] | 33 | ] |
34 | 34 | ||
35 | -urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) | 35 | +if settings.DEBUG: |
36 | + urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) |
app/templates/home.html
@@ -66,6 +66,7 @@ | @@ -66,6 +66,7 @@ | ||
66 | {% breadcrumb 'Home' 'app:index' %} | 66 | {% breadcrumb 'Home' 'app:index' %} |
67 | {% endblock %} | 67 | {% endblock %} |
68 | 68 | ||
69 | + | ||
69 | {% block render_breadcrumbs %} | 70 | {% block render_breadcrumbs %} |
70 | {% render_breadcrumbs %} | 71 | {% render_breadcrumbs %} |
71 | {% endblock %} | 72 | {% endblock %} |
@@ -77,29 +78,27 @@ | @@ -77,29 +78,27 @@ | ||
77 | </div> | 78 | </div> |
78 | <div class="panel-body"> | 79 | <div class="panel-body"> |
79 | <ul class="nav nav-pills nav-stacked"> | 80 | <ul class="nav nav-pills nav-stacked"> |
80 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
81 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
82 | - {% if user|has_role:'student' or not user.is_staff %} | ||
83 | - <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
84 | - <li><a href="{% url 'course:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
85 | - {% endif %} | ||
86 | - <li><a href="{% url 'core:guest' %}">{% trans 'Courses' %}</a></li> | 81 | + <li> |
82 | + <a href="#menu_courses" class="accordion" data-toggle="collapse">{% trans 'Courses' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> | ||
83 | + <div id="menu_courses" class="collapse"> | ||
84 | + <ul class="nav nav-pill nav-stacked accordion_list"> | ||
85 | + <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
86 | + <li><a href="{% url 'course:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
87 | + {% if user|has_role:'system_admin' or user|has_role:'professor'%} | ||
88 | + <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
89 | + <li><a href="{% url 'course:create' %}">{% trans 'Create Course' %}</a></li> | ||
90 | + <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
91 | + {% endif %} | ||
92 | + </ul> | ||
93 | + </div> | ||
94 | + </li> | ||
95 | + {% block menu %} | ||
96 | + | ||
97 | + {% endblock %} | ||
87 | {% if user|has_role:'system_admin' %} | 98 | {% if user|has_role:'system_admin' %} |
88 | <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | 99 | <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> |
89 | <li> <a href="{% url 'app:settings' %}">{% trans 'Settings' %}</a></li> | 100 | <li> <a href="{% url 'app:settings' %}">{% trans 'Settings' %}</a></li> |
90 | {% endif %} | 101 | {% endif %} |
91 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
92 | - <li> | ||
93 | - <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
94 | - <div id="courses_list" class="collapse"> | ||
95 | - <ul class="nav nav-pill nav-stacked accordion_list"> | ||
96 | - {% for course in courses_list %} | ||
97 | - <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
98 | - {% endfor %} | ||
99 | - </ul> | ||
100 | - </div> | ||
101 | - </li> | ||
102 | - {% endif %} | ||
103 | </ul> | 102 | </ul> |
104 | </div> | 103 | </div> |
105 | </div> | 104 | </div> |
app/templates/home_professor.html
@@ -15,18 +15,6 @@ | @@ -15,18 +15,6 @@ | ||
15 | {% endblock %} | 15 | {% endblock %} |
16 | 16 | ||
17 | {% block sidebar %} | 17 | {% block sidebar %} |
18 | - <div class="panel panel-primary"> | ||
19 | - <div class="panel-heading"> | ||
20 | - <h5>{% trans 'Menu' %}</h5> | ||
21 | - </div> | ||
22 | - <div class="panel-body"> | ||
23 | - <ul class="nav nav-pills nav-stacked"> | ||
24 | - <li><a href="javascript:void(0)">{% trans 'Pending tasks' %}</a></li> | ||
25 | - <li><a href="{% url 'course:create' %}">{% trans 'Create Course' %}</a></li> | ||
26 | - <li><a href="{% url 'course:manage' %}">{% trans 'Manage Course' %}</a></li> | ||
27 | - </ul> | ||
28 | - </div> | ||
29 | - </div> | ||
30 | {% endblock %} | 18 | {% endblock %} |
31 | 19 | ||
32 | {% block content %} | 20 | {% block content %} |
app/templates/home_student.html
@@ -16,19 +16,6 @@ | @@ -16,19 +16,6 @@ | ||
16 | 16 | ||
17 | 17 | ||
18 | {% block sidebar %} | 18 | {% block sidebar %} |
19 | - <div class="panel panel-primary"> | ||
20 | - <div class="panel-heading"> | ||
21 | - <h4>{% trans 'Menu' %}</h4> | ||
22 | - </div> | ||
23 | - <div class="panel-body"> | ||
24 | - <ul class="nav nav-pills nav-stacked"> | ||
25 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
26 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
27 | - <li><a href="{% url 'course:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
28 | - <li><a href="javascript:void(0)">{% trans 'Google accounts' %}</a></li> | ||
29 | - </ul> | ||
30 | - </div> | ||
31 | - </div> | ||
32 | {% endblock %} | 19 | {% endblock %} |
33 | 20 | ||
34 | {% block content %} | 21 | {% block content %} |
core/middleware.py
1 | from datetime import datetime | 1 | from datetime import datetime |
2 | +import time | ||
3 | +from django.core.urlresolvers import resolve | ||
2 | from django.shortcuts import get_object_or_404 | 4 | from django.shortcuts import get_object_or_404 |
3 | import json | 5 | import json |
4 | 6 | ||
@@ -9,36 +11,24 @@ class TimeSpentMiddleware(object): | @@ -9,36 +11,24 @@ class TimeSpentMiddleware(object): | ||
9 | self.get_response = get_response | 11 | self.get_response = get_response |
10 | 12 | ||
11 | def process_request(self, request): | 13 | def process_request(self, request): |
12 | - if not request.is_ajax(): | ||
13 | - log_id = request.session.get('log_id', None) | 14 | + app_names = resolve(request.path).app_names |
14 | 15 | ||
15 | - if not log_id is None: | ||
16 | - log = get_object_or_404(Log, id = log_id) | 16 | + if not 'admin' in app_names: |
17 | + if not request.is_ajax(): | ||
18 | + log_id = request.session.get('log_id', None) | ||
17 | 19 | ||
18 | - date_time_click = datetime.strptime(request.session.get('time_spent'), "%Y-%m-%d %H:%M:%S.%f") | ||
19 | - _now = datetime.now() | ||
20 | - | ||
21 | - time_spent = _now - date_time_click | ||
22 | - | ||
23 | - secs = time_spent.total_seconds() | ||
24 | - hours = int(secs / 3600) | ||
25 | - minutes = int(secs / 60) % 60 | ||
26 | - secs = secs % 60 | 20 | + if not log_id is None: |
21 | + log = get_object_or_404(Log, id = log_id) | ||
27 | 22 | ||
28 | - log_context = json.loads(log.context) | ||
29 | - print(log.context) | 23 | + if type(log.context) == dict: |
24 | + log_context = log.context | ||
25 | + else: | ||
26 | + log_context = json.loads(log.context) | ||
30 | 27 | ||
31 | - time = {} | ||
32 | - time['hours'] = hours | ||
33 | - time['minutes'] = minutes | ||
34 | - time['seconds'] = secs | 28 | + log_context['timestamp_end'] = str(int(time.time())) |
35 | 29 | ||
36 | - log_context['time_spent'] = time | ||
37 | - | ||
38 | - log.context = log_context | ||
39 | - | ||
40 | - log.save() | ||
41 | - | ||
42 | - request.session['log_id'] = None | 30 | + log.context = log_context |
43 | 31 | ||
32 | + log.save() | ||
44 | 33 | ||
34 | + request.session['log_id'] = None |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2016-11-10 15:15 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +import django.contrib.postgres.fields.jsonb | ||
6 | +from django.db import migrations | ||
7 | + | ||
8 | + | ||
9 | +class Migration(migrations.Migration): | ||
10 | + | ||
11 | + dependencies = [ | ||
12 | + ('core', '0003_auto_20161101_1457'), | ||
13 | + ] | ||
14 | + | ||
15 | + operations = [ | ||
16 | + migrations.AlterField( | ||
17 | + model_name='log', | ||
18 | + name='context', | ||
19 | + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, verbose_name='Context'), | ||
20 | + ), | ||
21 | + ] |
core/static/css/base/amadeus.css
@@ -22,6 +22,9 @@ | @@ -22,6 +22,9 @@ | ||
22 | position: absolute; | 22 | position: absolute; |
23 | left: 30%; | 23 | left: 30%; |
24 | } | 24 | } |
25 | +#btn-search{ | ||
26 | + margin-bottom: 0px; | ||
27 | + } | ||
25 | .user-notification-img{ | 28 | .user-notification-img{ |
26 | width:40%; | 29 | width:40%; |
27 | } | 30 | } |
@@ -453,4 +456,4 @@ ul, li { | @@ -453,4 +456,4 @@ ul, li { | ||
453 | 456 | ||
454 | #panel2 .col-md-2, #panel2 .col-md-10{ | 457 | #panel2 .col-md-2, #panel2 .col-md-10{ |
455 | padding-left: 0; | 458 | padding-left: 0; |
456 | -} | ||
457 | \ No newline at end of file | 459 | \ No newline at end of file |
460 | +} |
@@ -0,0 +1,79 @@ | @@ -0,0 +1,79 @@ | ||
1 | + | ||
2 | +var x = 0; | ||
3 | +$(".edit_card").on('click', function() { | ||
4 | + $(".presentation").css('display','none'); | ||
5 | + $(".editation").css('display','block'); | ||
6 | +}) | ||
7 | +$(".edit_card_end").on('click', function() { | ||
8 | + $(".editation").css('display','none'); | ||
9 | + $(".presentation").css('display','block'); | ||
10 | +}) | ||
11 | + | ||
12 | +$("#bot").on('click', function(){ | ||
13 | + x = x+1; | ||
14 | + console.log(2) | ||
15 | + if(x%2 == 0){ | ||
16 | + console.log(0) | ||
17 | + $("#down").attr('class', 'fa fa-caret-square-o-down'); | ||
18 | +} | ||
19 | +else{ | ||
20 | + console.log(1) | ||
21 | + $("#down").attr('class', 'fa fa-caret-square-o-up'); | ||
22 | +} | ||
23 | + | ||
24 | +}) | ||
25 | +$("#bot1").on('click', function(){ | ||
26 | + x = x+1; | ||
27 | + console.log(2) | ||
28 | + if(x%2 == 0){ | ||
29 | + console.log(0) | ||
30 | + $("#down1").attr('class', 'fa fa-caret-square-o-down'); | ||
31 | +} | ||
32 | +else{ | ||
33 | + console.log(1) | ||
34 | + $("#down1").attr('class', 'fa fa-caret-square-o-up'); | ||
35 | +} | ||
36 | + | ||
37 | +}) | ||
38 | + | ||
39 | +$("#bot2").on('click', function(){ | ||
40 | + x = x+1; | ||
41 | + console.log(2) | ||
42 | + if(x%2 == 0){ | ||
43 | + console.log(0) | ||
44 | + $("#down2").attr('class', 'fa fa-caret-square-o-down'); | ||
45 | +} | ||
46 | +else{ | ||
47 | + console.log(1) | ||
48 | + $("#down2").attr('class', 'fa fa-caret-square-o-up'); | ||
49 | +} | ||
50 | + | ||
51 | +}) | ||
52 | + | ||
53 | +$("#bot3").on('click', function(){ | ||
54 | + x = x+1; | ||
55 | + console.log(2) | ||
56 | + if(x%2 == 0){ | ||
57 | + console.log(0) | ||
58 | + $("#down3").attr('class', 'fa fa-caret-square-o-down'); | ||
59 | +} | ||
60 | +else{ | ||
61 | + console.log(1) | ||
62 | + $("#down3").attr('class', 'fa fa-caret-square-o-up'); | ||
63 | +} | ||
64 | + | ||
65 | +}) | ||
66 | +$("#bot4").on('click', function(){ | ||
67 | + x = x+1; | ||
68 | + console.log(2) | ||
69 | + if(x%2 == 0){ | ||
70 | + console.log(0) | ||
71 | + $("#down4").attr('class', 'fa fa-caret-square-o-down'); | ||
72 | +} | ||
73 | +else{ | ||
74 | + console.log(1) | ||
75 | + $("#down4").attr('class', 'fa fa-caret-square-o-up'); | ||
76 | +} | ||
77 | + | ||
78 | +}) | ||
79 | + |
core/templates/base.html
@@ -54,6 +54,12 @@ | @@ -54,6 +54,12 @@ | ||
54 | {% endblock %} | 54 | {% endblock %} |
55 | {% block javascript %} | 55 | {% block javascript %} |
56 | {% endblock %} | 56 | {% endblock %} |
57 | + | ||
58 | + <!-- Summernote --> | ||
59 | + <script src="http://podivej.se/js/summernote.min.js" type="text/javascript"></script> | ||
60 | + <link href="http://podivej.se/css/summernote.css" type="text/css" rel="stylesheet" /> | ||
61 | + <link href="http://podivej.se/css/summernote-bs3.css" type="text/css" rel="stylesheet"> | ||
62 | + | ||
57 | </head> | 63 | </head> |
58 | <body> | 64 | <body> |
59 | {% block nav %} | 65 | {% block nav %} |
@@ -66,20 +72,24 @@ | @@ -66,20 +72,24 @@ | ||
66 | </button> | 72 | </button> |
67 | <a class="navbar-brand" href="{% url 'app:index' %}"><img class="logo" src="{% static 'img/topo-amadeus-white.png' %}" alt="Logo"/></a> | 73 | <a class="navbar-brand" href="{% url 'app:index' %}"><img class="logo" src="{% static 'img/topo-amadeus-white.png' %}" alt="Logo"/></a> |
68 | </div> | 74 | </div> |
69 | - <div class="navbar-collapse collapse navbar-responsive-collapse"> | 75 | + <div class="navbar-collapse collapse navbar-responsive-collapse"> |
70 | <div class="col-md-5 cards-content" id= 'NavBarSearch'> | 76 | <div class="col-md-5 cards-content" id= 'NavBarSearch'> |
71 | <form id="SearchForm" action="{% url 'users:search' %}" method="get" accept-charset="utf-8"> | 77 | <form id="SearchForm" action="{% url 'users:search' %}" method="get" accept-charset="utf-8"> |
72 | <div class="input-group"> | 78 | <div class="input-group"> |
73 | <div class="form-group is-empty" > | 79 | <div class="form-group is-empty" > |
74 | - <input type="text" class="form-control" placeholder="{% trans 'Search Files (.pdf, others) and/or activities' %}" name="search"></div> | 80 | + <input type="text" class="form-control" placeholder="{% trans 'Search Files (.pdf, others) and/or activities' %}" name="search"> |
81 | + </div> | ||
75 | <span class="input-group-btn input-group-sm"> | 82 | <span class="input-group-btn input-group-sm"> |
76 | - <button type="submit" class="btn btn-fab btn-fab-mini"> | ||
77 | - <i class="fa fa-search" aria-hidden="true" style="color:#93C741"></i> | 83 | + <button type="submit" class="btn btn-primary" id="btn-search"> |
84 | + <i class="fa fa-search fa-2x" aria-hidden="true" style="color:#93C741"></i> | ||
78 | </button> | 85 | </button> |
79 | - </span> | 86 | + </span> |
87 | + | ||
88 | + | ||
80 | </div> | 89 | </div> |
81 | </form> | 90 | </form> |
82 | </div> | 91 | </div> |
92 | + | ||
83 | <ul class="nav navbar-nav navbar-right notifications"> | 93 | <ul class="nav navbar-nav navbar-right notifications"> |
84 | <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications"> | 94 | <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications"> |
85 | <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> | 95 | <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> |
@@ -99,7 +109,15 @@ | @@ -99,7 +109,15 @@ | ||
99 | </li> | 109 | </li> |
100 | 110 | ||
101 | <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> | 111 | <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> |
102 | - <li > <a class="link" href="{% url 'users:profile' %}">{{ user }}</a></li> | 112 | + <li > |
113 | + <a href="" data-toggle="dropdown">{{ user }}</a> | ||
114 | + <ul class="dropdown-menu pull-right"> | ||
115 | + <li><a href="{% url 'users:profile' %}">{% trans 'Perfil' %}</a></li> | ||
116 | + <li><a href="{% url 'users:update_profile' %}">{% trans 'Edit Profile' %}</a></li> | ||
117 | + <li><a href="{% url 'users:change_password' %}">{% trans 'Change password' %}</a></li> | ||
118 | + <li><a href="{% url 'users:remove_account' %}">{% trans 'Remove account' %}</a></li> | ||
119 | + </ul> | ||
120 | + </li> | ||
103 | <li data-toggle="tooltip" data-placement="bottom" title data-original-title="log out"> <a href="{% url 'core:logout' %}"><i class="fa fa-sign-out" aria-hidden="true"></i></a></li> | 121 | <li data-toggle="tooltip" data-placement="bottom" title data-original-title="log out"> <a href="{% url 'core:logout' %}"><i class="fa fa-sign-out" aria-hidden="true"></i></a></li> |
104 | </ul> | 122 | </ul> |
105 | </div> | 123 | </div> |
@@ -109,53 +127,6 @@ | @@ -109,53 +127,6 @@ | ||
109 | <div class="row"> | 127 | <div class="row"> |
110 | <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"> | 128 | <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"> |
111 | {% block sidebar %} | 129 | {% block sidebar %} |
112 | - <div class="panel panel-primary navigation"> | ||
113 | - <div class="panel-heading"> | ||
114 | - <h4>{% trans "Menu" %}</h4> | ||
115 | - </div> | ||
116 | - <div class="panel-body"> | ||
117 | - <ul class="nav nav-pills nav-stacked"> | ||
118 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
119 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
120 | - {% if user|has_role:'student' or not user.is_staff %} | ||
121 | - <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
122 | - <li><a href="{% url 'core:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
123 | - {% endif %} | ||
124 | - <li><a href="{% url 'core:guest' %}">{% trans 'Courses' %}</a></li> | ||
125 | - {% if user|has_role:'system_admin' %} | ||
126 | - <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | ||
127 | - {% endif %} | ||
128 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
129 | - <li> | ||
130 | - <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
131 | - <div id="courses_list" class="collapse"> | ||
132 | - <ul class="nav nav-pill nav-stacked accordion_list"> | ||
133 | - {% for course in courses_list %} | ||
134 | - <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
135 | - {% endfor %} | ||
136 | - </ul> | ||
137 | - </div> | ||
138 | - </li> | ||
139 | - {% endif %} | ||
140 | - </ul> | ||
141 | - </div> | ||
142 | - </div> | ||
143 | - | ||
144 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
145 | - | ||
146 | - <div class="panel panel-primary navigation"> | ||
147 | - <div class="panel-heading"> | ||
148 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | ||
149 | - </div> | ||
150 | - <div class="panel-body"> | ||
151 | - <ul class="nav nav-pills nav-stacked"> | ||
152 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category'%}</a></li> | ||
153 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
154 | - </ul> | ||
155 | - </div> | ||
156 | - </div> | ||
157 | - | ||
158 | - {% endif %} | ||
159 | {% endblock %} | 130 | {% endblock %} |
160 | </div> | 131 | </div> |
161 | <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"> | 132 | <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"> |
courses/serializers.py
@@ -4,26 +4,17 @@ from users.serializers import UserSerializer | @@ -4,26 +4,17 @@ from users.serializers import UserSerializer | ||
4 | 4 | ||
5 | class CourseSerializer(serializers.ModelSerializer): | 5 | class CourseSerializer(serializers.ModelSerializer): |
6 | #The set comes from the ManyToMany Relationship in django | 6 | #The set comes from the ManyToMany Relationship in django |
7 | - students = UserSerializer(many=True) | ||
8 | - professors = UserSerializer(many=True) | ||
9 | - category = serializers.ReadOnlyField(source ='category.name') | ||
10 | class Meta: | 7 | class Meta: |
11 | model = Course | 8 | model = Course |
12 | fields = ('name', 'slug', 'objectivies', 'content', 'max_students', 'create_date', | 9 | fields = ('name', 'slug', 'objectivies', 'content', 'max_students', 'create_date', |
13 | 'init_register_date', 'end_register_date', 'init_date', 'end_date', 'public', 'category' ,'students', 'professors') | 10 | 'init_register_date', 'end_register_date', 'init_date', 'end_date', 'public', 'category' ,'students', 'professors') |
14 | 11 | ||
15 | class SubjectSerializer(serializers.ModelSerializer): | 12 | class SubjectSerializer(serializers.ModelSerializer): |
16 | - students = UserSerializer(many=True) | ||
17 | - professors = UserSerializer(many=True) | ||
18 | - course = serializers.ReadOnlyField(source='course.name') | ||
19 | - category = serializers.ReadOnlyField(source ='category.name') | ||
20 | class Meta: | 13 | class Meta: |
21 | model = Subject | 14 | model = Subject |
22 | fields = ('name','slug','description','visible','init_date','course','category','professors','course','students') | 15 | fields = ('name','slug','description','visible','init_date','course','category','professors','course','students') |
23 | 16 | ||
24 | class TopicSerializer(serializers.ModelSerializer): | 17 | class TopicSerializer(serializers.ModelSerializer): |
25 | - subject = serializers.ReadOnlyField(source='subject.name') | ||
26 | - owner = serializers.ReadOnlyField(source='owner.username') | ||
27 | class Meta: | 18 | class Meta: |
28 | model = Topic | 19 | model = Topic |
29 | fields = ('name', 'slug','description','create_date','update_date','visible','owner','subject') | 20 | fields = ('name', 'slug','description','create_date','update_date','visible','owner','subject') |
courses/static/js/topic_editation_presentation.js
1 | 1 | ||
2 | $(document).ready(function(){ | 2 | $(document).ready(function(){ |
3 | - $(".editation").hide(); | 3 | + $(".editation").hide(); |
4 | }); | 4 | }); |
5 | + | ||
5 | function show_editation(id_topic){ | 6 | function show_editation(id_topic){ |
6 | $(".presentation_"+ id_topic).hide(); | 7 | $(".presentation_"+ id_topic).hide(); |
7 | $(".editation_"+ id_topic).show(); | 8 | $(".editation_"+ id_topic).show(); |
9 | + $('#summernote').summernote({height: 300}); | ||
8 | }; | 10 | }; |
9 | 11 | ||
10 | function show_presentation(id_topic){ | 12 | function show_presentation(id_topic){ |
courses/templates/category/create.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags %} | 3 | {% load static i18n permission_tags %} |
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
@@ -10,48 +10,6 @@ | @@ -10,48 +10,6 @@ | ||
10 | </ol> | 10 | </ol> |
11 | {% endblock %} | 11 | {% endblock %} |
12 | 12 | ||
13 | -{% block sidebar %} | ||
14 | - <div class="panel panel-primary navigation"> | ||
15 | - <div class="panel-heading"> | ||
16 | - <h5>{% trans 'Menu' %}</h5> | ||
17 | - </div> | ||
18 | - <div class="panel-body"> | ||
19 | - <ul class="nav nav-pills nav-stacked"> | ||
20 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
21 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
22 | - </ul> | ||
23 | - </div> | ||
24 | - </div> | ||
25 | - | ||
26 | -{% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
27 | - | ||
28 | - <div class="panel panel-primary navigation"> | ||
29 | - <div class="panel-heading"> | ||
30 | - <h3 class="panel-title">{% trans 'Actions' %}</h3> | ||
31 | - </div> | ||
32 | - <div class="panel-body"> | ||
33 | - <ul class="nav nav-pills nav-stacked"> | ||
34 | - <li><a href="{% url 'course:create' %}">{% trans 'Create Course' %}</a></li> | ||
35 | - </ul> | ||
36 | - </div> | ||
37 | - </div> | ||
38 | - | ||
39 | - | ||
40 | - <div class="panel panel-primary navigation"> | ||
41 | - <div class="panel-heading"> | ||
42 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | ||
43 | - </div> | ||
44 | - <div class="panel-body"> | ||
45 | - <ul class="nav nav-pills nav-stacked"> | ||
46 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
47 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
48 | - </ul> | ||
49 | - </div> | ||
50 | - </div> | ||
51 | -{% endif %} | ||
52 | - | ||
53 | -{% endblock %} | ||
54 | - | ||
55 | {% block content %} | 13 | {% block content %} |
56 | <div class="card card-content"> | 14 | <div class="card card-content"> |
57 | <div class="card-body"> | 15 | <div class="card-body"> |
courses/templates/category/index.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | {% load static i18n permission_tags %} | 4 | {% load static i18n permission_tags %} |
@@ -11,46 +11,6 @@ | @@ -11,46 +11,6 @@ | ||
11 | </ol> | 11 | </ol> |
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | -{% block sidebar %} | ||
15 | - <div class="panel panel-primary navigation"> | ||
16 | - <div class="panel-heading"> | ||
17 | - <h5>{% trans 'Menu' %}</h5> | ||
18 | - </div> | ||
19 | - <div class="panel-body"> | ||
20 | - <ul class="nav nav-pills nav-stacked"> | ||
21 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
22 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
23 | - </ul> | ||
24 | - </div> | ||
25 | - </div> | ||
26 | - | ||
27 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
28 | - | ||
29 | - <div class="panel panel-primary navigation"> | ||
30 | - <div class="panel-heading"> | ||
31 | - <h3 class="panel-title">{% trans 'Actions' %}</h3> | ||
32 | - </div> | ||
33 | - <div class="panel-body"> | ||
34 | - <ul class="nav nav-pills nav-stacked"> | ||
35 | - <li><a href="{% url 'course:create' %}">{% trans 'Create Course' %}</a></li> | ||
36 | - </ul> | ||
37 | - </div> | ||
38 | - </div> | ||
39 | - | ||
40 | - <div class="panel panel-primary navigation"> | ||
41 | - <div class="panel-heading"> | ||
42 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | ||
43 | - </div> | ||
44 | - <div class="panel-body"> | ||
45 | - <ul class="nav nav-pills nav-stacked"> | ||
46 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
47 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
48 | - </ul> | ||
49 | - </div> | ||
50 | - </div> | ||
51 | -{% endif %} | ||
52 | -{% endblock %} | ||
53 | - | ||
54 | {% block content %} | 14 | {% block content %} |
55 | {% if messages %} | 15 | {% if messages %} |
56 | {% for message in messages %} | 16 | {% for message in messages %} |
@@ -83,7 +43,7 @@ | @@ -83,7 +43,7 @@ | ||
83 | </ul> | 43 | </ul> |
84 | </div> | 44 | </div> |
85 | </div> | 45 | </div> |
86 | - | 46 | + |
87 | </div> | 47 | </div> |
88 | </div> | 48 | </div> |
89 | </div> | 49 | </div> |
@@ -114,4 +74,4 @@ | @@ -114,4 +74,4 @@ | ||
114 | </div> | 74 | </div> |
115 | <div class="row" id="modal_category"> | 75 | <div class="row" id="modal_category"> |
116 | <script src="{% static 'js/modal_category.js' %}"></script> | 76 | <script src="{% static 'js/modal_category.js' %}"></script> |
117 | -{% endblock %} | ||
118 | \ No newline at end of file | 77 | \ No newline at end of file |
78 | +{% endblock %} |
courses/templates/category/update.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | {% load static i18n permission_tags %} | 4 | {% load static i18n permission_tags %} |
@@ -11,45 +11,6 @@ | @@ -11,45 +11,6 @@ | ||
11 | </ol> | 11 | </ol> |
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | -{% block sidebar %} | ||
15 | - <div class="panel panel-primary navigation"> | ||
16 | - <div class="panel-heading"> | ||
17 | - <h5>{% trans 'Menu' %}</h5> | ||
18 | - </div> | ||
19 | - <div class="panel-body"> | ||
20 | - <ul class="nav nav-pills nav-stacked"> | ||
21 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
22 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
23 | - </ul> | ||
24 | - </div> | ||
25 | - </div> | ||
26 | - | ||
27 | -{% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
28 | - | ||
29 | - <div class="panel panel-primary navigation"> | ||
30 | - <div class="panel-heading"> | ||
31 | - <h3 class="panel-title">{% trans 'Actions' %}</h3> | ||
32 | - </div> | ||
33 | - <div class="panel-body"> | ||
34 | - <ul class="nav nav-pills nav-stacked"> | ||
35 | - <li><a href="{% url 'course:create' %}">{% trans 'Create Course' %}</a></li> | ||
36 | - </ul> | ||
37 | - </div> | ||
38 | - </div> | ||
39 | - <div class="panel panel-primary navigation"> | ||
40 | - <div class="panel-heading"> | ||
41 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | ||
42 | - </div> | ||
43 | - <div class="panel-body"> | ||
44 | - <ul class="nav nav-pills nav-stacked"> | ||
45 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
46 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
47 | - </ul> | ||
48 | - </div> | ||
49 | - </div> | ||
50 | -{% endif %} | ||
51 | -{% endblock %} | ||
52 | - | ||
53 | {% block content %} | 14 | {% block content %} |
54 | {% if messages %} | 15 | {% if messages %} |
55 | {% for message in messages %} | 16 | {% for message in messages %} |
courses/templates/course/course_card.html
@@ -7,13 +7,13 @@ | @@ -7,13 +7,13 @@ | ||
7 | <div class="col-md-1 moreAccordion" data-toggle="collapse" data-parent="#accordion-{{course.slug}}" href=".collapseOne-{{course.slug}}" aria-expanded="false" aria-controls="collapseOne-{{course.slug}}"> | 7 | <div class="col-md-1 moreAccordion" data-toggle="collapse" data-parent="#accordion-{{course.slug}}" href=".collapseOne-{{course.slug}}" aria-expanded="false" aria-controls="collapseOne-{{course.slug}}"> |
8 | <button class="btn btn-default btn-sm caret-square"><i class="fa fa-caret-square-o-down fa-2x" aria-hidden="true"></i></button> | 8 | <button class="btn btn-default btn-sm caret-square"><i class="fa fa-caret-square-o-down fa-2x" aria-hidden="true"></i></button> |
9 | </div> | 9 | </div> |
10 | - <div class="col-xs-9 col-md-4 titleTopic"> | 10 | + <div class="col-xs-5 col-md-5 titleTopic"> |
11 | <a role="button" href="{% url 'course:view' course.slug %}"> | 11 | <a role="button" href="{% url 'course:view' course.slug %}"> |
12 | <h4>{{course.name}}</h4> | 12 | <h4>{{course.name}}</h4> |
13 | </a> | 13 | </a> |
14 | </div> | 14 | </div> |
15 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} | 15 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} |
16 | - <div class="col-xs-4 col-md-6 divMoreActions" > | 16 | + <div class="col-xs-6 col-md-6 divMoreActions" > |
17 | <div class="btn-group"> | 17 | <div class="btn-group"> |
18 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 18 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
19 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | 19 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> |
@@ -55,11 +55,11 @@ | @@ -55,11 +55,11 @@ | ||
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | 57 | ||
58 | -<div class="modal fade" id="replicateCourse" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | 58 | +<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
59 | <div class="modal-dialog" role="document"> | 59 | <div class="modal-dialog" role="document"> |
60 | <div class="modal-content"> | 60 | <div class="modal-content"> |
61 | <div class="modal-header"> | 61 | <div class="modal-header"> |
62 | - <h4 class="modal-title" id="myModalLabel">{% trans 'Repicate Course' %}</h4> | 62 | + <h4 class="modal-title">{% trans 'Repicate Course' %}</h4> |
63 | </div> | 63 | </div> |
64 | <div class="modal-body"> | 64 | <div class="modal-body"> |
65 | <section> | 65 | <section> |
@@ -73,4 +73,4 @@ | @@ -73,4 +73,4 @@ | ||
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | - <script type="text/javascript" src="{% static 'js/course.js' %}"></script> | ||
77 | \ No newline at end of file | 76 | \ No newline at end of file |
77 | + <script type="text/javascript" src="{% static 'js/course.js' %}"></script> |
courses/templates/course/create.html
@@ -12,41 +12,48 @@ | @@ -12,41 +12,48 @@ | ||
12 | 12 | ||
13 | {% block content %} | 13 | {% block content %} |
14 | <div class="card card-content"> | 14 | <div class="card card-content"> |
15 | - <div class="card-body"> | ||
16 | - <form method="post" action="" enctype="multipart/form-data"> | ||
17 | - {% csrf_token %} | ||
18 | - {% for field in form %} | ||
19 | - <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
20 | - <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
21 | - {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} | ||
22 | - <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | 15 | + <div class="card-body"> |
16 | + <form method="post" action="" enctype="multipart/form-data"> | ||
17 | + {% csrf_token %} | ||
18 | + {% for field in form %} | ||
19 | + <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
20 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
21 | + {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} | ||
22 | + <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
23 | 23 | ||
24 | - {% else %} | ||
25 | - {% render_field field class='form-control' %} | ||
26 | - {% endif %} | ||
27 | - <span class="help-block">{{ field.help_text }}</span> | ||
28 | - {% if field.errors %} | ||
29 | - <div class="row"> | ||
30 | - </br> | ||
31 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
32 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
33 | - <span aria-hidden="true">×</span> | ||
34 | - </button> | ||
35 | - <ul> | ||
36 | - {% for error in field.errors %} | ||
37 | - <li>{{ error }}</li> | ||
38 | - {% endfor %} | ||
39 | - </ul> | ||
40 | - </div> | ||
41 | - </div> | ||
42 | - {% endif %} | 24 | + {% else %} |
25 | + {% render_field field class='form-control' %} | ||
26 | + {% endif %} | ||
27 | + <span class="help-block">{{ field.help_text }}</span> | ||
28 | + {% if field.errors %} | ||
29 | + <div class="row"> | ||
30 | + </br> | ||
31 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
32 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
33 | + <span aria-hidden="true">×</span> | ||
34 | + </button> | ||
35 | + <ul> | ||
36 | + {% for error in field.errors %} | ||
37 | + <li>{{ error }}</li> | ||
38 | + {% endfor %} | ||
39 | + </ul> | ||
43 | </div> | 40 | </div> |
44 | - {% endfor %} | ||
45 | - <div class="row text-center"> | ||
46 | - <input type="submit" value="{% trans 'Create' %}" class="btn btn-primary" /> | ||
47 | - </div> | ||
48 | - </form> | ||
49 | - </div> | 41 | + </div> |
42 | + {% endif %} | ||
43 | + </div> | ||
44 | + {% endfor %} | ||
45 | + <div class="row text-center"> | ||
46 | + <input type="submit" value="{% trans 'Create' %}" class="btn btn-primary btn-raised" /> | ||
47 | + </div> | ||
48 | + </form> | ||
49 | + </div> | ||
50 | </div> | 50 | </div> |
51 | </br> | 51 | </br> |
52 | +<script type="text/javascript"> | ||
53 | + var locale = navigator.language || navigator.userLanguage; | ||
54 | + | ||
55 | + $('.date-picker').datepicker({ | ||
56 | + language: locale, | ||
57 | + }); | ||
58 | +</script> | ||
52 | {% endblock %} | 59 | {% endblock %} |
courses/templates/course/delete.html
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <!-- Modal Footer --> | 20 | <!-- Modal Footer --> |
21 | <div class="modal-footer"> | 21 | <div class="modal-footer"> |
22 | <!-- Don't remove that!!! --> | 22 | <!-- Don't remove that!!! --> |
23 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | 23 | + <button type="button" class="btn btn-default btn-raised" data-dismiss="modal">{% trans "Close" %}</button> |
24 | <button type="submit" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> | 24 | <button type="submit" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> |
25 | <script> | 25 | <script> |
26 | $("#delete_form").submit(function(event) { | 26 | $("#delete_form").submit(function(event) { |
courses/templates/course/home.html
@@ -1,23 +0,0 @@ | @@ -1,23 +0,0 @@ | ||
1 | -{% extends 'app/base.html' %} | ||
2 | - | ||
3 | -{% load static i18n %} | ||
4 | -{% load widget_tweaks %} | ||
5 | - | ||
6 | -{% block breadcrumbs %} | ||
7 | - <ol class="breadcrumb"> | ||
8 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
9 | - <li class="active">{% trans 'Home Course' %}</li> | ||
10 | - </ol> | ||
11 | -{% endblock %} | ||
12 | - | ||
13 | -{% block sidebar %} | ||
14 | - <div class="list-group"> | ||
15 | - <a href="{% url 'course:manage' %}" class="list-group-item"> | ||
16 | - {% trans 'Courses' %} | ||
17 | - </a> | ||
18 | - </div> | ||
19 | -{% endblock %} | ||
20 | - | ||
21 | -{% block content %} | ||
22 | - | ||
23 | -{% endblock %} |
courses/templates/course/index.html
1 | -{% extends 'home_professor.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags %} | 3 | {% load static i18n permission_tags %} |
4 | {% load django_bootstrap_breadcrumbs %} | 4 | {% load django_bootstrap_breadcrumbs %} |
@@ -10,77 +10,6 @@ | @@ -10,77 +10,6 @@ | ||
10 | 10 | ||
11 | {% endblock %} | 11 | {% endblock %} |
12 | 12 | ||
13 | -{% block sidebar %} | ||
14 | - <div class="panel panel-primary"> | ||
15 | - <div class="panel-heading"> | ||
16 | - <h4>{% trans 'Menu' %}</h4> | ||
17 | - </div> | ||
18 | - <div class="panel-body"> | ||
19 | - <ul class="nav nav-pills nav-stacked"> | ||
20 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
21 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
22 | - {% if user|has_role:'student' or not user.is_staff %} | ||
23 | - <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
24 | - <li><a href="{% url 'course:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
25 | - {% endif %} | ||
26 | - <li><a href="{% url 'core:guest' %}">{% trans 'Courses' %}</a></li> | ||
27 | - {% if user|has_role:'system_admin' %} | ||
28 | - <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | ||
29 | - {% endif %} | ||
30 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
31 | - <li> | ||
32 | - <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
33 | - <div id="courses_list" class="collapse"> | ||
34 | - <ul class="nav nav-pill nav-stacked accordion_list"> | ||
35 | - {% for course in courses_list %} | ||
36 | - <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
37 | - {% endfor %} | ||
38 | - </ul> | ||
39 | - </div> | ||
40 | - </li> | ||
41 | - {% endif %} | ||
42 | - </ul> | ||
43 | - </div> | ||
44 | - </div> | ||
45 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
46 | - <div class="panel panel-primary"> | ||
47 | - <div class="panel-heading"> | ||
48 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | ||
49 | - </div> | ||
50 | - <div class="panel-body"> | ||
51 | - <ul class="nav nav-pills nav-stacked"> | ||
52 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
53 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
54 | - </ul> | ||
55 | - </div> | ||
56 | - </div> | ||
57 | - {% endif %} | ||
58 | - <div class="panel-group" id="accordion"> | ||
59 | - <div class="panel panel-primary"> | ||
60 | - <div class="panel-heading"> | ||
61 | - <h4 class="panel-title"> | ||
62 | - <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> | ||
63 | - </span>{% trans 'Categorys' %}</a> | ||
64 | - </h4> | ||
65 | - </div> | ||
66 | - <div id="collapseOne" class="panel-collapse collapse in"> | ||
67 | - <div class="panel-body"> | ||
68 | - <table class="table"> | ||
69 | - {% for category in categorys_courses %} | ||
70 | - <tr> | ||
71 | - <td> | ||
72 | - <a href="?category={{category.name}}">{{category.name}}</a> | ||
73 | - </td> | ||
74 | - </tr> | ||
75 | - {% endfor %} | ||
76 | - </table> | ||
77 | - </div> | ||
78 | - </div> | ||
79 | - </div> | ||
80 | - </div> | ||
81 | - | ||
82 | -{% endblock %} | ||
83 | - | ||
84 | {% block content %} | 13 | {% block content %} |
85 | {% if messages %} | 14 | {% if messages %} |
86 | {% for message in messages %} | 15 | {% for message in messages %} |
@@ -94,7 +23,7 @@ | @@ -94,7 +23,7 @@ | ||
94 | {% endif %} | 23 | {% endif %} |
95 | 24 | ||
96 | <div class="col-md-12 cards-content"> | 25 | <div class="col-md-12 cards-content"> |
97 | - <form id="searchform" action="{% url 'course:manage' %}" method="get" accept-charset="utf-8"> | 26 | + <form id="searchform" method="get" accept-charset="utf-8"> |
98 | <div class="input-group"> | 27 | <div class="input-group"> |
99 | <div class="form-group is-empty"> | 28 | <div class="form-group is-empty"> |
100 | <input type="text" class="form-control" placeholder="Search Courses" name="q"></div> | 29 | <input type="text" class="form-control" placeholder="Search Courses" name="q"></div> |
@@ -122,21 +51,18 @@ | @@ -122,21 +51,18 @@ | ||
122 | </div> | 51 | </div> |
123 | </div> | 52 | </div> |
124 | <div id="{{category.slug}}" class="panel-collapse collapse"> | 53 | <div id="{{category.slug}}" class="panel-collapse collapse"> |
125 | - {% for course in category.course_category.all %} | ||
126 | - {% if user in course.students.all or user in course.professors.all or user|has_role:'system_admin' %} | 54 | + {% for course in category.course_category %} |
55 | + {# {% if user in course.students.all or user in course.professors.all or user|has_role:'system_admin' %}#} | ||
127 | {% include "course/course_card.html" %} | 56 | {% include "course/course_card.html" %} |
128 | - {% endif %} | 57 | + {# {% endif %}#} |
129 | {% endfor %} | 58 | {% endfor %} |
130 | </div> | 59 | </div> |
131 | </div> | 60 | </div> |
132 | </div> | 61 | </div> |
133 | - | ||
134 | - | 62 | + |
63 | + | ||
135 | {% endfor %} | 64 | {% endfor %} |
136 | </div> | 65 | </div> |
137 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
138 | - <a href="{% url 'course:create' %}" class="btn btn-primary btn-fab float-button"><i class="fa fa-plus material-icons"></i></a> | ||
139 | - {% endif %} | ||
140 | <div class="col-md-12"> | 66 | <div class="col-md-12"> |
141 | <nav aria-label="Page navigation"> | 67 | <nav aria-label="Page navigation"> |
142 | <ul class="pagination"> | 68 | <ul class="pagination"> |
courses/templates/course/replicate.html
@@ -4,132 +4,139 @@ | @@ -4,132 +4,139 @@ | ||
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
5 | 5 | ||
6 | {% block breadcrumbs %} | 6 | {% block breadcrumbs %} |
7 | - <ol class="breadcrumb"> | ||
8 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
9 | - <li class="active">{% trans 'Replicate Course' %}</li> | ||
10 | - </ol> | 7 | +<ol class="breadcrumb"> |
8 | + <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
9 | + <li class="active">{% trans 'Replicate Course' %}</li> | ||
10 | +</ol> | ||
11 | {% endblock %} | 11 | {% endblock %} |
12 | 12 | ||
13 | {% block content %} | 13 | {% block content %} |
14 | <div class="card card-content"> | 14 | <div class="card card-content"> |
15 | - <div class="card-body"> | ||
16 | - <form method="post" action="" enctype="multipart/form-data">{% csrf_token %} | ||
17 | - <div class="form-group is-fileinput"> | ||
18 | - <label for="id_name">{% trans 'Name' %}</label> | ||
19 | - | ||
20 | - | ||
21 | - <input class="form-control" id="id_name" maxlength="100" name="name" type="text" required="" value="{{course.name}}"> | ||
22 | - | ||
23 | - <span class="help-block">{% trans 'Course name' %}</span> | ||
24 | - | ||
25 | - </div> | ||
26 | - | ||
27 | - <div class="form-group is-fileinput"> | ||
28 | - <label for="id_objectivies">{% trans 'Objectives' %}</label> | ||
29 | - | ||
30 | - <textarea class="form-control" cols="80" id="id_objectivies" name="objectivies" rows="5">{{course.objectivies}}</textarea> | ||
31 | - | ||
32 | - <span class="help-block">{% trans 'Course objective' %}</span> | ||
33 | - | ||
34 | - </div> | ||
35 | - | ||
36 | - <div class="form-group is-fileinput"> | ||
37 | - <label for="id_content">{% trans 'Content' %}</label> | ||
38 | - | ||
39 | - | ||
40 | - <textarea class="form-control" cols="80" id="id_content" name="content" rows="5">{{course.content}}</textarea> | ||
41 | - | ||
42 | - <span class="help-block">{% trans 'Course modules' %}</span> | ||
43 | - | ||
44 | - </div> | ||
45 | - | ||
46 | - <div class="form-group is-fileinput"> | ||
47 | - <label for="id_max_students">{% trans 'Number of studets maximum' %}</label> | ||
48 | - | ||
49 | - | ||
50 | - <input class="form-control" id="id_max_students" min="0" name="max_students" type="number" value="{{course.max_students}}"> | ||
51 | - | ||
52 | - <span class="help-block">{% trans 'Max number of students that a class can have' %}</span> | ||
53 | - | ||
54 | - </div> | ||
55 | - | ||
56 | - <div class="form-group is-fileinput"> | ||
57 | - <label for="id_init_register_date">{% trans 'Course registration start date' %}</label> | ||
58 | - | ||
59 | - | ||
60 | - <input type="text" class="form-control date-picker" name="init_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
61 | - | ||
62 | - <span class="help-block">{% trans 'Date that starts the registration period of the course (dd/mm/yyyy)' %}</span> | ||
63 | - | ||
64 | - </div> | ||
65 | - | ||
66 | - <div class="form-group is-fileinput"> | ||
67 | - <label for="id_end_register_date">{% trans 'Course registration end date' %}</label> | ||
68 | - | ||
69 | - | ||
70 | - <input type="text" class="form-control date-picker" name="end_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
71 | - | ||
72 | - <span class="help-block">{% trans 'Date that ends the registration period of the course (dd/mm/yyyy)' %}</span> | ||
73 | - | ||
74 | - </div> | ||
75 | - | ||
76 | - <div class="form-group is-fileinput"> | ||
77 | - <label for="id_init_date">{% trans 'Course start date' %}</label> | ||
78 | - | ||
79 | - | ||
80 | - <input type="text" class="form-control date-picker" name="init_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
81 | - | ||
82 | - <span class="help-block">{% trans 'Date that the course starts (dd/mm/yyyy)' %}</span> | ||
83 | - | ||
84 | - </div> | ||
85 | - | ||
86 | - <div class="form-group is-fileinput"> | ||
87 | - <label for="id_end_date">{% trans 'Course end date' %}</label> | ||
88 | - | ||
89 | - | ||
90 | - <input type="text" class="form-control date-picker" name="end_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
91 | - | ||
92 | - <span class="help-block">{% trans 'Date that the course ends (dd/mm/yyyy)' %}</span> | ||
93 | - | ||
94 | - </div> | ||
95 | - | ||
96 | - <div class="form-group is-fileinput"> | ||
97 | - <label for="id_image">{% trans 'Imagem' %}</label> | ||
98 | - | ||
99 | - | ||
100 | - <input class="form-control" id="id_image" name="image" type="file"> | ||
101 | - <div class="input-group"> | ||
102 | - <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."> | ||
103 | - <span class="input-group-btn input-group-sm"> | ||
104 | - <button type="button" class="btn btn-fab btn-fab-mini"> | ||
105 | - <i class="material-icons">{% trans 'attach_file' %}</i> | ||
106 | - </button> | ||
107 | - </span> | ||
108 | - </div> | ||
109 | - | ||
110 | - <span class="help-block">{% trans 'Representative image of the course' %}</span> | ||
111 | - | ||
112 | - </div> | ||
113 | - | ||
114 | - <div class="form-group is-fileinput"> | ||
115 | - <label for="id_category">{% trans 'CourseCategory' %}</label> | ||
116 | - | ||
117 | - | ||
118 | - <select class="form-control" id="id_category" name="category" required=""> | ||
119 | - {% for category in categorys_courses %} | ||
120 | - <option value="{{category.id}}">{{category}}</option> | ||
121 | - {% endfor %} | ||
122 | - </select> | ||
123 | - | ||
124 | - <span class="help-block">{% trans 'CourseCategory which the course belongs' %}</span> | ||
125 | - | ||
126 | - </div> | ||
127 | - | ||
128 | - <div class="row text-center"> | ||
129 | - <input type="submit" value="Create" class="btn btn-primary"> | ||
130 | - </div> | ||
131 | - </form> | ||
132 | - </div> | 15 | + <div class="card-body"> |
16 | + <form method="post" action="" enctype="multipart/form-data"> | ||
17 | + {% csrf_token %} | ||
18 | + <div class="form-group is-fileinput"> | ||
19 | + <label for="id_name">{% trans 'Name' %}</label> | ||
20 | + | ||
21 | + | ||
22 | + <input class="form-control" id="id_name" maxlength="100" name="name" type="text" required="" value="{{course.name}}"> | ||
23 | + | ||
24 | + <span class="help-block">{% trans 'Course name' %}</span> | ||
25 | + | ||
26 | + </div> | ||
27 | + | ||
28 | + <div class="form-group is-fileinput"> | ||
29 | + <label for="id_objectivies">{% trans 'Objectives' %}</label> | ||
30 | + | ||
31 | + <textarea class="form-control" cols="80" id="id_objectivies" name="objectivies" rows="5">{{ course.objectivies }}</textarea> | ||
32 | + | ||
33 | + <span class="help-block">{% trans 'Course objective' %}</span> | ||
34 | + | ||
35 | + </div> | ||
36 | + | ||
37 | + <div class="form-group is-fileinput"> | ||
38 | + <label for="id_content">{% trans 'Content' %}</label> | ||
39 | + | ||
40 | + | ||
41 | + <textarea class="form-control" cols="80" id="id_content" name="content" rows="5">{{course.content}}</textarea> | ||
42 | + | ||
43 | + <span class="help-block">{% trans 'Course modules' %}</span> | ||
44 | + | ||
45 | + </div> | ||
46 | + | ||
47 | + <div class="form-group is-fileinput"> | ||
48 | + <label for="id_max_students">{% trans 'Number of studets maximum' %}</label> | ||
49 | + | ||
50 | + | ||
51 | + <input class="form-control" id="id_max_students" min="0" name="max_students" type="number" value="{{course.max_students}}"> | ||
52 | + | ||
53 | + <span class="help-block">{% trans 'Max number of students that a class can have' %}</span> | ||
54 | + | ||
55 | + </div> | ||
56 | + | ||
57 | + <div class="form-group is-fileinput"> | ||
58 | + <label for="id_init_register_date">{% trans 'Course registration start date' %}</label> | ||
59 | + | ||
60 | + | ||
61 | + <input type="text" class="form-control date-picker" name="init_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
62 | + | ||
63 | + <span class="help-block">{% trans 'Date that starts the registration period of the course (dd/mm/yyyy)' %}</span> | ||
64 | + | ||
65 | + </div> | ||
66 | + | ||
67 | + <div class="form-group is-fileinput"> | ||
68 | + <label for="id_end_register_date">{% trans 'Course registration end date' %}</label> | ||
69 | + | ||
70 | + | ||
71 | + <input type="text" class="form-control date-picker" name="end_register_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
72 | + | ||
73 | + <span class="help-block">{% trans 'Date that ends the registration period of the course (dd/mm/yyyy)' %}</span> | ||
74 | + | ||
75 | + </div> | ||
76 | + | ||
77 | + <div class="form-group is-fileinput"> | ||
78 | + <label for="id_init_date">{% trans 'Course start date' %}</label> | ||
79 | + | ||
80 | + | ||
81 | + <input type="text" class="form-control date-picker" name="init_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
82 | + | ||
83 | + <span class="help-block">{% trans 'Date that the course starts (dd/mm/yyyy)' %}</span> | ||
84 | + | ||
85 | + </div> | ||
86 | + | ||
87 | + <div class="form-group is-fileinput"> | ||
88 | + <label for="id_end_date">{% trans 'Course end date' %}</label> | ||
89 | + | ||
90 | + | ||
91 | + <input type="text" class="form-control date-picker" name="end_date" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> | ||
92 | + | ||
93 | + <span class="help-block">{% trans 'Date that the course ends (dd/mm/yyyy)' %}</span> | ||
94 | + | ||
95 | + </div> | ||
96 | + | ||
97 | + <div class="form-group is-fileinput"> | ||
98 | + <label for="id_image">{% trans 'Imagem' %}</label> | ||
99 | + | ||
100 | + | ||
101 | + <input class="form-control" id="id_image" name="image" type="file"> | ||
102 | + <div class="input-group"> | ||
103 | + <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."> | ||
104 | + <span class="input-group-btn input-group-sm"> | ||
105 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
106 | + <i class="material-icons">{% trans 'attach_file' %}</i> | ||
107 | + </button> | ||
108 | + </span> | ||
109 | + </div> | ||
110 | + | ||
111 | + <span class="help-block">{% trans 'Representative image of the course' %}</span> | ||
112 | + | ||
113 | + </div> | ||
114 | + | ||
115 | + <div class="form-group is-fileinput"> | ||
116 | + <label for="id_category">{% trans 'CourseCategory' %}</label> | ||
117 | + | ||
118 | + | ||
119 | + <select class="form-control" id="id_category" name="category" required=""> | ||
120 | + {% for category in categorys_courses %} | ||
121 | + <option value="{{category.id}}">{{category}}</option> | ||
122 | + {% endfor %} | ||
123 | + </select> | ||
124 | + | ||
125 | + <span class="help-block">{% trans 'CourseCategory which the course belongs' %}</span> | ||
126 | + | ||
127 | + </div> | ||
128 | + | ||
129 | + <div class="row text-center"> | ||
130 | + <input type="submit" value="Create" class="btn btn-primary btn-raised"> | ||
131 | + </div> | ||
132 | + </form> | ||
133 | + </div> | ||
133 | </div> | 134 | </div> |
134 | -</br> | ||
135 | -{% endblock %} | ||
136 | \ No newline at end of file | 135 | \ No newline at end of file |
136 | + <script> | ||
137 | + $(document).ready(function() { | ||
138 | + $('#id_objectivies').summernote(); | ||
139 | + $('#id_content').summernote(); | ||
140 | + }); | ||
141 | + </script> | ||
142 | +</br></br></br> | ||
143 | +{% endblock %} |
courses/templates/course/update.html
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | </div> | 41 | </div> |
42 | {% endfor %} | 42 | {% endfor %} |
43 | <div class="row text-center"> | 43 | <div class="row text-center"> |
44 | - <input type="submit" value="{% trans 'Update' %}" class="btn btn-primary" /> | 44 | + <input type="submit" value="{% trans 'Update' %}" class="btn btn-primary btn-raised" /> |
45 | </div> | 45 | </div> |
46 | </form> | 46 | </form> |
47 | </div> | 47 | </div> |
@@ -49,4 +49,11 @@ | @@ -49,4 +49,11 @@ | ||
49 | </br> | 49 | </br> |
50 | </br> | 50 | </br> |
51 | </br> | 51 | </br> |
52 | -{% endblock %} | ||
53 | \ No newline at end of file | 52 | \ No newline at end of file |
53 | +<script type="text/javascript"> | ||
54 | + var locale = navigator.language || navigator.userLanguage; | ||
55 | + | ||
56 | + $('.date-picker').datepicker({ | ||
57 | + language: locale, | ||
58 | + }); | ||
59 | +</script> | ||
60 | +{% endblock %} |
courses/templates/course/view.html
@@ -21,53 +21,6 @@ | @@ -21,53 +21,6 @@ | ||
21 | </ol> | 21 | </ol> |
22 | {% endblock %} | 22 | {% endblock %} |
23 | 23 | ||
24 | -{% block sidebar %} | ||
25 | - <div class="panel panel-primary"> | ||
26 | - <div class="panel-heading"> | ||
27 | - <h4>{% trans 'Menu' %}</h4> | ||
28 | - </div> | ||
29 | - <div class="panel-body"> | ||
30 | - <ul class="nav nav-pills nav-stacked"> | ||
31 | - <li><a href="{% url 'core:home' %}">{% trans "Home" %}</a></li> | ||
32 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
33 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
34 | - <li><a href="{% url 'course:all_courses' %}">{% trans 'All Courses' %}</a></li> | ||
35 | - <li><a href="{% url 'core:guest' %}">{% trans 'Courses' %}</a></li> | ||
36 | - {# <li><a href="{% url 'course:participants' %}">{% trans 'Participants' %}</a></li> #} | ||
37 | - {% if user|has_role:'system_admin' %} | ||
38 | - <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | ||
39 | - {% endif %} | ||
40 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
41 | - <li> | ||
42 | - <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
43 | - <div id="courses_list" class="collapse"> | ||
44 | - <ul class="nav nav-pill nav-stacked accordion_list"> | ||
45 | - {% for course in courses_list %} | ||
46 | - <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
47 | - {% endfor %} | ||
48 | - </ul> | ||
49 | - </div> | ||
50 | - </li> | ||
51 | - {% endif %} | ||
52 | - </ul> | ||
53 | - </div> | ||
54 | - </div> | ||
55 | - | ||
56 | - <div class="panel panel-primary"> | ||
57 | - <div class="panel-heading"> | ||
58 | - <h5>{% trans 'Categories' %}</h5> | ||
59 | - </div> | ||
60 | - <div class="panel-body"> | ||
61 | - <ul class="nav nav-pills nav-stacked"> | ||
62 | - <li {% if category is None %}class="active"{% endif %}><a href="{% url 'course:view' course.slug %}">{% trans 'All' %}</a></li> | ||
63 | - {% for cat in categorys_subjects %} | ||
64 | - <li {% if category == cat.slug %}class="active"{% endif %}><a href="{% url 'course:view_filter' course.slug cat.slug %}">{{ cat }}</a></li> | ||
65 | - {% endfor %} | ||
66 | - </ul> | ||
67 | - </div> | ||
68 | - </div> | ||
69 | -{% endblock %} | ||
70 | - | ||
71 | {% block content %} | 24 | {% block content %} |
72 | 25 | ||
73 | <div class="col-md-12 cards-content"> | 26 | <div class="col-md-12 cards-content"> |
@@ -124,8 +77,8 @@ | @@ -124,8 +77,8 @@ | ||
124 | <div> | 77 | <div> |
125 | </div> | 78 | </div> |
126 | <div class="modal-footer"> | 79 | <div class="modal-footer"> |
127 | - <button type="button" data-dismiss="modal" class="btn btn-default">{% trans "Cancel" %}</button> | ||
128 | - <a href="#" target="_self"><button type="button" class="btn btn-primary"> {% trans "Confirm" %}</button></a> | 80 | + <button type="button" data-dismiss="modal" class="btn btn-default btn-raised">{% trans "Cancel" %}</button> |
81 | + <a href="#" target="_self"><button type="button" class="btn btn-primary btn-raised"> {% trans "Confirm" %}</button></a> | ||
129 | </div> | 82 | </div> |
130 | </div> | 83 | </div> |
131 | </div> | 84 | </div> |
@@ -158,9 +111,11 @@ | @@ -158,9 +111,11 @@ | ||
158 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | 111 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> |
159 | </button> | 112 | </button> |
160 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 113 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
161 | - <li><a href="{% url 'course:replicate_subject' subject.slug %}" data-toggle="modal" data-target="#myModal3"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans 'Replicate' %}</a></li> | ||
162 | - <li><a href="javascript:delete_subject.get('{% url 'course:delete_subject' subject.slug %}','#subject','#modal_subject')" data-toggle="modal" data-target="#removeSubject"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | 114 | + <li><a href="{% url 'course:replicate_subject' subject.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> |
115 | + <li><a href="{% url 'course:update_subject' subject.slug %}"> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | ||
116 | + <li><a href="{% url 'course:delete_subject' subject.slug %}" ><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | ||
163 | </ul> | 117 | </ul> |
118 | + | ||
164 | </div> | 119 | </div> |
165 | </div> | 120 | </div> |
166 | {% endif %} | 121 | {% endif %} |
courses/templates/subject/delete.html
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <!-- Modal Footer --> | 20 | <!-- Modal Footer --> |
21 | <div class="modal-footer"> | 21 | <div class="modal-footer"> |
22 | <!-- Don't remove that!!! --> | 22 | <!-- Don't remove that!!! --> |
23 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | 23 | + <button type="button" class="btn btn-raised btn-default" data-dismiss="modal">{% trans "Close" %}</button> |
24 | <button type="submit" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> | 24 | <button type="submit" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> |
25 | <script> | 25 | <script> |
26 | $("#delete_form").submit(function(event) { | 26 | $("#delete_form").submit(function(event) { |
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +{% load static i18n permission_tags professor_access %} | ||
2 | + | ||
3 | +<script src="{% static 'js/modals_requisitions.js'%}"></script> | ||
4 | +<script src="{% static 'js/modal_exam.js'%}"></script> | ||
5 | + | ||
6 | +{% for exam in exams %} | ||
7 | + {% professor_subject exam.topic.subject request.user as permission%} | ||
8 | + {% if permission %} | ||
9 | + <li id="exam_{{exam.slug}}"><i class="material-icons">{% trans 'exam' %}</i> <a href="javascript:modal.get('{% url 'course:exam:update_exam' exam.slug %}','#exam','#modal_exam');">{{ exam.name }}</a><a href="javascript:modal.get('{% url 'course:exam:delete_exam' exam.slug %}','#exam','#modal_exam');"><span class="glyphicon glyphicon-remove"></span></a></li> | ||
10 | + {% else %} | ||
11 | + <li id="exam_{{exam.slug}}"><i class="material-icons">{% trans 'exam' %}</i> <a href="javascript:modal.get('{% url 'course:exam:view_exam' exam.slug %}','#exam','#modal_exam');">{{ exam.name }}</a></li> | ||
12 | + {% endif %} | ||
13 | + {% endfor %} | ||
14 | +{# <button class="btn btn-primary btn-raised" onclick="javascript:modal.get('{% url 'course:exam:create_exam' topic.slug%}','#exam','#modal_exam');">{% trans '+ Create Exam' %}</button> #} | ||
15 | +<div class="row" id="modal_exam"> | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | +</div> |
courses/templates/subject/form_view_teacher.html
@@ -25,6 +25,8 @@ | @@ -25,6 +25,8 @@ | ||
25 | <li><a href="javascript:show_editation('{{topic.slug}}')"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | 25 | <li><a href="javascript:show_editation('{{topic.slug}}')"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> |
26 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeTopic"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | 26 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeTopic"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> |
27 | </ul> | 27 | </ul> |
28 | + | ||
29 | + | ||
28 | {% endif %} | 30 | {% endif %} |
29 | </div> | 31 | </div> |
30 | </div> | 32 | </div> |
@@ -49,7 +51,7 @@ | @@ -49,7 +51,7 @@ | ||
49 | </div> | 51 | </div> |
50 | <div class="form-group editation editation_{{topic.slug}}"> | 52 | <div class="form-group editation editation_{{topic.slug}}"> |
51 | <label class="control-label" for="focusedInput2">{% trans 'Description' %}</label> | 53 | <label class="control-label" for="focusedInput2">{% trans 'Description' %}</label> |
52 | - <textarea class="form-control" rows="3" id="textArea">{{topic.description}}</textarea> | 54 | + <textarea class="form-control" rows="3" id="summernote">{{topic.description}}</textarea> |
53 | </div> | 55 | </div> |
54 | 56 | ||
55 | {# materiais do topico#} | 57 | {# materiais do topico#} |
@@ -99,6 +101,7 @@ | @@ -99,6 +101,7 @@ | ||
99 | <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | 101 | <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> |
100 | <ul class="dropdown-menu" aria-labelledby="dLabel"> | 102 | <ul class="dropdown-menu" aria-labelledby="dLabel"> |
101 | <li><a href="javascript:createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans 'Create Forum' %}</a></li> | 103 | <li><a href="javascript:createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans 'Create Forum' %}</a></li> |
104 | + | ||
102 | <li><a href="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#requisicoes_ajax');">{% trans 'Create Poll' %}</a></li> | 105 | <li><a href="javascript:modal.get('{% url 'course:poll:create_poll' topic.slug%}','#poll','#requisicoes_ajax');">{% trans 'Create Poll' %}</a></li> |
103 | </ul> | 106 | </ul> |
104 | </div> | 107 | </div> |
@@ -119,6 +122,7 @@ | @@ -119,6 +122,7 @@ | ||
119 | {% list_topic_foruns request topic %} | 122 | {% list_topic_foruns request topic %} |
120 | </ul> | 123 | </ul> |
121 | </div> | 124 | </div> |
125 | + | ||
122 | </div> | 126 | </div> |
123 | </div> | 127 | </div> |
124 | 128 | ||
@@ -207,3 +211,5 @@ | @@ -207,3 +211,5 @@ | ||
207 | </div> | 211 | </div> |
208 | </div> | 212 | </div> |
209 | <!-- EndModal --> | 213 | <!-- EndModal --> |
214 | + | ||
215 | + |
courses/templates/subject/index.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags professor_access %} | 3 | {% load static i18n permission_tags professor_access %} |
4 | 4 | ||
@@ -21,41 +21,6 @@ | @@ -21,41 +21,6 @@ | ||
21 | <li class="active">{{ subject }}</li> | 21 | <li class="active">{{ subject }}</li> |
22 | </ol> | 22 | </ol> |
23 | {% endblock %} | 23 | {% endblock %} |
24 | -{% block sidebar %} | ||
25 | - <div class="panel panel-primary"> | ||
26 | - <div class="panel-heading"> | ||
27 | - <h4>{% trans 'Menu' %}</h4> | ||
28 | - </div> | ||
29 | - <div class="panel-body"> | ||
30 | - <ul class="nav nav-pills nav-stacked"> | ||
31 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
32 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
33 | - {% if user|has_role:'student' or not user.is_staff %} | ||
34 | - <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
35 | - <li><a href="{% url 'core:guest' %}">{% trans 'All Courses' %}</a></li> | ||
36 | - {% endif %} | ||
37 | - <li><a href="{% url 'core:guest' %}">{% trans 'Courses' %}</a></li> | ||
38 | - {% if user|has_role:'system_admin' %} | ||
39 | - <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | ||
40 | - {% endif %} | ||
41 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
42 | - <li> | ||
43 | - <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
44 | - <div id="courses_list" class="collapse"> | ||
45 | - <ul class="nav nav-pill nav-stacked accordion_list"> | ||
46 | - {% for course in courses_list %} | ||
47 | - <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
48 | - {% endfor %} | ||
49 | - </ul> | ||
50 | - </div> | ||
51 | - </li> | ||
52 | - {% endif %} | ||
53 | - </ul> | ||
54 | - </div> | ||
55 | - </div> | ||
56 | - | ||
57 | - | ||
58 | -{% endblock %} | ||
59 | 24 | ||
60 | {% block content %} | 25 | {% block content %} |
61 | <div class="panel panel-info"> | 26 | <div class="panel panel-info"> |
@@ -75,7 +40,7 @@ | @@ -75,7 +40,7 @@ | ||
75 | </button> | 40 | </button> |
76 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 41 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
77 | <li><a href="{% url 'course:replicate_subject' subject.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> | 42 | <li><a href="{% url 'course:replicate_subject' subject.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> |
78 | - <li><a href="{% url 'course:update_subject' subject.slug %}" <i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | 43 | + <li><a href="{% url 'course:update_subject' subject.slug %}"> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> |
79 | <li><a href="{% url 'course:delete_subject' subject.slug %}" ><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | 44 | <li><a href="{% url 'course:delete_subject' subject.slug %}" ><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> |
80 | </ul> | 45 | </ul> |
81 | </div> | 46 | </div> |
courses/templates/subject/poll_item_actions.html
@@ -4,4 +4,5 @@ | @@ -4,4 +4,5 @@ | ||
4 | {% for poll in polls %} | 4 | {% for poll in polls %} |
5 | <li id="poll_{{poll.slug}}"><i class="fa fa-bar-chart"></i> <a href="javascript:modal.get('{% url 'course:poll:view_poll' poll.slug %}','#poll','#requisicoes_ajax');">{{ poll }}</a></li> | 5 | <li id="poll_{{poll.slug}}"><i class="fa fa-bar-chart"></i> <a href="javascript:modal.get('{% url 'course:poll:view_poll' poll.slug %}','#poll','#requisicoes_ajax');">{{ poll }}</a></li> |
6 | {% endfor %} | 6 | {% endfor %} |
7 | + | ||
7 | </div> | 8 | </div> |
courses/templates/subject_category/index.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags professor_access%} | 3 | {% load static i18n permission_tags professor_access%} |
4 | 4 | ||
@@ -11,30 +11,6 @@ | @@ -11,30 +11,6 @@ | ||
11 | </ol> | 11 | </ol> |
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | -{% block sidebar %} | ||
15 | - | ||
16 | - <div class="panel panel-primary"> | ||
17 | - | ||
18 | - <div class="panel-heading"> | ||
19 | - <h3 class="panel-title">{{course}}</h3> | ||
20 | - </div> | ||
21 | - | ||
22 | - <div class="panel-body"> | ||
23 | - {% for category in subject_categories %} | ||
24 | - <div class="row"> | ||
25 | - <div class="col-md-12 col-sm-12"> | ||
26 | - <a href="" class="btn btn-default text-left">{{subject}}</a> | ||
27 | - </div> | ||
28 | - </div> | ||
29 | - {% endfor %} | ||
30 | - </div> | ||
31 | - </div> | ||
32 | - | ||
33 | - {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
34 | - <a href="" class="btn btn-primary btn-md btn-block">{% trans "Create Subject Category" %}</a> | ||
35 | - {% endif %} | ||
36 | -{% endblock %} | ||
37 | - | ||
38 | {% block content %} | 14 | {% block content %} |
39 | <div class="panel panel-info"> | 15 | <div class="panel panel-info"> |
40 | <div class="panel-heading"> | 16 | <div class="panel-heading"> |
courses/templates/topic/delete.html
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <!-- Modal Footer --> | 20 | <!-- Modal Footer --> |
21 | <div class="modal-footer"> | 21 | <div class="modal-footer"> |
22 | <!-- Don't remove that!!! --> | 22 | <!-- Don't remove that!!! --> |
23 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | 23 | + <button type="button" class="btn btn-default btn-raised" data-dismiss="modal">{% trans "Close" %}</button> |
24 | <button type="submit" id="button" form="delete_topic_{{topic.slug}}" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> | 24 | <button type="submit" id="button" form="delete_topic_{{topic.slug}}" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> |
25 | <script> | 25 | <script> |
26 | $("#delete_topic_{{topic.slug}}").submit(function(event) { | 26 | $("#delete_topic_{{topic.slug}}").submit(function(event) { |
courses/templates/topic/index.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags professor_access %} | 3 | {% load static i18n permission_tags professor_access %} |
4 | 4 | ||
@@ -26,24 +26,6 @@ | @@ -26,24 +26,6 @@ | ||
26 | </ol> | 26 | </ol> |
27 | {% endblock %} | 27 | {% endblock %} |
28 | 28 | ||
29 | -{% block sidebar %} | ||
30 | - | ||
31 | - <div class="panel panel-primary"> | ||
32 | - <div class="panel-heading"> | ||
33 | - <h5>{% trans 'Menu' %}</h5> | ||
34 | - </div> | ||
35 | - <div class="panel-body"> | ||
36 | - <ul class="nav nav-pills nav-stacked"> | ||
37 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
38 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
39 | - </ul> | ||
40 | - </div> | ||
41 | - </div> | ||
42 | - | ||
43 | - | ||
44 | - | ||
45 | -{% endblock %} | ||
46 | - | ||
47 | {% block content %} | 29 | {% block content %} |
48 | <div class="col-md-12 col-xs-12 col-sm-12"> | 30 | <div class="col-md-12 col-xs-12 col-sm-12"> |
49 | <div class="panel panel-info"> | 31 | <div class="panel panel-info"> |
courses/templates/topic/link_topic_list_edit.html
@@ -2,6 +2,6 @@ | @@ -2,6 +2,6 @@ | ||
2 | <div id="list-topic{{ topic.id }}-links-edit"> | 2 | <div id="list-topic{{ topic.id }}-links-edit"> |
3 | {% for link in links%} | 3 | {% for link in links%} |
4 | <li class="icon_edit_remove" id = "link_edit_icon_{{ link.slug }}"> <a href="javascript:modal.get('{% url 'course:links:update_link' link.slug %}', '#linksModalEdit', '#requisicoes_ajax')"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="javascript:modal.get('{% url 'course:links:delete_link' link.slug %}', '#linkDeleteModal', '#requisicoes_ajax')"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | 4 | <li class="icon_edit_remove" id = "link_edit_icon_{{ link.slug }}"> <a href="javascript:modal.get('{% url 'course:links:update_link' link.slug %}', '#linksModalEdit', '#requisicoes_ajax')"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="javascript:modal.get('{% url 'course:links:delete_link' link.slug %}', '#linkDeleteModal', '#requisicoes_ajax')"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> |
5 | - <li id = "link_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:modal.get('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#requisicoes_ajax')">{{link.name}}</a></li> | 5 | + <li id = "link_edit_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:modal.get('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#requisicoes_ajax')">{{link.name}}</a></li> |
6 | {% endfor %} | 6 | {% endfor %} |
7 | </div> | 7 | </div> |
courses/templates/topic/topic_card_student.html
@@ -6,11 +6,11 @@ | @@ -6,11 +6,11 @@ | ||
6 | <div class="resource_inline"> | 6 | <div class="resource_inline"> |
7 | <h4>{% trans "Materials" %}</h4> | 7 | <h4>{% trans "Materials" %}</h4> |
8 | </div> | 8 | </div> |
9 | - | 9 | + |
10 | <ul id="list-materials"> | 10 | <ul id="list-materials"> |
11 | {% list_topic_file request topic %} | 11 | {% list_topic_file request topic %} |
12 | {% list_topic_link request topic%} | 12 | {% list_topic_link request topic%} |
13 | - | 13 | + |
14 | </ul> | 14 | </ul> |
15 | </div> | 15 | </div> |
16 | <div class="col-xs-4 col-md-4"> | 16 | <div class="col-xs-4 col-md-4"> |
@@ -19,10 +19,11 @@ | @@ -19,10 +19,11 @@ | ||
19 | </div> | 19 | </div> |
20 | <ul> | 20 | <ul> |
21 | <div class="foruns_list"> | 21 | <div class="foruns_list"> |
22 | + {% list_topic_exam request topic %} | ||
22 | {% list_topic_poll request topic %} | 23 | {% list_topic_poll request topic %} |
23 | {% list_topic_foruns request topic %} | 24 | {% list_topic_foruns request topic %} |
24 | </div> | 25 | </div> |
25 | </ul> | 26 | </ul> |
26 | </div> | 27 | </div> |
27 | - | ||
28 | -</div> | ||
29 | \ No newline at end of file | 28 | \ No newline at end of file |
29 | + | ||
30 | +</div> |
courses/templatetags/list_topic_foruns.py
@@ -3,6 +3,7 @@ from django import template | @@ -3,6 +3,7 @@ from django import template | ||
3 | from links.models import Link | 3 | from links.models import Link |
4 | from forum.models import Forum | 4 | from forum.models import Forum |
5 | from poll.models import Poll | 5 | from poll.models import Poll |
6 | +from exam.models import Exam | ||
6 | from files.models import TopicFile | 7 | from files.models import TopicFile |
7 | register = template.Library() | 8 | register = template.Library() |
8 | 9 | ||
@@ -31,6 +32,7 @@ def list_topic_poll(request, topic): | @@ -31,6 +32,7 @@ def list_topic_poll(request, topic): | ||
31 | 32 | ||
32 | return context | 33 | return context |
33 | 34 | ||
35 | + | ||
34 | @register.inclusion_tag('subject/poll_item_actions_teacher.html') | 36 | @register.inclusion_tag('subject/poll_item_actions_teacher.html') |
35 | def list_topic_poll_teacher(request, topic): | 37 | def list_topic_poll_teacher(request, topic): |
36 | context = { | 38 | context = { |
courses/views.py
@@ -25,11 +25,39 @@ from courses.models import Material | @@ -25,11 +25,39 @@ from courses.models import Material | ||
25 | from django.urls import reverse | 25 | from django.urls import reverse |
26 | 26 | ||
27 | from datetime import date, datetime | 27 | from datetime import date, datetime |
28 | +import time | ||
28 | 29 | ||
29 | #API IMPORTS | 30 | #API IMPORTS |
30 | from rest_framework import viewsets, permissions | 31 | from rest_framework import viewsets, permissions |
31 | from .serializers import * | 32 | from .serializers import * |
32 | 33 | ||
34 | +class Category: | ||
35 | + name = None | ||
36 | + slug = None | ||
37 | + course_category = [] | ||
38 | + | ||
39 | +def course_category(list_courses): | ||
40 | + | ||
41 | + list_courses = list_courses.distinct().order_by('category','name') | ||
42 | + categorys_courses = [] | ||
43 | + cat_slug = None | ||
44 | + cat = None | ||
45 | + for course in list_courses: | ||
46 | + if (course.category.slug != cat_slug): | ||
47 | + if (cat != None): | ||
48 | + categorys_courses.append(cat) | ||
49 | + cat_slug = course.category.slug | ||
50 | + cat = Category() | ||
51 | + cat.name = course.category.name | ||
52 | + cat.slug = cat_slug | ||
53 | + cat.course_category = [] | ||
54 | + cat.course_category.append(course) | ||
55 | + | ||
56 | + if (cat): | ||
57 | + categorys_courses.append(cat) | ||
58 | + | ||
59 | + return categorys_courses | ||
60 | + | ||
33 | class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | 61 | class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): |
34 | 62 | ||
35 | login_url = reverse_lazy("core:home") | 63 | login_url = reverse_lazy("core:home") |
@@ -37,8 +65,6 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -37,8 +65,6 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
37 | queryset = Course.objects.all() | 65 | queryset = Course.objects.all() |
38 | template_name = 'course/index.html' | 66 | template_name = 'course/index.html' |
39 | context_object_name = 'courses' | 67 | context_object_name = 'courses' |
40 | - paginate_by = 10 | ||
41 | - aparece = True | ||
42 | 68 | ||
43 | 69 | ||
44 | def get_queryset(self): | 70 | def get_queryset(self): |
@@ -47,14 +73,12 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -47,14 +73,12 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
47 | course_search = self.request.GET.get('q', None) | 73 | course_search = self.request.GET.get('q', None) |
48 | category_search = self.request.GET.get('category', None) | 74 | category_search = self.request.GET.get('category', None) |
49 | if course_search: | 75 | if course_search: |
50 | - self.aparece = False | ||
51 | query_list = course_search.split() | 76 | query_list = course_search.split() |
52 | result = result.filter( | 77 | result = result.filter( |
53 | reduce(operator.and_, | 78 | reduce(operator.and_, |
54 | (Q(name__icontains=q) for q in query_list)) | 79 | (Q(name__icontains=q) for q in query_list)) |
55 | ) | 80 | ) |
56 | if category_search: | 81 | if category_search: |
57 | - self.aparece = False | ||
58 | query_list = category_search.split() | 82 | query_list = category_search.split() |
59 | result = result.filter( | 83 | result = result.filter( |
60 | reduce(operator.and_, | 84 | reduce(operator.and_, |
@@ -65,58 +89,40 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -65,58 +89,40 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
65 | def get_context_data(self, **kwargs): | 89 | def get_context_data(self, **kwargs): |
66 | context = super(IndexView, self).get_context_data(**kwargs) | 90 | context = super(IndexView, self).get_context_data(**kwargs) |
67 | list_courses = None | 91 | list_courses = None |
68 | - categorys_courses = None | ||
69 | - if has_role(self.request.user,'professor'): | ||
70 | - list_courses = Course.objects.filter(Q(professors = True)|Q(professors__name = self.request.user.name)).order_by('name') | ||
71 | - categorys_courses = CourseCategory.objects.filter(course_category__professors__name = self.request.user.name).distinct() | ||
72 | - elif has_role(self.request.user,'system_admin'): | ||
73 | - list_courses = queryset.order_by('name') | ||
74 | - categorys_courses = CourseCategory.objects.all() | 92 | + if has_role(self.request.user,'system_admin'): |
93 | + list_courses = self.get_queryset().order_by('name') | ||
94 | + # categorys_courses = CourseCategory.objects.all() | ||
95 | + elif has_role(self.request.user,'professor'): | ||
96 | + list_courses = self.get_queryset().filter(professors__in = [self.request.user]) | ||
97 | + # categorys_courses = CourseCategory.objects.filter(course_category__professors__name = self.request.user.name).distinct() | ||
75 | elif has_role(self.request.user, 'student'): | 98 | elif has_role(self.request.user, 'student'): |
76 | - list_courses = Course.objects.filter(Q(students = True)|Q(students__name = self.request.user.name)).order_by('name') | ||
77 | - categorys_courses = CourseCategory.objects.filter(course_category__students__name = self.request.user.name).distinct() | ||
78 | - | ||
79 | - paginator = Paginator(list_courses, self.paginate_by) | ||
80 | - page = self.request.GET.get('page') | ||
81 | - | ||
82 | - try: | ||
83 | - list_courses = paginator.page(page) | ||
84 | - except PageNotAnInteger: | ||
85 | - list_courses = paginator.page(1) | ||
86 | - except EmptyPage: | ||
87 | - list_courses = paginator.page(paginator.num_pages) | ||
88 | - | ||
89 | - context['list_courses'] = list_courses | ||
90 | - context['categorys_courses'] = categorys_courses | ||
91 | - context['aparece'] = self.aparece | 99 | + list_courses = self.get_queryset().filter(students__in = [self.request.user]) |
92 | 100 | ||
101 | + context['categorys_courses'] = course_category(list_courses) | ||
93 | return context | 102 | return context |
94 | 103 | ||
95 | class AllCoursesView(LoginRequiredMixin, NotificationMixin, generic.ListView): | 104 | class AllCoursesView(LoginRequiredMixin, NotificationMixin, generic.ListView): |
96 | 105 | ||
97 | login_url = reverse_lazy("core:home") | 106 | login_url = reverse_lazy("core:home") |
98 | redirect_field_name = 'next' | 107 | redirect_field_name = 'next' |
99 | - queryset = Course.objects.all() | ||
100 | template_name = 'course/index.html' | 108 | template_name = 'course/index.html' |
101 | context_object_name = 'courses' | 109 | context_object_name = 'courses' |
102 | - paginate_by = 5 | ||
103 | - aparece = True | ||
104 | 110 | ||
105 | 111 | ||
106 | def get_queryset(self): | 112 | def get_queryset(self): |
107 | - result = super(AllCoursesView, self).get_queryset() | 113 | + result = Course.objects.all() |
108 | 114 | ||
109 | course_search = self.request.GET.get('q', None) | 115 | course_search = self.request.GET.get('q', None) |
110 | category_search = self.request.GET.get('category', None) | 116 | category_search = self.request.GET.get('category', None) |
111 | if course_search: | 117 | if course_search: |
112 | - self.aparece = False | 118 | + # self.aparece = False |
113 | query_list = course_search.split() | 119 | query_list = course_search.split() |
114 | result = result.filter( | 120 | result = result.filter( |
115 | reduce(operator.and_, | 121 | reduce(operator.and_, |
116 | (Q(name__icontains=q) for q in query_list)) | 122 | (Q(name__icontains=q) for q in query_list)) |
117 | ) | 123 | ) |
118 | if category_search: | 124 | if category_search: |
119 | - self.aparece = False | 125 | + # self.aparece = False |
120 | query_list = category_search.split() | 126 | query_list = category_search.split() |
121 | result = result.filter( | 127 | result = result.filter( |
122 | reduce(operator.and_, | 128 | reduce(operator.and_, |
@@ -126,25 +132,10 @@ class AllCoursesView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -126,25 +132,10 @@ class AllCoursesView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
126 | 132 | ||
127 | def get_context_data(self, **kwargs): | 133 | def get_context_data(self, **kwargs): |
128 | context = super(AllCoursesView, self).get_context_data(**kwargs) | 134 | context = super(AllCoursesView, self).get_context_data(**kwargs) |
129 | - list_courses = None | ||
130 | - categorys_courses = None | ||
131 | - list_courses = Course.objects.all().order_by('name') | ||
132 | - #categorys_courses = CourseCategory.objects.all().distinct().order_by('name') | ||
133 | - categorys_courses = CourseCategory.objects.all() | ||
134 | - paginator = Paginator(list_courses, self.paginate_by) | ||
135 | - page = self.request.GET.get('page') | ||
136 | 135 | ||
137 | - try: | ||
138 | - list_courses = paginator.page(page) | ||
139 | - except PageNotAnInteger: | ||
140 | - list_courses = paginator.page(1) | ||
141 | - except EmptyPage: | ||
142 | - list_courses = paginator.page(paginator.num_pages) | ||
143 | - | ||
144 | - context['list_courses'] = list_courses | ||
145 | - context['categorys_courses'] = categorys_courses | ||
146 | - context['aparece'] = self.aparece | 136 | + list_courses = self.get_queryset() |
147 | 137 | ||
138 | + context['categorys_courses'] = course_category(list_courses) | ||
148 | return context | 139 | return context |
149 | 140 | ||
150 | class CreateCourseView(LoginRequiredMixin, HasRoleMixin, LogMixin, NotificationMixin, generic.edit.CreateView): | 141 | class CreateCourseView(LoginRequiredMixin, HasRoleMixin, LogMixin, NotificationMixin, generic.edit.CreateView): |
@@ -345,10 +336,10 @@ class CourseView(LogMixin, NotificationMixin, generic.DetailView): | @@ -345,10 +336,10 @@ class CourseView(LogMixin, NotificationMixin, generic.DetailView): | ||
345 | self.log_context['course_slug'] = course.slug | 336 | self.log_context['course_slug'] = course.slug |
346 | self.log_context['course_category_id'] = course.category.id | 337 | self.log_context['course_category_id'] = course.category.id |
347 | self.log_context['course_category_name'] = course.category.name | 338 | self.log_context['course_category_name'] = course.category.name |
339 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
348 | 340 | ||
349 | super(CourseView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 341 | super(CourseView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
350 | 342 | ||
351 | - self.request.session['time_spent'] = str(datetime.now()) | ||
352 | self.request.session['log_id'] = Log.objects.latest('id').id | 343 | self.request.session['log_id'] = Log.objects.latest('id').id |
353 | 344 | ||
354 | category_sub = self.kwargs.get('category', None) | 345 | category_sub = self.kwargs.get('category', None) |
@@ -552,10 +543,10 @@ class SubjectsView(LoginRequiredMixin, LogMixin, generic.ListView): | @@ -552,10 +543,10 @@ class SubjectsView(LoginRequiredMixin, LogMixin, generic.ListView): | ||
552 | self.log_context['course_slug'] = subject.course.slug | 543 | self.log_context['course_slug'] = subject.course.slug |
553 | self.log_context['course_category_id'] = subject.course.category.id | 544 | self.log_context['course_category_id'] = subject.course.category.id |
554 | self.log_context['course_category_name'] = subject.course.category.name | 545 | self.log_context['course_category_name'] = subject.course.category.name |
546 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
555 | 547 | ||
556 | super(SubjectsView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 548 | super(SubjectsView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
557 | 549 | ||
558 | - self.request.session['time_spent'] = str(datetime.now()) | ||
559 | self.request.session['log_id'] = Log.objects.latest('id').id | 550 | self.request.session['log_id'] = Log.objects.latest('id').id |
560 | 551 | ||
561 | return super(SubjectsView, self).dispatch(*args, **kwargs) | 552 | return super(SubjectsView, self).dispatch(*args, **kwargs) |
@@ -657,10 +648,10 @@ class TopicsView(LoginRequiredMixin, LogMixin, generic.ListView): | @@ -657,10 +648,10 @@ class TopicsView(LoginRequiredMixin, LogMixin, generic.ListView): | ||
657 | self.log_context['course_slug'] = topic.subject.course.slug | 648 | self.log_context['course_slug'] = topic.subject.course.slug |
658 | self.log_context['course_category_id'] = topic.subject.course.category.id | 649 | self.log_context['course_category_id'] = topic.subject.course.category.id |
659 | self.log_context['course_category_name'] = topic.subject.course.category.name | 650 | self.log_context['course_category_name'] = topic.subject.course.category.name |
651 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
660 | 652 | ||
661 | super(TopicsView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 653 | super(TopicsView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
662 | 654 | ||
663 | - self.request.session['time_spent'] = str(datetime.now()) | ||
664 | self.request.session['log_id'] = Log.objects.latest('id').id | 655 | self.request.session['log_id'] = Log.objects.latest('id').id |
665 | 656 | ||
666 | return super(TopicsView, self).dispatch(*args, **kwargs) | 657 | return super(TopicsView, self).dispatch(*args, **kwargs) |
@@ -1003,10 +994,10 @@ class FileMaterialView(LoginRequiredMixin, LogMixin, generic.DetailView): | @@ -1003,10 +994,10 @@ class FileMaterialView(LoginRequiredMixin, LogMixin, generic.DetailView): | ||
1003 | self.log_context['course_slug'] = file.topic.subject.course.slug | 994 | self.log_context['course_slug'] = file.topic.subject.course.slug |
1004 | self.log_context['course_category_id'] = file.topic.subject.course.category.id | 995 | self.log_context['course_category_id'] = file.topic.subject.course.category.id |
1005 | self.log_context['course_category_name'] = file.topic.subject.course.category.name | 996 | self.log_context['course_category_name'] = file.topic.subject.course.category.name |
997 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
1006 | 998 | ||
1007 | super(FileMaterialView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 999 | super(FileMaterialView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
1008 | 1000 | ||
1009 | - self.request.session['time_spent'] = str(datetime.now()) | ||
1010 | self.request.session['log_id'] = Log.objects.latest('id').id | 1001 | self.request.session['log_id'] = Log.objects.latest('id').id |
1011 | 1002 | ||
1012 | return super(FileMaterialView, self).dispatch(*args, **kwargs) | 1003 | return super(FileMaterialView, self).dispatch(*args, **kwargs) |
@@ -1028,4 +1019,3 @@ class TopicViewSet(viewsets.ModelViewSet): | @@ -1028,4 +1019,3 @@ class TopicViewSet(viewsets.ModelViewSet): | ||
1028 | queryset = Topic.objects.all() | 1019 | queryset = Topic.objects.all() |
1029 | serializer_class = TopicSerializer | 1020 | serializer_class = TopicSerializer |
1030 | permissions_class = (permissions.IsAuthenticatedOrReadOnly) | 1021 | permissions_class = (permissions.IsAuthenticatedOrReadOnly) |
1031 | - |
exam/templates/exam/create.html
1 | {% extends "home.html" %} | 1 | {% extends "home.html" %} |
2 | 2 | ||
3 | -{% load i18n %} | ||
4 | - | ||
5 | -{% block content %} | ||
6 | -<div class="panel panel-info"> | ||
7 | - <div class="panel-heading"> | ||
8 | - {% block title_poll %} | ||
9 | - <h1 class="panel-title">{% trans "New Exam" %}</h1> | ||
10 | - {% endblock title_poll %} | ||
11 | - </div> | ||
12 | - <div class="panel-body"> | ||
13 | - <div class="row form-group"> | ||
14 | - <label for="exam_name" class="col-md-2 control-label">{% trans "Exam Name" %}</label> | ||
15 | - <div class="col-md-10"> | ||
16 | - <input type="text" name="exam_name" class="form-control" id="exam_name" placeholder="{% trans 'Exam Name' %}"> | ||
17 | - </div> | ||
18 | - </div> | ||
19 | - <div class="row form-group"> | ||
20 | - <label for="begin_date" class="col-md-2 control-label">{% trans "Exam's begin date" %}</label> | ||
21 | - <div class="col-md-10"> | ||
22 | - <input type="date" name="begin_date" class="form-control" id="begin_date" placeholder='{% trans "Begin Date" %}'> | ||
23 | - </div> | ||
24 | - </div> | ||
25 | - <div class="row form-group"> | ||
26 | - <label for="end_date" class="col-md-2 control-label">{% trans "Exam's end date" %}</label> | ||
27 | - <div class="col-md-10"> | ||
28 | - <input type="text" name="end_date" class="form-control" id="end_date" placeholder='{% trans "End Date" %}'> | ||
29 | - </div> | ||
30 | - </div> | ||
31 | - <div class="row form-group"> | ||
32 | - <div class="col-md-10"> | ||
33 | - <div class="checkbox"> | ||
34 | - <label> | ||
35 | - <input type="checkbox" name="checkbox"><span class="checkbox-material"><span class="check"></span></span> {% trans "Allow submissions after deadline?" %} | ||
36 | - </label> | ||
37 | - </div> | ||
38 | - </div> | ||
39 | - </div> | ||
40 | - <div class="row form-group" id="questions"> | 3 | +{% load i18n widget_tweaks dict_access static%} |
41 | 4 | ||
42 | - </div> | ||
43 | - <div class="row form-group"> | ||
44 | - <label for="questionType" class="col-md-2 control-label">{% trans "Question Type" %}</label> | ||
45 | - <div class="col-md-10"> | ||
46 | - <select id="questionType" class="form-control" name="option_question" onchange="showDiv (this)"> | ||
47 | - <option selected disabled>{% trans "Question Type" %}</option> | ||
48 | - <option value="0">{% trans "Multiple Choice" %}</option> | ||
49 | - <option value="1">{% trans "True or False" %}</option> | ||
50 | - <option value="2">{% trans "Gap Filling" %}</option> | ||
51 | - <option value="3">{% trans "Discursive Question" %}</option> | ||
52 | - </select> | 5 | +{# {% block style %} #} |
6 | + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
7 | + <script src="{% static 'js/modal_exam.js' %}"></script> | ||
8 | + | ||
9 | +{# {% endblock %} #} | ||
10 | + | ||
11 | +{# {% block content %} #} | ||
12 | +<!-- Modal (remember to change the ids!!!) --> | ||
13 | +<div class="modal fade" id="exam" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
14 | + <div class="modal-dialog" role="document"> | ||
15 | + <div class="modal-content"> | ||
16 | + | ||
17 | + <!-- Modal Header --> | ||
18 | + <div class="modal-header"> | ||
19 | + | ||
20 | + {% block title_exam %} | ||
21 | + <!-- Put your title here!!! --> | ||
22 | + <h4 class="modal-title" id="myModalLabel">{% trans "Create a Exam" %}</h4> | ||
23 | + {% endblock title_exam %} | ||
53 | </div> | 24 | </div> |
54 | - </div> | ||
55 | - <div class="row"> | ||
56 | - <div class="col-md-12"> | ||
57 | - <button type="button" class="btn btn-primary btn-raised" id="add_question">{% trans "add question" %}</button> | 25 | + <!-- Modal Body --> |
26 | + <div class="modal-body"> | ||
27 | + | ||
28 | + {% block content_exam %} | ||
29 | + | ||
30 | + <div class="panel-body"> | ||
31 | + <div class="row form-group"> | ||
32 | + <label for="exam_name" class="col-md-2 control-label">{% trans "Exam Name" %}</label> | ||
33 | + <div class="col-md-10"> | ||
34 | + <input type="text" name="exam_name" class="form-control" id="exam_name" placeholder="{% trans 'Exam Name' %}"> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + <div class="row form-group"> | ||
38 | + <label for="begin_date" class="col-md-2 control-label">{% trans "Exam's begin date" %}</label> | ||
39 | + <div class="col-md-10"> | ||
40 | + <input type="date" name="begin_date" class="form-control" id="begin_date" placeholder='{% trans "Begin Date" %}'> | ||
41 | + </div> | ||
42 | + </div> | ||
43 | + <div class="row form-group"> | ||
44 | + <label for="end_date" class="col-md-2 control-label">{% trans "Exam's end date" %}</label> | ||
45 | + <div class="col-md-10"> | ||
46 | + <input type="date" name="end_date" class="form-control" id="end_date" placeholder='{% trans "End Date" %}'> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + <div class="row form-group"> | ||
50 | + <div class="col-md-10"> | ||
51 | + <div class="checkbox"> | ||
52 | + <label> | ||
53 | + <input type="checkbox" name="checkbox"><span class="checkbox-material"><span class="check"></span></span> {% trans "Allow submissions after deadline?" %} | ||
54 | + </label> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + <div class="row form-group" id="questions"> | ||
59 | + | ||
60 | + </div> | ||
61 | + <div class="row form-group"> | ||
62 | + <label for="questionType" class="col-md-2 control-label">{% trans "Question Type" %}</label> | ||
63 | + <div class="col-md-10"> | ||
64 | + <select id="questionType" class="form-control" name="option_question" onchange="showDiv (this)"> | ||
65 | + <option selected disabled>{% trans "Question Type" %}</option> | ||
66 | + <option value="0">{% trans "Multiple Choice" %}</option> | ||
67 | + <option value="1">{% trans "True or False" %}</option> | ||
68 | + <option value="2">{% trans "Gap Filling" %}</option> | ||
69 | + <option value="3">{% trans "Discursive Question" %}</option> | ||
70 | + </select> | ||
71 | + </div> | ||
72 | + </div> | ||
73 | + <!-- Modal Footer --> | ||
74 | + <div class="modal-footer"> | ||
75 | + | ||
76 | + <!-- Don't remove that!!! --> | ||
77 | + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | ||
78 | + {% block button_save %} | ||
79 | + <!-- Put curtom buttons here!!! --> | ||
80 | + <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | ||
81 | + {% endblock button_save %} | ||
82 | + </div> | ||
83 | + | ||
84 | + | ||
85 | + {% endblock content_exam %} | ||
58 | </div> | 86 | </div> |
59 | </div> | 87 | </div> |
60 | </div> | 88 | </div> |
61 | - <div class="panel-footer text-right"> | ||
62 | - <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | ||
63 | - </div> | ||
64 | </div> | 89 | </div> |
65 | -<script> | 90 | + |
91 | +<script type="text/javascript"> | ||
92 | + | ||
66 | var id = 1; | 93 | var id = 1; |
67 | $("#add_question").click(function(){ | 94 | $("#add_question").click(function(){ |
68 | $.get("{% url 'course:exam:true_or_false_question' %}", function(data){ | 95 | $.get("{% url 'course:exam:true_or_false_question' %}", function(data){ |
69 | - // var teste = String(data); | ||
70 | - // teste.replace("#radiosTF", "W3Schools"); | ||
71 | - // alert(teste); | 96 | + |
72 | $("#questions").append(data); | 97 | $("#questions").append(data); |
73 | - // $("#radiosTF").attr("id", "true_id_" + id); | 98 | + |
74 | $("#0").attr("id","true_" + id++); | 99 | $("#0").attr("id","true_" + id++); |
75 | }); | 100 | }); |
76 | }); | 101 | }); |
@@ -104,6 +129,9 @@ $('#tfAlternative').click(function () { | @@ -104,6 +129,9 @@ $('#tfAlternative').click(function () { | ||
104 | $(function() { | 129 | $(function() { |
105 | $( "#begin_date,#end_date" ).datepicker(); | 130 | $( "#begin_date,#end_date" ).datepicker(); |
106 | }); | 131 | }); |
132 | + | ||
107 | </script> | 133 | </script> |
108 | 134 | ||
135 | + | ||
136 | + | ||
109 | {% endblock content %} | 137 | {% endblock content %} |
exam/templates/exam/discursive_question.html
@@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
1 | -<div class="form-group" id="discursiveQuestion"> | ||
2 | - <label for="question" class="col-md-2 control-label">{% trans "Question" %}</label> | ||
3 | - <div class="col-md-10"> | ||
4 | - <textarea class="form-control" rows="1" id="question" placeholder="{% trans 'Question' %}"></textarea> | ||
5 | - </div> | ||
6 | -</div> |
exam/templates/exam/discursive_question.html.py
@@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
1 | -XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
2 | - XXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
3 | - XXXX XXXXXXXXXXXXXXXXXX | ||
4 | - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXXXXX | ||
5 | - XXXXXX | ||
6 | -XXXXXX |
exam/templates/exam/gap_filling_answer.html
exam/templates/exam/gap_filling_answer.html.py
exam/templates/exam/gap_filling_question.html
exam/templates/exam/gap_filling_question.html.py
exam/templates/exam/multiple_choice_answer.html
exam/templates/exam/multiple_choice_answer.html.py
exam/templates/exam/multiple_choice_question.html
@@ -1,42 +0,0 @@ | @@ -1,42 +0,0 @@ | ||
1 | -{% load i18n %} | ||
2 | - | ||
3 | -<div class="form-group" id="multipleChoice"> | ||
4 | - | ||
5 | - <label for="questionName" class="col-md-2 control-label">{% trans 'Question' %}</label> | ||
6 | - | ||
7 | - | ||
8 | - <div class="col-md-10"> | ||
9 | - <textarea class="form-control" rows="1" id="questionName" placeholder="Wording"></textarea> | ||
10 | - </div> | ||
11 | - | ||
12 | - | ||
13 | -</div> | ||
14 | -<div class="form-group"> | ||
15 | - <label for="alternative" class="col-md-2 control-label">{% trans 'Alternatives' %}</label> | ||
16 | - <div class="col-md-10" id="radios"> | ||
17 | - <div class="radio radio-primary"> | ||
18 | - <label> | ||
19 | - <input checked type="radio" name="alternatives" id="alternative1" value="1"> | ||
20 | - <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea> | ||
21 | - </label> | ||
22 | - </div> | ||
23 | - <div class="radio radio-primary"> | ||
24 | - <label> | ||
25 | - <input type="radio" name="alternatives" id="alternative2" value="2"> | ||
26 | - <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea> | ||
27 | - </label> | ||
28 | - </div> | ||
29 | - </div> | ||
30 | -</div> | ||
31 | -<!-- new alternative button --> | ||
32 | -<div class="form-group"> | ||
33 | - <div class="col-md-12 col-md-offset-2"> | ||
34 | - <button type="button" class="btn btn-primary" id="newAlternative">{% trans 'New Alternative' %}</button> | ||
35 | - </div> | ||
36 | -</div> | ||
37 | -<div class="form-group"> | ||
38 | - <div class="col-md-12 col-md-offset-2"> | ||
39 | - <button type="submit" class="btn btn-primary">Save</button> | ||
40 | - <button type="cancel" class="btn btn-default">Cancel</button> | ||
41 | - </div> | ||
42 | -</div> |
exam/templates/exam/multiple_choice_question.html.py
@@ -1,42 +0,0 @@ | @@ -1,42 +0,0 @@ | ||
1 | -BBBB BBBB | ||
2 | - | ||
3 | -XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX | ||
4 | - | ||
5 | - XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
6 | - | ||
7 | - | ||
8 | - XXXX XXXXXXXXXXXXXXXXXX | ||
9 | - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
10 | - XXXXXX | ||
11 | - | ||
12 | - | ||
13 | -XXXXXX | ||
14 | -XXXX XXXXXXXXXXXXXXXXXXX | ||
15 | - XXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Alternatives') XXXXXXXX | ||
16 | - XXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXX | ||
17 | - XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX | ||
18 | - XXXXXXX | ||
19 | - XXXXXX XXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
20 | - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
21 | - XXXXXXXX | ||
22 | - XXXXXX | ||
23 | - XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX | ||
24 | - XXXXXXX | ||
25 | - XXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
26 | - XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
27 | - XXXXXXXX | ||
28 | - XXXXXX | ||
29 | - XXXXXX | ||
30 | -XXXXXX | ||
31 | -XXXX XXX XXXXXXXXXXX XXXXXX XXX | ||
32 | -XXXX XXXXXXXXXXXXXXXXXXX | ||
33 | - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
34 | - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXX XXXXXXXXXXXX XXXXXXXXXXX | ||
35 | - XXXXXX | ||
36 | -XXXXXX | ||
37 | -XXXX XXXXXXXXXXXXXXXXXXX | ||
38 | - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
39 | - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX | ||
40 | - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
41 | - XXXXXX | ||
42 | -XXXXXX |
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<div class="form-group" id="discursiveQuestion"> | ||
2 | + <label for="question" class="col-md-2 control-label">{% trans "Question" %}</label> | ||
3 | + <div class="col-md-10"> | ||
4 | + <textarea class="form-control" rows="1" id="question" placeholder="{% trans 'Question' %}"></textarea> | ||
5 | + </div> | ||
6 | +</div> |
exam/templates/exam/questions/discursive_question.html.py
0 → 100644
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
2 | + XXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
3 | + XXXX XXXXXXXXXXXXXXXXXX | ||
4 | + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXXXXX | ||
5 | + XXXXXX | ||
6 | +XXXXXX |
exam/templates/exam/questions/gap_filling_answer.html.py
0 → 100644
exam/templates/exam/questions/gap_filling_question.html.py
0 → 100644
exam/templates/exam/questions/multiple_choice_answer.html
0 → 100644
exam/templates/exam/questions/multiple_choice_answer.html.py
0 → 100644
exam/templates/exam/questions/multiple_choice_question.html
0 → 100644
@@ -0,0 +1,42 @@ | @@ -0,0 +1,42 @@ | ||
1 | +{% load i18n %} | ||
2 | + | ||
3 | +<div class="form-group" id="multipleChoice"> | ||
4 | + | ||
5 | + <label for="questionName" class="col-md-2 control-label">{% trans 'Question' %}</label> | ||
6 | + | ||
7 | + | ||
8 | + <div class="col-md-10"> | ||
9 | + <textarea class="form-control" rows="1" id="questionName" placeholder="Wording"></textarea> | ||
10 | + </div> | ||
11 | + | ||
12 | + | ||
13 | +</div> | ||
14 | +<div class="form-group"> | ||
15 | + <label for="alternative" class="col-md-2 control-label">{% trans 'Alternatives' %}</label> | ||
16 | + <div class="col-md-10" id="radios"> | ||
17 | + <div class="radio radio-primary"> | ||
18 | + <label> | ||
19 | + <input checked type="radio" name="alternatives" id="alternative1" value="1"> | ||
20 | + <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea> | ||
21 | + </label> | ||
22 | + </div> | ||
23 | + <div class="radio radio-primary"> | ||
24 | + <label> | ||
25 | + <input type="radio" name="alternatives" id="alternative2" value="2"> | ||
26 | + <textarea class="form-control" rows="1" placeholder="Write your alternative"></textarea> | ||
27 | + </label> | ||
28 | + </div> | ||
29 | + </div> | ||
30 | +</div> | ||
31 | +<!-- new alternative button --> | ||
32 | +<div class="form-group"> | ||
33 | + <div class="col-md-12 col-md-offset-2"> | ||
34 | + <button type="button" class="btn btn-primary" id="newAlternative">{% trans 'New Alternative' %}</button> | ||
35 | + </div> | ||
36 | +</div> | ||
37 | +<div class="form-group"> | ||
38 | + <div class="col-md-12 col-md-offset-2"> | ||
39 | + <button type="submit" class="btn btn-primary">Save</button> | ||
40 | + <button type="cancel" class="btn btn-default">Cancel</button> | ||
41 | + </div> | ||
42 | +</div> |
exam/templates/exam/questions/multiple_choice_question.html.py
0 → 100644
@@ -0,0 +1,42 @@ | @@ -0,0 +1,42 @@ | ||
1 | +BBBB BBBB | ||
2 | + | ||
3 | +XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX | ||
4 | + | ||
5 | + XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
6 | + | ||
7 | + | ||
8 | + XXXX XXXXXXXXXXXXXXXXXX | ||
9 | + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
10 | + XXXXXX | ||
11 | + | ||
12 | + | ||
13 | +XXXXXX | ||
14 | +XXXX XXXXXXXXXXXXXXXXXXX | ||
15 | + XXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX gettext(u'Alternatives') XXXXXXXX | ||
16 | + XXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXX | ||
17 | + XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX | ||
18 | + XXXXXXX | ||
19 | + XXXXXX XXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
20 | + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
21 | + XXXXXXXX | ||
22 | + XXXXXX | ||
23 | + XXXX XXXXXXXXXXXX XXXXXXXXXXXXXXX | ||
24 | + XXXXXXX | ||
25 | + XXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
26 | + XXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
27 | + XXXXXXXX | ||
28 | + XXXXXX | ||
29 | + XXXXXX | ||
30 | +XXXXXX | ||
31 | +XXXX XXX XXXXXXXXXXX XXXXXX XXX | ||
32 | +XXXX XXXXXXXXXXXXXXXXXXX | ||
33 | + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
34 | + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXX XXXXXXXXXXXX XXXXXXXXXXX | ||
35 | + XXXXXX | ||
36 | +XXXXXX | ||
37 | +XXXX XXXXXXXXXXXXXXXXXXX | ||
38 | + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
39 | + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX | ||
40 | + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
41 | + XXXXXX | ||
42 | +XXXXXX |
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +{% load i18n %} | ||
2 | + | ||
3 | +<div class="row form-group" > | ||
4 | + <div class="col-md-1"> | ||
5 | + </br> | ||
6 | + <label><span class="glyphicon glyphicon-move"></span></label> | ||
7 | + </div> | ||
8 | + <div class="col-md-10"> | ||
9 | + <input class="form-control" placeholder='{% trans "Write your alternative" %}'></input> | ||
10 | + </div> | ||
11 | + <div class="col-md-1"> | ||
12 | + </br> | ||
13 | + <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
14 | + </div> | ||
15 | +</div> |
exam/templates/exam/questions/true_or_false_answer.html.py
0 → 100644
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +BBBB BBBB | ||
2 | + | ||
3 | +XXXX XXXXXXXXXX XXXXXXXXXXX X | ||
4 | + XXXX XXXXXXXXXXXXXXXXX | ||
5 | + XXXXX | ||
6 | + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
7 | + XXXXXX | ||
8 | + XXXX XXXXXXXXXXXXXXXXXX | ||
9 | + XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Write your alternative') XXXXXXXXXX | ||
10 | + XXXXXX | ||
11 | + XXXX XXXXXXXXXXXXXXXXX | ||
12 | + XXXXX | ||
13 | + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
14 | + XXXXXX | ||
15 | +XXXXXX |
exam/templates/exam/questions/true_or_false_question.html
0 → 100644
@@ -0,0 +1,67 @@ | @@ -0,0 +1,67 @@ | ||
1 | +{# {% extends "base.html" %} #} | ||
2 | + | ||
3 | +{% load i18n %} | ||
4 | +{# {% block content %} #} | ||
5 | +<style> | ||
6 | + .glyphicon-remove:hover { | ||
7 | + cursor: pointer; | ||
8 | + } | ||
9 | + .glyphicon-move:hover { | ||
10 | + cursor: move; | ||
11 | + } | ||
12 | +</style> | ||
13 | +<div class="" id="0"> | ||
14 | + <div class="row form-group"> | ||
15 | + <div class="col-md-1"> | ||
16 | + </br> | ||
17 | + <label><span class="glyphicon glyphicon-move"></span></label> | ||
18 | + </div> | ||
19 | + <div class="col-md-2"> | ||
20 | + <label for="questionName" class="control-label">{% trans "Question" %}</label> | ||
21 | + </div> | ||
22 | + <div class="col-md-9"> | ||
23 | + <div class="row"> | ||
24 | + <div class="col-md-11"> | ||
25 | + <input class="form-control" id="questionName" placeholder="{% trans 'Question' %}"></input> | ||
26 | + </div> | ||
27 | + <div class="col-md-1"> | ||
28 | + </br> | ||
29 | + <label><span class="glyphicon glyphicon-remove"></span></label> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + | ||
34 | + </div> | ||
35 | + <div class="row"> | ||
36 | + <div class="col-md-offset-1 col-md-2"> | ||
37 | + <label class="control-label">{% trans "Alternatives: T/F" %}</label> | ||
38 | + </div> | ||
39 | + <div class="col-md-9" id="radiosTF"> | ||
40 | + {% include "exam/true_or_false_answer.html" %} | ||
41 | + </div> | ||
42 | + </div> | ||
43 | + <div class="form-group"> | ||
44 | + <div class="col-md-9 col-md-offset-3"> | ||
45 | + <button type="button" class="btn btn-primary btn-raised" id="new_alternative">{% trans "New Alternative" %}</button> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | +</div> | ||
49 | +<script type="text/javascript"> | ||
50 | + $("#new_alternative").click(function(){ | ||
51 | + $.get("{% url 'course:exam:true_or_false_answer' %}", function(data){ | ||
52 | + $("#radiosTF").append(data); | ||
53 | + }); | ||
54 | + }); | ||
55 | + //deve ser importado apenas depois do html | ||
56 | + $( "#radiosTF" ).sortable({ // utilizado para fazer a re-organização das respostas | ||
57 | + delay: 100, | ||
58 | + distance: 5, | ||
59 | + update: function( event, ui ) { | ||
60 | + var cont = 1; | ||
61 | + $("#radiosTF div div input").each(function(){ | ||
62 | + $(this).attr('name',cont++); | ||
63 | + }); | ||
64 | + }, | ||
65 | + }); | ||
66 | +</script> | ||
67 | +{# {% endblock content %} #} |
exam/templates/exam/questions/true_or_false_question.html.py
0 → 100644
@@ -0,0 +1,67 @@ | @@ -0,0 +1,67 @@ | ||
1 | + | ||
2 | + | ||
3 | +BBBB BBBB | ||
4 | + | ||
5 | +XXXXXXX | ||
6 | + XXXXXXXXXXXXXXXXXXXXXXX X | ||
7 | + XXXXXXX XXXXXXXX | ||
8 | + X | ||
9 | + XXXXXXXXXXXXXXXXXXXXX X | ||
10 | + XXXXXXX XXXXX | ||
11 | + X | ||
12 | +XXXXXXXX | ||
13 | +XXXX XXXXXXXX XXXXXXX | ||
14 | + XXXX XXXXXXXXXX XXXXXXXXXXXX | ||
15 | + XXXX XXXXXXXXXXXXXXXXX | ||
16 | + XXXXX | ||
17 | + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
18 | + XXXXXX | ||
19 | + XXXX XXXXXXXXXXXXXXXXX | ||
20 | + XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
21 | + XXXXXX | ||
22 | + XXXX XXXXXXXXXXXXXXXXX | ||
23 | + XXXX XXXXXXXXXXXX | ||
24 | + XXXX XXXXXXXXXXXXXXXXXX | ||
25 | + XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXX | ||
26 | + XXXXXX | ||
27 | + XXXX XXXXXXXXXXXXXXXXX | ||
28 | + XXXXX | ||
29 | + XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
30 | + XXXXXX | ||
31 | + XXXXXX | ||
32 | + XXXXXX | ||
33 | + | ||
34 | + XXXXXX | ||
35 | + XXXX XXXXXXXXXXXX | ||
36 | + XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
37 | + XXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Alternatives: T/F') XXXXXXXX | ||
38 | + XXXXXX | ||
39 | + XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX | ||
40 | + BBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB | ||
41 | + XXXXXX | ||
42 | + XXXXXX | ||
43 | + XXXX XXXXXXXXXXXXXXXXXXX | ||
44 | + XXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
45 | + XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX gettext(u'New Alternative') XXXXXXXXX | ||
46 | + XXXXXX | ||
47 | + XXXXXX | ||
48 | +XXXXXX | ||
49 | +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXX | ||
50 | + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
51 | + XXXXXXXBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBXX XXXXXXXXXXXXXXX | ||
52 | + XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
53 | + XXX | ||
54 | + XXX | ||
55 | + XXXXXX XXX XXXXXXXXX XXXXXX XXXXXX XX XXXX | ||
56 | + XX XXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXX XXXX XXXXX X XXXXXXXXXXXXXX XXX XXXXXXXXX | ||
57 | + XXXXXX XXXX | ||
58 | + XXXXXXXXX XX | ||
59 | + XXXXXXX XXXXXXXXX XXXXXX XX X X | ||
60 | + XXX XXXX X XX | ||
61 | + XXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
62 | + XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
63 | + XXX | ||
64 | + XX | ||
65 | + XXX | ||
66 | +XXXXXXXXX | ||
67 | + |
exam/templates/exam/remove.html
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +{% extends "exam/create.html" %} | ||
2 | + | ||
3 | +{% load i18n static%} | ||
4 | + | ||
5 | +{% block title_exam %} | ||
6 | +<!-- Put your title here!!! --> | ||
7 | +<h4 class="modal-title" id="myModalLabel">{% trans "Delete Exam" %}</h4> | ||
8 | +{% endblock title_exam %} | ||
9 | + | ||
10 | +{% block content_exam %} | ||
11 | +<script src="{% static 'js/modal_exam.js' %}"></script> | ||
12 | +<!-- Put ONLY your content here!!! --> | ||
13 | +<form id="delete_form" action="" method="post"> | ||
14 | + {% csrf_token %} | ||
15 | + <p>{% trans 'Are you sure you want to delete the subject' %} "{{exam.name}}"?</p> | ||
16 | +</form> | ||
17 | +{% endblock content_exam %} | ||
18 | + | ||
19 | +{% block button_save %} | ||
20 | +<button type="submite" id="button" form="delete_form" class="btn btn-primary btn-raised">{% trans "Delete" %}</button> | ||
21 | +<script> | ||
22 | + $("#delete_form").submit(function(event) { | ||
23 | + Submite.remove("{% url 'course:exam:delete_exam' exam.slug %}",$(this).serialize(),"#exam_{{exam.slug}}"); | ||
24 | + event.preventDefault(); | ||
25 | + }); | ||
26 | +</script> | ||
27 | +{% endblock button_save %} |
exam/templates/exam/true_or_false_answer.html
@@ -1,15 +0,0 @@ | @@ -1,15 +0,0 @@ | ||
1 | -{% load i18n %} | ||
2 | - | ||
3 | -<div class="row form-group" > | ||
4 | - <div class="col-md-1"> | ||
5 | - </br> | ||
6 | - <label><span class="glyphicon glyphicon-move"></span></label> | ||
7 | - </div> | ||
8 | - <div class="col-md-10"> | ||
9 | - <input class="form-control" placeholder='{% trans "Write your alternative" %}'></input> | ||
10 | - </div> | ||
11 | - <div class="col-md-1"> | ||
12 | - </br> | ||
13 | - <label><span class="glyphicon glyphicon-remove" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></span></label> | ||
14 | - </div> | ||
15 | -</div> |
exam/templates/exam/true_or_false_answer.html.py
@@ -1,15 +0,0 @@ | @@ -1,15 +0,0 @@ | ||
1 | -BBBB BBBB | ||
2 | - | ||
3 | -XXXX XXXXXXXXXX XXXXXXXXXXX X | ||
4 | - XXXX XXXXXXXXXXXXXXXXX | ||
5 | - XXXXX | ||
6 | - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
7 | - XXXXXX | ||
8 | - XXXX XXXXXXXXXXXXXXXXXX | ||
9 | - XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Write your alternative') XXXXXXXXXX | ||
10 | - XXXXXX | ||
11 | - XXXX XXXXXXXXXXXXXXXXX | ||
12 | - XXXXX | ||
13 | - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
14 | - XXXXXX | ||
15 | -XXXXXX |
exam/templates/exam/true_or_false_question.html
@@ -1,67 +0,0 @@ | @@ -1,67 +0,0 @@ | ||
1 | -{# {% extends "base.html" %} #} | ||
2 | - | ||
3 | -{% load i18n %} | ||
4 | -{# {% block content %} #} | ||
5 | -<style> | ||
6 | - .glyphicon-remove:hover { | ||
7 | - cursor: pointer; | ||
8 | - } | ||
9 | - .glyphicon-move:hover { | ||
10 | - cursor: move; | ||
11 | - } | ||
12 | -</style> | ||
13 | -<div class="" id="0"> | ||
14 | - <div class="row form-group"> | ||
15 | - <div class="col-md-1"> | ||
16 | - </br> | ||
17 | - <label><span class="glyphicon glyphicon-move"></span></label> | ||
18 | - </div> | ||
19 | - <div class="col-md-2"> | ||
20 | - <label for="questionName" class="control-label">{% trans "Question" %}</label> | ||
21 | - </div> | ||
22 | - <div class="col-md-9"> | ||
23 | - <div class="row"> | ||
24 | - <div class="col-md-11"> | ||
25 | - <input class="form-control" id="questionName" placeholder="{% trans 'Question' %}"></input> | ||
26 | - </div> | ||
27 | - <div class="col-md-1"> | ||
28 | - </br> | ||
29 | - <label><span class="glyphicon glyphicon-remove"></span></label> | ||
30 | - </div> | ||
31 | - </div> | ||
32 | - </div> | ||
33 | - | ||
34 | - </div> | ||
35 | - <div class="row"> | ||
36 | - <div class="col-md-offset-1 col-md-2"> | ||
37 | - <label class="control-label">{% trans "Alternatives: T/F" %}</label> | ||
38 | - </div> | ||
39 | - <div class="col-md-9" id="radiosTF"> | ||
40 | - {% include "exam/true_or_false_answer.html" %} | ||
41 | - </div> | ||
42 | - </div> | ||
43 | - <div class="form-group"> | ||
44 | - <div class="col-md-9 col-md-offset-3"> | ||
45 | - <button type="button" class="btn btn-primary btn-raised" id="new_alternative">{% trans "New Alternative" %}</button> | ||
46 | - </div> | ||
47 | - </div> | ||
48 | -</div> | ||
49 | -<script type="text/javascript"> | ||
50 | - $("#new_alternative").click(function(){ | ||
51 | - $.get("{% url 'course:exam:true_or_false_answer' %}", function(data){ | ||
52 | - $("#radiosTF").append(data); | ||
53 | - }); | ||
54 | - }); | ||
55 | - //deve ser importado apenas depois do html | ||
56 | - $( "#radiosTF" ).sortable({ // utilizado para fazer a re-organização das respostas | ||
57 | - delay: 100, | ||
58 | - distance: 5, | ||
59 | - update: function( event, ui ) { | ||
60 | - var cont = 1; | ||
61 | - $("#radiosTF div div input").each(function(){ | ||
62 | - $(this).attr('name',cont++); | ||
63 | - }); | ||
64 | - }, | ||
65 | - }); | ||
66 | -</script> | ||
67 | -{# {% endblock content %} #} |
exam/templates/exam/true_or_false_question.html.py
@@ -1,67 +0,0 @@ | @@ -1,67 +0,0 @@ | ||
1 | - | ||
2 | - | ||
3 | -BBBB BBBB | ||
4 | - | ||
5 | -XXXXXXX | ||
6 | - XXXXXXXXXXXXXXXXXXXXXXX X | ||
7 | - XXXXXXX XXXXXXXX | ||
8 | - X | ||
9 | - XXXXXXXXXXXXXXXXXXXXX X | ||
10 | - XXXXXXX XXXXX | ||
11 | - X | ||
12 | -XXXXXXXX | ||
13 | -XXXX XXXXXXXX XXXXXXX | ||
14 | - XXXX XXXXXXXXXX XXXXXXXXXXXX | ||
15 | - XXXX XXXXXXXXXXXXXXXXX | ||
16 | - XXXXX | ||
17 | - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
18 | - XXXXXX | ||
19 | - XXXX XXXXXXXXXXXXXXXXX | ||
20 | - XXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Question') XXXXXXXX | ||
21 | - XXXXXX | ||
22 | - XXXX XXXXXXXXXXXXXXXXX | ||
23 | - XXXX XXXXXXXXXXXX | ||
24 | - XXXX XXXXXXXXXXXXXXXXXX | ||
25 | - XXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXX gettext(u'Question') XXXXXXXXXX | ||
26 | - XXXXXX | ||
27 | - XXXX XXXXXXXXXXXXXXXXX | ||
28 | - XXXXX | ||
29 | - XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
30 | - XXXXXX | ||
31 | - XXXXXX | ||
32 | - XXXXXX | ||
33 | - | ||
34 | - XXXXXX | ||
35 | - XXXX XXXXXXXXXXXX | ||
36 | - XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX | ||
37 | - XXXXXX XXXXXXXXXXXXXXXXXXXXXX gettext(u'Alternatives: T/F') XXXXXXXX | ||
38 | - XXXXXX | ||
39 | - XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX | ||
40 | - BBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB | ||
41 | - XXXXXX | ||
42 | - XXXXXX | ||
43 | - XXXX XXXXXXXXXXXXXXXXXXX | ||
44 | - XXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX | ||
45 | - XXXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX gettext(u'New Alternative') XXXXXXXXX | ||
46 | - XXXXXX | ||
47 | - XXXXXX | ||
48 | -XXXXXX | ||
49 | -XXXXXXX XXXXXXXXXXXXXXXXXXXXXXX | ||
50 | - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
51 | - XXXXXXXBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBXX XXXXXXXXXXXXXXX | ||
52 | - XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
53 | - XXX | ||
54 | - XXX | ||
55 | - XXXXXX XXX XXXXXXXXX XXXXXX XXXXXX XX XXXX | ||
56 | - XX XXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXX XXXX XXXXX X XXXXXXXXXXXXXX XXX XXXXXXXXX | ||
57 | - XXXXXX XXXX | ||
58 | - XXXXXXXXX XX | ||
59 | - XXXXXXX XXXXXXXXX XXXXXX XX X X | ||
60 | - XXX XXXX X XX | ||
61 | - XXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXX | ||
62 | - XXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
63 | - XXX | ||
64 | - XX | ||
65 | - XXX | ||
66 | -XXXXXXXXX | ||
67 | - |
exam/templates/exam/update.html
@@ -0,0 +1,32 @@ | @@ -0,0 +1,32 @@ | ||
1 | +{% extends "exam/create.html" %} | ||
2 | + | ||
3 | +{% load i18n dict_access static%} | ||
4 | + | ||
5 | +{% block title_exam %} | ||
6 | +<!-- Put your title here!!! --> | ||
7 | +<h4 class="modal-title" id="myModalLabel">{% trans "Update a Exam" %}</h4> | ||
8 | +{% endblock title_exam %} | ||
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 %} | ||
14 | + | ||
15 | +{% block script_exam %} | ||
16 | +<script type="text/javascript"> | ||
17 | + var locale = navigator.language || navigator.userLanguage; | ||
18 | + | ||
19 | + $('.date-picker').datepicker({ | ||
20 | + language: locale, | ||
21 | + }); | ||
22 | +// Este js tem que ficar aqui se não o button add não vai funcionar | ||
23 | + $("#add").click(function (){ | ||
24 | + Answer.init('{% url "course:exam:answer_exam" %}'); | ||
25 | + }); | ||
26 | + | ||
27 | + $("#form").submit(function(event) { | ||
28 | + Submite.post("{% url 'course:exam:update_exam' exam.slug %}",$(this).serialize()); | ||
29 | + event.preventDefault(); | ||
30 | + }); | ||
31 | +</script> | ||
32 | +{% endblock script_exam %} |
exam/templates/exam/view.html
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +{% extends "exam/create.html" %} | ||
2 | + | ||
3 | +{% load i18n dict_access static%} | ||
4 | + | ||
5 | +{% block style %} | ||
6 | +{% endblock %} | ||
7 | + | ||
8 | +{% block title_exam %} | ||
9 | +<!-- Put your title here!!! --> | ||
10 | +<h4 class="modal-title" id="myModalLabel">{{exam.name}}</h4> | ||
11 | +{% endblock title_exam %} | ||
12 | + | ||
13 | +{% block content_exam %} | ||
14 | +<!-- Put ONLY your content here!!! --> | ||
15 | +<div class="row"> | ||
16 | + <div class="col-md-10 col-md-offset-1"> | ||
17 | + <p>{% trans "Limit date:" %} {{exam.limit_date|date:'d/m/y'}}</p> | ||
18 | + </div> | ||
19 | + | ||
20 | +</div> | ||
21 | +{% endblock content_exam %} | ||
22 | + | ||
23 | +{% block button_save %} | ||
24 | +<!-- Put curtom buttons here!!! --> | ||
25 | +{% if not status %} | ||
26 | +<button type="button" onclick="javascript:modal.get('{% url 'course:exam:answer_student_exam' exam.slug%}','#exam','#modal_exam');$('div.modal-backdrop.fade.in').remove();" class="btn btn-primary btn-raised">{% trans "Answer" %}</button> | ||
27 | +{% endif %} | ||
28 | +{% endblock button_save %} |
exam/views.py
@@ -10,6 +10,7 @@ from rolepermissions.verifications import has_role | @@ -10,6 +10,7 @@ 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.db.models import Q |
12 | from datetime import datetime | 12 | from datetime import datetime |
13 | +import time | ||
13 | # from django.views.generic.edit import FormMixin | 14 | # from django.views.generic.edit import FormMixin |
14 | 15 | ||
15 | from .forms import ExamForm | 16 | from .forms import ExamForm |
@@ -59,10 +60,10 @@ class ViewExam(LoginRequiredMixin, LogMixin, generic.DetailView): | @@ -59,10 +60,10 @@ class ViewExam(LoginRequiredMixin, LogMixin, generic.DetailView): | ||
59 | self.log_context['course_slug'] = exam.topic.subject.course.slug | 60 | self.log_context['course_slug'] = exam.topic.subject.course.slug |
60 | self.log_context['course_category_id'] = exam.topic.subject.course.category.id | 61 | self.log_context['course_category_id'] = exam.topic.subject.course.category.id |
61 | self.log_context['course_category_name'] = exam.topic.subject.course.category.name | 62 | self.log_context['course_category_name'] = exam.topic.subject.course.category.name |
63 | + self.request.session['time_spent'] = str(int(time.time())) | ||
62 | 64 | ||
63 | super(ViewExam, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 65 | super(ViewExam, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
64 | 66 | ||
65 | - self.request.session['time_spent'] = str(datetime.now()) | ||
66 | self.request.session['log_id'] = Log.objects.latest('id').id | 67 | self.request.session['log_id'] = Log.objects.latest('id').id |
67 | 68 | ||
68 | return context | 69 | return context |
@@ -105,7 +106,7 @@ class CreateExam(LoginRequiredMixin,HasRoleMixin, LogMixin, NotificationMixin, g | @@ -105,7 +106,7 @@ class CreateExam(LoginRequiredMixin,HasRoleMixin, LogMixin, NotificationMixin, g | ||
105 | self.object.save() | 106 | self.object.save() |
106 | 107 | ||
107 | super(CreateExam, self).createNotification(message="created an Exam "+ self.object.name, actor=self.request.user, | 108 | super(CreateExam, self).createNotification(message="created an Exam "+ self.object.name, actor=self.request.user, |
108 | - resource_name=self.object.name, resource_link= reverse('course:exam:view_exam', args=[self.object.slug]), | 109 | + resource_name=self.object.name, resource_link= reverse('course:exam:view_exam', args=[self.object.slug]), |
109 | users=self.object.topic.subject.students.all()) | 110 | users=self.object.topic.subject.students.all()) |
110 | for key in self.request.POST: | 111 | for key in self.request.POST: |
111 | if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | 112 | if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): |
@@ -318,6 +319,7 @@ class AnswerStudentExam(LoginRequiredMixin, LogMixin, generic.CreateView): | @@ -318,6 +319,7 @@ class AnswerStudentExam(LoginRequiredMixin, LogMixin, generic.CreateView): | ||
318 | minutes = int(secs / 60) % 60 | 319 | minutes = int(secs / 60) % 60 |
319 | secs = secs % 60 | 320 | secs = secs % 60 |
320 | 321 | ||
322 | + self.log_context['timestamp_end'] = str(int(time.time())) | ||
321 | self.log_context['time_spent'] = {} | 323 | self.log_context['time_spent'] = {} |
322 | self.log_context['time_spent']['hours'] = hours | 324 | self.log_context['time_spent']['hours'] = hours |
323 | self.log_context['time_spent']['minutes'] = minutes | 325 | self.log_context['time_spent']['minutes'] = minutes |
@@ -346,6 +348,7 @@ class AnswerStudentExam(LoginRequiredMixin, LogMixin, generic.CreateView): | @@ -346,6 +348,7 @@ class AnswerStudentExam(LoginRequiredMixin, LogMixin, generic.CreateView): | ||
346 | context['answers'] = answers | 348 | context['answers'] = answers |
347 | context['keys'] = keys | 349 | context['keys'] = keys |
348 | 350 | ||
351 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
349 | self.request.session['time_spent'] = str(datetime.now()) | 352 | self.request.session['time_spent'] = str(datetime.now()) |
350 | 353 | ||
351 | return context | 354 | return context |
forum/templates/forum/forum_view.html
1 | -{% extends 'base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n permission_tags list_post %} | 3 | {% load static i18n permission_tags list_post %} |
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
@@ -21,32 +21,19 @@ | @@ -21,32 +21,19 @@ | ||
21 | </ol> | 21 | </ol> |
22 | {% endblock %} | 22 | {% endblock %} |
23 | 23 | ||
24 | -{% block sidebar %} | ||
25 | - <div class="panel panel-primary navigation"> | ||
26 | - <div class="panel-heading"> | ||
27 | - <h5>{% trans 'Menu' %}</h5> | ||
28 | - </div> | ||
29 | - <div class="panel-body"> | ||
30 | - <ul class="nav nav-pills nav-stacked"> | ||
31 | - <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
32 | - <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
33 | - </ul> | ||
34 | - </div> | ||
35 | - </div> | ||
36 | 24 | ||
37 | - {% if request.user|has_role:'system_admin' or request.user|has_role:'professor' and request.user in forum.topic.subject.professors.all %} | ||
38 | - <div class="panel panel-primary navigation"> | ||
39 | - <div class="panel-heading"> | ||
40 | - <h3 class="panel-title">{% trans 'Actions' %}</h3> | ||
41 | - </div> | ||
42 | - <div class="panel-body"> | ||
43 | - <ul class="nav nav-pills nav-stacked"> | ||
44 | - <li><a href="javascript:editForum('{% url 'course:forum:update' forum.id %}', '{{ forum.id }}', '{% trans 'Forum edited successfully!' %}')">{% trans 'Edit' %}</a></li> | ||
45 | - <li><a href="javascript:delete_forum('{% url 'course:forum:delete' forum.id %}', '{{ forum.id }}', '{% trans "Are you sure you want to delete this forum?" %}', '{% url 'course:view_subject' forum.topic.subject.slug %}')">{% trans 'Delete' %}</a></li> | ||
46 | - </ul> | ||
47 | - </div> | 25 | +{% block menu %} |
26 | + {% if user|has_role:'system_admin' or user|has_role:'professor'%} | ||
27 | + <li> | ||
28 | + <a href="#menu_forum" class="accordion" data-toggle="collapse">{% trans 'Forum' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> | ||
29 | + <div id="menu_forum" class="collapse"> | ||
30 | + <ul class="nav nav-pill nav-stacked accordion_list"> | ||
31 | + <li><a href="javascript:editForum('{% url 'course:forum:update' forum.id %}', '{{ forum.id }}', '{% trans 'Forum edited successfully!' %}')">{% trans 'Edit' %}</a></li> | ||
32 | + <li><a href="javascript:delete_forum('{% url 'course:forum:delete' forum.id %}', '{{ forum.id }}', '{% trans "Are you sure you want to delete this forum?" %}', '{% url 'course:view_subject' forum.topic.subject.slug %}')">{% trans 'Delete' %}</a></li> | ||
33 | + </ul> | ||
48 | </div> | 34 | </div> |
49 | - {% endif %} | 35 | + </li> |
36 | + {% endif %} | ||
50 | {% endblock %} | 37 | {% endblock %} |
51 | 38 | ||
52 | {% block content %} | 39 | {% block content %} |
@@ -130,4 +117,3 @@ | @@ -130,4 +117,3 @@ | ||
130 | </div> | 117 | </div> |
131 | </div> | 118 | </div> |
132 | {% endblock %} | 119 | {% endblock %} |
133 | - |
forum/views.py
@@ -8,6 +8,7 @@ from django.core.paginator import Paginator, EmptyPage | @@ -8,6 +8,7 @@ from django.core.paginator import Paginator, EmptyPage | ||
8 | from django.http import Http404, JsonResponse | 8 | from django.http import Http404, JsonResponse |
9 | from django.urls import reverse | 9 | from django.urls import reverse |
10 | from django.template.loader import render_to_string | 10 | from django.template.loader import render_to_string |
11 | +import time | ||
11 | 12 | ||
12 | from rolepermissions.mixins import HasRoleMixin | 13 | from rolepermissions.mixins import HasRoleMixin |
13 | from rolepermissions.verifications import has_object_permission | 14 | from rolepermissions.verifications import has_object_permission |
@@ -229,10 +230,10 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView): | @@ -229,10 +230,10 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView): | ||
229 | self.log_context['course_slug'] = forum.topic.subject.course.slug | 230 | self.log_context['course_slug'] = forum.topic.subject.course.slug |
230 | self.log_context['course_category_id'] = forum.topic.subject.course.category.id | 231 | self.log_context['course_category_id'] = forum.topic.subject.course.category.id |
231 | self.log_context['course_category_name'] = forum.topic.subject.course.category.name | 232 | self.log_context['course_category_name'] = forum.topic.subject.course.category.name |
233 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
232 | 234 | ||
233 | super(ForumDetailView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 235 | super(ForumDetailView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
234 | 236 | ||
235 | - self.request.session['time_spent'] = str(datetime.datetime.now()) | ||
236 | self.request.session['log_id'] = Log.objects.latest('id').id | 237 | self.request.session['log_id'] = Log.objects.latest('id').id |
237 | 238 | ||
238 | return super(ForumDetailView, self).dispatch(*args, **kwargs) | 239 | return super(ForumDetailView, self).dispatch(*args, **kwargs) |
links/templates/links/render_link.html
1 | -<li id="link_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:get_modal_link('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#divModalLink')">{{link.name}}</a></li> | 1 | +<li id="link_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:modal.get('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#requisicoes_ajax')">{{link.name}}</a></li> |
links/views.py
@@ -10,6 +10,7 @@ from core.mixins import NotificationMixin | @@ -10,6 +10,7 @@ from core.mixins import NotificationMixin | ||
10 | from django.urls import reverse | 10 | from django.urls import reverse |
11 | from django.core.files.base import ContentFile | 11 | from django.core.files.base import ContentFile |
12 | from rolepermissions.verifications import has_role | 12 | from rolepermissions.verifications import has_role |
13 | +import time | ||
13 | 14 | ||
14 | from core.models import Log | 15 | from core.models import Log |
15 | from core.mixins import LogMixin | 16 | from core.mixins import LogMixin |
@@ -244,6 +245,7 @@ class ViewLink(LoginRequiredMixin, HasRoleMixin, LogMixin, generic.DetailView): | @@ -244,6 +245,7 @@ class ViewLink(LoginRequiredMixin, HasRoleMixin, LogMixin, generic.DetailView): | ||
244 | self.log_context['course_slug'] = link.topic.subject.course.slug | 245 | self.log_context['course_slug'] = link.topic.subject.course.slug |
245 | self.log_context['course_category_id'] = link.topic.subject.course.category.id | 246 | self.log_context['course_category_id'] = link.topic.subject.course.category.id |
246 | self.log_context['course_category_name'] = link.topic.subject.course.category.name | 247 | self.log_context['course_category_name'] = link.topic.subject.course.category.name |
248 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
247 | 249 | ||
248 | super(ViewLink, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 250 | super(ViewLink, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
249 | 251 |
poll/templates/poll/create.html
@@ -144,7 +144,7 @@ | @@ -144,7 +144,7 @@ | ||
144 | <div class="modal-footer"> | 144 | <div class="modal-footer"> |
145 | 145 | ||
146 | <!-- Don't remove that!!! --> | 146 | <!-- Don't remove that!!! --> |
147 | - <button type="button" class="btn btn-default btn-raised" data-dismiss="modal">{% trans "Close" %}</button> | 147 | + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans "Close" %}</button> |
148 | {% block button_save %} | 148 | {% block button_save %} |
149 | <!-- Put curtom buttons here!!! --> | 149 | <!-- Put curtom buttons here!!! --> |
150 | <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> | 150 | <button type="submite" id="button" form="form" class="btn btn-primary btn-raised">{% trans "Create" %}</button> |
poll/views.py
@@ -10,6 +10,7 @@ from rolepermissions.verifications import has_role | @@ -10,6 +10,7 @@ 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.db.models import Q |
12 | from django.urls import reverse | 12 | from django.urls import reverse |
13 | +import time | ||
13 | 14 | ||
14 | from .forms import PollForm | 15 | from .forms import PollForm |
15 | from .models import Poll, Answer, AnswersStudent | 16 | from .models import Poll, Answer, AnswersStudent |
@@ -48,10 +49,10 @@ class ViewPoll(LoginRequiredMixin, LogMixin, generic.DetailView): | @@ -48,10 +49,10 @@ class ViewPoll(LoginRequiredMixin, LogMixin, generic.DetailView): | ||
48 | self.log_context['course_slug'] = poll.topic.subject.course.slug | 49 | self.log_context['course_slug'] = poll.topic.subject.course.slug |
49 | self.log_context['course_category_id'] = poll.topic.subject.course.category.id | 50 | self.log_context['course_category_id'] = poll.topic.subject.course.category.id |
50 | self.log_context['course_category_name'] = poll.topic.subject.course.category.name | 51 | self.log_context['course_category_name'] = poll.topic.subject.course.category.name |
52 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
51 | 53 | ||
52 | super(ViewPoll, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 54 | super(ViewPoll, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
53 | 55 | ||
54 | - self.request.session['time_spent'] = str(datetime.datetime.now()) | ||
55 | self.request.session['log_id'] = Log.objects.latest('id').id | 56 | self.request.session['log_id'] = Log.objects.latest('id').id |
56 | 57 | ||
57 | return poll | 58 | return poll |
@@ -315,6 +316,7 @@ class AnswerStudentPoll(LoginRequiredMixin, LogMixin, generic.CreateView): | @@ -315,6 +316,7 @@ class AnswerStudentPoll(LoginRequiredMixin, LogMixin, generic.CreateView): | ||
315 | def dispatch(self, *args, **kwargs): | 316 | def dispatch(self, *args, **kwargs): |
316 | if self.request.method == 'GET': | 317 | if self.request.method == 'GET': |
317 | self.request.session['time_spent'] = str(datetime.datetime.now()) | 318 | self.request.session['time_spent'] = str(datetime.datetime.now()) |
319 | + self.log_context['timestamp_start'] = str(int(time.time())) | ||
318 | 320 | ||
319 | return super(AnswerStudentPoll, self).dispatch(*args, **kwargs) | 321 | return super(AnswerStudentPoll, self).dispatch(*args, **kwargs) |
320 | 322 | ||
@@ -344,6 +346,7 @@ class AnswerStudentPoll(LoginRequiredMixin, LogMixin, generic.CreateView): | @@ -344,6 +346,7 @@ class AnswerStudentPoll(LoginRequiredMixin, LogMixin, generic.CreateView): | ||
344 | self.log_context['course_slug'] = poll.topic.subject.course.slug | 346 | self.log_context['course_slug'] = poll.topic.subject.course.slug |
345 | self.log_context['course_category_id'] = poll.topic.subject.course.category.id | 347 | self.log_context['course_category_id'] = poll.topic.subject.course.category.id |
346 | self.log_context['course_category_name'] = poll.topic.subject.course.category.name | 348 | self.log_context['course_category_name'] = poll.topic.subject.course.category.name |
349 | + self.log_context['timestamp_end'] = str(int(time.time())) | ||
347 | 350 | ||
348 | date_time_click = datetime.datetime.strptime(self.request.session.get('time_spent'), "%Y-%m-%d %H:%M:%S.%f") | 351 | date_time_click = datetime.datetime.strptime(self.request.session.get('time_spent'), "%Y-%m-%d %H:%M:%S.%f") |
349 | _now = datetime.datetime.now() | 352 | _now = datetime.datetime.now() |
users/templates/list_users.html
@@ -9,23 +9,11 @@ | @@ -9,23 +9,11 @@ | ||
9 | 9 | ||
10 | {% endblock %} | 10 | {% endblock %} |
11 | 11 | ||
12 | -{% if user|has_role:'system_admin' %} | ||
13 | - {% block sidebar %} | ||
14 | - <div class="panel panel-primary navigation"> | ||
15 | - <div class="panel-heading"> | ||
16 | - <h5>{% trans 'Menu' %}</h5> | ||
17 | - </div> | ||
18 | - <div class="panel-body"> | ||
19 | - <ul class="nav nav-pills nav-stacked"> | ||
20 | - <li><a href="{% url 'core:home' %}">{% trans "Home" %}</a></li> | ||
21 | - <li><a href="{% url 'users:create' %}">{% trans 'Add user' %}</a></li> | ||
22 | - <li><a href="javascript:void(0)">{% trans 'Send email' %}</a></li> | ||
23 | - </ul> | ||
24 | - </div> | ||
25 | - </div> | ||
26 | - {% endblock %} | ||
27 | -{% endif %} | ||
28 | - | 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 %} | ||
29 | 17 | ||
30 | {% block content %} | 18 | {% block content %} |
31 | {% if messages %} | 19 | {% if messages %} |
@@ -108,4 +96,3 @@ | @@ -108,4 +96,3 @@ | ||
108 | </div> | 96 | </div> |
109 | {% endif %} | 97 | {% endif %} |
110 | {% endblock %} | 98 | {% endblock %} |
111 | - |
users/templates/users/index.html
1 | -{% extends 'app/base.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | 4 | ||
@@ -9,18 +9,8 @@ | @@ -9,18 +9,8 @@ | ||
9 | </ol> | 9 | </ol> |
10 | {% endblock %} | 10 | {% endblock %} |
11 | 11 | ||
12 | -{% block sidebar %} | ||
13 | - <div class="list-group"> | ||
14 | - <a href="{% url 'users:manage' %}" class="list-group-item active"> | ||
15 | - {% trans 'System Users' %} | ||
16 | - </a> | ||
17 | - <a href="{% url 'users:create' %}" class="list-group-item"> | ||
18 | - {% trans 'New Account' %} | ||
19 | - </a> | ||
20 | - <a href="#" class="list-group-item"> | ||
21 | - {% trans 'Send Mail' %} | ||
22 | - </a> | ||
23 | - </div> | 12 | +{% block menu %} |
13 | + <li> <a href="{% url 'users:create' %}">{% trans 'Add User' %}</a></li> | ||
24 | {% endblock %} | 14 | {% endblock %} |
25 | 15 | ||
26 | {% block content %} | 16 | {% block content %} |
users/templates/users/profile.html
1 | -{% extends 'home_student.html' %} | 1 | +{% extends 'home.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
5 | -{% load django_bootstrap_breadcrumbs %} | 5 | +{% load django_bootstrap_breadcrumbs permission_tags%} |
6 | 6 | ||
7 | {% block breadcrumbs %} | 7 | {% block breadcrumbs %} |
8 | 8 | ||
@@ -11,21 +11,10 @@ | @@ -11,21 +11,10 @@ | ||
11 | 11 | ||
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | -{% block sidebar %} | ||
15 | - <div class="panel panel-primary navigation"> | ||
16 | - <div class="panel-heading"> | ||
17 | - <h4>{% trans "Menu" %}</h4> | ||
18 | - </div> | ||
19 | - <div class="panel-body"> | ||
20 | - <ul class="nav nav-pills nav-stacked"> | ||
21 | - <li><a href="{% url 'app:index' %}">{% trans 'Home page' %}</a></li> | ||
22 | - <li><a href="{% url 'users:profile' %}">{% trans 'View Profile' %}</a></li> | ||
23 | - <li><a href="{% url 'users:update_profile' %}">{% trans 'Edit Profile' %}</a></li> | ||
24 | - <li><a href="{% url 'users:change_password' %}">{% trans 'Change Password' %}</a></li> | ||
25 | - <li><a href="{% url 'users:remove_account' %}">{% trans 'Remove account' %}</a></li> | ||
26 | - </ul> | ||
27 | - </div> | ||
28 | - </div> | 14 | +{% block menu %} |
15 | + {% if user|has_role:'system_admin' %} | ||
16 | + <li> <a href="{% url 'users:create' %}">{% trans 'Add User' %}</a></li> | ||
17 | + {% endif %} | ||
29 | {% endblock %} | 18 | {% endblock %} |
30 | 19 | ||
31 | {% block content %} | 20 | {% block content %} |
users/templates/users/search.html
@@ -5,7 +5,6 @@ | @@ -5,7 +5,6 @@ | ||
5 | <script type="text/javascript" src="{% static 'js/forum.js' %}"></script> | 5 | <script type="text/javascript" src="{% static 'js/forum.js' %}"></script> |
6 | <script src="{% static 'js/file.js' %}"></script> | 6 | <script src="{% static 'js/file.js' %}"></script> |
7 | <script type="text/javascript" src="{% static 'js/material.js' %}"></script> | 7 | <script type="text/javascript" src="{% static 'js/material.js' %}"></script> |
8 | - <script type = "text/javascript" src="{% static 'js/topic_editation_presentation.js' %}"></script> | ||
9 | <script type = "text/javascript" src="{% static 'js/links.js' %}"></script> | 8 | <script type = "text/javascript" src="{% static 'js/links.js' %}"></script> |
10 | <script src="{% static 'js/modals_requisitions.js'%}"></script> | 9 | <script src="{% static 'js/modals_requisitions.js'%}"></script> |
11 | <script src="{% static 'js/modal_poll.js'%}"></script> | 10 | <script src="{% static 'js/modal_poll.js'%}"></script> |
@@ -21,47 +20,48 @@ | @@ -21,47 +20,48 @@ | ||
21 | {% block content %} | 20 | {% block content %} |
22 | <div class="jumbotron"> | 21 | <div class="jumbotron"> |
23 | <h3>Search Result:</h3> {{qtd}} items found | 22 | <h3>Search Result:</h3> {{qtd}} items found |
23 | + | ||
24 | +{% if link_list %} | ||
24 | <div class="panel-group"> | 25 | <div class="panel-group"> |
25 | <div class="panel panel-default"> | 26 | <div class="panel panel-default"> |
26 | <div class="panel-heading"> | 27 | <div class="panel-heading"> |
27 | <h4 class="panel-title"> | 28 | <h4 class="panel-title"> |
28 | - <a data-toggle="collapse" href="#Link" id="bot"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down"></i>Links</a> | 29 | + <a data-toggle="collapse" href="#Link" id="bot" style="color: black"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down"></i>Links</a> |
29 | </h4> | 30 | </h4> |
30 | </div> | 31 | </div> |
31 | <div id="Link" class="panel-collapse collapse"> | 32 | <div id="Link" class="panel-collapse collapse"> |
32 | <div class="panel-body"> | 33 | <div class="panel-body"> |
33 | 34 | ||
34 | - {% if link_list %} | 35 | + |
35 | {% for link in link_list %} | 36 | {% for link in link_list %} |
36 | <li id = "link_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:modal.get('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#divModalLink')">{{link.name}}</a></li> | 37 | <li id = "link_{{ link.slug }}"><i class="fa fa-link" aria-hidden="true"></i> <a href="javascript:modal.get('{% url 'course:links:view_link' link.slug %}', '#viewLinkModal','#divModalLink')">{{link.name}}</a></li> |
37 | {% endfor %} | 38 | {% endfor %} |
38 | <div class = 'row' id ="divModalLink"> | 39 | <div class = 'row' id ="divModalLink"> |
39 | 40 | ||
40 | </div> | 41 | </div> |
41 | - {% else %} | ||
42 | - {% trans 'No results found'%} | ||
43 | - {% endif%} | 42 | + |
44 | </div> | 43 | </div> |
45 | 44 | ||
46 | </div> | 45 | </div> |
47 | </div> | 46 | </div> |
48 | </div> | 47 | </div> |
48 | +{% endif%} | ||
49 | + | ||
50 | +{% if file_list %} | ||
49 | <div class="panel-group"> | 51 | <div class="panel-group"> |
50 | <div class="panel panel-default"> | 52 | <div class="panel panel-default"> |
51 | <div class="panel-heading"> | 53 | <div class="panel-heading"> |
52 | <h4 class="panel-title"> | 54 | <h4 class="panel-title"> |
53 | - <a data-toggle="collapse" href="#File" id="bot1"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down1"></i>File</a> | 55 | + <a data-toggle="collapse" href="#File" id="bot1" style="color: black"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down1"></i>File</a> |
54 | </h4> | 56 | </h4> |
55 | </div> | 57 | </div> |
56 | <div id="File" class="panel-collapse collapse"> | 58 | <div id="File" class="panel-collapse collapse"> |
57 | <div class="panel-body"> | 59 | <div class="panel-body"> |
58 | - {% if file_list %} | 60 | + |
59 | {% for file in file_list %} | 61 | {% for file in file_list %} |
60 | <li id="file_{{ file.slug }}"><i class="material-icons">{{ file.file_type.icon }}</i> <a href="{% url 'course:file_material_view' file.slug %}" target="_blank">{{ file.name }}</a></li> | 62 | <li id="file_{{ file.slug }}"><i class="material-icons">{{ file.file_type.icon }}</i> <a href="{% url 'course:file_material_view' file.slug %}" target="_blank">{{ file.name }}</a></li> |
61 | {% endfor%} | 63 | {% endfor%} |
62 | - {% else %} | ||
63 | - {% trans 'No results found' %} | ||
64 | - {% endif %} | 64 | + |
65 | 65 | ||
66 | <div class="row" id="divModalFile"> | 66 | <div class="row" id="divModalFile"> |
67 | 67 | ||
@@ -72,65 +72,65 @@ | @@ -72,65 +72,65 @@ | ||
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | +{% endif %} | ||
75 | 76 | ||
77 | +{% if forum_list %} | ||
76 | <div class="panel-group"> | 78 | <div class="panel-group"> |
77 | <div class="panel panel-default"> | 79 | <div class="panel panel-default"> |
78 | <div class="panel-heading"> | 80 | <div class="panel-heading"> |
79 | <h4 class="panel-title"> | 81 | <h4 class="panel-title"> |
80 | - <a data-toggle="collapse" href="#Forum" id="bot2"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down2"></i>Forum</a> | 82 | + <a data-toggle="collapse" href="#Forum" id="bot2" style="color: black"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down2"></i>Forum</a> |
81 | </h4> | 83 | </h4> |
82 | </div> | 84 | </div> |
83 | <div id="Forum" class="panel-collapse collapse"> | 85 | <div id="Forum" class="panel-collapse collapse"> |
84 | <div class="panel-body"> | 86 | <div class="panel-body"> |
85 | - {% if forum_list %} | ||
86 | {% for forum in forum_list %} | 87 | {% for forum in forum_list %} |
87 | <li><i class="fa fa-commenting" aria-hidden="true"></i> <a id="forum_{{ forum.id }}" href="{% url 'course:forum:view' forum.slug %}"> {{ forum }}</a></li> | 88 | <li><i class="fa fa-commenting" aria-hidden="true"></i> <a id="forum_{{ forum.id }}" href="{% url 'course:forum:view' forum.slug %}"> {{ forum }}</a></li> |
88 | {% endfor %} | 89 | {% endfor %} |
89 | - {% else %} | ||
90 | - | ||
91 | - {% trans 'No results found' %} | ||
92 | 90 | ||
93 | - {% endif %} | ||
94 | </div> | 91 | </div> |
95 | 92 | ||
96 | </div> | 93 | </div> |
97 | </div> | 94 | </div> |
98 | </div> | 95 | </div> |
96 | +{% endif %} | ||
97 | + | ||
98 | +{% if exam_list %} | ||
99 | <div class="panel-group"> | 99 | <div class="panel-group"> |
100 | <div class="panel panel-default"> | 100 | <div class="panel panel-default"> |
101 | <div class="panel-heading"> | 101 | <div class="panel-heading"> |
102 | <h4 class="panel-title"> | 102 | <h4 class="panel-title"> |
103 | - <a data-toggle="collapse" href="#Exam" id="bot3"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down3"></i>Exam</a> | 103 | + <a data-toggle="collapse" href="#Exam" id="bot3" style="color: black"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down3"></i>Exam</a> |
104 | </h4> | 104 | </h4> |
105 | </div> | 105 | </div> |
106 | <div id="Exam" class="panel-collapse collapse"> | 106 | <div id="Exam" class="panel-collapse collapse"> |
107 | <div class="panel-body"> | 107 | <div class="panel-body"> |
108 | - {% if exam_list %} | 108 | + {% for exam in exam_list %} |
109 | + {{exam.name}} | ||
110 | + {% endfor %} | ||
109 | 111 | ||
110 | - {% else %} | ||
111 | - {% trans 'No results found' %} | ||
112 | - {% endif %} | ||
113 | </div> | 112 | </div> |
114 | 113 | ||
115 | </div> | 114 | </div> |
116 | </div> | 115 | </div> |
117 | </div> | 116 | </div> |
117 | +{% endif %} | ||
118 | + | ||
119 | +{% if poll_list %} | ||
118 | <div class="panel-group"> | 120 | <div class="panel-group"> |
119 | <div class="panel panel-default"> | 121 | <div class="panel panel-default"> |
120 | <div class="panel-heading"> | 122 | <div class="panel-heading"> |
121 | <h4 class="panel-title"> | 123 | <h4 class="panel-title"> |
122 | - <a data-toggle="collapse" href="#Poll" id="bot4"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down4"></i>Poll</a> | 124 | + <a data-toggle="collapse" href="#Poll" id="bot4" style="color: black"> <i class="fa fa-caret-square-o-down" aria-hidden="true" id="down4"></i>Poll</a> |
123 | </h4> | 125 | </h4> |
124 | </div> | 126 | </div> |
125 | <div id="Poll" class="panel-collapse collapse"> | 127 | <div id="Poll" class="panel-collapse collapse"> |
126 | <div class="panel-body"> | 128 | <div class="panel-body"> |
127 | - {% if poll_list %} | 129 | + |
128 | {% for poll in poll_list %} | 130 | {% for poll in poll_list %} |
129 | <li id="poll_{{poll.slug}}"><i class="material-icons">{% trans 'poll' %}</i> <a href="javascript:modal.get('{% url 'course:poll:view_poll' poll.slug %}','#poll','#modal_poll');">{{ poll.name }}</a></li> | 131 | <li id="poll_{{poll.slug}}"><i class="material-icons">{% trans 'poll' %}</i> <a href="javascript:modal.get('{% url 'course:poll:view_poll' poll.slug %}','#poll','#modal_poll');">{{ poll.name }}</a></li> |
130 | {% endfor %} | 132 | {% endfor %} |
131 | - {% else %} | ||
132 | - {% trans 'No results found' %} | ||
133 | - {% endif %} | 133 | + |
134 | <div class="row" id="modal_poll"> | 134 | <div class="row" id="modal_poll"> |
135 | 135 | ||
136 | </div> | 136 | </div> |
@@ -138,16 +138,10 @@ | @@ -138,16 +138,10 @@ | ||
138 | </div> | 138 | </div> |
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | +{% endif %} | ||
141 | </div> | 142 | </div> |
142 | 143 | ||
143 | -<script type="text/javascript" src="{% static 'js/topic_editation_presentation.js' %}"></script> | ||
144 | -<script type="text/javascript" src="{% static 'js/amadeus.js' %}"> </script> | ||
145 | -<script> | ||
146 | - // set up all (import templates, set up navbar and set environment variables) | ||
147 | - Amadeus.load(function() { | ||
148 | - // set data to breadcrumb | ||
149 | - Amadeus.setBreadcrumb(null,'Home'); | ||
150 | - }); | ||
151 | -</script> | ||
152 | 144 | ||
145 | +<script type="text/javascript" src="{% static 'js/amadeus.js' %}"> </script> | ||
146 | +<script type="text/javascript" src="{% static 'js/topic_editation_presentation_search.js' %}"></script> | ||
153 | {% endblock %} | 147 | {% endblock %} |
users/templates/users/view.html
1 | -{% extends 'app/base.html' %} | 1 | +{% extends 'users/profile.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | 4 | ||
@@ -9,26 +9,6 @@ | @@ -9,26 +9,6 @@ | ||
9 | </ol> | 9 | </ol> |
10 | {% endblock %} | 10 | {% endblock %} |
11 | 11 | ||
12 | -{% block sidebar %} | ||
13 | - <div class="list-group"> | ||
14 | - <a href="{% url 'users:manage' %}" class="list-group-item"> | ||
15 | - {% trans 'System Users' %} | ||
16 | - </a> | ||
17 | - <a href="{% url 'users:create' %}" class="list-group-item"> | ||
18 | - {% trans 'New Account' %} | ||
19 | - </a> | ||
20 | - <a href="{% url 'users:view' acc.username %}" class="list-group-item active"> | ||
21 | - {% trans 'View User Account' %} | ||
22 | - </a> | ||
23 | - <a href="{% url 'users:update' acc.username %}" class="list-group-item"> | ||
24 | - {% trans 'Edit User Account' %} | ||
25 | - </a> | ||
26 | - <a href="#" class="list-group-item"> | ||
27 | - {% trans 'Send Mail' %} | ||
28 | - </a> | ||
29 | - </div> | ||
30 | -{% endblock %} | ||
31 | - | ||
32 | {% block content %} | 12 | {% block content %} |
33 | <div class="row"> | 13 | <div class="row"> |
34 | <div class="col-sm-3"> | 14 | <div class="col-sm-3"> |