From: Jason Woofenden Date: Fri, 15 Apr 2011 22:02:14 +0000 (-0400) Subject: add site-template, switch css->less X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=71258ffcb40b1d507855f2fb62f76aa8d583acfc add site-template, switch css->less --- diff --git a/metaform.php b/metaform.php index 35652c8..cee8033 100644 --- a/metaform.php +++ b/metaform.php @@ -321,9 +321,12 @@ function make_html($whole_file = true) { 'caption' => 'Save')); } - $tem->set('form', array( - 'visible_fields' => $visible_fields, - 'hidden_fields' => $hidden_fields)); + $form_fields = array(); + $form_fields['visible_fields'] = $visible_fields; + if($hidden_fields) { + $form_fields['hidden_fields'] = $hidden_fields; + } + $tem->set('form', $form_fields); # opt_display and opt_listing control whether these are actually displayed $tem->set('display_fields', $display_fields); @@ -539,7 +542,8 @@ function download_tar() { "INSTALL" => read_whole_file('code/wfpl/metaform/INSTALL'), ".htaccess" => make_htaccess(), #"run.php ->" => 'code/wfpl/run.php', - "style.css" => read_whole_file('code/wfpl/metaform/style.css'), + "style.less" => read_whole_file('code/wfpl/metaform/style.less'), + "template.html" => read_whole_file('code/wfpl/metaform/site-template.html'), "$name.html" => make_html(), "$name.php" => make_php()); if($GLOBALS['opt_db']) { diff --git a/metaform/htaccess b/metaform/htaccess index 82d409b..517f638 100644 --- a/metaform/htaccess +++ b/metaform/htaccess @@ -7,7 +7,7 @@ AddDefaultCharset UTF-8 # You should rename your images and css files when you change them so they can # be cached forever - + ExpiresActive On ExpiresDefault A31536000 @@ -16,7 +16,7 @@ AddDefaultCharset UTF-8 # stylesheet without actually renaming it all the time. This is needed even if # you don't set a long cache period on stylesheets, because Safari will check # for a new html, but not check for a new css. -RewriteRule ^style_[0-9]*.css$ /style.css [L] +RewriteRule ^style_[0-9]*.less$ /style.less [L] # To enable larger uploads, you'll need both of these: @@ -24,7 +24,7 @@ RewriteRule ^style_[0-9]*.css$ /style.css [L] # php_value upload_max_filesize 200M -############ START OF PRETTY URLS SETTINGS +############ START OF PRETTY URLS SETTINGS ############ # This section contains directives to enable pretty URLs, and instruct apache # to run wfpl on them. This runs code/config.php if it exists, then loads # templates, then loads the php file, and call's it's main function. See @@ -47,4 +47,4 @@ RewriteRule ^[^/.]*$ /run.php # use this line instead if you have this (.htaccess) file and your php and html # files in the ~form~ directory: #RewriteRule ^[^/.]*$ /~form~/run.php -############ END OF PRETTY URLS SETTINGS +############ END OF PRETTY URLS SETTINGS ############ diff --git a/metaform/site-template.html b/metaform/site-template.html new file mode 100644 index 0000000..71cf70f --- /dev/null +++ b/metaform/site-template.html @@ -0,0 +1,43 @@ + + + + + ~main-title html~ + + + + + + + +
+
+
+ + + +
+ +
+ +

~data html~

+ +
+ + +
+ + +
+ ~main_body~ +
+ +
+
+
+
+ + diff --git a/metaform/style.css b/metaform/style.css deleted file mode 100644 index c39d711..0000000 --- a/metaform/style.css +++ /dev/null @@ -1,49 +0,0 @@ -.caption { - margin-top: 15px; - font-weight: bold; -} -.field { - margin-bottom: 15px; -} -div.field_notes { - font-size: 12px; - line-height: 16px; -} -fieldset { - border: 1px dotted black; - padding: 0 15px 15px 15px; - margin: 15px 0; - position: relative; -} -legend { - padding: 0 6px; - font-weight: bold; -} -div.error { - border: 2px solid red; - padding: 13px; - margin: 20px; - background: #fdd; -} - -/* hack so that vertical margins are only between siblings for the most part */ -td > :first-child, -th > :first-child, -legend + *, -article > :first-child, -section > :first-child, -nav > :first-child, -div > :first-child, -.first { - margin-top: 0px; -} -td > :last-child, -th > :last-child, -fieldset > :last-child, -article > :last-child, -section > :last-child, -nav > :last-child, -div > :last-child, -.last { - margin-bottom: 0px; -} diff --git a/metaform/style.less b/metaform/style.less new file mode 100644 index 0000000..7541895 --- /dev/null +++ b/metaform/style.less @@ -0,0 +1,63 @@ +#wfpl_messages { + border: 2px solid red; + background: #fbb; + padding: 5px; + margin: 20px 0px; + p { + font-size: 120%; + padding: 5px; + margin: 0px; + } + hr { + height: 1px; + } +} +.caption { + margin-top: 15px; + font-weight: bold; +} +.field { + margin-bottom: 15px; +} +div.field_notes { + font-size: 12px; + line-height: 16px; +} +fieldset { + border: 1px dotted black; + padding: 0 15px 15px 15px; + margin: 15px 0; + position: relative; +} +legend { + padding: 0 6px; + font-weight: bold; +} +div.error { + border: 2px solid red; + padding: 13px; + margin: 20px; + background: #fdd; +} + +/* hack so that vertical margins are only between siblings for the most part */ +td > :first-child, +th > :first-child, +legend + *, +article > :first-child, +section > :first-child, +nav > :first-child, +div > :first-child, +.first { + margin-top: 0px; +} +td > :last-child, +th > :last-child, +fieldset > :last-child, +article > :last-child, +section > :last-child, +nav > :last-child, +div > :last-child, +.last { + margin-bottom: 0px; +} diff --git a/metaform/template.html b/metaform/template.html index 0aaa08b..33ea178 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -18,19 +18,7 @@ - - - -
- -

~~data html~~

- -
- - -
- - +

~singular cap~ details