Commit 80c3eb3ed43bb2398c6e153e111405ecbe701ea7
1 parent
4784944b
Exists in
master
and in
5 other branches
atualização de campo obrigatorio em settings #373
Showing
2 changed files
with
256 additions
and
258 deletions
Show diff stats
app/models.py
@@ -3,7 +3,7 @@ from django.utils.translation import ugettext_lazy as _ | @@ -3,7 +3,7 @@ from django.utils.translation import ugettext_lazy as _ | ||
3 | # Create your models here. | 3 | # Create your models here. |
4 | 4 | ||
5 | class EmailBackend(models.Model): | 5 | class EmailBackend(models.Model): |
6 | - | 6 | + |
7 | SAFE_CONECTIONS = ( | 7 | SAFE_CONECTIONS = ( |
8 | (0, _('No')), | 8 | (0, _('No')), |
9 | (1, _('TLS, if available')), | 9 | (1, _('TLS, if available')), |
@@ -17,7 +17,7 @@ class EmailBackend(models.Model): | @@ -17,7 +17,7 @@ class EmailBackend(models.Model): | ||
17 | username = models.CharField(_('Email host username'), max_length=30) | 17 | username = models.CharField(_('Email host username'), max_length=30) |
18 | password = models.CharField(_('Email host password'), max_length=30, blank=True) | 18 | password = models.CharField(_('Email host password'), max_length=30, blank=True) |
19 | safe_conection = models.IntegerField(_('Use safe conection'), choices=SAFE_CONECTIONS, default=0) | 19 | safe_conection = models.IntegerField(_('Use safe conection'), choices=SAFE_CONECTIONS, default=0) |
20 | - default_from_email = models.EmailField(_('Default from email'), blank=True) | 20 | + default_from_email = models.EmailField(_('Default from email')) |
21 | 21 | ||
22 | class Meta: | 22 | class Meta: |
23 | verbose_name = _('Amadeus SMTP setting') | 23 | verbose_name = _('Amadeus SMTP setting') |
app/templates/admin_settings.html
@@ -3,268 +3,266 @@ | @@ -3,268 +3,266 @@ | ||
3 | {% load static i18n django_bootstrap_breadcrumbs permission_tags widget_tweaks %} | 3 | {% load static i18n django_bootstrap_breadcrumbs permission_tags widget_tweaks %} |
4 | 4 | ||
5 | {% block breadcrumbs %} | 5 | {% block breadcrumbs %} |
6 | - {{ block.super }} | ||
7 | - {% breadcrumb 'Settings' 'app:settings' %} | 6 | +{{ block.super }} |
7 | +{% breadcrumb 'Settings' 'app:settings' %} | ||
8 | {% endblock %} | 8 | {% endblock %} |
9 | 9 | ||
10 | {% block content %} | 10 | {% block content %} |
11 | - {% for message in messages %} | ||
12 | - <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert"> | ||
13 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
14 | - <span aria-hidden="true">×</span> | ||
15 | - </button> | ||
16 | - <p>{{ message }}</p> | ||
17 | - </div> | ||
18 | - {% endfor %} | ||
19 | - <!-- Nav tabs --> | ||
20 | - <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> | ||
21 | - <li class="nav-item"> | ||
22 | - {% if form.safe_conection.errors or form.host.errors or form.default_from_email.errors %} | ||
23 | - <a class="nav-link" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
24 | - </li> | ||
25 | - <li class="nav-item"> | ||
26 | - <a class="nav-link active" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
27 | - </li> | ||
28 | - {% else %} | ||
29 | - <a class="nav-link active" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
30 | - </li> | ||
31 | - <li class="nav-item"> | ||
32 | - <a class="nav-link" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
33 | - </li> | ||
34 | - {% endif %} | ||
35 | - </li> | ||
36 | - <li class="nav-item"> | ||
37 | - <a class="nav-link" data-toggle="tab" href="#panel3" role="tab"><i class="fa fa-lock"></i> {% trans "Security" %}</a> | ||
38 | - </li> | ||
39 | - </ul> | 11 | +{% for message in messages %} |
12 | +<div class="alert alert-{{ message.tags }} alert-dismissible" role="alert"> | ||
13 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
14 | + <span aria-hidden="true">×</span> | ||
15 | + </button> | ||
16 | + <p>{{ message }}</p> | ||
17 | +</div> | ||
18 | +{% endfor %} | ||
19 | +<!-- Nav tabs --> | ||
20 | +<ul class="nav nav-tabs md-pills pills-ins" role="tablist"> | ||
21 | + <li class="nav-item"> | ||
22 | + {% if form.safe_conection.errors or form.host.errors or form.default_from_email.errors %} | ||
23 | + <a class="nav-link" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
24 | + </li> | ||
25 | + <li class="nav-item"> | ||
26 | + <a class="nav-link active" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
27 | + </li> | ||
28 | + {% else %} | ||
29 | + <a class="nav-link active" data-toggle="tab" href="#panel1" role="tab"><i class="fa fa-cog"></i> {% trans "System" %}</a> | ||
30 | +<li class="nav-item"> | ||
31 | + <a class="nav-link" data-toggle="tab" href="#panel2" role="tab"><i class="fa fa-envelope"></i> {% trans "Mail Sender" %}</a> | ||
32 | +</li> | ||
33 | +{% endif %} | ||
34 | +<li class="nav-item"> | ||
35 | + <a class="nav-link" data-toggle="tab" href="#panel3" role="tab"><i class="fa fa-lock"></i> {% trans "Security" %}</a> | ||
36 | +</li> | ||
37 | +</ul> | ||
40 | 38 | ||
41 | - <!-- Tab panels --> | ||
42 | - <div class="tab-content"> | ||
43 | - <!--Panel 1--> | 39 | +<!-- Tab panels --> |
40 | +<div class="tab-content"> | ||
41 | + <!--Panel 1--> | ||
44 | {% if form.errors %} | 42 | {% if form.errors %} |
45 | - <div class="tab-pane fade" id="panel1" role="tabpanel"> | ||
46 | - {% else %} | ||
47 | - <div class="tab-pane fade in active" id="panel1" role="tabpanel"> | ||
48 | - {% endif %} | ||
49 | - <div class="panel panel-default"> | ||
50 | - <div class="panel-body"> | ||
51 | - <h3><b>{% trans "General" %}</b></h3> | ||
52 | - <div class="panel panel-default"> | ||
53 | - <div class="panel-body"> | ||
54 | - Content | ||
55 | - <hr> | ||
56 | - </div> | ||
57 | - </div> | ||
58 | - </div> | ||
59 | - </div> | ||
60 | - </div> | ||
61 | - <!--/.Panel 1--> | ||
62 | - | ||
63 | - <!--Panel 2--> | ||
64 | - {% if form.errors %} | ||
65 | - <div class="tab-pane fade in active" id="panel2" role="tabpanel"> | ||
66 | - {% else %} | ||
67 | - <div class="tab-pane fade" id="panel2" role="tabpanel"> | ||
68 | - {% endif %} | ||
69 | - <div class="panel panel-default"> | ||
70 | - <form class="form-horizontal" method="post"> | ||
71 | - {% csrf_token %} | ||
72 | - <div class="panel-body"> | ||
73 | - <h3><b>{% trans "Outgoing Server (SMTP)" %}</b></h3> | ||
74 | - <div class="panel panel-default"> | ||
75 | - <div class="panel-body"> | ||
76 | - <h4><b>{% trans "Settings" %}</b></b></h4> | ||
77 | - <hr> | ||
78 | - <div class="form-group label-floating"> | ||
79 | - {% if form.description.field.required %} | ||
80 | - <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}<span>*</span></label> | ||
81 | - {% else %} | ||
82 | - <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label> | ||
83 | - {% endif %} | ||
84 | - {% render_field form.description class='form-control' %} | ||
85 | - </div> | ||
86 | - {% if form.description.errors %} | ||
87 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
88 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
89 | - <span aria-hidden="true">×</span> | ||
90 | - </button> | ||
91 | - <ul> | ||
92 | - {% for error in form.description.errors %} | ||
93 | - <li>{{ error }}</li> | ||
94 | - {% endfor %} | ||
95 | - </ul> | ||
96 | - </div> | ||
97 | - {% endif %} | ||
98 | - <div class="form-group label-floating"> | ||
99 | - {% if form.host.field.required %} | ||
100 | - <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}<span>*</span></label> | ||
101 | - {% else %} | ||
102 | - <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}</label> | ||
103 | - {% endif %} | ||
104 | - {% render_field form.host class='form-control' %} | ||
105 | - </div> | ||
106 | - {% if form.host.errors %} | ||
107 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
108 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
109 | - <span aria-hidden="true">×</span> | ||
110 | - </button> | ||
111 | - <ul> | ||
112 | - {% for error in form.host.errors %} | ||
113 | - <li>{{ error }}</li> | ||
114 | - {% endfor %} | ||
115 | - </ul> | ||
116 | - </div> | ||
117 | - {% endif %} | ||
118 | - <div class="form-group label-floating"> | ||
119 | - {% if form.port.field.required %} | ||
120 | - <label class="control-label" for="{{ form.port.auto_id }}">{{ form.port.label }}<span>*</span></label> | ||
121 | - {% else %} | ||
122 | - <label class="control-label" for="{{ form.port.auto_id }}">{{ form.port.label }}</label> | ||
123 | - {% endif %} | ||
124 | - <div class="col-md-2"> | ||
125 | - {% render_field form.port class='form-control' onkeypress='campoNumerico(this,event);' %} | ||
126 | - </div> | ||
127 | - <div> | ||
128 | - <label for="number">{% trans "Default:" %}</label> 25 | ||
129 | - </div> | ||
130 | - </div> | ||
131 | - {% if form.port.errors %} | ||
132 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
133 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
134 | - <span aria-hidden="true">×</span> | ||
135 | - </button> | ||
136 | - <ul> | ||
137 | - {% for error in form.port.errors %} | ||
138 | - <li>{{ error }}</li> | ||
139 | - {% endfor %} | ||
140 | - </ul> | ||
141 | - </div> | ||
142 | - {% endif %} | ||
143 | - </div> | ||
144 | - </div> | ||
145 | - </div> | ||
146 | - <div class="panel-body"> | ||
147 | - <div class="panel panel-default"> | ||
148 | - <div class="panel-body"> | ||
149 | - <h4><b>{% trans "Security and authentication" %}</b></h4> | ||
150 | - <hr> | ||
151 | - <div class="form-group label-floating"> | ||
152 | - {% if form.username.field.required %} | ||
153 | - <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}<span>*</span></label> | ||
154 | - {% else %} | ||
155 | - <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}</label> | ||
156 | - {% endif %} | ||
157 | - {% render_field form.username class='form-control' %} | ||
158 | - </div> | ||
159 | - {% if form.username.errors %} | ||
160 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
161 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
162 | - <span aria-hidden="true">×</span> | ||
163 | - </button> | ||
164 | - <ul> | ||
165 | - {% for error in form.username.errors %} | ||
166 | - <li>{{ error }}</li> | ||
167 | - {% endfor %} | ||
168 | - </ul> | ||
169 | - </div> | ||
170 | - {% endif %} | ||
171 | - <div class="form-group label-floating"> | ||
172 | - {% if form.password.field.required %} | ||
173 | - <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}<span>*</span></label> | ||
174 | - {% else %} | ||
175 | - <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}</label> | ||
176 | - {% endif %} | ||
177 | - {% render_field form.password type='password' class='form-control' %} | ||
178 | - </div> | ||
179 | - {% if form.password.errors %} | ||
180 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
181 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
182 | - <span aria-hidden="true">×</span> | ||
183 | - </button> | ||
184 | - <ul> | ||
185 | - {% for error in form.password.errors %} | ||
186 | - <li>{{ error }}</li> | ||
187 | - {% endfor %} | ||
188 | - </ul> | ||
189 | - </div> | ||
190 | - {% endif %} | ||
191 | - <div class="form-group label-floating"> | ||
192 | - {% if form.default_from_email.field.required %} | ||
193 | - <label class="control-label" for="{{ form.default_from_email.auto_id }}">{{ form.default_from_email.label }}<span>*</span></label> | ||
194 | - {% else %} | ||
195 | - <label class="control-label" for="{{ form.default_from_email.auto_id }}">{{ form.default_from_email.label }}</label> | ||
196 | - {% endif %} | ||
197 | - {% render_field form.default_from_email class='form-control' %} | ||
198 | - </div> | ||
199 | - {% if form.default_from_email.errors %} | ||
200 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
201 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
202 | - <span aria-hidden="true">×</span> | ||
203 | - </button> | ||
204 | - <ul> | ||
205 | - {% for error in form.default_from_email.errors %} | ||
206 | - <li>{{ error }}</li> | ||
207 | - {% endfor %} | ||
208 | - </ul> | ||
209 | - </div> | ||
210 | - {% endif %} | ||
211 | - <div class="form-group"> | ||
212 | - {% if form.safe_conection.fiel.required %} | ||
213 | - <p><b>{{ form.safe_conection.label }}<span>*</span></b></p> | ||
214 | - {% else %} | ||
215 | - <p><b>{{ form.safe_conection.label }}</b></p> | ||
216 | - {% endif %} | ||
217 | - <div class="col-md-10"> | ||
218 | - <div class="radio radio-primary"> | ||
219 | - {% for value, text in form.safe_conection.field.choices %} | ||
220 | - <label> | ||
221 | - {% if form.safe_conection.value == value %} | ||
222 | - <input type="radio" name="safe_conection" id="{{ value }}" value="{{ value }}" checked=""> | ||
223 | - {{ text }} | ||
224 | - {% else %} | ||
225 | - <input type="radio" name="safe_conection" id="{{ value }}" value="{{ value }}"> | ||
226 | - {{ text }} | ||
227 | - {% endif %} | ||
228 | - | ||
229 | - </label> | ||
230 | - {% endfor %} | ||
231 | - </div> | ||
232 | - </div> | ||
233 | - </div> | ||
234 | - {% if form.safe_conection.errors %} | ||
235 | - <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
236 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
237 | - <span aria-hidden="true">×</span> | ||
238 | - </button> | ||
239 | - <ul> | ||
240 | - {% for error in form.safe_conection.errors %} | ||
241 | - <li>{{ error }}</li> | ||
242 | - {% endfor %} | ||
243 | - </ul> | ||
244 | - </div> | ||
245 | - {% endif %} | ||
246 | - </div> | ||
247 | - </div> | ||
248 | - <button type="submit" class="btn btn-success btn-raised" name="submit-settings">{% trans "Save changes" %}</button> | ||
249 | - </div> | ||
250 | - </form> | ||
251 | - </div> | 43 | + <div class="tab-pane fade" id="panel1" role="tabpanel"> |
44 | + {% else %} | ||
45 | + <div class="tab-pane fade in active" id="panel1" role="tabpanel"> | ||
46 | + {% endif %} | ||
47 | + <div class="panel panel-default"> | ||
48 | + <div class="panel-body"> | ||
49 | + <h3><b>{% trans "General" %}</b></h3> | ||
50 | + <div class="panel panel-default"> | ||
51 | + <div class="panel-body"> | ||
52 | + Content | ||
53 | + <hr> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </div> | ||
252 | </div> | 58 | </div> |
59 | + <!--/.Panel 1--> | ||
60 | + | ||
61 | + <!--Panel 2--> | ||
62 | + {% if form.errors %} | ||
63 | + <div class="tab-pane fade in active" id="panel2" role="tabpanel"> | ||
64 | + {% else %} | ||
65 | + <div class="tab-pane fade" id="panel2" role="tabpanel"> | ||
66 | + {% endif %} | ||
67 | + <div class="panel panel-default"> | ||
68 | + <form class="form-horizontal" method="post"> | ||
69 | + {% csrf_token %} | ||
70 | + <div class="panel-body"> | ||
71 | + <h3><b>{% trans "Outgoing Server (SMTP)" %}</b></h3> | ||
72 | + <div class="panel panel-default"> | ||
73 | + <div class="panel-body"> | ||
74 | + <h4><b>{% trans "Settings" %}</b></b></h4> | ||
75 | + <hr> | ||
76 | + <div class="form-group label-floating"> | ||
77 | + {% if form.description.field.required %} | ||
78 | + <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}<span>*</span></label> | ||
79 | + {% else %} | ||
80 | + <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label> | ||
81 | + {% endif %} | ||
82 | + {% render_field form.description class='form-control' %} | ||
83 | + </div> | ||
84 | + {% if form.description.errors %} | ||
85 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
86 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
87 | + <span aria-hidden="true">×</span> | ||
88 | + </button> | ||
89 | + <ul> | ||
90 | + {% for error in form.description.errors %} | ||
91 | + <li>{{ error }}</li> | ||
92 | + {% endfor %} | ||
93 | + </ul> | ||
94 | + </div> | ||
95 | + {% endif %} | ||
96 | + <div class="form-group label-floating"> | ||
97 | + {% if form.host.field.required %} | ||
98 | + <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}<span>*</span></label> | ||
99 | + {% else %} | ||
100 | + <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}</label> | ||
101 | + {% endif %} | ||
102 | + {% render_field form.host class='form-control' %} | ||
103 | + </div> | ||
104 | + {% if form.host.errors %} | ||
105 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
106 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
107 | + <span aria-hidden="true">×</span> | ||
108 | + </button> | ||
109 | + <ul> | ||
110 | + {% for error in form.host.errors %} | ||
111 | + <li>{{ error }}</li> | ||
112 | + {% endfor %} | ||
113 | + </ul> | ||
114 | + </div> | ||
115 | + {% endif %} | ||
116 | + <div class="form-group label-floating"> | ||
117 | + {% if form.port.field.required %} | ||
118 | + <label class="control-label" for="{{ form.port.auto_id }}">{{ form.port.label }}<span>*</span></label> | ||
119 | + {% else %} | ||
120 | + <label class="control-label" for="{{ form.port.auto_id }}">{{ form.port.label }}</label> | ||
121 | + {% endif %} | ||
122 | + <div class="col-md-2"> | ||
123 | + {% render_field form.port class='form-control' onkeypress='campoNumerico(this,event);' %} | ||
124 | + </div> | ||
125 | + <div> | ||
126 | + <label for="number">{% trans "Default:" %}</label> 25 | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + {% if form.port.errors %} | ||
130 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
131 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
132 | + <span aria-hidden="true">×</span> | ||
133 | + </button> | ||
134 | + <ul> | ||
135 | + {% for error in form.port.errors %} | ||
136 | + <li>{{ error }}</li> | ||
137 | + {% endfor %} | ||
138 | + </ul> | ||
139 | + </div> | ||
140 | + {% endif %} | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + </div> | ||
144 | + <div class="panel-body"> | ||
145 | + <div class="panel panel-default"> | ||
146 | + <div class="panel-body"> | ||
147 | + <h4><b>{% trans "Security and authentication" %}</b></h4> | ||
148 | + <hr> | ||
149 | + <div class="form-group label-floating"> | ||
150 | + {% if form.username.field.required %} | ||
151 | + <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}<span>*</span></label> | ||
152 | + {% else %} | ||
153 | + <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}</label> | ||
154 | + {% endif %} | ||
155 | + {% render_field form.username class='form-control' %} | ||
156 | + </div> | ||
157 | + {% if form.username.errors %} | ||
158 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
159 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
160 | + <span aria-hidden="true">×</span> | ||
161 | + </button> | ||
162 | + <ul> | ||
163 | + {% for error in form.username.errors %} | ||
164 | + <li>{{ error }}</li> | ||
165 | + {% endfor %} | ||
166 | + </ul> | ||
167 | + </div> | ||
168 | + {% endif %} | ||
169 | + <div class="form-group label-floating"> | ||
170 | + {% if form.password.field.required %} | ||
171 | + <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}<span>*</span></label> | ||
172 | + {% else %} | ||
173 | + <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}</label> | ||
174 | + {% endif %} | ||
175 | + {% render_field form.password type='password' class='form-control' %} | ||
176 | + </div> | ||
177 | + {% if form.password.errors %} | ||
178 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
179 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
180 | + <span aria-hidden="true">×</span> | ||
181 | + </button> | ||
182 | + <ul> | ||
183 | + {% for error in form.password.errors %} | ||
184 | + <li>{{ error }}</li> | ||
185 | + {% endfor %} | ||
186 | + </ul> | ||
187 | + </div> | ||
188 | + {% endif %} | ||
189 | + <div class="form-group label-floating"> | ||
190 | + {% if form.default_from_email.field.required %} | ||
191 | + <label class="control-label" for="{{ form.default_from_email.auto_id }}">{{ form.default_from_email.label }}<span>*</span></label> | ||
192 | + {% else %} | ||
193 | + <label class="control-label" for="{{ form.default_from_email.auto_id }}">{{ form.default_from_email.label }}</label> | ||
194 | + {% endif %} | ||
195 | + {% render_field form.default_from_email class='form-control' %} | ||
196 | + </div> | ||
197 | + {% if form.default_from_email.errors %} | ||
198 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
199 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
200 | + <span aria-hidden="true">×</span> | ||
201 | + </button> | ||
202 | + <ul> | ||
203 | + {% for error in form.default_from_email.errors %} | ||
204 | + <li>{{ error }}</li> | ||
205 | + {% endfor %} | ||
206 | + </ul> | ||
207 | + </div> | ||
208 | + {% endif %} | ||
209 | + <div class="form-group"> | ||
210 | + {% if form.safe_conection.fiel.required %} | ||
211 | + <p><b>{{ form.safe_conection.label }}<span>*</span></b></p> | ||
212 | + {% else %} | ||
213 | + <p><b>{{ form.safe_conection.label }}</b></p> | ||
214 | + {% endif %} | ||
215 | + <div class="col-md-10"> | ||
216 | + <div class="radio radio-primary"> | ||
217 | + {% for value, text in form.safe_conection.field.choices %} | ||
218 | + <label> | ||
219 | + {% if form.safe_conection.value == value %} | ||
220 | + <input type="radio" name="safe_conection" id="{{ value }}" value="{{ value }}" checked=""> | ||
221 | + {{ text }} | ||
222 | + {% else %} | ||
223 | + <input type="radio" name="safe_conection" id="{{ value }}" value="{{ value }}"> | ||
224 | + {{ text }} | ||
225 | + {% endif %} | ||
226 | + | ||
227 | + </label> | ||
228 | + {% endfor %} | ||
229 | + </div> | ||
230 | + </div> | ||
231 | + </div> | ||
232 | + {% if form.safe_conection.errors %} | ||
233 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | ||
234 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
235 | + <span aria-hidden="true">×</span> | ||
236 | + </button> | ||
237 | + <ul> | ||
238 | + {% for error in form.safe_conection.errors %} | ||
239 | + <li>{{ error }}</li> | ||
240 | + {% endfor %} | ||
241 | + </ul> | ||
242 | + </div> | ||
243 | + {% endif %} | ||
244 | + </div> | ||
245 | + </div> | ||
246 | + <button type="submit" class="btn btn-success btn-raised" name="submit-settings">{% trans "Save changes" %}</button> | ||
247 | + </div> | ||
248 | + </form> | ||
249 | + </div> | ||
250 | + </div> | ||
253 | 251 | ||
254 | - <!--/.Panel 2--> | 252 | + <!--/.Panel 2--> |
255 | 253 | ||
256 | - <!--Panel 3--> | ||
257 | - <div class="tab-pane fade" id="panel3" role="tabpanel"> | ||
258 | - <div class="panel panel-default"> | ||
259 | - <div class="panel-body"> | ||
260 | - <div class="togglebutton"> | ||
261 | - <label> | ||
262 | - <input type="checkbox" checked> <b>{% trans "Allow users self-enroll." %}</b> | ||
263 | - </label> | ||
264 | - </div> | ||
265 | - <button type="button" class="btn btn-success btn-raised">{% trans "Save changes" %}</button> | ||
266 | - </div> | ||
267 | - </div> | 254 | + <!--Panel 3--> |
255 | + <div class="tab-pane fade" id="panel3" role="tabpanel"> | ||
256 | + <div class="panel panel-default"> | ||
257 | + <div class="panel-body"> | ||
258 | + <div class="togglebutton"> | ||
259 | + <label> | ||
260 | + <input type="checkbox" checked> <b>{% trans "Allow users self-enroll." %}</b> | ||
261 | + </label> | ||
262 | + </div> | ||
263 | + <button type="button" class="btn btn-success btn-raised">{% trans "Save changes" %}</button> | ||
264 | + </div> | ||
265 | + </div> | ||
266 | + </div> | ||
268 | </div> | 267 | </div> |
269 | - </div> | ||
270 | -{% endblock content %} | ||
271 | \ No newline at end of file | 268 | \ No newline at end of file |
269 | + {% endblock content %} |