Commit e03d9a0d2c34cd7c4e19caa31e72704ffec30942
1 parent
1bee4623
Exists in
master
and in
2 other branches
Updating news form
Showing
1 changed file
with
67 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,67 @@ | @@ -0,0 +1,67 @@ | ||
1 | +{% load static i18n %} | ||
2 | +{% load widget_tweaks %} | ||
3 | + | ||
4 | +<form method="post" action="" enctype="multipart/form-data"> | ||
5 | + {% csrf_token %} | ||
6 | + {% for field in form %} | ||
7 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput col-lg-12 col-md-12 col-sm-12"> | ||
8 | + {% if field.auto_id == 'id_image' %} | ||
9 | + <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label> | ||
10 | + {% render_field field class='form-control' %} | ||
11 | + <div class="input-group"> | ||
12 | + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}"> | ||
13 | + <span class="input-group-btn input-group-sm"> | ||
14 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
15 | + <i class="material-icons">image</i> | ||
16 | + </button> | ||
17 | + </span> | ||
18 | + </div> | ||
19 | + | ||
20 | + | ||
21 | + {% elif field.auto_id == 'id_content' %} | ||
22 | + {% if field.field.required %} | ||
23 | + <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label> | ||
24 | + {% else %} | ||
25 | + | ||
26 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
27 | + {% endif %} | ||
28 | + {% render_field field class='form-control text_wysiwyg' %} | ||
29 | + {% else %} | ||
30 | + {% if field.field.required %} | ||
31 | + <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label> | ||
32 | + {% else %} | ||
33 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
34 | + | ||
35 | + {% endif %} | ||
36 | + {% render_field field class='form-control' %} | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + {% endif %} | ||
41 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | ||
42 | + {% if field.errors %} | ||
43 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
44 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
45 | + <span aria-hidden="true">×</span> | ||
46 | + </button> | ||
47 | + <ul> | ||
48 | + {% for error in field.errors %} | ||
49 | + <li>{{ error }}</li> | ||
50 | + {% endfor %} | ||
51 | + </ul> | ||
52 | + </div> | ||
53 | + {% endif %} | ||
54 | + </div> | ||
55 | + {% endfor %} | ||
56 | + <div class="row"> | ||
57 | + <div class="col-lg-12 col-md-12 col-sm-12"> | ||
58 | + <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | ||
59 | + <input type="submit" value="{% trans 'Save' %}" class="btn btn-success btn-raised btn-block" /> | ||
60 | + </div> | ||
61 | + <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | ||
62 | + <a href="" class="btn btn-default btn-raised btn-block">{% trans 'Cancel' %}</a> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + | ||
67 | +</form> |