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,6 +8,14 @@ | ||
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 %} | ||
11 | <!-- Nav tabs --> | 19 | <!-- Nav tabs --> |
12 | <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> | 20 | <ul class="nav nav-tabs md-pills pills-ins" role="tablist"> |
13 | <li class="nav-item"> | 21 | <li class="nav-item"> |
@@ -43,6 +51,7 @@ | @@ -43,6 +51,7 @@ | ||
43 | <div class="tab-pane fade" id="panel2" role="tabpanel"> | 51 | <div class="tab-pane fade" id="panel2" role="tabpanel"> |
44 | <div class="panel panel-default"> | 52 | <div class="panel panel-default"> |
45 | <form class="form-horizontal" method="post"> | 53 | <form class="form-horizontal" method="post"> |
54 | + {% csrf_token %} | ||
46 | <div class="panel-body"> | 55 | <div class="panel-body"> |
47 | <h3><b>{% trans "Outgoing Server (SMTP)" %}</b></h3> | 56 | <h3><b>{% trans "Outgoing Server (SMTP)" %}</b></h3> |
48 | <div class="panel panel-default"> | 57 | <div class="panel panel-default"> |
@@ -53,19 +62,55 @@ | @@ -53,19 +62,55 @@ | ||
53 | <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label> | 62 | <label class="control-label" for="{{ form.description.auto_id }}">{{ form.description.label }}</label> |
54 | {% render_field form.description class='form-control' %} | 63 | {% render_field form.description class='form-control' %} |
55 | </div> | 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 | <div class="form-group label-floating"> | 77 | <div class="form-group label-floating"> |
57 | <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}</label> | 78 | <label class="control-label" for="{{ form.host.auto_id }}">{{ form.host.label }}</label> |
58 | {% render_field form.host class='form-control' %} | 79 | {% render_field form.host class='form-control' %} |
59 | </div> | 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 | <div class="form-group label-floating"> | 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 | <div class="col-md-2"> | 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 | </div> | 97 | </div> |
65 | <div> | 98 | <div> |
66 | <label for="number">{% trans "Default:" %}</label> 25 | 99 | <label for="number">{% trans "Default:" %}</label> 25 |
67 | </div> | 100 | </div> |
68 | </div> | 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 | </div> | 114 | </div> |
70 | </div> | 115 | </div> |
71 | </div> | 116 | </div> |
@@ -78,18 +123,42 @@ | @@ -78,18 +123,42 @@ | ||
78 | <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}</label> | 123 | <label class="control-label" for="{{ form.username.auto_id }}">{{ form.username.label }}</label> |
79 | <input class="form-control" id="focusedInput1" type="text"> | 124 | <input class="form-control" id="focusedInput1" type="text"> |
80 | </div> | 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 | <div class="form-group label-floating"> | 138 | <div class="form-group label-floating"> |
82 | <label class="control-label" for="{{ form.password.auto_id }}">{{ form.password.label }}</label> | 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 | </div> | 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 | <div class="form-group"> | 154 | <div class="form-group"> |
86 | <p><b>{{ form.safe.connection.label }}</b></p> | 155 | <p><b>{{ form.safe.connection.label }}</b></p> |
87 | <div class="col-md-10"> | 156 | <div class="col-md-10"> |
88 | <div class="radio radio-primary"> | 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 | <label> | 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 | </label> | 162 | </label> |
94 | {% endfor %} | 163 | {% endfor %} |
95 | </div> | 164 | </div> |
@@ -97,7 +166,7 @@ | @@ -97,7 +166,7 @@ | ||
97 | </div> | 166 | </div> |
98 | </div> | 167 | </div> |
99 | </div> | 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 | </div> | 170 | </div> |
102 | </form> | 171 | </form> |
103 | </div> | 172 | </div> |