Commit 9c295d7745f600019c07dae3de5ec9c91c91dbd7

Authored by Gustavo
1 parent d81fb53b

Modified bulletin form to remove students option and properly add the file system

Showing 1 changed file with 44 additions and 75 deletions   Show diff stats
bulletin/templates/bulletin/_form.html
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 </div> 27 </div>
28 28
29 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> 29 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
30 - <label for="{{ form.content.auto_id }}">{{ form.content.label }} <span>*</span></label> 30 + <label for="{{ form.content.auto_id }}">{{ form.content.label }} </label>
31 {% render_field form.content class='form-control text_wysiwyg' %} 31 {% render_field form.content class='form-control text_wysiwyg' %}
32 32
33 <span id="helpBlock" class="help-block">{{ form.content.help_text }}</span> 33 <span id="helpBlock" class="help-block">{{ form.content.help_text }}</span>
@@ -69,6 +69,49 @@ @@ -69,6 +69,49 @@
69 </div> 69 </div>
70 70
71 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> 71 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
  72 + <label for="{{ form.file_content.auto_id }}">{{ form.file_content.label }} <span>*</span></label>
  73 + {% render_field form.file_content class='file-selector' %}
  74 +
  75 + <div class="input-group common-file-input">
  76 + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your file...' %}">
  77 + <span class="input-group-btn input-group-sm">
  78 + <button type="button" class="btn btn-fab btn-fab-mini">
  79 + <i class="material-icons">attach_file</i>
  80 + </button>
  81 + </span>
  82 + </div>
  83 +
  84 + <div class="filedrag">
  85 + {% if bulletin %}
  86 + <i class="fa fa-file-archive-o"></i> <br />
  87 +
  88 + <small>{{ bulletin.filename }}</small>
  89 + {% else %}
  90 + {% trans 'Click or drop the .xls file with the goals data' %}<br />
  91 +
  92 + <small>{% trans 'The file could not exceed 1MB.' %}</small>
  93 + {% endif %}
  94 + </div>
  95 +
  96 + <span id="helpBlock" class="help-block">{{ form.file_content.help_text }}</span>
  97 +
  98 + {% if form.file_content.errors %}
  99 + <div class="alert alert-danger alert-dismissible" role="alert">
  100 + <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  101 + <span aria-hidden="true">&times;</span>
  102 + </button>
  103 + <ul>
  104 + {% for error in form.file_content.errors %}
  105 + <li>{{ error }}</li>
  106 + {% endfor %}
  107 + </ul>
  108 + </div>
  109 + {% endif %}
  110 + </div>
  111 +
  112 +
  113 +
  114 + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
72 <label for="{{ form.tags.auto_id }}">{{ form.tags.label }}</label> 115 <label for="{{ form.tags.auto_id }}">{{ form.tags.label }}</label>
73 {% render_field form.tags class='form-control' data-role="tagsinput" %} 116 {% render_field form.tags class='form-control' data-role="tagsinput" %}
74 117
@@ -197,81 +240,7 @@ @@ -197,81 +240,7 @@
197 </div> 240 </div>
198 </div> 241 </div>
199 242
200 - <div class="panel panel-info">  
201 - <div class="panel-heading">  
202 - <div class="row">  
203 - <div class="col-md-12">  
204 - <a data-parent="#professors_accordion" data-toggle="collapse" href="#students">  
205 - <h4 class="panel-title">  
206 - <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label for="{{ form.students.auto_id }}">{{ form.students.label }}</label>  
207 - </h4>  
208 - </a>  
209 - </div>  
210 - </div>  
211 - </div>  
212 - <div id="students" class="panel-collapse collapse">  
213 - <div class="form-group{% if form.has_error %} has-error {% endif %}">  
214 - <div class=" checkbox">  
215 - <label for="{{ form.all_students.auto_id }}">  
216 - {% render_field form.all_students %} {{ form.all_students.label }}  
217 - </label>  
218 - </div>  
219 -  
220 - <span id="helpBlock" class="help-block">{{ form.all_students.help_text }}</span>  
221 -  
222 - {% if form.all_students.errors %}  
223 - <div class="alert alert-danger alert-dismissible" role="alert">  
224 - <button type="button" class="close" data-dismiss="alert" aria-label="Close">  
225 - <span aria-hidden="true">&times;</span>  
226 - </button>  
227 - <ul>  
228 - {% for error in form.all_students.errors %}  
229 - <li>{{ error }}</li>  
230 - {% endfor %}  
231 - </ul>  
232 - </div>  
233 - {% endif %}  
234 - </div>  
235 243
236 - <p><em>{% trans 'Attribute students to bulletin' %}:</em></p>  
237 - {% render_field form.students class='form-control' %}  
238 -  
239 - <span id="helpBlock" class="help-block">{{ form.students.help_text }}</span>  
240 -  
241 - {% if form.students.errors %}  
242 - <div class="alert alert-danger alert-dismissible" role="alert">  
243 - <button type="button" class="close" data-dismiss="alert" aria-label="Close">  
244 - <span aria-hidden="true">&times;</span>  
245 - </button>  
246 - <ul>  
247 - {% for error in form.students.errors %}  
248 - <li>{{ error }}</li>  
249 - {% endfor %}  
250 - </ul>  
251 - </div>  
252 - {% endif %}  
253 -  
254 - <br clear="all" />  
255 -  
256 - <p><em>{% trans 'Attribute groups to bulletin' %}:</em></p>  
257 - {% render_field form.groups class='form-control' %}  
258 -  
259 - <span id="helpBlock" class="help-block">{{ form.groups.help_text }}</span>  
260 -  
261 - {% if form.groups.errors %}  
262 - <div class="alert alert-danger alert-dismissible" role="alert">  
263 - <button type="button" class="close" data-dismiss="alert" aria-label="Close">  
264 - <span aria-hidden="true">&times;</span>  
265 - </button>  
266 - <ul>  
267 - {% for error in form.groups.errors %}  
268 - <li>{{ error }}</li>  
269 - {% endfor %}  
270 - </ul>  
271 - </div>  
272 - {% endif %}  
273 - </div>  
274 - </div>  
275 </div> 244 </div>
276 245
277 <div class="form-group{% if form.has_error %} has-error {% endif %}"> 246 <div class="form-group{% if form.has_error %} has-error {% endif %}">