From 27d4b7221fafd480e9532e14c65c865f964f39ab Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Sun, 2 Dec 2012 15:26:18 +0100
Subject: [PATCH] not too bad

---
 Makefile                       |  6 +++++-
 myslice/static/css/mymenu.css  | 28 ++++++++--------------------
 myslice/static/css/myslice.css | 32 +++++++++++++-------------------
 myslice/templates/logo.html    |  1 -
 myslice/templates/mymenu.html  |  6 +-----
 myslice/templates/myslice.html |  8 ++------
 myslice/urls.py                |  1 +
 slice/views.py                 |  2 +-
 8 files changed, 31 insertions(+), 53 deletions(-)
 delete mode 100644 myslice/templates/logo.html

diff --git a/Makefile b/Makefile
index eb8ec41d..02d4ada7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,13 @@ all:
 force:
 
 #################### compute emacs tags
+# list files under git but exclude third-party stuff like bootstrap and jquery
+myfiles: force
+	@git ls-files | egrep -v 'insert_above/|/bootstrap/|/jquery/'
+
 # in general it's right to rely on the contents as reported by git
 tags: force
-	git ls-files | xargs etags
+	$(MAKE) myfiles | xargs etags
 
 # however sometimes we have stuff not yet added, so in this case
 ftags: force
diff --git a/myslice/static/css/mymenu.css b/myslice/static/css/mymenu.css
index 06e37819..08db8274 100644
--- a/myslice/static/css/mymenu.css
+++ b/myslice/static/css/mymenu.css
@@ -1,23 +1,11 @@
-ul#mymenu { display: block; }
-ul#mymenu>li { display: block; 
-	       float: left;
-	       padding: 5px;
+#menu_ul {
+    position: absolute;
+    left: 0px;
+    margin: 15px;
 }
-
-/*
-div.mymenu {
-    position: fixed; 
-    display: block;
-    padding:0;
-    margin:0;
-    top: 10px;
-    right: 10px; 
-    background-color: #abc;
+#menu_logo {
+    position: absolute;
+    right:0px;
+    margin: 15px;
 }
 
-ul.mymenu {
-    list-style-type: none;
-    margin: 0;
-    padding: 0;
-}
-*/
diff --git a/myslice/static/css/myslice.css b/myslice/static/css/myslice.css
index 84d376a4..0862ecf2 100644
--- a/myslice/static/css/myslice.css
+++ b/myslice/static/css/myslice.css
@@ -1,32 +1,26 @@
 #header {
     position: fixed; 
     display: block;
-    margin:0;
+    margin:0px;
     top: 0px;
     left: 0px;
     right: 0px; 
     height: 60px;
-    background-color: #f8f8f8;
+/*    background-color: #f8f8f8; */
+    background-color: #ccc;
 }
 
-#column-wrap {
-    margin-top: 60px;
-    display: table;
-    table-layout: fixed;
-    border-collapse: collapse;
-}
-#content-main, #content-related {
-    display: table-cell;
-    position: static;
-    padding: 10px;
-}
 #content-main {
-    width: 100%;
+    margin: 60 200 0 0;
+    padding: 0;
 }
 #content-related {
-    width: 200px;
-}
-
-img.logo {
-    right:0px;
+    margin-top: 60;
+    padding: 0;
+    width: 200;
+    position: fixed;
+    display: block;
+    right: 0px;
+    top: 0px;
+    background-color: #d0d0f8;
 }
diff --git a/myslice/templates/logo.html b/myslice/templates/logo.html
deleted file mode 100644
index ff3ed501..00000000
--- a/myslice/templates/logo.html
+++ /dev/null
@@ -1 +0,0 @@
-<a href="/"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
diff --git a/myslice/templates/mymenu.html b/myslice/templates/mymenu.html
index 66c8153e..b4e531ad 100644
--- a/myslice/templates/mymenu.html
+++ b/myslice/templates/mymenu.html
@@ -1,10 +1,7 @@
 {% insert_str prelude "js/mymenu.js" %}
 {% insert_str prelude "css/mymenu.css" %}
-{# 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 class="nav nav-pills">
+<ul class="nav nav-pills" id='menu_ul'>
 {% for d in menu_items %}
   {% if d.active %}
   <li class='active'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
@@ -13,4 +10,3 @@
   {% endif %}
   {% endfor %}
 </ul>
-</div>
diff --git a/myslice/templates/myslice.html b/myslice/templates/myslice.html
index fc9d3c9f..f316c6ec 100644
--- a/myslice/templates/myslice.html
+++ b/myslice/templates/myslice.html
@@ -9,7 +9,7 @@
 {% insert_str prelude "bootstrap/js/bootstrap.js" %}
 {% insert_str prelude "bootstrap/css/bootstrap.css" %}
 <script type="text/javascript">
-{# In case we need to add raw js code #}
+{# In case we need to add raw js code - use {% insert prelude_js %} ... {% endinsert %} #}
 {% container prelude_js %}
 </script>
 <style type="text/css">
@@ -29,13 +29,11 @@
 
     <div id='header'>
     {% block header %}
+      <a id='menu_logo' href="/"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
       {% include 'mymenu.html' %}
-      {% include 'logo.html' %}
     {% endblock header %}
     </div>
 
-    {% block column_wrap %}
-    <div id='column-wrap'>
     <div id='content-main'>
       {% block content_main %}
       "The main content area (set block 'content_main')"
@@ -47,8 +45,6 @@
       "The related content area (set block 'related_main')"
       {% endblock content_related %}
     </div>
-    </div>
-    {% endblock column_wrap %}
 
 </div>
 {% endblock container %}
diff --git a/myslice/urls.py b/myslice/urls.py
index 6e431caa..e1dd5e5a 100644
--- a/myslice/urls.py
+++ b/myslice/urls.py
@@ -19,6 +19,7 @@ urlpatterns = patterns(
 
     # Uncomment the next line to enable the admin:
     # url(r'^admin/', include(admin.site.urls)),
+    (r'^/?$', 'slice.views.fake_slice_view'),
     (r'^login/?$', 'auth.views.login_user'),
     (r'^slice/?$', 'slice.views.fake_slice_view'),
     (r'^slice/(?P<name>\w+)/?$', 'slice.views.fake_slice_view'),
diff --git a/slice/views.py b/slice/views.py
index c9fcca8a..463ff84a 100644
--- a/slice/views.py
+++ b/slice/views.py
@@ -13,7 +13,7 @@ def fake_slice_view (request, name=None):
                                             'content_main' : lorem,
                                             'menu_items' : 
                                             [ { 'label':'Sample', 'href': '/sample/'},
-                                              { 'label':'Slice', 'href': '/other/', 'active':True},
+                                              { 'label':'Slice', 'href': '/slice/', 'active':True},
                                               ]},
                               context_instance=RequestContext(request))
 
-- 
2.47.0