From 45e1429edda8093e8d49855d356e7e7bf52f2957 Mon Sep 17 00:00:00 2001
From: anonymous <anonymous>
Date: Thu, 13 Sep 2018 14:21:37 +0200
Subject: [PATCH] Adds example for static content with link in main navigation

---
 ckanext/odsh/controller.py            |  6 ++++++
 ckanext/odsh/plugin.py                |  5 +++++
 ckanext/odsh/templates/header.html    | 17 ++++++++++++++++-
 ckanext/odsh/templates/info_page.html |  1 +
 4 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 ckanext/odsh/controller.py
 create mode 100644 ckanext/odsh/templates/info_page.html

diff --git a/ckanext/odsh/controller.py b/ckanext/odsh/controller.py
new file mode 100644
index 00000000..f1990fd5
--- /dev/null
+++ b/ckanext/odsh/controller.py
@@ -0,0 +1,6 @@
+import ckan.lib.base as base
+from ckan.controllers.home import HomeController
+
+class OdshRouteController(HomeController):
+    def info_page(self):
+        return base.render('info_page.html')
\ No newline at end of file
diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py
index 3c2218af..d9d679ea 100644
--- a/ckanext/odsh/plugin.py
+++ b/ckanext/odsh/plugin.py
@@ -14,6 +14,7 @@ def odsh_main_groups():
 class OdshPlugin(plugins.SingletonPlugin):
     plugins.implements(plugins.IConfigurer)
     plugins.implements(plugins.ITemplateHelpers)
+    plugins.implements(plugins.IRoutes, inherit=True)
 
     # IConfigurer
 
@@ -27,3 +28,7 @@ class OdshPlugin(plugins.SingletonPlugin):
         # extension they belong to, to avoid clashing with functions from
         # other extensions.
         return {'odsh_main_groups': odsh_main_groups}
+
+    def before_map(self, map):
+        map.connect('info_page', '/info_page', controller='ckanext.odsh.controller:OdshRouteController', action='info_page')
+        return map
diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html
index 8aebd7a9..fdac883c 100644
--- a/ckanext/odsh/templates/header.html
+++ b/ckanext/odsh/templates/header.html
@@ -1,4 +1,19 @@
 {% ckan_extends %}
 {% block header_account_container_content %}
-hier war der login 
+hier war der login
+{% endblock %}
+{% block header_site_navigation %}
+<nav class="section navigation">
+    <ul class="nav nav-pills">
+        {% block header_site_navigation_tabs %}
+        {{ h.build_nav_main(
+        ('search', _('Datasets')),
+        ('organizations_index', _('Organizations')),
+        ('group_index', _('Groups')),
+        ('about', _('About')),
+        ('info_page', _('Info'))
+        ) }}
+        {% endblock %}
+    </ul>
+</nav>
 {% endblock %}
\ No newline at end of file
diff --git a/ckanext/odsh/templates/info_page.html b/ckanext/odsh/templates/info_page.html
new file mode 100644
index 00000000..06e55476
--- /dev/null
+++ b/ckanext/odsh/templates/info_page.html
@@ -0,0 +1 @@
+info
\ No newline at end of file
-- 
GitLab