Commit f654c81a7bd2db940b108ceae90f3248f28b5959
1 parent
7de0a6c6
Exists in
master
and in
5 other branches
Build template for user create --admin #55
Showing
1 changed file
with
52 additions
and
24 deletions
Show diff stats
users/templates/users/create.html
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | {% block breadcrumbs %} |
9 | 9 | |
10 | 10 | {{ block.super }} |
11 | - {% breadcrumb 'Create' 'users:create' %} | |
11 | + {% breadcrumb 'Add User' 'users:create' %} | |
12 | 12 | |
13 | 13 | {% endblock %} |
14 | 14 | |
... | ... | @@ -38,29 +38,57 @@ |
38 | 38 | {% endfor %} |
39 | 39 | {% endif %} |
40 | 40 | |
41 | - <form method="post" action="" enctype="multipart/form-data"> | |
42 | - {% csrf_token %} | |
43 | - {% for field in form %} | |
44 | - <div class="form-group{% if form.has_error %} has-error {% endif %}"> | |
45 | - <label for="{{ field.auto_id }}">{{ field.label }}</label> | |
46 | - {% render_field field class='form-control input-sm' %} | |
47 | - <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | |
48 | - {% if field.errors.length > 0 %} | |
49 | - <div class="alert alert-danger alert-dismissible" role="alert"> | |
50 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
51 | - <span aria-hidden="true">×</span> | |
52 | - </button> | |
53 | - <ul> | |
54 | - {% for error in field.errors %} | |
55 | - <li>{{ error }}</li> | |
56 | - {% endfor %} | |
57 | - </ul> | |
58 | - </div> | |
59 | - </div> | |
60 | - {% endif %} | |
41 | + <div class="card"> | |
42 | + <div class="card-content"> | |
43 | + <div class="card-body"> | |
44 | + <form method="post" action="" enctype="multipart/form-data"> | |
45 | + {% csrf_token %} | |
46 | + {% for field in form %} | |
47 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | |
48 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | |
49 | + {% if field.auto_id == 'id_birth_date' %} | |
50 | + {% render_field field class='form-control input-sm' type='date' %} | |
51 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | |
52 | + {% elif field.auto_id == 'id_image' %} | |
53 | + {% render_field field class='form-control input-sm' %} | |
54 | + <div class="input-group"> | |
55 | + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}"> | |
56 | + <span class="input-group-btn input-group-sm"> | |
57 | + <button type="button" class="btn btn-fab btn-fab-mini"> | |
58 | + <i class="material-icons">attach_file</i> | |
59 | + </button> | |
60 | + </span> | |
61 | + </div> | |
62 | + {% elif field.auto_id == 'id_is_staff' or field.auto_id == 'id_is_active' %} | |
63 | + <div class="checkbox"> | |
64 | + <label> | |
65 | + {% render_field field type='checkbox' %} | |
66 | + </label> | |
67 | + </div> | |
68 | + {% else %} | |
69 | + {% render_field field class='form-control input-sm' %} | |
70 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | |
71 | + {% endif %} | |
72 | + {% if field.errors.length > 0 %} | |
73 | + <div class="alert alert-danger alert-dismissible" role="alert"> | |
74 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
75 | + <span aria-hidden="true">×</span> | |
76 | + </button> | |
77 | + <ul> | |
78 | + {% for error in field.errors %} | |
79 | + <li>{{ error }}</li> | |
80 | + {% endfor %} | |
81 | + </ul> | |
82 | + </div> | |
83 | + </div> | |
84 | + {% endif %} | |
85 | + </div> | |
86 | + {% endfor %} | |
87 | + <input type="submit" value="{% trans 'Save' %}" class="btn btn-sm btn-success" /> | |
88 | + </form> | |
61 | 89 | </div> |
62 | - {% endfor %} | |
63 | - <input type="submit" value="{% trans 'Save' %}" class="btn btn-sm btn-success" /> | |
64 | - </form> | |
90 | + </div> | |
91 | + </div> | |
92 | + | |
65 | 93 | <br clear="all" /> |
66 | 94 | {% endblock %} | ... | ... |