Commit 8043540f4663d91e8d7618bc604a3552d5c69e7c
1 parent
d2acecc9
Exists in
master
and in
5 other branches
modifying home #205
Showing
1 changed file
with
55 additions
and
55 deletions
Show diff stats
app/templates/home.html
... | ... | @@ -3,55 +3,55 @@ |
3 | 3 | {% load static i18n django_bootstrap_breadcrumbs permission_tags %} |
4 | 4 | |
5 | 5 | {% block javascript %} |
6 | - {% if page_obj %} | |
7 | - <script type="text/javascript"> | |
8 | - var pageNum = {{ page_obj.number }}; // The latest page loaded | |
9 | - var numberPages = {{ paginator.num_pages }}; // Indicates the number of pages | |
10 | - var baseUrl = '{% url "app:index" %}'; | |
6 | + {% if page_obj %} | |
7 | + <script type="text/javascript"> | |
8 | + var pageNum = {{ page_obj.number }}; // The latest page loaded | |
9 | + var numberPages = {{ paginator.num_pages }}; // Indicates the number of pages | |
10 | + var baseUrl = '{% url "app:index" %}'; | |
11 | 11 | |
12 | - // loadOnScroll handler | |
13 | - var loadOnScroll = function() { | |
14 | - // If the current scroll position is past out cutoff point... | |
15 | - if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) { | |
16 | - // temporarily unhook the scroll event watcher so we don't call a bunch of times in a row | |
17 | - $(window).unbind(); | |
18 | - // execute the load function below that will visit the view and return the content | |
19 | - loadItems(); | |
20 | - } | |
21 | - }; | |
12 | + // loadOnScroll handler | |
13 | + var loadOnScroll = function() { | |
14 | + // If the current scroll position is past out cutoff point... | |
15 | + if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) { | |
16 | + // temporarily unhook the scroll event watcher so we don't call a bunch of times in a row | |
17 | + $(window).unbind(); | |
18 | + // execute the load function below that will visit the view and return the content | |
19 | + loadItems(); | |
20 | + } | |
21 | + }; | |
22 | 22 | |
23 | - var loadItems = function() { | |
24 | - // Check if page is equal to the number of pages | |
25 | - if (pageNum == numberPages) { | |
26 | - return false | |
27 | - } | |
28 | - // Update the page number | |
29 | - pageNum = pageNum + 1; | |
23 | + var loadItems = function() { | |
24 | + // Check if page is equal to the number of pages | |
25 | + if (pageNum == numberPages) { | |
26 | + return false | |
27 | + } | |
28 | + // Update the page number | |
29 | + pageNum = pageNum + 1; | |
30 | 30 | |
31 | - $("#loading").show(); | |
32 | - // Configure the url we're about to hit | |
33 | - setTimeout(function (){ | |
34 | - $.ajax({ | |
35 | - url: baseUrl, | |
36 | - data: {'page': pageNum}, | |
37 | - success: function(data) { | |
38 | - $("#loading").hide(); | |
31 | + $("#loading").show(); | |
32 | + // Configure the url we're about to hit | |
33 | + setTimeout(function (){ | |
34 | + $.ajax({ | |
35 | + url: baseUrl, | |
36 | + data: {'page': pageNum}, | |
37 | + success: function(data) { | |
38 | + $("#loading").hide(); | |
39 | 39 | |
40 | - $("#timeline").append(data); | |
41 | - }, | |
42 | - complete: function(data, textStatus){ | |
43 | - // Turn the scroll monitor back on | |
44 | - $(window).bind('scroll', loadOnScroll); | |
45 | - } | |
46 | - }); | |
47 | - }, 1000) | |
48 | - }; | |
40 | + $("#timeline").append(data); | |
41 | + }, | |
42 | + complete: function(data, textStatus){ | |
43 | + // Turn the scroll monitor back on | |
44 | + $(window).bind('scroll', loadOnScroll); | |
45 | + } | |
46 | + }); | |
47 | + }, 1000) | |
48 | + }; | |
49 | 49 | |
50 | - $(document).ready(function(){ | |
51 | - $(window).bind('scroll', loadOnScroll); | |
52 | - }); | |
53 | - </script> | |
54 | - {% endif %} | |
50 | + $(document).ready(function(){ | |
51 | + $(window).bind('scroll', loadOnScroll); | |
52 | + }); | |
53 | + </script> | |
54 | + {% endif %} | |
55 | 55 | {% endblock %} |
56 | 56 | |
57 | 57 | {% block breadcrumbs %} |
... | ... | @@ -64,9 +64,9 @@ |
64 | 64 | {% endblock %} |
65 | 65 | |
66 | 66 | {% block sidebar %} |
67 | - <div class="panel panel-primary navigation"> | |
67 | + <div class="panel panel-primary"> | |
68 | 68 | <div class="panel-heading"> |
69 | - <h4>{% trans 'Menu' %}</h4> | |
69 | + <h4>Menu</h4> | |
70 | 70 | </div> |
71 | 71 | <div class="panel-body"> |
72 | 72 | <ul class="nav nav-pills nav-stacked"> |
... | ... | @@ -97,19 +97,19 @@ |
97 | 97 | {% endblock %} |
98 | 98 | |
99 | 99 | {% block content %} |
100 | - {% if user|has_role:'system_admin' %} | |
100 | + {% if user|has_role:'system_admin' %} | |
101 | 101 | <h3>{% trans 'Courses' %}</h3> |
102 | 102 | <div id="timeline"> |
103 | - {% include page_template %} | |
103 | + {% include page_template %} | |
104 | 104 | </div> |
105 | - {% else %} | |
105 | + {% else %} | |
106 | 106 | <div id="timeline"> |
107 | 107 | {% include page_template %} |
108 | 108 | </div> |
109 | - {% endif %} | |
110 | - <div id="loading" class="alert alert-primary" role="alert" style="display: none"> | |
111 | - <center> | |
112 | - <span class="fa fa-spin fa-circle-o-notch"></span> | |
113 | - </center> | |
114 | - </div> | |
109 | + {% endif %} | |
110 | + <div id="loading" class="alert alert-primary" role="alert" style="display: none"> | |
111 | + <center> | |
112 | + <span class="fa fa-spin fa-circle-o-notch"></span> | |
113 | + </center> | |
114 | + </div> | |
115 | 115 | {% endblock %} | ... | ... |