Merge lp:~methanal-developers/methanal/459864-improve-default-appearance into lp:methanal

Proposed by Jonathan Jacobs
Status: Merged
Approved by: Tristan Seligmann
Approved revision: 235
Merged at revision: 195
Proposed branch: lp:~methanal-developers/methanal/459864-improve-default-appearance
Merge into: lp:methanal
Diff against target: 1439 lines (+453/-429)
12 files modified
methanal/js/Methanal/Tests/TestView.js (+1/-1)
methanal/js/Methanal/Tests/Util.js (+0/-1)
methanal/js/Methanal/View.js (+51/-33)
methanal/js/Methanal/Widgets.js (+22/-4)
methanal/static/styles/methanal-ie.css (+17/-27)
methanal/static/styles/methanal-ie6.css (+0/-9)
methanal/static/styles/methanal.css (+350/-341)
methanal/test/test_view.py (+8/-8)
methanal/themes/methanal-base/methanal-action-container.html (+1/-1)
methanal/themes/methanal-base/methanal-liveform.html (+0/-1)
methanal/themes/methanal-base/methanal-tab-view.html (+1/-2)
methanal/view.py (+2/-1)
To merge this branch: bzr merge lp:~methanal-developers/methanal/459864-improve-default-appearance
Reviewer Review Type Date Requested Status
Tristan Seligmann Approve
Review via email: mp+116278@code.launchpad.net
To post a comment you must log in.
232. By Jonathan Jacobs

Don't zebra stripe simple forms.

233. By Jonathan Jacobs

Tweak table zebra striping.

234. By Jonathan Jacobs

Expander colour tweaks.

235. By Jonathan Jacobs

Button style tweaks.

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

The code changes here look good, and I'm just going to rubber-stamp the style changes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'methanal/js/Methanal/Tests/TestView.js'
2--- methanal/js/Methanal/Tests/TestView.js 2011-08-20 12:02:37 +0000
3+++ methanal/js/Methanal/Tests/TestView.js 2012-07-27 14:39:22 +0000
4@@ -986,7 +986,7 @@
5 * value for valid date values.
6 */
7 function test_displayValue(self) {
8- self.testControl({value: null},
9+ self.testControl({value: '2012-07-18'},
10 function (control) {
11 // TextInput._updateDisplayValue should have been called by the
12 // time the node has been inserted, if it has then the first
13
14=== modified file 'methanal/js/Methanal/Tests/Util.js'
15--- methanal/js/Methanal/Tests/Util.js 2011-08-19 13:27:53 +0000
16+++ methanal/js/Methanal/Tests/Util.js 2012-07-27 14:39:22 +0000
17@@ -53,7 +53,6 @@
18 */
19 Methanal.Tests.Util.setUpForm = function setUpForm(form) {
20 var makeWidgetChildNode = Methanal.Tests.Util.makeWidgetChildNode;
21- makeWidgetChildNode(form, 'span', 'form-error');
22
23 Methanal.Util.addElementClass(
24 makeWidgetChildNode(form, 'span', 'modifiedIndicator'),
25
26=== modified file 'methanal/js/Methanal/View.js'
27--- methanal/js/Methanal/View.js 2012-07-16 11:58:01 +0000
28+++ methanal/js/Methanal/View.js 2012-07-27 14:39:22 +0000
29@@ -745,6 +745,7 @@
30 Methanal.View.FormAction.upcall(self, '__init__', node);
31 self.actionID = args.actionID;
32 self.allowViewOnly = args.allowViewOnly;
33+ self.identifier = args.identifier;
34 },
35
36
37@@ -799,6 +800,10 @@
38 self._buttonNode = self.node.getElementsByTagName('button')[0];
39 Methanal.View.ActionButton.upcall(self, 'nodeInserted');
40 self.widgetParent.loadedUp(self);
41+ if (self.identifier) {
42+ Methanal.Util.addElementClass(
43+ self._buttonNode, 'methanal-action-button-' + self.identifier);
44+ }
45 },
46
47
48@@ -1023,7 +1028,8 @@
49
50
51 function nodeInserted(self) {
52- self._formErrorNode = self.nodeById('form-error');
53+ self._submissionErrorTooltip = Methanal.Util.Tooltip(
54+ self.node, null, 'top', 'error-tooltip submission-error-tooltip');
55 self._validationErrorTooltip = Methanal.Util.Tooltip(
56 self.node, null, 'top', 'error-tooltip submission-error-tooltip ' +
57 'form-validation-error-tooltip');
58@@ -1138,8 +1144,7 @@
59 * Clear submission errors.
60 */
61 function clearError(self) {
62- Methanal.Util.removeNodeContent(self._formErrorNode);
63- Methanal.Util.addElementClass(self._formErrorNode, 'hidden');
64+ self._submissionErrorTooltip.hide();
65 },
66
67
68@@ -1149,32 +1154,21 @@
69 * @type failure: C{Divmod.Defer.Failure}
70 */
71 function setError(self, failure) {
72- var T = Methanal.Util.DOMBuilder(self.node.ownerDocument);
73-
74- var a = T('a', {'class': 'methanal-submit-error-action'}, [
75- T('img', {
76- 'src': '/static/Methanal/images/icons/page_white_error.png',
77- 'title': 'Toggle traceback'})]);
78+ var D = Methanal.Util.DOMBuilder(self.node.ownerDocument);
79
80 function showTraceback() {
81- var traceback = T('pre', {}, [failure.toPrettyText()]);
82- this.parentNode.parentNode.appendChild(traceback);
83- this.onclick = hideTraceback;
84- }
85-
86- function hideTraceback() {
87- var node = this.parentNode.parentNode;
88- node.removeChild(node.lastChild);
89- this.onclick = showTraceback;
90- }
91-
92- a.onclick = showTraceback;
93-
94- Methanal.Util.replaceNodeContent(self._formErrorNode, [
95- T('h1', {}, ['Error submitting form', a]),
96- T('div', {'class': 'methanal-submit-error-message'}, [
97- self.formatFailure(failure)])]);
98- Methanal.Util.removeElementClass(self._formErrorNode, 'hidden');
99+ var traceback = D('pre', {}, [failure.toPrettyText()]);
100+ this.parentNode.appendChild(traceback);
101+ this.onclick = null;
102+ }
103+
104+ var header = D('h2', {}, ['Submission error']);
105+ header.onclick = showTraceback;
106+ var errorText = D('span', {}, [header,
107+ D('p', {}, [self.formatFailure(failure)])]);
108+ self._submissionErrorTooltip.setText(errorText);
109+ self._submissionErrorTooltip.show();
110+ self._submissionErrorTooltip.scrollIntoView(true);
111 },
112
113
114@@ -1241,9 +1235,11 @@
115 },
116
117
118- function valueChanged(self, control) {
119+ function valueChanged(self, control, updateModified/*=true*/) {
120 Methanal.View.LiveForm.upcall(self, 'valueChanged', control);
121- self.formModified(true);
122+ if (updateModified === undefined || !!updateModified) {
123+ self.formModified(true);
124+ }
125 },
126
127
128@@ -1826,20 +1822,36 @@
129
130
131 /**
132+ * Show the display value element.
133+ */
134+ function _showDisplayValue(self) {
135+ Methanal.Util.removeElementClass(self._displayValueNode, 'hidden');
136+ },
137+
138+
139+ /**
140 * Enable the human-readable "display value" representation.
141 */
142- function enableDisplayValue(self) {
143- Methanal.Util.removeElementClass(self._displayValueNode, 'hidden');
144+ function enableDisplayValue(self, update) {
145+ self._showDisplayValue();
146 self._useDisplayValue = true;
147 self._updateDisplayValue();
148 },
149
150
151 /**
152+ * Hide the display value element.
153+ */
154+ function _hideDisplayValue(self) {
155+ Methanal.Util.addElementClass(self._displayValueNode, 'hidden');
156+ },
157+
158+
159+ /**
160 * Disable the human-readable "display value" representation.
161 */
162 function disableDisplayValue(self) {
163- Methanal.Util.addElementClass(self._displayValueNode, 'hidden');
164+ self._hideDisplayValue();
165 self._useDisplayValue = false;
166 },
167
168@@ -1875,7 +1887,13 @@
169 if (value && self.baseValidator(value) === undefined) {
170 displayValue = self.makeDisplayValue(value);
171 }
172- Methanal.Util.replaceNodeText(self._displayValueNode, displayValue);
173+ if (displayValue) {
174+ Methanal.Util.replaceNodeText(
175+ self._displayValueNode, displayValue);
176+ self._showDisplayValue(false);
177+ } else {
178+ self._hideDisplayValue();
179+ }
180 },
181
182
183
184=== modified file 'methanal/js/Methanal/Widgets.js'
185--- methanal/js/Methanal/Widgets.js 2011-08-19 13:27:53 +0000
186+++ methanal/js/Methanal/Widgets.js 2012-07-27 14:39:22 +0000
187@@ -1118,6 +1118,17 @@
188
189
190 /**
191+ * Handler for the "onchange" DOM event.
192+ *
193+ * Inform the containing form that our value has changed.
194+ */
195+ function onChange(self, node, updateModified) {
196+ self.getForm().valueChanged(self, updateModified);
197+ return true;
198+ },
199+
200+
201+ /**
202 * Set the values of the result input.
203 *
204 * @type values: C{Array} of L{LookupResult}
205@@ -1138,6 +1149,7 @@
206 function setValue(self, data) {
207 self._waitForForm.addCallback(function () {
208 self._lookupForm.populateForm(data, true);
209+ self._lookupForm._initialisedOnce = true;
210 });
211 },
212
213@@ -1204,6 +1216,7 @@
214
215 self.results = {};
216 self.storeResults = false;
217+ self._initialisedOnce = false;
218 },
219
220
221@@ -1360,7 +1373,7 @@
222 }
223
224 // Trigger Lookup.onChange so the parent form refreshes validators.
225- self.widgetParent.onChange(control.node);
226+ self.widgetParent.onChange(control.node, self._initialisedOnce);
227
228 // Don't trigger when the result input is changed or when there are
229 // validation errors.
230@@ -1614,9 +1627,14 @@
231 self._groups = {};
232 self.fullyLoaded = false;
233 if (_makeThrobber === undefined) {
234- _makeThrobber = function() { return self._makeThrobber(); };
235+ _makeThrobber = function() { return self._defaultMakeThrobber(); };
236 }
237- self.throbber = _makeThrobber();
238+ self._makeThrobber = _makeThrobber;
239+ },
240+
241+
242+ function nodeInserted(self) {
243+ self.throbber = self._makeThrobber();
244 self.throbber.start();
245 },
246
247@@ -1624,7 +1642,7 @@
248 /**
249 * Create a throbber object.
250 */
251- function _makeThrobber(self) {
252+ function _defaultMakeThrobber(self) {
253 return Methanal.Util.Throbber(self);
254 },
255
256
257=== removed file 'methanal/static/images/group-bg.png'
258Binary files methanal/static/images/group-bg.png 2010-12-17 09:26:57 +0000 and methanal/static/images/group-bg.png 1970-01-01 00:00:00 +0000 differ
259=== removed file 'methanal/static/images/icons/dependency_parent.gif'
260Binary files methanal/static/images/icons/dependency_parent.gif 2010-07-06 14:14:44 +0000 and methanal/static/images/icons/dependency_parent.gif 1970-01-01 00:00:00 +0000 differ
261=== modified file 'methanal/static/styles/methanal-ie.css'
262--- methanal/static/styles/methanal-ie.css 2011-07-13 15:51:04 +0000
263+++ methanal/static/styles/methanal-ie.css 2012-07-27 14:39:22 +0000
264@@ -1,13 +1,12 @@
265 form {
266 margin: 0;
267-}
268-
269-.methanal-multi-input {
270- border: 1px outset #ddd;
271-}
272-
273-.methanal-form-group {
274- border-color: white;
275+ padding: 0;
276+}
277+
278+button {
279+ border-color: #444;
280+ width: auto;
281+ overflow: visible;
282 }
283
284 .modal-dialog-overlay {
285@@ -27,28 +26,19 @@
286 border: 2px solid #999;
287 }
288
289-.methanal-tab-view .methanal-tab-labels {
290- padding-top: 0;
291-}
292-
293 .methanal-tab-view .methanal-tab-label {
294- /* Simulate inline-block. */
295- zoom: 1;
296 display: inline;
297-}
298-
299-.methanal-tab-view .methanal-tab-label a {
300 zoom: 1;
301- margin-bottom: -0.5em;
302-}
303-
304-.methanal-tab-view .selected-tab-label a {
305- padding-top: 0.5em;
306-}
307-
308-.methanal-tab-view .methanal-tab-group-label {
309- margin-bottom: -0.5em;
310- padding: 0.25em;
311+}
312+
313+.methanal-tab-view .selected-tab-label {
314+ border-bottom: 1px solid #fff;
315+ position: relative;
316+}
317+
318+.methanal-tab-view .methanal-tab-group {
319+ position: relative;
320+ top: 1px;
321 }
322
323 .dependancy-parent {
324
325=== modified file 'methanal/static/styles/methanal-ie6.css'
326--- methanal/static/styles/methanal-ie6.css 2010-12-17 09:18:55 +0000
327+++ methanal/static/styles/methanal-ie6.css 2012-07-27 14:39:22 +0000
328@@ -12,15 +12,6 @@
329 width: 20em;
330 }
331
332-.methanal-error {
333- background: none;
334- filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/static/Methanal/images/error-icon.png', sizingMethod='image');
335-}
336-
337-.methanal-error-text {
338- font-size: 75%;
339-}
340-
341 .dependancy-child {
342 border-bottom: 1px solid #ccc;
343 }
344
345=== modified file 'methanal/static/styles/methanal.css'
346--- methanal/static/styles/methanal.css 2011-07-13 16:05:19 +0000
347+++ methanal/static/styles/methanal.css 2012-07-27 14:39:22 +0000
348@@ -1,99 +1,238 @@
349+/**
350+ * Button styles.
351+ */
352+
353+button {
354+ color: #fff;
355+ font-weight: bold;
356+ text-transform: uppercase;
357+ border: 1px solid transparent;
358+ border-color: rgba(0, 0, 0, 0.15);
359+ border-radius: 0.2em;
360+ -o-box-shadow: 0px 1px rgba(0, 0, 0, 0.333);
361+ -moz-box-shadow: 0px 1px rgba(0, 0, 0, 0.333);
362+ -webkit-box-shadow: 0px 1px rgba(0, 0, 0, 0.333);
363+ box-shadow: 0px 1px rgba(0, 0, 0, 0.333);
364+ background-color: #555;
365+ padding: 0.5em 1em;
366+ padding: 0.6em 1em;
367+ cursor: pointer;
368+}
369+
370+button:active:focus,
371+button:active {
372+ -o-box-shadow: none;
373+ -moz-box-shadow: none;
374+ -webkit-box-shadow: none;
375+ box-shadow: none;
376+ background-color: #193c59;
377+ border-color: transparent;
378+ position: relative;
379+ top: 1px;
380+}
381+
382+button:focus {
383+ border-color: #193c59;
384+}
385+
386+button:hover {
387+ text-decoration: underline;
388+}
389+
390+button.methanal-waiting,
391+button.methanal-waiting:hover,
392+button.methanal-waiting:active {
393+ text-decoration: none;
394+ cursor: wait;
395+}
396+
397+button.methanal-submit-disabled,
398+button.methanal-submit-disabled:hover,
399+button.methanal-submit-disabled:active {
400+ text-decoration: none;
401+ border-color: #ccc;
402+ background-color: transparent;
403+ color: #444;
404+ cursor: default;
405+ cursor: not-allowed;
406+ top: 0;
407+ opacity: 0.5;
408+ -o-box-shadow: none;
409+ -moz-box-shadow: none;
410+ -webkit-box-shadow: none;
411+ box-shadow: none;
412+}
413+
414+/**
415+ * Option groups.
416+ */
417+
418+optgroup {
419+ font-style: normal;
420+}
421+
422+optgroup option {
423+ padding-left: 1em;
424+}
425+
426+/**
427+ * LiveForm and controls.
428+ */
429+
430+.methanal-liveform h1 {
431+ color: #000;
432+ font-weight: bold;
433+ margin: 0 0 0.5em 0;
434+ text-transform: uppercase;
435+ font-size: 130%;
436+ padding: 0.5em 0;
437+ border-bottom: 2px solid #ccc;
438+}
439+
440+.methanal-liveform .modified-indicator {
441+ font-weight: bold;
442+}
443+
444 .methanal-form-group {
445- margin: 10px 0;
446- border: 1px outset #25a;
447- background: #e5e5ef url(/static/Methanal/images/group-bg.png) repeat-x top left;
448- padding: 10px;
449+ margin: 1em 0;
450+ border: none;
451+ border-top: 1px solid #ccc;
452+ padding: 1em;
453+ padding-top: 0;
454+}
455+
456+.methanal-form-group legend {
457+ color: #c9000c;
458+ font-weight: bold;
459+ font-size: 120%;
460 }
461
462 .methanal-control {
463- padding: 3px 0;
464+ padding: 0.333em 0;
465 clear: left;
466 }
467
468 .methanal-control-inputs,
469-.methanal-control-inputs > * {
470+.methanal-control-inputs > div {
471 float: left;
472 }
473
474-.methanal-liveform h1,
475-.methanal-form-group h2 {
476- color: #555;
477- font-weight: normal;
478- text-shadow: 0 1px 0 #fff;
479- margin: 0 0 0.5em 0;
480-}
481-
482-.methanal-form-group .methanal-control-even {
483- background-color: #d3d3ea;
484-}
485-
486 .methanal-control-even {
487- background-color: #f0f0fc;
488+ background-color: #f0f0f0;
489+ background-color: rgba(127, 127, 127, 0.08);
490 }
491
492 .methanal-caption {
493 float: left;
494- min-width: 20em;
495+ width: 20em;
496 line-height: 1.75em;
497- margin: 0 0.75em;
498+ margin-right: 2em;
499+ margin-top: 0.2em;
500 vertical-align: middle;
501-}
502-
503-.methanal-inline-children .methanal-inline-control .methanal-input {
504- clear: none;
505- float: left;
506- margin-right: 3px;
507- min-width: 5em;
508+ text-align: right;
509+ font-weight: bold;
510+ color: #353535;
511 }
512
513 .methanal-multi-input,
514 .methanal-lookup-form {
515- background: white;
516- border: 1px solid #ccc;
517- border-bottom: 2px solid #aaa;
518- padding: 0.5em;
519 float: left;
520-}
521-
522-.methanal-lookup-form .lookup-result .methanal-caption {
523- font-style: italic;
524- font-weight: bold;
525+ padding-left: 1em;
526+ border-left: 1px solid #b7b7b7;
527+}
528+
529+.methanal-lookup-form .lookup-result {
530+ border-top: 2px solid #3580bf;
531+}
532+
533+.methanal-simple-form .methanal-control-even {
534+ background-color: transparent;
535 }
536
537 .methanal-lookup-form .methanal-caption,
538 .methanal-multi-input .methanal-caption {
539- min-width: 8em;
540- margin: 0 0.25em;
541-}
542-
543-.methanal-sub-caption {
544- padding: 3px 0;
545- float: left;
546- clear: left;
547+ width: 8em;
548+ margin-right: 0.533em;
549+}
550+
551+.methanal-choice-group {
552+ border: solid #ddd;
553+ border-width: 0 0 0 1px;
554+ margin: 0.5em;
555+ padding: 0.3em 0 0.3em 0.5em;
556+}
557+
558+.methanal-choice-group h4 {
559+ margin: 0 0 0.25em 0;
560+}
561+
562+.dependancy-parent {
563+ border-left: 3px solid #777;
564+ margin-left: -3px;
565+}
566+
567+.dependancy-child {
568+ border-left: 3px solid #bbb;
569+ margin-left: -3px;
570 }
571
572 input.methanal-input,
573 select.methanal-input,
574 textarea.methanal-input {
575+ float: left;
576+ background-color: #fff;
577 background-image: url(/static/Methanal/images/icons/valid.png);
578 background-repeat: no-repeat;
579 background-position: 4px center;
580- border: 1px solid #ccc;
581- padding: 4px;
582+ border: 1px solid #b7b7b7;
583+ padding: 0.333em 5px;
584 padding-left: 22px;
585- margin-right: 4px;
586- float: left;
587+ margin-right: 0.333em;
588+ -o-box-shadow: 0 1px #fff;
589+ -moz-box-shadow: 0 1px #fff;
590+ -webkit-box-shadow: 0 1px #fff;
591+ box-shadow: 0 1px #fff;
592+}
593+
594+.methanal-check-input {
595+ border: none;
596+ margin-left: 0;
597+ float: left;
598+ cursor: pointer;
599+}
600+
601+.methanal-check-input-label {
602+ float: left;
603+ margin-right: 0.5em;
604+ cursor: pointer;
605+ line-height: 1.75em;
606 }
607
608 select.methanal-input {
609- padding-top: 3px;
610- padding-bottom: 3px;
611+ padding-top: 0.233em;
612+ padding-bottom: 0.233em;
613 }
614
615-textarea.methanal-input {
616+textarea.methanal-input,
617+select.methanal-multiselect {
618 background-position: 4px 4px;
619+}
620+
621+textarea.methanal-input {
622 width: 20em;
623- height: 14ex;
624+ height: 10em;
625+}
626+
627+.methanal-multiselect {
628+ max-height: 20em;
629+}
630+
631+.methanal-multiselect-selection {
632+ font-size: 80%;
633+ clear: left;
634+ float: left;
635+ margin: 2px;
636+ font-weight: bold;
637 }
638
639 .methanal-control-error input.methanal-input,
640@@ -103,13 +242,6 @@
641 border-color: #da2603;
642 }
643
644-.methanal-check-input-label {
645- float: left;
646- margin-right: 0.5em;
647- cursor: pointer;
648- line-height: 1.75em;
649-}
650-
651 .methanal-multi-input input {
652 margin-left: 0;
653 }
654@@ -119,120 +251,73 @@
655 cursor: pointer;
656 }
657
658-input.methanal-check-input {
659- border: none;
660- margin-left: 0;
661- float: left;
662- cursor: pointer;
663-}
664-
665-button.methanal-waiting,
666-button.methanal-waiting:hover,
667-button.methanal-waiting:active {
668- cursor: wait;
669-}
670-
671-button.methanal-submit-disabled,
672-button.methanal-submit-disabled:hover,
673-button.methanal-submit-disabled:active {
674- background-color: #bbb;
675- cursor: default;
676- cursor: not-allowed;
677-}
678-
679-button.methanal-submit-disabled:active {
680- border-style: double;
681-}
682-
683-input.telephone-area {
684- min-width: 0;
685- width: 3em;
686-}
687-
688-input.telephone-number {
689- min-width: 0;
690- width: 7em;
691-}
692-
693-input.suburb-postal-code {
694- min-width: 0;
695- width: 4em;
696-}
697-
698-input.suburb-postal {
699- min-width: 0;
700- margin-left: 0;
701-}
702-
703-optgroup {
704- font-style: normal;
705-}
706-
707-optgroup option {
708- padding-left: 1em;
709-}
710-
711-.methanal-multiselect {
712- max-height: 30ex;
713-}
714-
715-.methanal-multiselect-selection {
716- font-size: 80%;
717- clear: left;
718- float: left;
719- margin: 2px;
720- font-weight: bold;
721-}
722-
723-.terminator {
724- clear: both;
725-}
726+.friendly-representation {
727+ float: left;
728+ font-style: italic;
729+ vertical-align: middle;
730+ padding: 0.333em 5px;
731+ margin-left: -0.333em;
732+ margin-right: 0.333em;
733+ border: 1px solid #b7b7b7;
734+ border-left: none;
735+ background: #ddd;
736+ color: #333;
737+ -o-box-shadow: 0 1px #fff;
738+ -moz-box-shadow: 0 1px #fff;
739+ -webkit-box-shadow: 0 1px #fff;
740+ box-shadow: 0 1px #fff;
741+}
742+
743+.embedded-label {
744+ color: #bbb !important;
745+}
746+
747+/**
748+ * Table.
749+ */
750
751 .methanal-table table {
752 border-collapse: collapse;
753 table-layout: fixed;
754 width: 100%;
755- background: white;
756+ background: transparent;
757 }
758
759 .methanal-table thead td {
760+ border-bottom: 2px solid #3580bf;
761+ color: #000;
762+ font-size: 90%;
763 font-weight: bold;
764- color: #555;
765- background: #ddd url(/Mantissa/images/scrolltable-header-bg.png) repeat-x;
766- padding: 4px 5px;
767+ text-transform: uppercase;
768+ padding: 1em 0.35em;
769 }
770
771 .methanal-table a {
772- color: black;
773 display: block;
774 margin: -0.3em;
775 padding: 0.3em;
776 }
777
778-.methanal-table td:first-child a,
779-.methanal-table td.first-child a {
780- background: url(/static/Methanal/images/link.gif) no-repeat 5px center;
781- padding-left: 19px;
782+.methanal-table tbody tr:hover {
783+ background-color: #e8e8e8;
784 }
785
786-.methanal-table tr:hover {
787- background-color: #eee !important;
788+.methanal-table tr,
789+.methanal-table a {
790+ color: #333;
791 }
792
793 .methanal-table td {
794+ border-bottom: 1px solid #ddd;
795 text-align: left;
796- border: 1px solid #ccc;
797- padding: 0.3em;
798-}
799-
800-.methanal-table .even {
801- background-color: #f5f5f5;
802+ padding: 0.5em 0.3em;
803 }
804
805 .methanal-table .methanal-table-empty-row td {
806- font-size: 90%;
807- font-weight: bold;
808- text-align: center;
809+ font-size: 90%;
810+ font-weight: bold;
811+ text-align: center;
812+ text-transform: uppercase;
813 }
814
815 .methanal-table .table-action-icon {
816@@ -240,84 +325,45 @@
817 vertical-align: middle;
818 }
819
820+.methanal-table .even {
821+ background-color: #f5f5f5;
822+ background-color: rgba(0, 0, 0, 0.035);
823+}
824+
825+/**
826+ * Filter list widget.
827+ */
828+
829 .methanal-filter-list {
830- margin: 5px;
831- border: 1px outset #777;
832- background-color: #f4f4f4;
833- padding: 5px;
834+ margin: 0.5em;
835+ padding: 0.5em;
836 }
837
838 .methanal-filter-list .filter-results {
839- background: url(/static/Methanal/images/liveform-bg-bottom-top.png) repeat-x top left;
840- padding: 1em;
841-}
842-
843-.methanal-lookup-form {
844- float: left;
845- border: 1px outset #777;
846- background: white;
847- padding: 2px;
848-}
849-
850-.friendly-representation {
851- font-weight: bold;
852- font-style: italic;
853- font-size: 85%;
854- padding: 0 0.25em;
855- line-height: 2em;
856- vertical-align: middle;
857-}
858-
859-.embedded-label {
860- color: #bbb !important;
861-}
862-
863-.methanal-submit-error {
864- color: white;
865- background: #74010c;
866- border-top: 1px solid #f30219;
867- padding: 5px;
868- margin: -5px;
869- margin-top: 5px;
870-}
871-
872-.methanal-submit-error h1 {
873- font-size: 130%;
874- /*font-family: "Georgia", "Times New Roman", serif;*/
875- font-weight: normal;
876- margin: 0 0 0.3em 0;
877-}
878-
879-.methanal-submit-error > div {
880- background: url(/static/Methanal/images/error-icon.png) no-repeat center left;
881- padding: 2px;
882- padding-left: 24px;
883-}
884-
885-.methanal-submit-error-action {
886- padding: 0 4px;
887- cursor: pointer;
888-}
889-
890-.methanal-submit-error-action img {
891- vertical-align: middle;
892-}
893+ margin-top: 1em;
894+}
895+
896+/**
897+ * LiveForm actions.
898+ */
899
900 .methanal-action-container {
901- border-top: 1px solid #aaa;
902- background: white;
903- margin: -5px;
904- margin-top: 5px;
905- padding: 5px 0;
906+ margin-top: 0.5em;
907 }
908
909 .methanal-action-container .methanal-action-button {
910- margin: 0 5px;
911-}
912-
913-.throbber {
914- vertical-align: middle;
915-}
916+ margin: 0;
917+ margin-right: 1em;
918+}
919+
920+.methanal-action-button-submit {
921+ color: #fff;
922+ background-color: #3580bf;
923+}
924+
925+/**
926+ * Modal dialog.
927+ */
928
929 .modal-dialog-overlay {
930 position: fixed;
931@@ -325,14 +371,13 @@
932 left: 0;
933 bottom: 0;
934 right: 0;
935- background: white;
936+ background: #000;
937 opacity: 0.75;
938 z-index: 1000;
939 }
940
941 .modal-dialog-outer {
942 z-index: 1001;
943-
944 display: table;
945 position: absolute;
946 top: 0;
947@@ -342,7 +387,6 @@
948 }
949
950 .modal-dialog-middle {
951- margin: 0 auto;
952 display: table-cell;
953 vertical-align: middle;
954 }
955@@ -350,14 +394,12 @@
956 .modal-dialog-inner {
957 display: table;
958 margin: 5% auto;
959- background: white;
960+ background: #fff;
961 padding: 1em;
962- border-radius: 4px;
963- -moz-border-radius: 4px;
964- -webkit-border-radius: 4px;
965- box-shadow: 0 0 30px #333;
966- -moz-box-shadow: 0 0 30px #333;
967- -webkit-box-shadow: 0 0 30px #333;
968+ -o-box-shadow: 0.5em 0.5em #aaa;
969+ -moz-box-shadow: 0.5em 0.5em #aaa;
970+ -webkit-box-shadow: 0.5em 0.5em #aaa;
971+ box-shadow: 0.5em 0.5em #aaa;
972 }
973
974 .modal-dialog-inner h1 {
975@@ -374,69 +416,70 @@
976 height: 16px;
977 }
978
979-.placeholder {
980- height: 32px;
981- background: url(/static/Methanal/images/long-throbber.gif) no-repeat center center;
982- padding: 1em 0;
983-}
984-
985 /**
986- * Tab view widget.
987+ * Tab view.
988 */
989
990 .methanal-tab-view {
991 margin: 3em 0;
992 }
993
994+.methanal-tab-view .methanal-tab-view {
995+ margin: 1em 0;
996+}
997+
998 .methanal-tab-view .methanal-tab-labels {
999- background: #e0f1ff;
1000- color: #185280;
1001- list-style: none;
1002 margin: 0;
1003- padding: 0.5em 0;
1004- border-bottom: 1px solid #247dc2;
1005+ padding: 0;
1006+ padding-left: 1px;
1007+ overflow: hidden;
1008 }
1009
1010 .methanal-tab-view .methanal-tab-label {
1011 cursor: pointer;
1012+ list-style: none;
1013 display: inline-block;
1014- list-style: none;
1015+ padding: 0.75em 1.413em;
1016+ border: 1px solid #ccc;
1017+ margin-left: -1px;
1018+ background: #e8e8e8;
1019+}
1020+
1021+.methanal-tab-view .methanal-tab-label-throbber {
1022+ border: none;
1023+ background: none
1024 }
1025
1026 .methanal-tab-view .methanal-tab-label a {
1027- padding: 0.5em 1em;
1028- border: 1px solid transparent;
1029- border-bottom: none;
1030-}
1031-
1032-.methanal-tab-view .methanal-dynamic-tab a {
1033- background: #f2e0ff;
1034+ font-weight: bold;
1035+ color: #404040;
1036 }
1037
1038 .methanal-tab-view .methanal-tab-label a:hover {
1039- background: #247dc2;
1040- color: white;
1041+ color: #247dc2;
1042+ text-decoration: underline;
1043 }
1044
1045-.methanal-tab-view .selected-tab-label a,
1046-.methanal-tab-view .selected-tab-label a:hover {
1047- background: white;
1048- color: black;
1049+.methanal-tab-view .selected-tab-label {
1050+ background: #fff;
1051+ border-bottom: 1px solid transparent;
1052+ border-top-color: #000;
1053 }
1054
1055 .methanal-tab-view .selected-tab-label a {
1056- position: relative;
1057- top: 1px;
1058- padding-top: 0.8em;
1059- border-color: #247dc2;
1060+ color: #000;
1061 }
1062
1063 .methanal-tab-view .methanal-tab-content {
1064- border: 1px solid #247dc2;
1065- border-top: none;
1066+ background: #fff;
1067+ border: 1px solid #ccc;
1068 display: none;
1069- clear: left;
1070 padding: 1em;
1071+ margin-top: -1px;
1072+ -o-box-shadow: 2px 2px #eee;
1073+ -moz-box-shadow: 2px 2px #eee;
1074+ -webkit-box-shadow: 2px 2px #eee;
1075+ box-shadow: 2px 2px #eee;
1076 }
1077
1078 .methanal-tab-view .selected-tab {
1079@@ -445,70 +488,24 @@
1080
1081 .methanal-tab-view .methanal-tab-group {
1082 cursor: default;
1083- background: #9bc4e5;
1084- margin: -2.5em 0.25em -0.5em;
1085+ background: #f9f9f9;
1086 padding: 0 0.5em;
1087- -moz-border-radius: 0.5em 0.5em 0 0;
1088- -webkit-border-radius: 0.5em 0.5em 0 0;
1089+}
1090+
1091+.methanal-tab-view .methanal-tab-group .methanal-tab-label {
1092+ margin-bottom: -1px;
1093 }
1094
1095 .methanal-tab-view .methanal-tab-group-label {
1096 font-size: 80%;
1097 text-align: center;
1098 padding: 0.5em;
1099- color: #e0f1ff;
1100+ color: #000;
1101 }
1102
1103 .methanal-tab-view .methanal-tab-group-tabs {
1104- list-style: none;
1105 margin: 0;
1106- padding: 0.5em 0;
1107-}
1108-
1109-.hidden {
1110- display: none !important;
1111-}
1112-
1113-.methanal-choice-group {
1114- border: solid #ddd;
1115- border-width: 0 0 0 1px;
1116- margin: 0.5em;
1117- padding: 0.3em 0 0.3em 0.5em;
1118-}
1119-
1120-.methanal-choice-group h4 {
1121- margin: 0 0 0.25em 0;
1122-}
1123-
1124-.methanal-lookup-form .methanal-control-even {
1125- background-color: #f5f5f5;
1126-}
1127-
1128-.methanal-lookup-form .lookup-result {
1129- background: #e0f1ff;
1130-}
1131-
1132-.dependancy-parent {
1133- border-left: 3px solid #6094a4;
1134- margin-left: -3px;
1135- background-image: url("/static/Methanal/images/icons/dependency_parent.gif");
1136- background-repeat: no-repeat;
1137- background-position: left center;
1138-}
1139-
1140-.dependancy-child {
1141- border-left: 3px solid #9fc4cf;
1142- margin-left: -3px;
1143-}
1144-
1145-.form-modified {
1146- background: #fbede1;
1147-}
1148-
1149-.modified-indicator {
1150- background: url(/static/Methanal/images/icons/warning.png) no-repeat 2px center;
1151- padding: 5px 2px 5px 20px;
1152- display: inline-block;
1153+ padding: 0;
1154 }
1155
1156 /**
1157@@ -516,7 +513,7 @@
1158 */
1159
1160 .expander {
1161- background: #e0e0e0;
1162+ background: #f3f3f3;
1163 border: 1px solid #ddd;
1164 border-color: #f5f5f5 #ddd #bbb;
1165 border-radius: 3px;
1166@@ -527,16 +524,12 @@
1167 }
1168
1169 .expander-header {
1170- background: #f0f0f0 url(/static/Methanal/images/expander-header-bg.png) repeat-x left bottom;
1171+ background: #e7e7e7;
1172 vertical-align: middle;
1173- height: 18px;
1174+ height: auto;
1175 padding: 0.5em;
1176 }
1177
1178-.expander-header:hover {
1179- color: #247dc2;
1180-}
1181-
1182 .expanded .expander-header-label {
1183 background-image: url(/static/Methanal/images/collapse.png);
1184 }
1185@@ -549,10 +542,14 @@
1186 }
1187
1188 .expander-content {
1189- margin: 0.5em;
1190- margin-top: 1em;
1191+ padding: 1em;
1192+ border-top: 1px solid #b7b7b7;
1193 }
1194
1195+/**
1196+ * Print media.
1197+ */
1198+
1199 @media print {
1200 body.printing > * {
1201 display: none;
1202@@ -560,7 +557,7 @@
1203
1204 body.printing .print-target {
1205 display: block;
1206- position: absolute:
1207+ position: absolute;
1208 left: 0;
1209 top: 0;
1210 font-size: 50%;
1211@@ -574,12 +571,10 @@
1212 display: block;
1213 max-width: 100%;
1214 margin: auto;
1215- border-radius: 0;
1216- -moz-border-radius: 0;
1217- -webkit-border-radius: 0;
1218- box-shadow: none;
1219+ -o-box-shadow: none;
1220 -moz-box-shadow: none;
1221 -webkit-box-shadow: none;
1222+ box-shadow: none;
1223 }
1224
1225 .print-target .no-print {
1226@@ -595,14 +590,12 @@
1227 display: inline-block;
1228 position: relative;
1229 border: 1px solid;
1230- border-radius: 2px;
1231- box-shadow: 0 0 2px black;
1232- -o-box-shadow: 0 0 2px black;
1233- -moz-box-shadow: 0 0 2px black;
1234- -webkit-box-shadow: 0 0 2px black;
1235+ -o-box-shadow: 1px 1px black;
1236+ -moz-box-shadow: 1px 1px black;
1237+ -webkit-box-shadow: 1px 1px black;
1238+ box-shadow: 1px 1px black;
1239 color: #fff;
1240 font-size: 90%;
1241- font-style: italic;
1242 padding: 0.25em;
1243 margin-right: 0.5em;
1244 }
1245@@ -614,10 +607,6 @@
1246 background: #6094a4;
1247 }
1248
1249-.hover-tooltip h2 {
1250- text-shadow: 0 -1px 0 #333;
1251-}
1252-
1253 .hover-tooltip-arrow {
1254 position: absolute;
1255 width: 0;
1256@@ -687,11 +676,10 @@
1257 .submission-error-tooltip .hover-tooltip {
1258 background-repeat: no-repeat;
1259 background-position: 0.25em center;
1260- padding-left: 25px;
1261+ padding-left: 0.5em;
1262 }
1263
1264 .error-tooltip .hover-tooltip {
1265- background-image: url(/static/Methanal/images/icons/warning.png);
1266 background-color: #8d0e1b;
1267 border-color: #8d0e1b;
1268 color: #fff;
1269@@ -702,13 +690,13 @@
1270 .label-tooltip .hover-tooltip {
1271 position: absolute;
1272 left: inherit;
1273+ margin-left: -3em;
1274 margin-top: -2em;
1275 }
1276
1277 /** LiveForm submission error tooltip. */
1278
1279 .submission-error-tooltip .hover-tooltip {
1280- background-image: url(/static/Methanal/images/icons/error.png);
1281 margin-top: 0.5em;
1282 }
1283
1284@@ -727,7 +715,6 @@
1285 /** LiveForm validation error tooltip. */
1286
1287 .form-validation-error-tooltip .hover-tooltip {
1288- background-image: url(/static/Methanal/images/icons/warning.png);
1289 max-width: 25%;
1290 }
1291
1292@@ -745,3 +732,25 @@
1293 .form-validation-error-tooltip h2 {
1294 cursor: default;
1295 }
1296+
1297+/**
1298+ * Utility.
1299+ */
1300+
1301+.hidden {
1302+ display: none !important;
1303+}
1304+
1305+.throbber {
1306+ vertical-align: middle;
1307+}
1308+
1309+.placeholder {
1310+ height: 32px;
1311+ background: url(/static/Methanal/images/long-throbber.gif) no-repeat center center;
1312+ padding: 1em 0;
1313+}
1314+
1315+.terminator {
1316+ clear: both;
1317+}
1318
1319=== modified file 'methanal/test/test_view.py'
1320--- methanal/test/test_view.py 2011-04-29 08:50:50 +0000
1321+++ methanal/test/test_view.py 2012-07-27 14:39:22 +0000
1322@@ -88,7 +88,7 @@
1323 # Oh where, oh where can it be?
1324 # With real XPath support and functionality.
1325 # Oh where, oh where can it be?
1326- candidates = tree.findall('//form/div')
1327+ candidates = tree.findall('.//form/div')
1328 actionsNode = None
1329 id = 'athenaid:%d-actions' % (self.form._athenaID,)
1330 for node in candidates:
1331@@ -717,7 +717,7 @@
1332 dict(values=values), checkExpectedValues=False)
1333
1334 def verifyRendering(tree):
1335- groupNodes = tree.findall('//select/optgroup')
1336+ groupNodes = tree.findall('.//select/optgroup')
1337 groups = set(item.group for item in values)
1338 self.assertEquals(len(groupNodes), len(groups))
1339 for groupNode, item in zip(groupNodes, values):
1340@@ -748,7 +748,7 @@
1341 dict(values=values), checkExpectedValues=False)
1342
1343 def verifyRendering(tree):
1344- optionNodes = tree.findall('//option')
1345+ optionNodes = tree.findall('.//option')
1346 self.assertEquals(len(optionNodes), len(list(values)))
1347 for optionNode, item in zip(optionNodes, values):
1348 self.assertEquals(optionNode.get('value'), item.id)
1349@@ -1025,7 +1025,7 @@
1350 dict(values=values), checkExpectedValues=False)
1351
1352 def verifyRendering(tree):
1353- groupNodes = tree.findall('//select/optgroup')
1354+ groupNodes = tree.findall('.//select/optgroup')
1355 self.assertEquals(len(groupNodes), len(values))
1356 for groupNode, (group, subvalues) in zip(groupNodes, values):
1357 self.assertEquals(groupNode.get('label'), group)
1358@@ -1094,7 +1094,7 @@
1359 control = self.createControl(dict(values=values))
1360
1361 def verifyRendering(tree):
1362- inputs = tree.findall('//input')
1363+ inputs = tree.findall('.//input')
1364 self.assertEquals(len(values), len(inputs))
1365 for input, (value, desc) in zip(inputs, values):
1366 self.assertEquals(input.get('name'), self.name)
1367@@ -1128,7 +1128,7 @@
1368 control.parent.param.value = False
1369
1370 def verifyRendering(tree):
1371- input = tree.find('//input')
1372+ input = tree.find('.//input')
1373 self.assertIdentical(input.get('checked'), None)
1374
1375 return renderWidget(control).addCallback(verifyRendering)
1376@@ -1142,7 +1142,7 @@
1377 control.parent.param.value = True
1378
1379 def verifyRendering(tree):
1380- input = tree.find('//input')
1381+ input = tree.find('.//input')
1382 self.assertEquals(input.get('checked'), 'checked')
1383
1384 return renderWidget(control).addCallback(verifyRendering)
1385@@ -1157,7 +1157,7 @@
1386 control.parent.param.value = True
1387
1388 def verifyRendering(tree):
1389- input = tree.find('//input')
1390+ input = tree.find('.//input')
1391 self.assertEquals(input.tail.strip(), 'HELLO WORLD')
1392
1393 return renderWidget(control).addCallback(verifyRendering)
1394
1395=== modified file 'methanal/themes/methanal-base/methanal-action-container.html'
1396--- methanal/themes/methanal-base/methanal-action-container.html 2011-03-16 12:58:08 +0000
1397+++ methanal/themes/methanal-base/methanal-action-container.html 2012-07-27 14:39:22 +0000
1398@@ -2,5 +2,5 @@
1399 <nevow:invisible nevow:render="formActions" />
1400 <img id="throbber" class="throbber" src="/static/Methanal/images/main-throbber.gif" />
1401 <span id="viewOnlyIndicator" class="modified-indicator hidden">Changes <em>cannot</em> be saved</span>
1402- <span id="modifiedIndicator" class="modified-indicator hidden">Unsaved changes</span>
1403+ <span id="modifiedIndicator" class="modified-indicator hidden">Form has unsaved changes</span>
1404 </div>
1405
1406=== modified file 'methanal/themes/methanal-base/methanal-liveform.html'
1407--- methanal/themes/methanal-base/methanal-liveform.html 2011-07-11 11:33:39 +0000
1408+++ methanal/themes/methanal-base/methanal-liveform.html 2012-07-27 14:39:22 +0000
1409@@ -4,6 +4,5 @@
1410 <athena:handler event="onsubmit" handler="handleSubmit" />
1411 <nevow:invisible nevow:render="children" />
1412 <div id="actions" nevow:render="formActions" />
1413- <div id="form-error" class="methanal-submit-error hidden" />
1414 </form>
1415 </div>
1416
1417=== modified file 'methanal/themes/methanal-base/methanal-tab-view.html'
1418--- methanal/themes/methanal-base/methanal-tab-view.html 2010-04-25 13:48:14 +0000
1419+++ methanal/themes/methanal-base/methanal-tab-view.html 2012-07-27 14:39:22 +0000
1420@@ -1,7 +1,6 @@
1421 <div class="methanal-tab-view" xmlns:nevow="http://nevow.com/ns/nevow/0.1" xmlns:athena="http://divmod.org/ns/athena/0.7" nevow:render="liveElement">
1422 <ul class="methanal-tab-labels" id="labels">
1423- <li id="throbber" class="methanal-tab-label" style="padding: 0 2px;"><img src="/static/Methanal/images/main-throbber.gif" style="height: 10px; width: 10px;" /></li>
1424- </ul>
1425+ <li id="throbber" class="methanal-tab-label methanal-tab-label-throbber"><img src="/static/Methanal/images/main-throbber.gif" style="height: 10px; width: 10px;" /></li></ul>
1426 <div id="contents" style="clear: both;" nevow:render="tabContents" />
1427 <div class="terminator"></div>
1428 </div>
1429
1430=== modified file 'methanal/view.py'
1431--- methanal/view.py 2011-07-11 18:06:33 +0000
1432+++ methanal/view.py 2012-07-27 14:39:22 +0000
1433@@ -66,7 +66,8 @@
1434
1435 def getArgs(self):
1436 return {u'actionID': self.id,
1437- u'allowViewOnly': self.allowViewOnly}
1438+ u'allowViewOnly': self.allowViewOnly,
1439+ u'identifier': self.identifier}
1440
1441
1442

Subscribers

People subscribed via source and target branches

to all changes: