Преглед на файлове

Create a bottom_html property and theme region to use like header_html region

Markus Ochel преди 12 години
родител
ревизия
a216beacdd

+ 1 - 1
admin/models/site.coffee

@@ -6,7 +6,7 @@ utils = require('lib/utils')
 BaseModel = require('models/base')
 
 class Site extends BaseModel
-  @configure "Site", "_id", "name", "name_html", "tagline", "menu_html", "header_html", "footer_html", "link", "social_links", "theme", "css", "seo_description", "seo_keywords", "google_analytics_code", "editor_email", "admin_email", "default_ad_unit", "default_ad_enabled"
+  @configure "Site", "_id", "name", "name_html", "tagline", "menu_html", "header_html", "bottom_html", "footer_html", "link", "social_links", "theme", "css", "seo_description", "seo_keywords", "google_analytics_code", "editor_email", "admin_email", "default_ad_unit", "default_ad_enabled"
   
   @extend @CouchAjax
   

+ 54 - 1
admin/static/css/common.styl

@@ -196,15 +196,68 @@ table
     text-align: left
     vertical-align: top
 
+/* Custom style classes */
+
+ul.grid-2
+  list-style-type: none
+  margin: 0
+  padding: 0
+  border-collapse: collapse
+  clearfix()
+
+  > li
+    display: inline-block
+    position: relative
+    width: 48%
+    padding: 0
+    margin: 0.8em 0.5em 0 0
+    vertical-align: top
+
+  &.with-borders > li
+    width: 47%
+    padding: 1em
+    margin: 0.5em 0.4em
+    border: solid 1px $faintGrey
+    
+  &.no-margins > li
+    margin: 0
+
+ul.links
+  list-style-type: none
+  margin: 0
+  padding: 0
+  border-collapse: collapse
+
+  > li
+    padding: 0
+    margin: 0.3em 0
+    
+    a
+      display: block
+
+  &.with-borders > li
+    border: solid 1px $faintGrey
+    
+    a
+      padding: 0.3em 0.5em
+
+  &.no-margins > li
+    margin: 0
 
 /* Extra helper classes */
 
 .primary-color
   color: $primaryColor
 
+.primary-link
+  color: $linkColor
+
 .primary-background
   color: #fff
-  background: $primaryColor
+  background-color: $primaryColor
+
+.primary-border
+  border-color: $primaryColor
 
 .normal
   font-weight: $normalFont

+ 19 - 4
admin/templates/site-form.html

@@ -40,18 +40,33 @@
     </div>
     <div class="field">
       <label>Menu HTML</label>
-      <textarea name="menu_html" placeholder="only LI items">{{menu_html}}</textarea>
+      <textarea name="menu_html" placeholder="">{{menu_html}}</textarea>
+      <div class="note">
+        Main menu list items. Only list the <code>&lt;li&gt;&lt;a href=""&gt;&lt;/a&gt;&lt;/li&gt;</code> entries.
+      </div>
     </div>
     <div class="field">
       <label>Header HTML</label>
-      <textarea name="header_html" placeholder="Content to show on all pages in the header">{{header_html}}</textarea>
+      <textarea name="header_html" placeholder="">{{header_html}}</textarea>
+      <div class="note">
+        Content to show on all pages in the header.
+        Use <code>div.content</code> as a wrapper to get auto <code>margin-bottom</code>.
+        Use classes like <code>"home-hide"</code> or <code>"hide doc-show"</code> to control display of elements if needed.
+      </div>
+    </div>
+    <div class="field">
+      <label>Bottom HTML</label>
+      <textarea name="bottom_html" placeholder="">{{bottom_html}}</textarea>
       <div class="note">
-        Use `div.content` as a wrapper to get auto `margin-bottom`.<br>Use classes like `home-hide` or `hide doc-show` to control display of elements if needed.
+        Content to show on all pages just above the footer.
       </div>
     </div>
     <div class="field">
       <label>Footer HTML</label>
-      <textarea name="footer_html" placeholder="Content to show on all pages in the footer">{{footer_html}}</textarea>
+      <textarea name="footer_html" placeholder="">{{footer_html}}</textarea>
+      <div class="note">
+        Content to show on all pages in the footer. Use <code>div.copyright</code> as a wrapper.
+      </div>
     </div>
     
     <h4 class="heading">

+ 8 - 8
site/static/css/responsive.styl

@@ -140,14 +140,6 @@
       width: 100%
       margin: 1em auto
 
-    ul.grid-2
-      > li
-        width: 100%
-        margin: 0.8em 0 0 0
-      &.with-borders > li
-        width: 100%
-        margin: 0.8em 0 0 0
-
   article.home
     .collections
       > ul
@@ -164,6 +156,14 @@
       float: none
       margin: 0 0 1em 0
 
+  ul.grid-2
+    > li
+      width: 100%
+      margin: 0.8em 0 0 0
+    &.with-borders > li
+      width: 100%
+      margin: 0.8em 0 0 0
+
 
 @media (min-width: 481px) and (max-width: 767px)
   

+ 9 - 1
site/static/css/setup-theme.styl

@@ -9,8 +9,14 @@ setupTheme($primaryColor = $blueColor, $secondaryColor = $lightGrey, $linkColor
   .primary-color
     color: $primaryColor
 
+  .primary-link
+    color: $linkColor
+
   .primary-background
-    background: $primaryColor
+    background-color: $primaryColor
+
+  .primary-border
+    border-color: $primaryColor
 
   a
     color: $linkColor
@@ -101,6 +107,8 @@ setupTheme($primaryColor = $blueColor, $secondaryColor = $lightGrey, $linkColor
 
   footer
     border-color: $primaryColor
+    .bottom-html
+      border-color: $primaryColor
     .social-icons
       a
         color: $primaryColor

+ 12 - 21
site/static/css/theme.styl

@@ -499,26 +499,6 @@ article
           display: inline-block
           margin-right: 2em
 
-  ul.grid-2
-    list-style-type: none
-    margin: 0
-    padding: 0
-    clearfix()
-
-    > li
-      display: inline-block
-      position: relative
-      width: 48%
-      padding: 0
-      margin: 0.8em 0.5em 0 0
-      vertical-align: top
-
-    &.with-borders > li
-      width: 47%
-      padding: 1em
-      margin: 0.5em 0.4em
-      border: solid 1px $faintGrey
-
 article.home
 
   .collections
@@ -615,6 +595,11 @@ footer
   color: #aaa
   clear: both
 
+  .bottom-html
+    margin-bottom: 2em
+    padding-bottom: 2em
+    border-bottom: 1px dotted $primaryColor
+
   .social-icons
     float: right
     margin: 0 0 1em 1em
@@ -638,11 +623,17 @@ footer
   .footer-html
 
     .copyright
-      font-size: 0.75em
+      font-size: 0.8em
       line-height: 1.5em
       
       a
         font-weight: $boldFont
+        color: #999
+
+        html.no-touch &:hover
+        html.touch &:active
+          text-decoration: underline
+
 
 
 .search-results-view

+ 7 - 0
site/templates/base.html

@@ -74,13 +74,20 @@
     </nav>
 
     <footer>
+      {{#if site.bottom_html}}
+      <div class="bottom-html">{{{site.bottom_html}}}</div>
+      {{/if}}
+
       <div class="social-icons">
         {{#each site.social_links}}
         <a href="{{url}}" title="{{label}}"><i class="icon icon-{{code}}"></i></a>
         {{/each}}
         <a href="{{baseURL}}/feed" title="RSS Feed"><i class="icon icon-rss"></i></a>
       </div>
+      
+      {{#if site.footer_html}}
       <div class="footer-html">{{{site.footer_html}}}</div>
+      {{/if}}
     </footer>
 
     <div class="search-results-view">