diff options
| author | etienne <etienne@9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864> | 2010-01-17 19:03:44 +0000 |
|---|---|---|
| committer | etienne <etienne@9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864> | 2010-01-17 19:03:44 +0000 |
| commit | d7f4dede2d05ee22bb4d743aef1586631ec35b48 (patch) | |
| tree | f301567f21746d0cee82612fbae093d838e420f7 | |
| parent | bc92084d0643db30904f327658b9eba46504db26 (diff) | |
| download | Chimère-d7f4dede2d05ee22bb4d743aef1586631ec35b48.tar.bz2 Chimère-d7f4dede2d05ee22bb4d743aef1586631ec35b48.zip | |
Simplify the customization of templates - #69
git-svn-id: http://www.peacefrogs.net/svn/chimere/trunk@43 9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864
| -rw-r--r-- | templates/base.html | 10 | ||||
| -rw-r--r-- | templates/base_user.html | 10 | ||||
| -rw-r--r-- | templates/edit.html | 7 | ||||
| -rw-r--r-- | templates/edit_route.html | 8 | ||||
| -rw-r--r-- | templates/main_map.html | 10 | ||||
| -rw-r--r-- | templates/submited.html | 5 |
6 files changed, 31 insertions, 19 deletions
diff --git a/templates/base.html b/templates/base.html index 956347a..c358fa2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,6 +12,7 @@ </head> <body> + {% block top %}{% endblock %} <div id="topbar"> <ul id='action'> {% for action in actions %} @@ -19,13 +20,16 @@ {% endfor %} </ul> </div> + {% block message_map %}{% endblock %} + {% block message_edit %}{% endblock %} {% block sidebar %}{% endblock %} <div id="content"> {% block content %}{% endblock %} </div> - {% block footer %} - <div id='footer'>{% trans "This site uses Chimère"%} - Copyright © 2008-2009 <a href='http://redmine.peacefrogs.net/projects/show/chimere'>Chimère project</a></div> - {% endblock %} + {% block bottom %}{% endblock %} + <div id='footer'>{% block footer %} + {% trans "This site uses Chimère"%} - © 2008-2010 <a href='http://blog.peacefrogs.net/nim/chimere/'>Chimère project</a> + {% endblock %}</div> </body> </html> diff --git a/templates/base_user.html b/templates/base_user.html new file mode 100644 index 0000000..2255311 --- /dev/null +++ b/templates/base_user.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% load i18n %} +{# to customize your base Chimère template add codes between the following blocks #} +{# top of the page before the tabs #}{% block top %}{% endblock %} +{# message block displayed on the map #}{% block message_map %}{% endblock %} +{# message block displayed on the edit pages #}{% block message_edit %}{% endblock %} +{# top of the page after the tabs #}{% block sidebar %}{% endblock %} +{# main part of the page #}{% block content %}{% endblock %} +{# bottom of the page before the footer #}{% block bottom %}{% endblock %} +{# inside the footer - please leave bloc.super it shows the Chimère copyright #}{% block footer %}{{ block.super }}{% endblock %} diff --git a/templates/edit.html b/templates/edit.html index 4f9d015..730035b 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -1,9 +1,8 @@ -{% extends "base.html" %} +{% extends "base_user.html" %} {% load i18n %} -{% block sidebar %} -{% endblock %} +{% block message_map %}{% endblock %} -{% block content %} +{% block content %}{{ block.super }} {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} <fieldset class='edit'> <legend>{% trans "Add a new site" %}</legend> diff --git a/templates/edit_route.html b/templates/edit_route.html index d870b0e..7f1aa1d 100644 --- a/templates/edit_route.html +++ b/templates/edit_route.html @@ -1,9 +1,7 @@ -{% extends "base.html" %} +{% extends "base_user.html" %} {% load i18n %} -{% block sidebar %} -{% endblock %} - -{% block content %} +{% block message_map %}{% endblock %} +{% block content %}{{ block.super }} {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} <fieldset class='edit'> <legend>{% trans "Add a new route" %}</legend> diff --git a/templates/main_map.html b/templates/main_map.html index 164d0ae..4d4f94d 100644 --- a/templates/main_map.html +++ b/templates/main_map.html @@ -1,6 +1,7 @@ -{% extends "base.html" %} +{% extends "base_user.html" %} {% load i18n %} -{% block sidebar %} +{% block message_edit %}{% endblock %} +{% block sidebar %}{{ block.super }} <div id='panel'> <form method='post' name='frm_categories' id='frm_categories'> <ul id='categories'>{% for category, lst_sub_categories in sub_categories %} @@ -37,7 +38,7 @@ lst_{{category.id}}.push("{{sub_category.id}}");{% endfor %} </div> {{welcome}}{% endblock %} -{% block content %}<div id='map'></div> +{% block content %}{{ block.super }}<div id='map'></div> <script type='text/javascript'><!-- var map_layer = {{map_layer|safe}}; var permalink_label = '{%trans "Permalink"%}'; @@ -50,6 +51,5 @@ var p_display_submited={{p_display_submited}}; var p_checked_categories = [{{p_checked_categories}}];{%endif%} init(); // --> </script>{% endblock %} -{% block footer %} - <div id='map-footer'><a href='javascript:show("welcome");'>{% trans "Welcome message"%}</a> - {% trans "Map"%} © <a href='http://openstreetmap.org/'>OpenStreetMap</a> - {% trans "This site uses Chimère"%} - Copyright © 2008-2009 <a href='http://redmine.peacefrogs.net/projects/show/chimere'>Chimère project</a></div> +{% block footer %}<div id='map-footer'><a href='javascript:show("welcome");'>{% trans "Welcome message"%}</a> - {{ block.super }} - {% trans "Map"%} © <a href='http://openstreetmap.org/'>OpenStreetMap</a></div> {% endblock %} diff --git a/templates/submited.html b/templates/submited.html index eae3623..ab40cce 100644 --- a/templates/submited.html +++ b/templates/submited.html @@ -1,6 +1,7 @@ -{% extends "base.html" %} +{% extends "base_user.html" %} {% load i18n %} -{% block content %} +{% block message_map %}{% endblock %} +{% block content %}{{ block.super }} <fieldset class='edit'> <p>{% trans "Your proposition has been submited. A moderator will treat your submission shortly. Thanks!" %}</p> </fieldset> |
