try to define a decent naming scheme for templates,
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2012 15:07:11 +0000 (16:07 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2012 15:07:11 +0000 (16:07 +0100)
whether a layout (no content), a view (uses a layout and ends up in a
full view), or a widget (a re-usable fragment of html)

auth/views.py
engine/plugin.py
slice/views.py
templates/layout-myslice.html [moved from templates/myslice-layout.html with 97% similarity]
templates/view-login.html [moved from templates/login-view.html with 65% similarity]
templates/view-scroll.html [moved from templates/scroll-view.html with 96% similarity]
templates/view-slice.html [moved from templates/slice-view.html with 94% similarity]
templates/view-tab.html [moved from templates/tab-view.html with 98% similarity]
templates/widget-plugin.html [moved from templates/render_plugin.html with 100% similarity]
templates/widget-topmenu.html [moved from templates/mymenu-widget.html with 100% similarity]

index af7fbc4..eca1939 100644 (file)
@@ -21,5 +21,5 @@ def login_user(request):
         else:
             state = "Your username and/or password were incorrect."
 
-    return render_to_response('login-view.html',{'state':state, 'username': username},
+    return render_to_response('view-login.html',{'state':state, 'username': username},
                               context_instance=RequestContext(request))
index f3c659f..b766ad7 100644 (file)
@@ -37,7 +37,7 @@ class Plugin:
         # compute an 'optionstr' from the set of available settings/options as a json string
         # that gets passed to jquery somehow
         # see the bottom of 
-        result = render_to_string ('render_plugin.html',
+        result = render_to_string ('plugin-wrap.html',
                                    {'uuid':uuid, 'title':title,
                                     'visible':self.is_visible(),
                                     'hidable':self.is_hidable(),
index dbeab92..a057a05 100644 (file)
@@ -30,7 +30,7 @@ for site in [ 'inria', 'upmc' , 'ibbt' ]:
         hard_wired_slice_names.append ("ple.%s.%s"%(site,slice))
 
 def fake_slice_view (request, name=None):
-    result=render_to_response('slice-view.html',
+    result=render_to_response('view-slice.html',
                               {'foo':'var_foo_set_in_view', 
                                'name':name,
                                'slices': hard_wired_slice_names,
@@ -49,7 +49,7 @@ def tab_view (request):
                                context_instance=RequestContext(request))
 
 def scroll_view (request):
-    return render_to_response ('scroll-view.html',
+    return render_to_response ('view-scroll.html',
                                { 'lorem':lorem,
                                  'menu_items': menu_items('scroll'),
                                  },
similarity index 97%
rename from templates/myslice-layout.html
rename to templates/layout-myslice.html
index 4fc6e85..de2792e 100644 (file)
@@ -31,7 +31,7 @@
     <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-widget.html' %}
+      {% include 'widget-topmenu.html' %}
     {% endblock header %}
     </div>
 
similarity index 65%
rename from templates/login-view.html
rename to templates/view-login.html
index a588e26..ed78463 100644 (file)
@@ -1,8 +1,7 @@
-{% extends 'myslice-layout.html' %}
+{% extends 'layout-myslice.html' %}
 
 {% block content_related %}
 <p class='login-status'> {{ state }} </p>
-<code>Current exp. login is based on hard-wired users</code>
 <a href="/" alt="Home"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
 <form action="/login/" method="post">
   {% csrf_token %}
   <input type="submit" value="Log In" />
 </form>
 {% endblock content_related %}
+
+{% block content_main %}
+<code>
+This page is currently not connected to any useful authentication system, but instead, as a proof of concept, it uses a set of hardwired user accounts, see auth/backend.py for more details.
+</code>
+
+{% endblock content_main %}
similarity index 96%
rename from templates/scroll-view.html
rename to templates/view-scroll.html
index 4875f09..bd3b53b 100644 (file)
@@ -1,4 +1,4 @@
-{% extends 'myslice-layout.html' %}
+{% extends 'layout-myslice.html' %}
 
 {% block content_main %}
 
similarity index 94%
rename from templates/slice-view.html
rename to templates/view-slice.html
index 72d2a1a..9bf68b1 100644 (file)
@@ -1,4 +1,4 @@
-{% extends 'myslice-layout.html' %}
+{% extends 'layout-myslice.html' %}
 
 {% block content_main %}
 <p>The URL variable name= {{ name }} </p>
similarity index 98%
rename from templates/tab-view.html
rename to templates/view-tab.html
index a8334ed..be358f3 100644 (file)
@@ -1,4 +1,4 @@
-{% extends 'myslice-layout.html' %}
+{% extends 'layout-myslice.html' %}
 
 {% block content_main %}