JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
add site-template, switch css->less
authorJason Woofenden <jason@jasonwoof.com>
Fri, 15 Apr 2011 22:02:14 +0000 (18:02 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 15 Apr 2011 22:09:00 +0000 (18:09 -0400)
metaform.php
metaform/htaccess
metaform/site-template.html [new file with mode: 0644]
metaform/style.css [deleted file]
metaform/style.less [new file with mode: 0644]
metaform/template.html

index 35652c8..cee8033 100644 (file)
@@ -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']) {
index 82d409b..517f638 100644 (file)
@@ -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
-<FilesMatch "\.(css|jpg|png)$">
+<FilesMatch "\.(css|less|jpg|png)$">
        ExpiresActive On
        ExpiresDefault A31536000
 </FilesMatch>
@@ -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 (file)
index 0000000..71cf70f
--- /dev/null
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <meta charset="utf-8" />
+       <title>~main-title html~</title>
+       <!--[if lt IE 9]>
+               <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+       <![endif]-->
+       <link rel="stylesheet/less" href="style_01.less" />
+       <script src="http://lesscss.googlecode.com/files/less-1.0.41.min.js"></script>
+       <!--~extra-headers~-->
+</head>
+
+<body>
+       <div id="centerer">
+               <header>
+               </header>
+
+               <nav>
+               </nav>
+
+               <div id="main-body">
+                       <!--~wfpl_messages once_if {~-->
+                               <div id="wfpl_messages">
+                                       <!--~wfpl_messages {~-->
+                                               <p>~data html~</p>
+                                               <!--~ sep {~-->
+                                                       <hr>
+                                               <!--~}~-->
+                                       <!--~}~-->
+                               </div>
+                       <!--~}~-->
+
+                       <article>
+                               ~main_body~
+                       </article>
+
+                       <footer>
+                       </footer>
+               </div>
+       </div>
+</body>
+</html>
diff --git a/metaform/style.css b/metaform/style.css
deleted file mode 100644 (file)
index c39d711..0000000
+++ /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 (file)
index 0000000..7541895
--- /dev/null
@@ -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;
+}
index 0aaa08b..33ea178 100644 (file)
 </head>
 
 <body>
-<!--~~main_body show {~~-->
-
-       <!--~~wfpl_messages once_if {~~-->
-               <div style="border: 2px solid red; background: #fbb; padding: 5px; margin: 20px 0px">
-                       <!--~~wfpl_messages {~~-->
-                               <p style="font-size: 120%; padding: 5px; margin: 0px">~~data html~~</p>
-                               <!--~~ sep {~~-->
-                                       <hr>
-                               <!--~~}~~-->
-                       <!--~~}~~-->
-               </div>
-       <!--~~}~~--><!--~opt_display {~-->
-
+<!--~~main_body show {~~--><!--~opt_display {~-->
        <!--~~display {~~-->
                <h2>~singular cap~ details</h2><!--~opt_listing {~-->