Commit 01a31a1d01a0928297c52bb02388588b5d57acb1

Authored by Zambom
1 parent 23faf5ce

Adding no subjects message

amadeus/static/css/base/amadeus.css
... ... @@ -603,4 +603,12 @@ ul, li {
603 603 .form-group input[type=file] {
604 604 margin-top: 20px;
605 605 height: initial;
  606 +}
  607 +
  608 +.no-subjects i {
  609 + font-size: 50px;
  610 +}
  611 +.no-subjects h4 {
  612 + font-family: Roboto;
  613 + font-weight: normal;
606 614 }
607 615 \ No newline at end of file
... ...
amadeus/static/css/themes/black.css
... ... @@ -267,4 +267,13 @@ a, a:focus, a:hover {
267 267 .filedrag {
268 268 color: #555;
269 269 border: 2px dashed #555;
  270 +}
  271 +
  272 +.footer {
  273 + color: #FFFFFF;
  274 + background: #26A69A;
  275 +}
  276 +
  277 +.no-subjects {
  278 + color: #999999;
270 279 }
271 280 \ No newline at end of file
... ...
amadeus/static/css/themes/green.css
... ... @@ -272,4 +272,8 @@ a, a:focus, a:hover {
272 272 .footer {
273 273 color: #FFFFFF;
274 274 background: #26A69A;
  275 +}
  276 +
  277 +.no-subjects {
  278 + color: #999999;
275 279 }
276 280 \ No newline at end of file
... ...
amadeus/static/css/themes/red.css
... ... @@ -267,4 +267,13 @@ a, a:focus, a:hover {
267 267 .filedrag {
268 268 color: #555;
269 269 border: 2px dashed #555;
  270 +}
  271 +
  272 +.footer {
  273 + color: #FFFFFF;
  274 + background: #26A69A;
  275 +}
  276 +
  277 +.no-subjects {
  278 + color: #999999;
270 279 }
271 280 \ No newline at end of file
... ...
subjects/templates/subjects/initial.html
... ... @@ -27,14 +27,23 @@
27 27  
28 28 <div class="col-md-12 cards-content">
29 29 <h2 class=" my-subjects-title"><b><i>{% trans "Meus Assuntos" %}</i></b></h2>
30   - <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true">
31   - {% for subject in subjects %}
32   - {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %}
33   - {% endfor %}
34   - </div>
  30 +
  31 + {% if subjects|length > 0 %}
  32 + <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true">
  33 + {% for subject in subjects %}
  34 + {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %}
  35 + {% endfor %}
  36 +
  37 + {% pagination request paginator page_obj %}
  38 + </div>
  39 + {% else %}
  40 + <div class="text-center no-subjects">
  41 + <i class="fa fa-graduation-cap"></i>
  42 + <h4>{% trans 'You still do not posses any subject in our platform' %}</h4>
  43 + </div>
  44 + {% endif %}
35 45 </div>
36 46  
37   - {% pagination request paginator page_obj %}
38 47  
39 48 <script type="text/javascript" src="{% static 'js/course.js' %}"></script>
40 49 {% endblock content %}
41 50 \ No newline at end of file
... ...
subjects/templates/subjects/list.html
... ... @@ -45,128 +45,135 @@
45 45  
46 46 <!-- Code for listing categories -->
47 47 <div class="col-md-12 cards-content">
48   - <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
49   - {% for category in categories %}
50   - {% if category.visible %}
51   - <div class="panel panel-info category-panel">
52   - <div class="panel-heading">
53   - <div class="row">
54   - <div class="col-md-12 category-header">
55   - <h4 class="panel-title">
56   - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}">
57   - <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ category.name }} ({{ category.subject_category.count }})
58   - </a>
59   - </h4>
60   -
61   - <div class="col-md-5 pull-right category-card-items">
62   - {% if request.user.is_staff or user in category.coordinators.all %}
63   - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
64   - <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
  48 + {% if subjects|length > 0 %}
  49 + <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  50 + {% for category in categories %}
  51 + {% if category.visible %}
  52 + <div class="panel panel-info category-panel">
  53 + <div class="panel-heading">
  54 + <div class="row">
  55 + <div class="col-md-12 category-header">
  56 + <h4 class="panel-title">
  57 + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}">
  58 + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ category.name }} ({{ category.subject_category.count }})
65 59 </a>
66   - <ul class="dropdown-menu pull-right" aria-labelledby="moreActions">
67   - {% if request.user.is_staff %}
68   - <li><a href="{% url 'categories:replicate' category.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans 'Replicate' %}</a></li>
69   - {% endif %}
70   - <li><a href="{% url 'categories:update' category.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans 'Edit' %}</a></li>
71   - <li>
72   - <a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')" aria-hidden="true"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li>
73   - </ul>
74   - {% endif %}
75   - <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a>
76   - <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
77   - <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a>
78   - <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a>
  60 + </h4>
  61 +
  62 + <div class="col-md-5 pull-right category-card-items">
  63 + {% if request.user.is_staff or user in category.coordinators.all %}
  64 + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  65 + <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
  66 + </a>
  67 + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions">
  68 + {% if request.user.is_staff %}
  69 + <li><a href="{% url 'categories:replicate' category.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans 'Replicate' %}</a></li>
  70 + {% endif %}
  71 + <li><a href="{% url 'categories:update' category.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans 'Edit' %}</a></li>
  72 + <li>
  73 + <a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')" aria-hidden="true"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li>
  74 + </ul>
  75 + {% endif %}
  76 + <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a>
  77 + <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
  78 + <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a>
  79 + <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a>
  80 + </div>
79 81 </div>
80 82 </div>
81 83 </div>
82   - </div>
83   - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content">
84   - <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" />
85   - <input type="hidden" class="log_id" value="" />
86   - {% if category.coordinators.all|length > 0 %}
87   - <h4><b>{% trans "Coordinator(s) " %}: </b>
88   - {{ category.coordinators.all|join:', ' }}
89   - </h4>
90   - {% else %}
91   - <h4> {% trans "It doesn't possess coordinators" %} </h4>
92   - {% endif %}
93   -
94   - {{category.description|safe}}
95   -
96   - {% if request.user in category.coordinators.all or request.user.is_staff %}
97   - <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a>
98   - {% endif %}
  84 + <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content">
  85 + <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" />
  86 + <input type="hidden" class="log_id" value="" />
  87 + {% if category.coordinators.all|length > 0 %}
  88 + <h4><b>{% trans "Coordinator(s) " %}: </b>
  89 + {{ category.coordinators.all|join:', ' }}
  90 + </h4>
  91 + {% else %}
  92 + <h4> {% trans "It doesn't possess coordinators" %} </h4>
  93 + {% endif %}
  94 +
  95 + {{category.description|safe}}
99 96  
100   - <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true">
101   - {% for subject in category.subject_category.all %}
102   - {% if request.user in subject.students.all or request.user.is_staff or request.user in subject.professor.all or all or request.user in subject.category.coordinators.all %}
103   -
104   - {% include "subjects/subject_card.html" %}
105   - {% endif %}
106   - {% endfor %}
  97 + {% if request.user in category.coordinators.all or request.user.is_staff %}
  98 + <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a>
  99 + {% endif %}
  100 +
  101 + <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true">
  102 + {% for subject in category.subject_category.all %}
  103 + {% if request.user in subject.students.all or request.user.is_staff or request.user in subject.professor.all or all or request.user in subject.category.coordinators.all %}
  104 +
  105 + {% include "subjects/subject_card.html" %}
  106 + {% endif %}
  107 + {% endfor %}
  108 + </div>
107 109 </div>
108 110 </div>
109   - </div>
110   - {% elif request.user in category.coordinators.all or request.user.is_staff %}
111   - <div class="panel special-panel">
112   - <div class="panel-heading panel-invisible">
113   - <div class="row">
114   - <div class="col-md-12 category-header">
115   - <h4 class="panel-title">
116   - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}">
117   - <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} ({{ category.subject_category.count }})
118   - </a>
119   - </h4>
120   -
121   - <div class="col-md-5 pull-right category-card-items">
122   - {% if request.user.is_staff or user in category.coordinators.all %}
123   - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
124   - <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
  111 + {% elif request.user in category.coordinators.all or request.user.is_staff %}
  112 + <div class="panel special-panel">
  113 + <div class="panel-heading panel-invisible">
  114 + <div class="row">
  115 + <div class="col-md-12 category-header">
  116 + <h4 class="panel-title">
  117 + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}">
  118 + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} ({{ category.subject_category.count }})
125 119 </a>
126   - <ul class="dropdown-menu pull-right" aria-labelledby="moreActions">
127   - {% if request.user.is_staff %}
128   - <li><a href="{% url 'categories:replicate' category.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans 'Replicate' %}</a></li>
129   - {% endif %}
130   - <li><a href="{% url 'categories:update' category.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans 'Edit' %}</a></li>
131   - <li><a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li>
132   - </ul>
133   - {% endif %}
134   - <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a>
135   - <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
136   - <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a>
137   - <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a>
  120 + </h4>
  121 +
  122 + <div class="col-md-5 pull-right category-card-items">
  123 + {% if request.user.is_staff or user in category.coordinators.all %}
  124 + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  125 + <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
  126 + </a>
  127 + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions">
  128 + {% if request.user.is_staff %}
  129 + <li><a href="{% url 'categories:replicate' category.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans 'Replicate' %}</a></li>
  130 + {% endif %}
  131 + <li><a href="{% url 'categories:update' category.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans 'Edit' %}</a></li>
  132 + <li><a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li>
  133 + </ul>
  134 + {% endif %}
  135 + <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a>
  136 + <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
  137 + <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a>
  138 + <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a>
  139 + </div>
138 140 </div>
139 141 </div>
140 142 </div>
141   - </div>
142   - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content">
143   - <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" />
144   - <input type="hidden" class="log_id" value="" />
145   - {% if category.coordinators.all|length > 0 %}
146   - <h4><b>{% trans "Coordinator(s) " %}: </b>
147   - {{ category.coordinators.all|join:', ' }}
148   - </h4>
149   - {% else %}
150   - <h4> {% trans "It doesn't possess coordinators" %} </h4>
151   - {% endif %}
152   -
153   - {{category.description|safe}}
154   -
155   - {% if request.user in category.coordinators.all or request.user.is_staff %}
156   - <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a>
157   - {% endif %}
  143 + <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content">
  144 + <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" />
  145 + <input type="hidden" class="log_id" value="" />
  146 + {% if category.coordinators.all|length > 0 %}
  147 + <h4><b>{% trans "Coordinator(s) " %}: </b>
  148 + {{ category.coordinators.all|join:', ' }}
  149 + </h4>
  150 + {% else %}
  151 + <h4> {% trans "It doesn't possess coordinators" %} </h4>
  152 + {% endif %}
  153 +
  154 + {{category.description|safe}}
  155 +
  156 + {% if request.user in category.coordinators.all or request.user.is_staff %}
  157 + <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a>
  158 + {% endif %}
158 159  
159   - <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true">
160   - {% for subject in category.subject_category.all %}
161   - {% include "subjects/subject_card.html" %}
162   - {% endfor %}
  160 + <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true">
  161 + {% for subject in category.subject_category.all %}
  162 + {% include "subjects/subject_card.html" %}
  163 + {% endfor %}
  164 + </div>
163 165 </div>
164 166 </div>
165   - </div>
166   - {% endif %}
167   - {% endfor %}
168   - {% pagination request paginator page_obj %}
169   - </div>
  167 + {% endif %}
  168 + {% endfor %}
  169 + {% pagination request paginator page_obj %}
  170 + </div>
  171 + {% else %}
  172 + <div class="text-center no-subjects">
  173 + <i class="fa fa-graduation-cap"></i>
  174 + <h4>{% trans 'You still do not posses any subject in our platform' %}</h4>
  175 + </div>
  176 + {% endif %}
170 177 </div>
171 178 <div id="modal_course">
172 179 </div>
... ...