From: Thierry Parmentelat Date: Mon, 10 Dec 2012 15:07:11 +0000 (+0100) Subject: try to define a decent naming scheme for templates, X-Git-Tag: myslice-django-0.1-1~156 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=d1a79ca71659cdcc0de34fb681d9250362eb52e9 try to define a decent naming scheme for templates, 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) --- diff --git a/auth/views.py b/auth/views.py index af7fbc42..eca19396 100644 --- a/auth/views.py +++ b/auth/views.py @@ -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)) diff --git a/engine/plugin.py b/engine/plugin.py index f3c659f6..b766ad74 100644 --- a/engine/plugin.py +++ b/engine/plugin.py @@ -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(), diff --git a/slice/views.py b/slice/views.py index dbeab927..a057a059 100644 --- a/slice/views.py +++ b/slice/views.py @@ -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'), }, diff --git a/templates/myslice-layout.html b/templates/layout-myslice.html similarity index 97% rename from templates/myslice-layout.html rename to templates/layout-myslice.html index 4fc6e856..de2792ea 100644 --- a/templates/myslice-layout.html +++ b/templates/layout-myslice.html @@ -31,7 +31,7 @@ diff --git a/templates/login-view.html b/templates/view-login.html similarity index 65% rename from templates/login-view.html rename to templates/view-login.html index a588e26c..ed784636 100644 --- a/templates/login-view.html +++ b/templates/view-login.html @@ -1,8 +1,7 @@ -{% extends 'myslice-layout.html' %} +{% extends 'layout-myslice.html' %} {% block content_related %}

{{ state }}

-Current exp. login is based on hard-wired users
{% csrf_token %} @@ -16,3 +15,10 @@
{% endblock content_related %} + +{% block content_main %} + +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. + + +{% endblock content_main %} diff --git a/templates/scroll-view.html b/templates/view-scroll.html similarity index 96% rename from templates/scroll-view.html rename to templates/view-scroll.html index 4875f094..bd3b53bc 100644 --- a/templates/scroll-view.html +++ b/templates/view-scroll.html @@ -1,4 +1,4 @@ -{% extends 'myslice-layout.html' %} +{% extends 'layout-myslice.html' %} {% block content_main %} diff --git a/templates/slice-view.html b/templates/view-slice.html similarity index 94% rename from templates/slice-view.html rename to templates/view-slice.html index 72d2a1ad..9bf68b15 100644 --- a/templates/slice-view.html +++ b/templates/view-slice.html @@ -1,4 +1,4 @@ -{% extends 'myslice-layout.html' %} +{% extends 'layout-myslice.html' %} {% block content_main %}

The URL variable name= {{ name }}

diff --git a/templates/tab-view.html b/templates/view-tab.html similarity index 98% rename from templates/tab-view.html rename to templates/view-tab.html index a8334edd..be358f3f 100644 --- a/templates/tab-view.html +++ b/templates/view-tab.html @@ -1,4 +1,4 @@ -{% extends 'myslice-layout.html' %} +{% extends 'layout-myslice.html' %} {% block content_main %} diff --git a/templates/render_plugin.html b/templates/widget-plugin.html similarity index 100% rename from templates/render_plugin.html rename to templates/widget-plugin.html diff --git a/templates/mymenu-widget.html b/templates/widget-topmenu.html similarity index 100% rename from templates/mymenu-widget.html rename to templates/widget-topmenu.html