Commit 8d79ffd19f7134a19faf9fcb953a6c54c07f35d7
1 parent
f9103c4b
Exists in
master
and in
5 other branches
Git pull #211
Showing
1 changed file
with
76 additions
and
7 deletions
Show diff stats
app/templates/admin_settings.html
... | ... | @@ -8,6 +8,14 @@ |
8 | 8 | {% endblock %} |
9 | 9 | |
10 | 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 %} | |
11 | 19 | <!-- Nav tabs --> |
12 | 20 | <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> |
13 | 21 | <li class="nav-item"> |
... | ... | @@ -43,6 +51,7 @@ |
43 | 51 | <div class="tab-pane fade" id="panel2" role="tabpanel"> |
44 | 52 | <div class="panel panel-default"> |
45 | 53 | <form class="form-horizontal" method="post"> |
54 | + {% csrf_token %} | |
46 | 55 | <div class="panel-body"> |
47 | 56 | <h3><b>{% trans "Outgoing Server (SMTP)" %}</b></h3> |
48 | 57 | <div class="panel panel-default"> |
... | ... | @@ -53,19 +62,55 @@ |
53 | 62 | <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label> |
54 | 63 | {% render_field form.description class='form-control' %} |
55 | 64 | </div> |
65 | + {% if form.description.errors %} | |
66 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | |
67 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
68 | + <span aria-hidden="true">×</span> | |
69 | + </button> | |
70 | + <ul> | |
71 | + {% for error in form.description.errors %} | |
72 | + <li>{{ error }}</li> | |
73 | + {% endfor %} | |
74 | + </ul> | |
75 | + </div> | |
76 | + {% endif %} | |
56 | 77 | <div class="form-group label-floating"> |
57 | 78 | <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}</label> |
58 | 79 | {% render_field form.host class='form-control' %} |
59 | 80 | </div> |
81 | + {% if form.host.errors %} | |
82 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | |
83 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
84 | + <span aria-hidden="true">×</span> | |
85 | + </button> | |
86 | + <ul> | |
87 | + {% for error in form.host.errors %} | |
88 | + <li>{{ error }}</li> | |
89 | + {% endfor %} | |
90 | + </ul> | |
91 | + </div> | |
92 | + {% endif %} | |
60 | 93 | <div class="form-group label-floating"> |
61 | - <label for="{{ form.port.auto_id }}" class="col-md_10 control-label">{{ form.port.label }}</label> | |
94 | + <label for="{{ form.port.auto_id }}" class="control-label">{{ form.port.label }}</label> | |
62 | 95 | <div class="col-md-2"> |
63 | - {% render_field form.port class='form-control' %} | |
96 | + {% render_field form.port class='form-control' onkeypress='campoNumerico(this,event);' %} | |
64 | 97 | </div> |
65 | 98 | <div> |
66 | 99 | <label for="number">{% trans "Default:" %}</label> 25 |
67 | 100 | </div> |
68 | 101 | </div> |
102 | + {% if form.port.errors %} | |
103 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | |
104 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
105 | + <span aria-hidden="true">×</span> | |
106 | + </button> | |
107 | + <ul> | |
108 | + {% for error in form.port.errors %} | |
109 | + <li>{{ error }}</li> | |
110 | + {% endfor %} | |
111 | + </ul> | |
112 | + </div> | |
113 | + {% endif %} | |
69 | 114 | </div> |
70 | 115 | </div> |
71 | 116 | </div> |
... | ... | @@ -78,18 +123,42 @@ |
78 | 123 | <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}</label> |
79 | 124 | <input class="form-control" id="focusedInput1" type="text"> |
80 | 125 | </div> |
126 | + {% if form.username.errors %} | |
127 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | |
128 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
129 | + <span aria-hidden="true">×</span> | |
130 | + </button> | |
131 | + <ul> | |
132 | + {% for error in form.username.errors %} | |
133 | + <li>{{ error }}</li> | |
134 | + {% endfor %} | |
135 | + </ul> | |
136 | + </div> | |
137 | + {% endif %} | |
81 | 138 | <div class="form-group label-floating"> |
82 | 139 | <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}</label> |
83 | - {% render_field form.password class='form-control' %} | |
140 | + {% render_field form.password type='password' class='form-control' %} | |
84 | 141 | </div> |
142 | + {% if form.password.errors %} | |
143 | + <div class="alert alert-danger alert-dismissible clearfix" role="alert"> | |
144 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
145 | + <span aria-hidden="true">×</span> | |
146 | + </button> | |
147 | + <ul> | |
148 | + {% for error in form.password.errors %} | |
149 | + <li>{{ error }}</li> | |
150 | + {% endfor %} | |
151 | + </ul> | |
152 | + </div> | |
153 | + {% endif %} | |
85 | 154 | <div class="form-group"> |
86 | 155 | <p><b>{{ form.safe.connection.label }}</b></p> |
87 | 156 | <div class="col-md-10"> |
88 | 157 | <div class="radio radio-primary"> |
89 | - {% for field in form.safe_conection.field.choices %} | |
158 | + {% for value, text in form.safe_conection.field.choices %} | |
90 | 159 | <label> |
91 | - <input type="radio" name="safe_conection" id="{{ fiel.auto_id }}" value="{{ field.value }}"> | |
92 | - {{ field.label }} | |
160 | + <input type="radio" name="safe_conection" id="{{ value }}" value="{{ value }}"> | |
161 | + {{ text }} | |
93 | 162 | </label> |
94 | 163 | {% endfor %} |
95 | 164 | </div> |
... | ... | @@ -97,7 +166,7 @@ |
97 | 166 | </div> |
98 | 167 | </div> |
99 | 168 | </div> |
100 | - <button type="button" class="btn btn-success btn-raised">{% trans "Save changes" %}</button> | |
169 | + <button type="submit" class="btn btn-success btn-raised">{% trans "Save changes" %}</button> | |
101 | 170 | </div> |
102 | 171 | </form> |
103 | 172 | </div> | ... | ... |