Merge lp:~ronnie.vd.c/ubuntu-community-webthemes/django-forms into lp:ubuntu-community-webthemes/light-django-theme

Proposed by Ronnie
Status: Merged
Approved by: Chris Johnston
Approved revision: 33
Merged at revision: 35
Proposed branch: lp:~ronnie.vd.c/ubuntu-community-webthemes/django-forms
Merge into: lp:ubuntu-community-webthemes/light-django-theme
Diff against target: 303 lines (+234/-8)
3 files modified
media/css/default.css (+210/-0)
media/css/django_extras.css (+6/-8)
templates/form.html (+18/-0)
To merge this branch: bzr merge lp:~ronnie.vd.c/ubuntu-community-webthemes/django-forms
Reviewer Review Type Date Requested Status
Ubuntu Community Web Themes Developers Pending
Review via email: mp+53998@code.launchpad.net

Description of the change

Added form styling conform web design guidelines

To post a comment you must log in.
33. By Ronnie

Readded some django css

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'media/css/default.css'
2--- media/css/default.css 2011-03-14 19:11:05 +0000
3+++ media/css/default.css 2011-03-18 15:26:20 +0000
4@@ -205,6 +205,32 @@
5 /* 16x0.75 =12 */
6 }
7
8+/* Form typography */
9+form .smalltext {
10+ font-size:0.625em;
11+ line-height: 1.4em;
12+}
13+
14+legend span.supporting, label, form .error {
15+ font-size: 0.75em;
16+ line-height: 1.2em;
17+}
18+
19+legend {
20+ font-size: 1em;
21+ line-height: 1em;
22+}
23+
24+input[type="text"], input[type="password"], select {
25+ font-size: 0.75em;
26+}
27+
28+input[type="submit"] {
29+ font-size: 1em;
30+ line-height: 1.25em;
31+}
32+/* END Form typography */
33+
34 .showcase-text {
35 font-size: 0.875em;
36 /* 16x0.875=14 */
37@@ -360,6 +386,100 @@
38 width: auto;
39 }
40
41+/* Form Layout */
42+form {
43+ width: 542px;
44+ margin: 0 auto;
45+}
46+
47+form ul.errorlist {
48+ display: inline-block;
49+ line-height: 1em;
50+ vertical-align: top;
51+}
52+
53+form .error {
54+ width: 184px; /* 224 - 30 */
55+ height: 20px;
56+ display: inline-block;
57+ padding-left: 30px;
58+ line-height: 1em;
59+ vertical-align: top;
60+ padding-top: 4px;
61+}
62+
63+form .help {
64+ position: absolute;
65+ z-index: 10;
66+ right: 16px;
67+ width: 20px;
68+}
69+
70+label {
71+ display: block;
72+ margin-bottom: 4px;
73+}
74+
75+label.inline {
76+ display: inline-block;
77+ vertical-align: middle;
78+}
79+
80+legend {
81+ width: 100%;
82+ position: relative;
83+ padding: 8px;
84+ margin: 0 -8px;
85+}
86+
87+legend span.supporting {
88+ position: absolute;
89+ right: 8px;
90+}
91+
92+fieldset {
93+ position: relative;
94+ margin-bottom: 16px;
95+ padding: 8px;
96+}
97+
98+input[type="text"], input[type="password"], select, textarea {
99+ width: 286px;
100+ height: 20px;
101+ margin-right: 16px;
102+ margin-bottom: 8px;
103+}
104+
105+textarea, select[multiple="multiple"] {
106+ min-width: 286px;
107+ max-width: 286px;
108+ min-height: 20px;
109+ height: 100px;
110+}
111+
112+input[type="checkbox"], input[type="radio"] {
113+ margin-top: 0px;
114+ margin-bottom: 8px;
115+}
116+
117+input[type="text"]:focus, input[type="password"]:focus {
118+ width: 284px;
119+ height: 18px;
120+}
121+
122+input[type="text"].small, input[type="password"].small, select.small {
123+ width: 134px;
124+}
125+
126+input[type="text"].small:focus, input[type="password"].small:focus, select.small:focus {
127+ width: 132px;
128+}
129+
130+input[type="submit"] {
131+ padding: 10px 8px;
132+}
133+/* END Form Layout */
134+
135 .showcase-item {
136 float: left;
137 margin: 5px 10px;
138@@ -699,6 +819,96 @@
139 color: #333
140 }
141
142+/* Form decoration */
143+form ul {
144+ list-style-type: none;
145+}
146+
147+form .error {
148+ background-image: url('../images/error.png');
149+ background-repeat: no-repeat;
150+}
151+
152+form .help {
153+ background-image: url('../images/help.png');
154+ background-repeat: no-repeat;
155+}
156+
157+form .smalltext {
158+ color: #333333;
159+}
160+
161+label {
162+ color: #333333;
163+}
164+
165+label.required:after {
166+ color: #DD4814;
167+ content: " *";
168+}
169+
170+legend {
171+ background-color: #aea79f;
172+ color: #ffffff;
173+}
174+
175+legend span.supporting {
176+ color: #ffffff;
177+}
178+
179+legend span.supporting:before {
180+ color: #DD4814;
181+ content: "* ";
182+}
183+
184+fieldset {
185+ background-color: #dfdcd9;
186+}
187+
188+input[type="text"], input[type="password"], select, textarea {
189+ color: #333333;
190+ border: 1px solid #ccc1c1;
191+ background-color: white;
192+}
193+
194+input[type="submit"][disabled="disabled"], input[type="submit"][disabled="disabled"]:hover {
195+ background-color:#AEA79F;
196+ text-shadow: none;
197+}
198+
199+input[type="text"]:focus, input[type="password"]:focus {
200+ border: 2px solid #dd4814;
201+ color: #333333;
202+}
203+
204+select:focus {
205+ border: 2px solid #dd4814;
206+ color: #333333;
207+}
208+
209+input[type="text"].error, input[type="password"].error, select.error {
210+ border: 2px solid #dd4814;
211+ color: #dd4814;
212+}
213+
214+input[type="submit"] {
215+ border-radius: 4px;
216+ background: #dd4814 url('../images/gradient.png') repeat-x;
217+ color: #ffffff;
218+ border: none;
219+ text-shadow: black 0px 1px 2px;
220+}
221+
222+input[type="submit"]:hover {
223+ background-color: #b83a0f;
224+}
225+
226+input[type="submit"]:active {
227+ background-color: #962d0c;
228+}
229+/* END Form decoration */
230+
231+
232 FORM.search_form INPUT, #searchbox {
233 background-color: #f0f0f0;
234 border: 1px solid #CCCCCC;
235
236=== modified file 'media/css/django_extras.css'
237--- media/css/django_extras.css 2010-09-30 16:24:11 +0000
238+++ media/css/django_extras.css 2011-03-18 15:26:20 +0000
239@@ -1,21 +1,19 @@
240-/* - Form Decoration [Django]
241---------------------------------------------------------------------------------------------------------
242-*/
243-
244-FORM TH, .form-item-label {
245+.form-item-label {
246 font-size: 0.75em;
247 font-weight: bold;
248 text-align: left;
249 padding-right: 10px;
250+ text-align: left;
251+ white-space: nowrap;
252 }
253
254-FORM TD, .form-item-value {
255+.form-item-value {
256 font-size: 0.75em;
257 font-weight: normal;
258 text-align: left;
259 }
260
261-FORM INPUT[type=text], .form-item-field {
262+.form-item-field {
263 background-color: #f0f0f0;
264 border: 1px solid #CCCCCC;
265 height: 16px;
266@@ -24,7 +22,7 @@
267 width: 180px;
268 }
269
270-FORM INPUT[type=text]:focus, .form-item-field:focus {
271+.form-item-field:focus {
272 background-color: #f7f7f7;
273 border: 1px solid #DD4814;
274 }
275
276=== added file 'media/images/error.png'
277Binary files media/images/error.png 1970-01-01 00:00:00 +0000 and media/images/error.png 2011-03-18 15:26:20 +0000 differ
278=== added file 'media/images/gradient.png'
279Binary files media/images/gradient.png 1970-01-01 00:00:00 +0000 and media/images/gradient.png 2011-03-18 15:26:20 +0000 differ
280=== added file 'media/images/help.png'
281Binary files media/images/help.png 1970-01-01 00:00:00 +0000 and media/images/help.png 2011-03-18 15:26:20 +0000 differ
282=== added file 'templates/form.html'
283--- templates/form.html 1970-01-01 00:00:00 +0000
284+++ templates/form.html 2011-03-18 15:26:20 +0000
285@@ -0,0 +1,18 @@
286+{% load i18n %}
287+{% for field in form.visible_fields %}
288+ <div>
289+ {% if field.field.label %}<label for="id_{{ field.name }}"{% if field.field.required %} class="required"{% endif %}>{{ field.label }}</label>{% endif %}
290+ {{ field }}
291+ {% if field.help_text %}<span class="help" rel="help" title="{{ field.help_text }} {% if field.field.required %}({% trans "Required" %}){% endif %}">&nbsp;</span>{% endif %}
292+ {% if field.errors %}
293+ <ul class="errorlist">
294+ {% for error in field.errors %}
295+ <li class="error">{{ error }}</li>
296+ {% endfor %}
297+ </ul>
298+ {% endif %}
299+ </div>
300+{% endfor %}
301+{% for field in form.hidden_fields %}
302+ <div class="hidden">{{ field }}</div>
303+{% endfor %}

Subscribers

People subscribed via source and target branches