Commit f49006dba5217fbebf384e06e5cb3f1d308b9d84
1 parent
96cf48d1
Exists in
master
and in
5 other branches
modifying css cards #250
Showing
10 changed files
with
99 additions
and
98 deletions
Show diff stats
... | ... | @@ -0,0 +1,42 @@ |
1 | +// loadOnScroll handler | |
2 | +var loadOnScroll = function() { | |
3 | + // If the current scroll position is past out cutoff point... | |
4 | + if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) { | |
5 | + // temporarily unhook the scroll event watcher so we don't call a bunch of times in a row | |
6 | + $(window).unbind(); | |
7 | + // execute the load function below that will visit the view and return the content | |
8 | + loadItems(); | |
9 | + } | |
10 | +}; | |
11 | + | |
12 | +var loadItems = function() { | |
13 | + // Check if page is equal to the number of pages | |
14 | + if (pageNum == numberPages) { | |
15 | + return false | |
16 | + } | |
17 | + // Update the page number | |
18 | + pageNum = pageNum + 1; | |
19 | + | |
20 | + $("#loading").show(); | |
21 | + // Configure the url we're about to hit | |
22 | + setTimeout(function (){ | |
23 | + $.ajax({ | |
24 | + url: baseUrl, | |
25 | + data: {'page': pageNum}, | |
26 | + success: function(data) { | |
27 | + $("#loading").hide(); | |
28 | + | |
29 | + $("#timeline").append(data); | |
30 | + }, | |
31 | + complete: function(data, textStatus){ | |
32 | + // Turn the scroll monitor back on | |
33 | + $(window).bind('scroll', loadOnScroll); | |
34 | + } | |
35 | + }); | |
36 | + }, 1000) | |
37 | +}; | |
38 | + | |
39 | +$(document).ready(function(){ | |
40 | + $(window).bind('scroll', loadOnScroll); | |
41 | + $.material.init(); | |
42 | +}); | |
0 | 43 | \ No newline at end of file | ... | ... |
app/templates/home.html
... | ... | @@ -5,59 +5,16 @@ |
5 | 5 | {% block javascript %} |
6 | 6 | {% if page_obj %} |
7 | 7 | <script type="text/javascript"> |
8 | - {% if page_obj and paginator %} | |
9 | - var pageNum = {{ page_obj.number }}; // The latest page loaded | |
10 | - var numberPages = {{ paginator.num_pages }}; // Indicates the number of pages | |
11 | - {% else %} | |
12 | - var pageNum = 0 ; // The latest page loaded | |
13 | - var numberPages = 0 ; // Indicates the number of pages | |
14 | - {% endif %} | |
15 | - | |
16 | - var baseUrl = '{% url "app:index" %}'; | |
17 | - | |
18 | - // loadOnScroll handler | |
19 | - var loadOnScroll = function() { | |
20 | - // If the current scroll position is past out cutoff point... | |
21 | - if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) { | |
22 | - // temporarily unhook the scroll event watcher so we don't call a bunch of times in a row | |
23 | - $(window).unbind(); | |
24 | - // execute the load function below that will visit the view and return the content | |
25 | - loadItems(); | |
26 | - } | |
27 | - }; | |
28 | - | |
29 | - var loadItems = function() { | |
30 | - // Check if page is equal to the number of pages | |
31 | - if (pageNum == numberPages) { | |
32 | - return false | |
33 | - } | |
34 | - // Update the page number | |
35 | - pageNum = pageNum + 1; | |
36 | - | |
37 | - $("#loading").show(); | |
38 | - // Configure the url we're about to hit | |
39 | - setTimeout(function (){ | |
40 | - $.ajax({ | |
41 | - url: baseUrl, | |
42 | - data: {'page': pageNum}, | |
43 | - success: function(data) { | |
44 | - $("#loading").hide(); | |
45 | - | |
46 | - $("#timeline").append(data); | |
47 | - }, | |
48 | - complete: function(data, textStatus){ | |
49 | - // Turn the scroll monitor back on | |
50 | - $(window).bind('scroll', loadOnScroll); | |
51 | - } | |
52 | - }); | |
53 | - }, 1000) | |
54 | - }; | |
55 | - | |
56 | - $(document).ready(function(){ | |
57 | - $(window).bind('scroll', loadOnScroll); | |
58 | - $.material.init(); | |
59 | - }); | |
8 | + {% if page_obj and paginator %} | |
9 | + var pageNum = {{ page_obj.number }}; // The latest page loaded | |
10 | + var numberPages = {{ paginator.num_pages }}; // Indicates the number of pages | |
11 | + {% else %} | |
12 | + var pageNum = 0 ; // The latest page loaded | |
13 | + var numberPages = 0 ; // Indicates the number of pages | |
14 | + {% endif %} | |
15 | + var baseUrl = '{% url "app:index" %}'; | |
60 | 16 | </script> |
17 | + <script type="text/javascript" src="{% static 'js/home.js' %}"></script> | |
61 | 18 | {% endif %} |
62 | 19 | {% endblock %} |
63 | 20 | |
... | ... | @@ -96,7 +53,7 @@ |
96 | 53 | |
97 | 54 | {% endblock %} |
98 | 55 | {% if user|has_role:'system_admin' %} |
99 | - | |
56 | + | |
100 | 57 | <li> |
101 | 58 | <a href="#menu_users" class="accordion" data-toggle="collapse">{% trans 'Users' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> |
102 | 59 | <div id="menu_users" class="collapse"> |
... | ... | @@ -104,9 +61,9 @@ |
104 | 61 | <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> |
105 | 62 | <li> <a href="{% url 'users:create' %}">{% trans 'Create User' %}</a></li> |
106 | 63 | </ul> |
107 | - </div> | |
64 | + </div> | |
108 | 65 | </li> |
109 | - <li> | |
66 | + <li> | |
110 | 67 | <a href="#menu_settings" class="accordion" data-toggle="collapse">{% trans 'Settings' %}<span class="pull-right glyphicon glyphicon-chevron-down"></span></a> |
111 | 68 | <div id="menu_settings" class="collapse"> |
112 | 69 | <ul class="nav nav-pill nav-stacked accordion_list"> | ... | ... |
core/static/css/base/amadeus.css
... | ... | @@ -77,9 +77,6 @@ |
77 | 77 | .end{ |
78 | 78 | text-align: right; |
79 | 79 | } |
80 | -h5{ | |
81 | - text-align: center; | |
82 | -} | |
83 | 80 | #img { |
84 | 81 | |
85 | 82 | display: block; |
... | ... | @@ -406,16 +403,19 @@ ul, li { |
406 | 403 | -webkit-animation-timing-function: ease-in-out; |
407 | 404 | } |
408 | 405 | /* Icon Topic */ |
409 | -.divMoreActions {text-align: right; height: 39px; float: right;} | |
410 | -.divMoreActions div button {padding-left: 10px; padding-right: 10px; padding-bottom: 10px; margin-bottom: 4px; height: 31px;} | |
411 | -.titleTopic {padding-top: 18px; padding-left: 0px;} | |
412 | -.titleTopic-detail {padding-top: 8px; color: white;} | |
413 | -.titleTopic a h4 {margin-top: 0px; color: black; cursor:pointer;} | |
406 | +.divMoreActions {text-align: right; height: 59px; float: right;} | |
407 | +.moreAccordion {height: 59px;} | |
408 | +/*.divMoreActions div button {padding-left: 10px; padding-right: 10px; padding-bottom: 10px; margin-bottom: 4px; height: 31px;}*/ | |
409 | +.divMoreActions , .moreAccordion{padding-top: 5px; padding-bottom: 5px;} | |
410 | +.moreAccordion button{margin-bottom: 0px; margin-top: 8px;} | |
411 | +.titleTopic {padding-top: 10px; padding-bottom: 10px;} | |
412 | +.titleTopic a h4, .titleTopic h4{color: white;} | |
413 | +.titleTopic a:hover{text-decoration: none;} | |
414 | +.Topic-detail a h4{color: black;} | |
415 | +/* .titleTopic a h4 {margin-top: 0px; color: black; cursor:pointer;}*/ | |
414 | 416 | .dropdown-menu .pull-right { |
415 | 417 | right: 0; |
416 | 418 | } |
417 | -.moreAccordion{ padding-left: 0px; padding-right: 0px;} | |
418 | -.moreAccordion div button{ padding-left: 0px; padding-right: 0px;} | |
419 | 419 | .cards-content{ padding-left: 0px; padding-right: 0px; } |
420 | 420 | .cards-detail{margin-left: 4%;} |
421 | 421 | .cards-detail .panel .panel-heading{/*background-color:;*/} | ... | ... |
courses/static/js/topic.js
... | ... | @@ -20,7 +20,7 @@ function openTopic(url, topic, btn) { |
20 | 20 | dataType: 'json', |
21 | 21 | success: function (data) { |
22 | 22 | if (action == 'open') { |
23 | - $(".topic_" + topic).find(".log_id").val(data.log_id); | |
23 | + $(".topic_" + topic).find(".log_id").val(data.log_id); | |
24 | 24 | } |
25 | 25 | }, |
26 | 26 | error: function(data) { | ... | ... |
courses/templates/course/course_card.html
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <div class="panel panel-info"> |
4 | 4 | <div class="panel-heading course"> |
5 | 5 | <div class="row"> |
6 | - <div class="col-xs-5 col-md-5 titleTopic"> | |
6 | + <div class="col-xs-6 col-md-6 titleTopic"> | |
7 | 7 | <a role="button" href="{% url 'course:view' course.slug %}"> |
8 | 8 | <h4>{{course.name}}</h4> |
9 | 9 | </a> | ... | ... |
courses/templates/course/view.html
... | ... | @@ -23,30 +23,36 @@ |
23 | 23 | {% block content %} |
24 | 24 | |
25 | 25 | <div class="col-md-12 cards-content"> |
26 | - <div class="panel panel-info"> | |
27 | - <div class="panel-heading course-detail"> | |
28 | - <div class="row"> | |
29 | - <div class="col-xs-8 col-md-11 .titleTopic-detail"> | |
30 | - <h4>{{course.name}}</h4> | |
31 | - </div> | |
32 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | |
33 | - <div class="col-xs-4 col-md-1" id="divMoreActions"> | |
26 | + <div class="group course-card "> | |
27 | + <div class="panel panel-info"> | |
28 | + <div class="panel-heading course"> | |
29 | + <div class="row"> | |
30 | + <div class="col-xs-6 col-md-6 titleTopic"> | |
31 | + <h4>{{course.name}}</h4> | |
32 | + </div> | |
33 | + {% if user|has_role:'professor' or user|has_role:'system_admin' %} | |
34 | + <div class="col-xs-6 col-md-6 divMoreActions" > | |
34 | 35 | <div class="btn-group"> |
35 | 36 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
36 | 37 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> |
37 | - <div class="ripple-container"></div></button> | |
38 | + </button> | |
38 | 39 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
39 | - <li><a href="{% url 'course:replicate_course' course.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> | |
40 | - <li><a href="{% url 'course:update' course.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
41 | - <li><a href="javascript:javascript:delete_course('{% url 'course:delete' course.slug %}', '{{ course.slug }}', '{% trans "Are you sure you want to delete this course?" %}', '{% url 'course:manage' %}')" data-toggle="modal" data-target="#myModal2"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | |
40 | + <li><a href="{% url 'course:replicate_course' course.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i>{% trans 'Replicate' %}</a></li> | |
41 | + <li><a href="{% url 'course:update' course.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i>{% trans 'Edit' %}</a></li> | |
42 | + <li><a href="javascript:delete_course.get('{% url 'course:delete' course.slug %}','#course','#modal_course')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | |
42 | 43 | </ul> |
43 | 44 | </div> |
44 | 45 | </div> |
46 | + {% elif user|has_role:'student' %} | |
47 | + {% if not request.user in course.students.all %} | |
48 | + <a onclick="subscribe($(this), '{% url 'course:subscribe' course.slug %}', {{ course.id}}, '{% trans 'Are you sure you want to subscribe to this course?' %}')"><button class="btn btn-sm btn-primary btn-raised pull-right">{% trans 'Subscribe' %}</button></a> | |
49 | + {% endif %} | |
45 | 50 | {% endif %} |
51 | + </div> | |
52 | + </div> | |
53 | + <div class="panel-body"> | |
54 | + <p><b>{% trans 'Coordinator' %}: </b>{{course.coordenator}}</p> | |
46 | 55 | </div> |
47 | - </div> | |
48 | - <div class="panel-body"> | |
49 | - <p><b>{% trans 'Coordinator' %}: </b>{{course.coordenator}}</p> | |
50 | 56 | </div> |
51 | 57 | </div> |
52 | 58 | |
... | ... | @@ -70,18 +76,18 @@ |
70 | 76 | </div> |
71 | 77 | |
72 | 78 | <div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false"></div> |
73 | -<div class="cards-detail"> | |
79 | + <div class="cards-detail"> | |
74 | 80 | {% for subject in subjects %} |
75 | 81 | <div class="panel panel-default panel_{{ subject.id }}"> |
76 | 82 | <div class="panel-heading heading_{{subject.id}} subject ui-sortable-handle"> |
77 | 83 | <div class="row"> |
78 | - <div class="col-xs-9 col-md-10 titleTopic"> | |
84 | + <div class="col-xs-9 col-md-6 titleTopic"> | |
79 | 85 | <a role="button" href="{% url 'course:view_subject' subject.slug %}"> |
80 | 86 | <h4>{{subject.name}}</h4> |
81 | 87 | </a> |
82 | 88 | </div> |
83 | 89 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} |
84 | - <div class="col-xs-3 col-md-1" id="divMoreActions"> | |
90 | + <div class="col-xs-3 col-md-6 divMoreActions"> | |
85 | 91 | <div class="btn-group"> |
86 | 92 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
87 | 93 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | ... | ... |
courses/templates/subject/form_view_student.html
courses/templates/subject/form_view_teacher.html
... | ... | @@ -6,9 +6,9 @@ |
6 | 6 | <div class="panel-heading topic"> |
7 | 7 | <div class="row"> |
8 | 8 | <div class="col-md-1 moreAccordion" data-toggle="collapse" data-parent="#accordion-{{topic.slug}}" href=".collapseTopic-{{topic.slug}}" aria-expanded="false" aria-controls="collapseTopic-{{topic.slug}}"> |
9 | - <button class="btn btn-default btn-sm caret-square" onclick="openTopic('{% url 'course:topic_log' topic.id %}', '{{topic.id}}', $(this));"><i class="fa fa-caret-square-o-down fa-2x" aria-hidden="true"></i></button> | |
9 | + <button class="btn btn-default btn-sm caret-square" onclick="openTopic('{% url 'course:topic_log' topic.id %}', '{{topic.id}}', $(this));"><i class="fa fa-angle-down fa-2x" aria-hidden="true"></i></button> | |
10 | 10 | </div> |
11 | - <div class="col-xs-9 col-md-9 titleTopic"> | |
11 | + <div class="col-xs-9 col-md-9 titleTopic Topic-detail"> | |
12 | 12 | <a href="{% url 'course:view_topic' topic.slug %}" role="button"> |
13 | 13 | <h4>{{topic}}</h4> |
14 | 14 | </a> | ... | ... |
courses/templates/subject/index.html
... | ... | @@ -19,14 +19,13 @@ |
19 | 19 | |
20 | 20 | {% block content %} |
21 | 21 | <div class="panel panel-info"> |
22 | - <div class="panel-heading course-detail"> | |
22 | + <div class="panel-heading course"> | |
23 | 23 | <div class="row"> |
24 | - <div class="col-md-10 col-sm-10"> | |
24 | + <div class="col-xs-6 col-md-6 titleTopic"> | |
25 | 25 | <h4>{{subject}}</h4> |
26 | 26 | </div> |
27 | - | |
28 | 27 | {# dropdown de subject com as opções de replicar, editar e deletar #} |
29 | - <div class="col-xs-4 col-md-2 divMoreActions"> | |
28 | + <div class="col-xs-6 col-md-6 divMoreActions"> | |
30 | 29 | {% professor_subject subject user as subject_professor%} |
31 | 30 | {% if subject_professor %} |
32 | 31 | <div class="btn-group"> |
... | ... | @@ -41,10 +40,8 @@ |
41 | 40 | </div> |
42 | 41 | {% endif %} |
43 | 42 | </div> |
44 | - | |
45 | 43 | </div> |
46 | 44 | </div> |
47 | - | |
48 | 45 | {# informações do subject(professor, descrição etc) #} |
49 | 46 | <div class="panel-body"> |
50 | 47 | <p><b>{% trans "Professor" %}:</b> {% for professor in subject.professors.all %}{% if not forloop.first %},{% endif %} |
... | ... | @@ -62,7 +59,6 @@ |
62 | 59 | </div> |
63 | 60 | </div> |
64 | 61 | </div> |
65 | - | |
66 | 62 | </div> |
67 | 63 | |
68 | 64 | {# lista de tópicos #} | ... | ... |
courses/templates/topic/index.html
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | <div class="panel-heading"> |
23 | 23 | <div class="row"> |
24 | 24 | <div class="col-md-10 col-sm-7"> |
25 | - <h3> {{topic.name}} </h3> | |
25 | + <h3> {{topic.name}}</h3> | |
26 | 26 | </div> |
27 | 27 | <div class="col-xs-4 col-md-2 divMoreActions"> |
28 | 28 | {% professor_subject subject user as permissions%} |
... | ... | @@ -110,8 +110,8 @@ |
110 | 110 | </div> |
111 | 111 | </div> |
112 | 112 | <div class="col-md-6"> |
113 | - <h3>{% trans 'Students - Specific Exercises' %}</h3> | |
114 | - <br/> | |
113 | + <h3>{% trans 'Students - Specific Exercises' %}</h3> | |
114 | + <br/> | |
115 | 115 | </div> |
116 | 116 | {# mostra a lista de usuários caso seja um professor ou admin #} |
117 | 117 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ... | ... |