Commit 3a69a8f8db9cb8ae60e489308eeb91e9e1e58044
1 parent
55f8edef
Exists in
master
and in
2 other branches
Fix'd register template bug with excessive space between inputs
Showing
1 changed file
with
63 additions
and
62 deletions
Show diff stats
users/templates/users/register.html
@@ -48,73 +48,74 @@ | @@ -48,73 +48,74 @@ | ||
48 | <form class="{% if form.has_error %} has-error {% endif %} form-horizontal is-fileinput" method="post" enctype="multipart/form-data" id="user-form"> | 48 | <form class="{% if form.has_error %} has-error {% endif %} form-horizontal is-fileinput" method="post" enctype="multipart/form-data" id="user-form"> |
49 | {% csrf_token %} | 49 | {% csrf_token %} |
50 | {% for field in form %} | 50 | {% for field in form %} |
51 | - <div class="col-lg-12 col-md-12 col-sm-12"> | ||
52 | - <div class="form-group form-group-md"> | ||
53 | - <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12"> | ||
54 | - {% if field.auto_id == 'id_image' %} | ||
55 | - <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
56 | - | 51 | + {% if field.auto_id == 'id_show_email' %} |
52 | + {% elif field.auto_id == 'id_x' %} | ||
53 | + <input class="form-control" id="id_x" name="x" type="hidden"> | ||
54 | + {% elif field.auto_id == 'id_y' %} | ||
55 | + <input class="form-control" id="id_y" name="y" type="hidden"> | ||
56 | + {% elif field.auto_id == 'id_width' %} | ||
57 | + <input class="form-control" id="id_width" name="width" type="hidden"> | ||
58 | + {% elif field.auto_id == 'id_height' %} | ||
59 | + <input class="form-control" id="id_height" name="height" type="hidden"> | ||
60 | + {% else %} | ||
61 | + <div class="col-lg-12 col-md-12 col-sm-12"> | ||
62 | + <div class="form-group form-group-md"> | ||
63 | + <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12"> | ||
64 | + {% if field.auto_id == 'id_image' %} | ||
65 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | ||
57 | {% render_field field class='form-control file-selector' %} | 66 | {% render_field field class='form-control file-selector' %} |
58 | - | ||
59 | - <div class="input-group common-file-input"> | ||
60 | - <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}"> | ||
61 | - <span class="input-group-btn input-group-sm"> | ||
62 | - <button type="button" class="btn btn-fab btn-fab-mini"> | ||
63 | - <i class="material-icons">attach_file</i> | ||
64 | - </button> | ||
65 | - </span> | ||
66 | - </div> | ||
67 | - | ||
68 | - <div class="filedrag"> | ||
69 | - {% if acc.image %} | ||
70 | - <i class="fa fa-file-archive-o"></i> <br /> | ||
71 | - | ||
72 | - <small>{{ acc.image.path }}</small> | ||
73 | - {% else %} | ||
74 | - {% trans 'Click or drop the file here' %}<br /> | ||
75 | - | ||
76 | - <small>{% trans 'The photo could not exceed 2MB.' %}</small> | ||
77 | - {% endif %} | ||
78 | - </div> | ||
79 | - {% else %} | ||
80 | - {% if field.auto_id == 'id_show_email' %} | ||
81 | - {% else %} | ||
82 | - {% render_field field class='form-control' %} | ||
83 | - {% endif %} | ||
84 | - | ||
85 | - | 67 | + <div class="input-group common-file-input"> |
68 | + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}"> | ||
69 | + <span class="input-group-btn input-group-sm"> | ||
70 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
71 | + <i class="material-icons">attach_file</i> | ||
72 | + </button> | ||
73 | + </span> | ||
74 | + </div> | ||
75 | + <div class="filedrag"> | ||
76 | + {% if acc.image %} | ||
77 | + <i class="fa fa-file-archive-o"></i> <br /> | ||
78 | + <small>{{ acc.image.path }}</small> | ||
79 | + {% else %} | ||
80 | + {% trans 'Click or drop the file here' %}<br /> | ||
81 | + <small>{% trans 'The photo could not exceed 2MB.' %}</small> | ||
82 | + {% endif %} | ||
83 | + </div> | ||
84 | + {% else %} | ||
85 | + {% render_field field class='form-control' %} | ||
86 | + {% endif %} | ||
87 | + | ||
88 | + <span class="help-block">{{ field.help_text }}</span> | ||
89 | + </div> | ||
90 | + {% if field.errors %} | ||
91 | + <div class="row"> | ||
92 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
93 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
94 | + <span aria-hidden="true">×</span> | ||
95 | + </button> | ||
96 | + <ul> | ||
97 | + {% for error in field.errors %} | ||
98 | + <li>{{ error }}</li> | ||
99 | + {% endfor %} | ||
100 | + </ul> | ||
101 | + </div> | ||
102 | + </div> | ||
86 | {% endif %} | 103 | {% endif %} |
87 | - <span class="help-block">{{ field.help_text }}</span> | ||
88 | - </div> | ||
89 | - | ||
90 | - {% if field.errors %} | ||
91 | - <div class="row"> | ||
92 | - <div class="alert alert-danger alert-dismissible" role="alert"> | ||
93 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
94 | - <span aria-hidden="true">×</span> | ||
95 | - </button> | 104 | + |
105 | + {% if field.auto_id == 'id_image' %} | ||
106 | + <div class="col-lg-12 col-md-12 col-sm-12 alert alert-danger alert-dismissible client-file-errors" style="display:none" role="alert"> | ||
107 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
108 | + <span aria-hidden="true">×</span> | ||
109 | + </button> | ||
96 | <ul> | 110 | <ul> |
97 | - {% for error in field.errors %} | ||
98 | - <li>{{ error }}</li> | ||
99 | - {% endfor %} | 111 | + <li class="size" style="display:none">{% trans "The image is too large. It should have less than 2MB." %}</li> |
112 | + <li class="format" style="display:none">{% trans 'File not supported.' %}</li> | ||
100 | </ul> | 113 | </ul> |
101 | </div> | 114 | </div> |
102 | - </div> | ||
103 | - {% endif %} | ||
104 | - | ||
105 | - {% if field.auto_id == 'id_image' %} | ||
106 | - <div class="col-lg-12 col-md-12 col-sm-12 alert alert-danger alert-dismissible client-file-errors" style="display:none" role="alert"> | ||
107 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
108 | - <span aria-hidden="true">×</span> | ||
109 | - </button> | ||
110 | - <ul> | ||
111 | - <li class="size" style="display:none">{% trans "The image is too large. It should have less than 2MB." %}</li> | ||
112 | - <li class="format" style="display:none">{% trans 'File not supported.' %}</li> | ||
113 | - </ul> | ||
114 | - </div> | ||
115 | - {% endif %} | 115 | + {% endif %} |
116 | + </div> | ||
116 | </div> | 117 | </div> |
117 | - </div> | 118 | + {% endif %} |
118 | {% endfor %} | 119 | {% endfor %} |
119 | <div class="row"> | 120 | <div class="row"> |
120 | <div class="col-lg-12 col-md-12 col-sm-12"> | 121 | <div class="col-lg-12 col-md-12 col-sm-12"> |
@@ -146,7 +147,7 @@ function Init() { | @@ -146,7 +147,7 @@ function Init() { | ||
146 | var small = $(".file-selector"), | 147 | var small = $(".file-selector"), |
147 | filedrag = $(".filedrag"), | 148 | filedrag = $(".filedrag"), |
148 | common = $(".common-file-input"); | 149 | common = $(".common-file-input"); |
149 | - | 150 | + |
150 | // file select | 151 | // file select |
151 | small.on("change", FileSelectHandler); | 152 | small.on("change", FileSelectHandler); |
152 | 153 |