1. Dan Watson
  2. leaves-cms

Commits

Dan Watson  committed 811f110

More plugin configs

  • Participants
  • Parent commits 6507600
  • Branches default

Comments (0)

Files changed (8)

File leaves/plugins/blog/admin.py

View file
 from django.contrib import admin
-from leaves.plugins.blog.models import Post, Category
-from leaves.admin import LeafAdmin, UserSiteAdmin
+from leaves.plugins.blog.models import Post, Category, Config
+from leaves.admin import LeafAdmin, UserSiteAdmin, ConfigAdmin
 
 class PostAdmin (LeafAdmin):
 	fieldsets = (
 
 admin.site.register(Post, PostAdmin)
 admin.site.register(Category, CategoryAdmin)
+admin.site.register(Config, ConfigAdmin)

File leaves/plugins/blog/models.py

View file
 from django.db import models
 from django.contrib.sites.models import Site
 from django.utils.translation import ugettext_lazy as _
-from leaves.models import Leaf, Translatable, TreeUtilsMixIn
+from leaves.models import Leaf, Translatable, TreeUtilsMixIn, SiteConfig
 from leaves.managers import LeafManager, RequestSiteManager
 
+class Config (SiteConfig):
+	nav_link = models.BooleanField(default=True)
+
 class Category (models.Model, TreeUtilsMixIn, Translatable):
 	sites = models.ManyToManyField(Site, related_name='blog_categories')
 	name = models.CharField(max_length=30)

File leaves/plugins/photos/admin.py

View file
 from django.contrib import admin
-from leaves.plugins.photos.models import Photo, Gallery
-from leaves.admin import LeafAdmin
+from leaves.plugins.photos.models import Photo, Gallery, Config
+from leaves.admin import LeafAdmin, ConfigAdmin
 
 class PhotoAdmin (LeafAdmin):
 	fieldsets = (
 
 admin.site.register(Photo, PhotoAdmin)
 admin.site.register(Gallery, GalleryAdmin)
+admin.site.register(Config, ConfigAdmin)

File leaves/plugins/photos/models.py

View file
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
-from leaves.models import Leaf
+from leaves.models import Leaf, SiteConfig
 from leaves.managers import LeafManager, RequestSiteManager
 import os
 
+class Config (SiteConfig):
+	enabled = models.BooleanField(default=True)
+	nav_photos = models.BooleanField(default=True)
+	nav_galleries = models.BooleanField(default=True)
+
 class Photo (Leaf):
 	image = models.ImageField(upload_to='photos/%Y/%m/%d', max_length=200, height_field='height', width_field='width')
 	width = models.PositiveIntegerField(default=0, editable=False)

File leaves/themes/stream/static/stream/css/style.css

View file
        0px  0px 7px rgba(255,255,255,0.5);
 }
 
-#header a:hover {
-    border-bottom: 1px solid transparent;
-}
-
 #header a.title {
     font-size: 3em;
     font-weight: bold;
     border-radius: 5px;
 }
 
+#header .page-list li.selected a:hover,
+.archive .page-list li.archive a:hover {
+    border-bottom: 1px solid transparent;
+}
+
 #content {
 	margin-left: 235px;
 	padding: 15px 0px;
     color: #999;
     width: 50px;
     margin-right: 10px;
-    font-size: 0.9em;
+    font-size: 0.85em;
+	position: relative;
+	top: -1px;
 }
 div.archive ul li {
     margin-bottom: 3px;

File leaves/themes/stream/templates/base.html

View file
 <div id="header">
 	<div class="container">
 		<a class="title stroked" href="{% url homepage %}">{{ site.name }}</a>
-		{% block topnav %}
 		<ul class="page-list">
 			<li class="archive"><a href="{% url archive-index %}">Archive</a></li>
 			{% for p in leaves.pages.navigable_pages %}
 			<li{% ifequal p leaf %} class="selected"{% endifequal %}><a href="{{ p.get_url }}">{{ p }}</a></li>
 			{% endfor %}
 		</ul>
-		{% endblock %}
 	</div>
 </div>
 {% if messages %}
 </div>
 {% block post-container %}{% endblock %}
 {% block analytics %}
+{% if config.analytics_id %}
 <script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-10897395-2']);
 	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
 </script>
+{% endif %}
 {% endblock %}
 </body>
 </html>

File leaves/themes/stream/templates/pages/navigation.html

-{% load pages %}
-{% page_hierarchy %}

File leaves/themes/stream/templates/pages/page.html

-{% extends "leaf.html" %}
-{% load pages %}