From 4c0d8f0266ab4acd371955c3bf3cdc9c080ea1c9 Mon Sep 17 00:00:00 2001 From: Marcus Ramberg Date: Thu, 16 Sep 2004 15:27:44 +0000 Subject: [PATCH] fixed layout and made factory templates xhtml compliant git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@185 48953598-375a-da11-a14b-00016c27c3ee --- templates/beer/addnew | 16 +-- templates/factory/addnew | 15 ++- templates/factory/edit | 20 +-- templates/factory/footer | 1 + templates/factory/list | 9 +- templates/factory/macros | 14 +-- templates/factory/search_form | 16 ++- templates/factory/view | 6 +- templates/maypole.css | 227 ++++++++++++++++++---------------- 9 files changed, 173 insertions(+), 151 deletions(-) diff --git a/templates/beer/addnew b/templates/beer/addnew index 248fe28..05aea1b 100644 --- a/templates/beer/addnew +++ b/templates/beer/addnew @@ -1,10 +1,9 @@ -

Add a new [%classmetadata.moniker%]

[% USE element_maker = Class("HTML::Element") %] -

+
+Add a new [%classmetadata.moniker%] - [% FOR col = classmetadata.columns; NEXT IF col == "id"; SET element = classmetadata.cgi.$col; @@ -22,11 +21,12 @@ SET element = element.unshift_content(new_element); END; %] - - - - + + [% END; %] -
[% classmetadata.colnames.$col; %][% element.as_HTML; %]
+ + diff --git a/templates/factory/addnew b/templates/factory/addnew index 9345c78..950d89d 100644 --- a/templates/factory/addnew +++ b/templates/factory/addnew @@ -10,17 +10,16 @@ table. =cut #%] -

Add a new [% classmetadata.moniker %]

-
+ +
+Add a new [% classmetadata.moniker %] - [% FOR col = classmetadata.columns %] [% NEXT IF col == "id" %] - - - - + [% END; %] -
[% classmetadata.colnames.$col %][% classmetadata.cgi.$col.as_HTML; %]
+
diff --git a/templates/factory/edit b/templates/factory/edit index c5c511b..714cb87 100644 --- a/templates/factory/edit +++ b/templates/factory/edit @@ -11,18 +11,22 @@ form similar to L but with the current values filled in. [% PROCESS macros %] [% INCLUDE header %] [% FOR item = objects; %] -

Edit [% item.name %]

+
+Edit [% item.name %] [% FOR col = classmetadata.columns; NEXT IF col == "id"; - "

"; - ""; classmetadata.colnames.$col; ""; - ": "; - item.to_field(col).as_HTML; - "

"; + '"; IF errors.$col; - errors.$col; + ''; errors.$col;''; + END; END; ''; -END %] + "
"; + + END %] + [% INCLUDE footer %] diff --git a/templates/factory/footer b/templates/factory/footer index 64584ee..bb196d3 100644 --- a/templates/factory/footer +++ b/templates/factory/footer @@ -1,3 +1,4 @@ +

diff --git a/templates/factory/list b/templates/factory/list index 120abbb..843f9a4 100644 --- a/templates/factory/list +++ b/templates/factory/list @@ -6,22 +6,23 @@

Listing of all [% classmetadata.plural %]

[% END %] [% INCLUDE navbar %] - +[% INCLUDE search_form %]
- +
[% FOR col = classmetadata.columns.list; NEXT IF col == "id"; ""; END %] + [% SET count = 0; FOR item = objects; diff --git a/templates/factory/macros b/templates/factory/macros index 3d45a6f..06f5773 100644 --- a/templates/factory/macros +++ b/templates/factory/macros @@ -55,8 +55,8 @@ for some. FOR col = classmetadata.columns; NEXT IF col == "id"; ""; END; + ""; END %] [%# @@ -77,12 +79,8 @@ This is a generic button, which performs an action on an object. #%] [% MACRO button(obj, action) BLOCK; %] - + + [% action %] [% END %] [%# diff --git a/templates/factory/search_form b/templates/factory/search_form index 907ef7e..065332a 100644 --- a/templates/factory/search_form +++ b/templates/factory/search_form @@ -1,24 +1,22 @@ -

Search

+
"; SET additional = "?order=" _ col; - SET additional = additional _ "&page=" _ pager.current_page + SET additional = additional _ "&page=" _ pager.current_page IF pager; - SET additional = additional _ "&o2=desc" + SET additional = additional _ "&o2=desc" IF col == request.query.order and request.query.o2 != "desc"; link(classmetadata.table, "list", additional, classmetadata.colnames.$col); "Actions
"; - IF col == "url"; - " "; item.url; ""; + IF col == "url" AND item.url; + ' '; item.url; ''; ELSIF col == item.stringify_column; maybe_link_view(item); ELSE; @@ -64,8 +64,10 @@ for some. END; ""; button(item, "edit"); button(item, "delete"); + " -
- -
-
[% FOR col = classmetadata.columns; NEXT IF col == "id"; %] - - - - + element.as_XML; %] + [% END; %] -
[% classmetadata.colnames.$col; %] +
+
diff --git a/templates/factory/view b/templates/factory/view index 6736da6..75d003f 100644 --- a/templates/factory/view +++ b/templates/factory/view @@ -35,7 +35,7 @@ from the C method: [% classmetadata.colnames.$col; %] [% IF col == "url"; # Possibly too much magic. - " "; item.url; ""; + ' '; item.url; ''; ELSE; maybe_link_view(item.$col); END; %] @@ -65,9 +65,11 @@ a list of has-many accessors. Next it calls each of those accessors, and displays the results in a table. #%] +[% view_related(item); %] + [% - view_related(item); button(item, "edit"); button(item, "delete"); %] [% END; %] +[% INCLUDE footer %] diff --git a/templates/maypole.css b/templates/maypole.css index 07cc28d..cd4bc5e 100644 --- a/templates/maypole.css +++ b/templates/maypole.css @@ -1,145 +1,164 @@ -HTML { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px -} -BODY { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; - BACKGROUND-COLOR: #ffffea; +html { + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + margin: 0px; + padding-top: 0px +} +body { + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + margin: 0px; padding-top: 0px; + background-color: #ffffea; } .content { - PADDING: 12px; - MARGIN-TOP: 1px; MARGIN-BOTTOM:0px; - MARGIN-LEFT: 15px; MARGIN-RIGHT: 15px; - BORDER-COLOR: #000000; - BORDER-TOP: 0px; - BORDER-BOTTOM: 0px; - BORDER-LEFT: 1px; - BORDER-RIGHT: 1px; -} - -H1 { - FONT-SIZE: 30pt; MARGIN: 0px; - FONT-FAMILY: Optima, "Lucida Grande",Sans-serif; - TEXT-ALIGN: center; - PADDING-BOTTOM: 1em; + padding: 12px; + margin-top: 1px; + margin-bottom:0px; + margin-left: 15px; + margin-right: 15px; + border-color: #000000; + border-top: 0px; + border-bottom: 0px; + border-left: 1px; + border-right: 1px; +} +h1 { + font-size: 30pt; + margin: 0px; + font-family: Optima, "Lucida Grande",Sans-serif; + text-align: center; + padding-bottom: 1em; +} +h2 { + padding-right: 0.25em; + padding-left: 0.25em; + font-size: 16pt; + padding-bottom: 0.5em; + margin: 0px; + padding-top: 0.1em; + font-family: Optima, "Lucida Grande",Sans-serif; + text-align: center; +} + +A { + text-decoration: none; + color:#225 +} +A:hover { + text-decoration: underline; + color:#222 } -H2 { - PADDING-RIGHT: 0.25em; PADDING-LEFT: 0.25em; FONT-SIZE: 16pt; - PADDING-BOTTOM: 0.5em; MARGIN: 0px; PADDING-TOP: 0.1em; -FONT-FAMILY: Optima, "Lucida Grande",Sans-serif; - TEXT-ALIGN: center; -} - -A { text-decoration: none; color:#225 } -A:hover { text-decoration: underline; color:#222 } table { -border: 0px solid; -background-color: #ffffff; - + border: 0px solid; + background-color: #ffffff; } + #matrix th { -background-color: #DDE; -border: 1px solid; + background-color: #DDE; + border: 1px solid; font: bold 12px Verdana, sans-serif; } #matrix tr.alternate { background-color:#EEF; } -#matrix td { - font: 12px Verdana, sans-serif; -} +#matrix td { font: 12px Verdana, sans-serif; } -#navlist -{ -padding: 3px 0; -margin-left: 0; -border-bottom: 1px solid #778; -font: bold 12px Verdana, sans-serif; +#navlist { + padding: 3px 0; + margin-left: 0; + border-bottom: 1px solid #778; + font: bold 12px Verdana, sans-serif; } -#navlist li -{ -list-style: none; -margin: 0; -display: inline; +#navlist li { + list-style: none; + margin: 0; + display: inline; } -#navlist li a -{ -padding: 3px 0.5em; -margin-left: 3px; -border: 1px solid #778; -border-bottom: none; -background: #DDE; -text-decoration: none; +#navlist li a { + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #778; + border-bottom: none; + background: #DDE; + text-decoration: none; } #navlist li a:link { color: #448; } #navlist li a:visited { color: #667; } -#navlist li a:hover -{ -color: #000; -background: #AAE; -border-color: #227; +#navlist li a:hover { + color: #000; + background: #AAE; + border-color: #227; } -#navlist li a#current -{ -background: white; -border-bottom: 1px solid white; +#navlist li a#current { + background: white; + border-bottom: 1px solid white; } td { font: 12px Verdana, sans-serif; } -.field { -background-color: #DDE; -border: 1px solid; -font-weight: bold; + + +fieldset { + padding: 1em; + font:80%/1 sans-serif; + border:1px solid #8484ce; } -#vlist -{ -padding: 0 1px 1px; -margin-left: 0; -font: bold 12px Verdana, sans-serif; -background: gray; -width: 13em; +legend { + padding: 0.2em 0.5em; + border:1px solid #8484ce; + font-size:90%; + text-align:right; } -#vlist li -{ -list-style: none; -margin: 0; -border-top: 1px solid gray; -text-align: left; +label { + display:block; } -#vlist li a -{ -display: block; -padding: 0.25em 0.5em 0.25em 0.75em; -border-left: 1em solid #AAB; -background: #CCD; -text-decoration: none; +label .field { + float:left; + width:25%; + margin-right:0.5em; + padding-top:0.2em; + text-align:right; + font-weight:bold; } -#vlist li a:hover { - border-color: #227; + +#vlist { + padding: 0 1px 1px; + margin-left: 0; + font: bold 12px Verdana, sans-serif; + background: gray; + width: 13em; } -.search {float:right; background: #ffa; padding-left: 5px; padding-right: 5px} -.list { width: 70%; } -.column-wrap { position: relative; } -.leftcolumn { position: absolute; left: 10px; top: 50px; width: 200px; - border-right: 1px dotted black; +#vlist li { + list-style: none; + margin: 0; + border-top: 1px solid gray; + text-align: left; } -.centercolumn { margin-left: 200px; margin-right: 300px; } -.rightcolumn { position: absolute; right: 0px; top: 50px; width: 300px; } -.messages { - margin: 20px; padding: 3px; border: 1px solid black; - background: #ddd; - font: bold 12px Verdana, sans-serif; +#vlist li a { + display: block; + padding: 0.25em 0.5em 0.25em 0.75em; + border-left: 1em solid #AAB; + background: #CCD; + text-decoration: none; } +#vlist li a:hover { + border-color: #227; +} +.search {width: 25%;border:1px outset #000;float:right; background: #eef;} +.search legend {border:none;} .error { color: #d00; } -.chorus { font-style: italic; position: relative; margin-left:50px; } +.list { width: 70%; } +.action { style:block; -- 2.39.2