diff templates/snippet/snippet_box.djhtml @ 190:a4f88ac85837

Changes: Now guest users cannot see revision history and they also cannot see snippets posted by registered users. To see snippets posted by registered users, one has to login.
author ahsanalishahid <ahsan.ali.shahid@gmail.com>
date Thu, 20 Jun 2013 17:17:16 +0500
parents c7be7def8b57
children b3c3d940cc87
line wrap: on
line diff
--- a/templates/snippet/snippet_box.djhtml	Tue Jun 18 19:59:40 2013 +0500
+++ b/templates/snippet/snippet_box.djhtml	Thu Jun 20 17:17:16 2013 +0500
@@ -1,5 +1,8 @@
 {% autoescape off %}
+
 <div class="snippet {{ default_style }}">
+{%  if  show   %}
+
     <div class="code-lines">
         {% for line in lines %}
         <p class="line" id="l{{ forloop.counter }}">{% if line %}{{ line }}{% else %}&nbsp;{% endif %}</p>
@@ -7,4 +10,12 @@
     </div>
     <div class="line-counters"></div>
 </div>
+{%  else %}
+    <div class="code-lines">
+        
+
+<p class="hint">  You need to register first if you want to see the content. Register for a new account or log in. </p>
+</div>
+</div>
+{% endif %}
 {% endautoescape %}