commit 14fbb44a241b552dd897a01fbbbac9a3a785b5e0
Author: Serghei MIHAI <smihai@entrouvert.com>
Date:   Tue Mar 3 17:00:49 2015 +0100

    ozwillo links built from a config var (#6604)

diff --git a/README.rst b/README.rst
index 3180f11..90bc1de 100644
--- a/README.rst
+++ b/README.rst
@@ -44,6 +44,9 @@ Requirements
 For example, you might want to mention here which versions of CKAN this
 extension works with.
 
+The configuration variable ``ckanext.ozwillo_theme.plugin.ozwillo_url`` must be
+set(for example to https://ozwillo-preprod.eu)
+
 
 ------------
 Installation
diff --git a/ckanext/ozwillo_theme/plugin.py b/ckanext/ozwillo_theme/plugin.py
index 0e8fbf0..e6afd21 100644
--- a/ckanext/ozwillo_theme/plugin.py
+++ b/ckanext/ozwillo_theme/plugin.py
@@ -1,11 +1,17 @@
+from pylons import config as pconfig
+
 import ckan.plugins as plugins
 import ckan.plugins.toolkit as toolkit
+from ckan.lib.app_globals import set_global
 
 
 class OzwilloThemePlugin(plugins.SingletonPlugin):
     plugins.implements(plugins.IConfigurer)
 
     def update_config(self, config_):
+        set_global('ckan.ozwillo_url',
+                   pconfig.get('%s.ozwillo_url' % __name__))
+
         toolkit.add_template_directory(config_, 'templates')
         toolkit.add_public_directory(config_, 'public')
         toolkit.add_resource('fanstatic', 'theme')
diff --git a/ckanext/ozwillo_theme/templates/footer.html b/ckanext/ozwillo_theme/templates/footer.html
index bdf77a2..f3234fb 100644
--- a/ckanext/ozwillo_theme/templates/footer.html
+++ b/ckanext/ozwillo_theme/templates/footer.html
@@ -1,3 +1,4 @@
+{% set current_lang = request.environ.CKAN_LANG %}
 <footer id="t3-footer" class="wrap t3-footer">
 
 	<section class="t3-sitemap">
@@ -23,25 +24,25 @@
 							</div>
 					<div class=" col-lg-2 col-md-2 col-sm-3 col-xs-4">
 								<div class="t3-module module " id="Mod141"><div class="module-inner"><div class="module-ct"><ul class="nav navbar-nav navbar-right navbar-footer">
-<li><a href="{% trans %}/en/oz/discover{% endtrans %}">{% trans %}Discovering{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/oz/news{% endtrans %}">{% trans %}News{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/oz/co-construct{% endtrans %}">{% trans %}Co-construct{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/oz/let-s-go{% endtrans %}">{% trans %}Let's go{% endtrans %}</a></li></ul>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/discover">{% trans %}Discovering{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/news">{% trans %}News{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/co-construct">{% trans %}Co-construct{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/let-s-go">{% trans %}Let's go{% endtrans %}</a></li></ul>
 </div></div></div>
 							</div>
 					<div class=" col-lg-2 col-md-2 col-sm-3 col-xs-4">
 								<div class="t3-module module " id="Mod142"><div class="module-inner"><div class="module-ct"><ul class="nav navbar-nav navbar-right navbar-footer">
-<li><a href="{% trans %}/en/contact{% endtrans %}">{% trans %}Contact{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/l-equipe-projet-oasis{% endtrans %}">{% trans %}Project team{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/oz/projects{% endtrans %}">{% trans %}Projects{% endtrans %}</a></li></ul>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/contact">{% trans %}Contact{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/l-equipe-projet-oasis">{% trans %}Project team{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/projects">{% trans %}Projects{% endtrans %}</a></li></ul>
 </div></div></div>
 							</div>
 					<div class=" col-lg-2 col-md-2 col-sm-3 col-xs-4">
 								<div class="t3-module module " id="Mod143"><div class="module-inner"><div class="module-ct"><ul class="nav navbar-nav navbar-right navbar-footer">
-<li><a href="{% trans %}/en/guide-utilisateur{% endtrans %}">{% trans %}User guide{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/terms{% endtrans %}">{% trans %}General terms of use{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/legal-notices{% endtrans %}">{% trans %}Legal Notices{% endtrans %}</a></li>
-<li><a href="{% trans %}/en/oz/co-construct{% endtrans %}">{% trans %}Governance{% endtrans %}</a></li></ul>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/guide-utilisateur">{% trans %}User guide{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/terms">{% trans %}General terms of use{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/legal-notices">{% trans %}Legal Notices{% endtrans %}</a></li>
+<li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/co-construct">{% trans %}Governance{% endtrans %}</a></li></ul>
 </div></div></div>
 							</div>
 			</div>
diff --git a/ckanext/ozwillo_theme/templates/header.html b/ckanext/ozwillo_theme/templates/header.html
index 0c727f1..3d8527e 100644
--- a/ckanext/ozwillo_theme/templates/header.html
+++ b/ckanext/ozwillo_theme/templates/header.html
@@ -20,8 +20,8 @@
 		
 		<div class="t3-navbar navbar-collapse collapse">
 					<ul class="nav navbar-nav">
-			<li class="item-107 current active">				<a class="logo" href="/en/"><img src="/img/logo-100.png" alt="{% trans %}Home{% endtrans %}"></a>
-				</li><li class="item-108">				<a class="nav-apps" href="https://portal.ozwillo-preprod.eu/en/store?ui_locales={{current_lang}}">{% trans %}Catalog{% endtrans %}</a>
+			<li class="item-107 current">				<a class="logo" href="{{ g.ozwillo_url }}/{{current_lang}}"><img src="/img/logo-100.png" alt="{% trans %}Home{% endtrans %}"></a>
+				</li><li class="item-108">				<a class="nav-apps" href="{{ g.ozwillo_url }}/{{current_lang}}/store?ui_locales={{current_lang}}">{% trans %}Catalog{% endtrans %}</a>
 				</li>
 <li class="item-119 deeper dropdown parent">
   <a class="dropdown-toggle nav-data" href="#" data-toggle="dropdown">{% trans %}Data{% endtrans %}<b class="caret"></b></a>
@@ -45,16 +45,16 @@
   {% if c.userobj %}
   <a class="btn navbar-btn" href="{{ h.url_for('/user/slo') }}">{% trans %}Log out{% endtrans %}</a>
   {% else %}
-  <a class="btn navbar-btn" href="https://portal.ozwillo-preprod.eu/my">{% trans %}Log in{% endtrans %}</a>
+  <a class="btn navbar-btn" href="{{ g.ozwillo_url }}/{{current_lang}}/my">{% trans %}Log in{% endtrans %}</a>
   {% endif %}
   </li>
 <li class="item-112 deeper dropdown parent"><a class="dropdown-toggle" href="/en/oz/discover" data-toggle="dropdown">{% trans %}Discover{% endtrans %}<b class="caret"></b></a>
   <ul class="dropdown-menu">
-    <li><a href="/en/oz/discover">{% trans %}Discovering the Platform{% endtrans %}</a></li>
-    <li><a href="/en/oz/news">{% trans %}News{% endtrans %}</a></li>
-    <li><a href="/en/oz/co-construct">{% trans %}Co-construct{% endtrans %}</a></li>
-    <li><a href="/en/oz/let-s-go">{% trans %}Let's go{% endtrans %}</a></li>
-    <li><a href="/en/oz/projects">{% trans %}Projects{% endtrans %}</a></li>
+    <li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/discover">{% trans %}Discovering the Platform{% endtrans %}</a></li>
+    <li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/news">{% trans %}News{% endtrans %}</a></li>
+    <li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/co-construct">{% trans %}Co-construct{% endtrans %}</a></li>
+    <li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/let-s-go">{% trans %}Let's go{% endtrans %}</a></li>
+    <li><a href="{{ g.ozwillo_url }}/{{current_lang}}/oz/projects">{% trans %}Projects{% endtrans %}</a></li>
 </ul></li></ul>
 
       	    <!-- //RIGHT NAV -->
