admin preview,
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Aug 2012 10:36:21 +0000 (12:36 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Aug 2012 10:36:21 +0000 (12:36 +0200)
style: blockquotes and bigger font

migdal/templates/migdal/entry/entry_detail.html
migdal/views.py
prawokultury/static/css/base.css
prawokultury/static/css/base.scss
prawokultury/static/css/entry.css
prawokultury/static/css/entry.scss

index 990d7f4..1f322be 100755 (executable)
 
 {% block "body" %}
 
+{% if not entry.published %}
+    <p class="warning">{% trans "This entry hasn't been published yet." %}</p>
+{% endif %}
+
 <div class="entry entry-detail entry-{{ entry.type }}">
 <div class="entry-wrapped">
 
index 1ece4cc..84cd6fe 100644 (file)
@@ -45,8 +45,9 @@ def entry_list(request, type_db=None, category_slug=None):
 
 def entry(request, type_db, slug):
     lang = request.LANGUAGE_CODE
-    args = {'type': type_db, 'slug_%s' % lang: slug, 'published_%s' % lang: True}
-    # TODO: preview for admins
+    args = {'type': type_db, 'slug_%s' % lang: slug}
+    if not request.user.has_perm('migdal.change_entry'):
+        args['published_%s' % lang] = True
     entry = get_object_or_404(Entry, **args)
 
     templates = ["migdal/entry/entry_detail.html"]
index d52e8eb..615e005 100644 (file)
@@ -22,3 +22,9 @@ h1 {
   margin: 0 0 .5em 0;
   color: #01519a;
   font-size: 2em; }
+
+.warning {
+  border: 1px solid #ddd;
+  padding: 1em;
+  background: #ffd;
+  font-size: 1.3em; }
index 9fd624e..01723b1 100644 (file)
@@ -28,3 +28,11 @@ h1 {
     color: #01519a;
     font-size: 2em;
 }
+
+
+.warning {
+    border: 1px solid #ddd;
+    padding: 1em;
+    background: #ffd;
+    font-size: 1.3em;
+}
index 6c19bf1..d3a9a5e 100644 (file)
   .entry-wrapped h1, .entry-wrapped h2 {
     margin: 0;
     color: #01519a;
-    font-size: 1.2em; }
+    font-size: 1.3em; }
     .entry-wrapped h1 a, .entry-wrapped h2 a {
       color: #01519a; }
   .entry-wrapped h2.section {
     margin: 2em 0; }
   .entry-wrapped .entry-data {
-    font-size: 1.2em;
+    font-size: 1.3em;
     margin-top: 1.4em;
     margin-bottom: 1.4em; }
     .entry-wrapped .entry-data .date {
       .entry-wrapped .entry-data .categories a {
         color: black; }
   .entry-wrapped .lead {
-    font-size: 1.2em; }
+    font-size: 1.3em; }
   .entry-wrapped .body {
-    font-size: 1.2em; }
+    font-size: 1.3em; }
   .entry-wrapped .more {
     clear: both;
     float: right;
-    font-size: 1.2em;
+    font-size: 1.3em;
     font-style: italic;
     margin-top: .6em;
     margin-bottom: 1.8em; }
@@ -70,7 +70,7 @@
   border-bottom: 1px solid #8b8b87; }
   .submit-link a {
     color: black;
-    font-size: 1.2em; }
+    font-size: 1.3em; }
   .submit-link a:before {
     content: url("/static/img/plus.png");
     vertical-align: top;
@@ -81,7 +81,7 @@
   .comments .comment-form {
     border-top: 1px solid #494948; }
   .comments .comment-data {
-    font-size: 1.2em;
+    font-size: 1.3em;
     margin-top: 1.4em;
     margin-bottom: 1.4em; }
     .comments .comment-data .comment-date {
@@ -89,4 +89,4 @@
     .comments .comment-data .comment-author {
       font-weight: bold; }
   .comments .body {
-    font-size: 1.2em; }
+    font-size: 1.3em; }
index e6b5056..5ce77cb 100644 (file)
@@ -18,7 +18,7 @@
     h1, h2 {
         margin: 0;
         color: #01519a;
-        font-size: 1.2em;
+        font-size: 1.3em;
 
         a {
             color: #01519a;
@@ -30,7 +30,7 @@
     }
 
     .entry-data {
-        font-size: 1.2em;
+        font-size: 1.3em;
         margin-top: 1.4em;
         margin-bottom: 1.4em;
         .date {
     }
 
     .lead {
-        font-size: 1.2em;
+        font-size: 1.3em;
     }
 
     .body {
-        font-size: 1.2em;
+        font-size: 1.3em;
+    }
+
+    blockquote {
+        position:relative;
+        left:1em;
+        font-style:italic;
+        margin-left: 1em;
     }
 
     .more {
         clear: both;
         float: right;
-        font-size: 1.2em;
+        font-size: 1.3em;
         font-style: italic;
         margin-top: .6em;
         margin-bottom: 1.8em;
 
     a {
         color: black;
-        font-size: 1.2em;
+        font-size: 1.3em;
     }
     a:before {
         content: url("/static/img/plus.png");
     }
 
     .comment-data {
-        font-size: 1.2em;
+        font-size: 1.3em;
         margin-top: 1.4em;
         margin-bottom: 1.4em;
         .comment-date {
     }
 
     .body {
-        font-size: 1.2em;
+        font-size: 1.3em;
     }
 }