Commit 67fa72da441b4c2a0fde2a2a9345c47948ca3584
1 parent
37c7a084
Exists in
master
and in
2 other branches
Adjusting bulletin templates for non student users
Showing
2 changed files
with
42 additions
and
1 deletions
Show diff stats
bulletin/templates/bulletin/view.html
@@ -31,6 +31,7 @@ | @@ -31,6 +31,7 @@ | ||
31 | {% endif %} | 31 | {% endif %} |
32 | 32 | ||
33 | {% resource_permissions request.user bulletin as has_resource_permissions %} | 33 | {% resource_permissions request.user bulletin as has_resource_permissions %} |
34 | + {% subject_permissions request.user bulletin.topic.subject as has_subject_permissions %} | ||
34 | 35 | ||
35 | {% if bulletin.visible %} | 36 | {% if bulletin.visible %} |
36 | <div class="panel panel-info topic-panel"> | 37 | <div class="panel panel-info topic-panel"> |
@@ -55,6 +56,18 @@ | @@ -55,6 +56,18 @@ | ||
55 | </div> | 56 | </div> |
56 | </div> | 57 | </div> |
57 | <div id="{{subject.slug}}" class="panel-collapse in collapse category-panel-content"> | 58 | <div id="{{subject.slug}}" class="panel-collapse in collapse category-panel-content"> |
59 | + {% if has_subject_permissions %} | ||
60 | + <form id="student_bulletin" action="" method="POST"> | ||
61 | + {% csrf_token %} | ||
62 | + <select name="selected_student" onchange="$('#student_bulletin').submit();"> | ||
63 | + {% for stu in students %} | ||
64 | + <option value="{{ stu.email }}" {% if stu.email == student %}selected{% endif %}>{{ stu }}</option> | ||
65 | + {% endfor %} | ||
66 | + </select> | ||
67 | + </form> | ||
68 | + <br clear="all" /> | ||
69 | + {% endif %} | ||
70 | + | ||
58 | {% autoescape off %} | 71 | {% autoescape off %} |
59 | {{ bulletin.content }} | 72 | {{ bulletin.content }} |
60 | {% endautoescape %} | 73 | {% endautoescape %} |
@@ -179,6 +192,7 @@ | @@ -179,6 +192,7 @@ | ||
179 | </div> | 192 | </div> |
180 | </div> | 193 | </div> |
181 | 194 | ||
195 | + {% if not has_subject_permissions %} | ||
182 | <div class="form-group" style="background-color:#fff; box-shadow: 1px 1px 25px #c0beaf; margin-top: 15px;"> | 196 | <div class="form-group" style="background-color:#fff; box-shadow: 1px 1px 25px #c0beaf; margin-top: 15px;"> |
183 | <div class="row"> | 197 | <div class="row"> |
184 | <div class="col-md-1" align="left" style="padding-left: 25px; padding-top: 10px;"> | 198 | <div class="col-md-1" align="left" style="padding-left: 25px; padding-top: 10px;"> |
@@ -212,6 +226,13 @@ | @@ -212,6 +226,13 @@ | ||
212 | </div> | 226 | </div> |
213 | </div> | 227 | </div> |
214 | </div> | 228 | </div> |
229 | + {% endif %} | ||
230 | + | ||
231 | + {% block addtional_scripts %} | ||
232 | + <script type="text/javascript"> | ||
233 | + sessionSecurity.confirmFormDiscard = undefined; | ||
234 | + </script> | ||
235 | + {% endblock %} | ||
215 | 236 | ||
216 | 237 | ||
217 | <script type="text/javascript"> | 238 | <script type="text/javascript"> |
bulletin/templates/bulletin/window_view.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | 2 | ||
3 | -{% load static i18n util_tags %} | 3 | +{% load static i18n permissions_tags util_tags %} |
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
5 | 5 | ||
6 | <html> | 6 | <html> |
@@ -64,7 +64,21 @@ | @@ -64,7 +64,21 @@ | ||
64 | <link rel="stylesheet" href="{% static 'css/estilo.css' %}"> | 64 | <link rel="stylesheet" href="{% static 'css/estilo.css' %}"> |
65 | </head> | 65 | </head> |
66 | <body style="background: #FFF"> | 66 | <body style="background: #FFF"> |
67 | + | ||
68 | + {% subject_permissions request.user bulletin.topic.subject as has_subject_permissions %} | ||
67 | <div class="container-fluid" style="padding-top: 20px;"> | 69 | <div class="container-fluid" style="padding-top: 20px;"> |
70 | + {% if has_subject_permissions %} | ||
71 | + <form id="student_bulletin" action="" method="POST"> | ||
72 | + {% csrf_token %} | ||
73 | + <select name="selected_student" onchange="$('#student_bulletin').submit();"> | ||
74 | + {% for stu in students %} | ||
75 | + <option value="{{ stu.email }}" {% if stu.email == student %}selected{% endif %}>{{ stu }}</option> | ||
76 | + {% endfor %} | ||
77 | + </select> | ||
78 | + </form> | ||
79 | + <br clear="all" /> | ||
80 | + {% endif %} | ||
81 | + | ||
68 | {% autoescape off %} | 82 | {% autoescape off %} |
69 | {{ bulletin.content }} | 83 | {{ bulletin.content }} |
70 | {% endautoescape %} | 84 | {% endautoescape %} |
@@ -189,6 +203,7 @@ | @@ -189,6 +203,7 @@ | ||
189 | </div> | 203 | </div> |
190 | </div> | 204 | </div> |
191 | 205 | ||
206 | + {% if not has_subject_permissions %} | ||
192 | <div class="form-group" style="background-color:#fff; box-shadow: 1px 1px 25px #c0beaf; margin-top: 15px;"> | 207 | <div class="form-group" style="background-color:#fff; box-shadow: 1px 1px 25px #c0beaf; margin-top: 15px;"> |
193 | <div class="row"> | 208 | <div class="row"> |
194 | <div class="col-md-1" align="left" style="padding-left: 25px; padding-top: 10px;"> | 209 | <div class="col-md-1" align="left" style="padding-left: 25px; padding-top: 10px;"> |
@@ -222,7 +237,12 @@ | @@ -222,7 +237,12 @@ | ||
222 | </div> | 237 | </div> |
223 | </div> | 238 | </div> |
224 | </div> | 239 | </div> |
240 | + {% endif %} | ||
225 | 241 | ||
242 | +{% include 'session_security/all.html' %} | ||
243 | + <script type="text/javascript"> | ||
244 | + sessionSecurity.confirmFormDiscard = undefined; | ||
245 | + </script> | ||
226 | 246 | ||
227 | <script type="text/javascript"> | 247 | <script type="text/javascript"> |
228 | // Variável obtidas a partir do número de metas atendidas | 248 | // Variável obtidas a partir do número de metas atendidas |