toplevel menus use pills for now - need alignment
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 1 Dec 2012 23:35:21 +0000 (00:35 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 1 Dec 2012 23:35:21 +0000 (00:35 +0100)
myslice/static/css/myslice.css
myslice/templates/logo.html [new file with mode: 0644]
myslice/templates/mymenu.html
myslice/templates/myslice.html
slice/static/js/sample.js [deleted file]
slice/templates/sample.html
slice/views.py

index 4173ccc..84d376a 100644 (file)
@@ -6,7 +6,7 @@
     left: 0px;
     right: 0px; 
     height: 60px;
-    background-color: #fc9;
+    background-color: #f8f8f8;
 }
 
 #column-wrap {
@@ -26,3 +26,7 @@
 #content-related {
     width: 200px;
 }
+
+img.logo {
+    right:0px;
+}
diff --git a/myslice/templates/logo.html b/myslice/templates/logo.html
new file mode 100644 (file)
index 0000000..ff3ed50
--- /dev/null
@@ -0,0 +1 @@
+<a href="/"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
index d19b19d..b32ffa3 100644 (file)
@@ -1,16 +1,17 @@
 {% insert_str prelude "js/mymenu.js" %}
 {% insert_str prelude "css/mymenu.css" %}
-{# this shows how to add raw js code #}
-{# {% insert raw_js %} "some script useful for mymenu" {% endinsert %} #}
-{# use the raw_css container for css style #}
+{# this shows how to add raw js or css code #}
+{# {% insert prelude_js %} "some script useful for mymenu" {% endinsert %} #}
+{# use the prelude_css container for css style #}
 
+<!--
 <div id='mymenu'>
 <ul id='mymenu'>
 <li>
   <a href="/"><img class="logo mymenu" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
 </li>
 {% for d in menu_items %}
-  {% if d.current %}
+  {% if d.active %}
   <li class='current'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
   {% else %}
   <li class='other'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
   {% endfor %}
 </ul>
 </div>
+-->
 
+<div class="nav nav-pills">
+{% for d in menu_items %}
+  {% if d.active %}
+  <li class='active'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
+  {% else %}
+  <li class='other'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
+  {% endif %}
+  {% endfor %}
+</ul>
index a112917..fc9d3c9 100644 (file)
 {% insert_str prelude "bootstrap/css/bootstrap.css" %}
 <script type="text/javascript">
 {# In case we need to add raw js code #}
-{% container raw_js %}
+{% container prelude_js %}
 </script>
 <style type="text/css">
 {# In case we need to add raw css code #}
-{% container raw_css %}
+{% container prelude_css %}
 </style>
 </head>
 
@@ -30,6 +30,7 @@
     <div id='header'>
     {% block header %}
       {% include 'mymenu.html' %}
+      {% include 'logo.html' %}
     {% endblock header %}
     </div>
 
diff --git a/slice/static/js/sample.js b/slice/static/js/sample.js
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
index 717b6d9..40c85ba 100644 (file)
@@ -12,7 +12,7 @@
   </ul>
 <div class="tab-content">
    <div class="tab-pane fade in" id="name1">
-     <p> {{ lorem }} </p>
+     <p> {{ lorem|safe }} </p>
    </div>
    <div class="tab-pane fade in active" id="name2">
      <p> Sample tabs, this one is the active one; A shorter Lorem <code> with embedded code </code> <span class='bold'>ipsum dolor</span> sit amet, consectetuer
 </div>
 
 
-<script>
- $(function () {
-    $('#myTab a:last').tab('show');
-  })
-</script>
-
-<div class='well'> quis nostrud exerci tation </div>
+<div class='well'> a sample of the 'well' class quis nostrud exerci tation </div>
 
 <div>
  {{ lorem }}   Lorem <span class='bold'>ipsum dolor</span> <code> counter += 1
index c7d7c9d..4e8fab3 100644 (file)
@@ -23,7 +23,7 @@ def sample (request):
     return render_to_response ('sample.html',
                                { 'lorem': lorem,
                                  'menu_items':
-                                     [ { 'label':'Some label', 'href': '/url1/','current':True, },
+                                     [ { 'label':'Some label', 'href': '/url1/','active':True, },
                                        { 'label':'Another topic ', 'href': '/other/'},
                                        ]},
                                context_instance=RequestContext(request))