You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/12/15 13:32:02 UTC

[04/15] allura git commit: ticket:866 added global_nav with links;

ticket:866 added global_nav with links;


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/8a804ad9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/8a804ad9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/8a804ad9

Branch: refs/heads/ib/5940a
Commit: 8a804ad955a27a82acbf557c90b5c168ec06ed40
Parents: a54dbbf
Author: DeV1doR <de...@ukr.net>
Authored: Wed Dec 2 00:13:50 2015 +0200
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Dec 15 13:19:25 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py                       |  4 ++++
 Allura/allura/nf/allura/css/site_style.css             |  9 ++++++++-
 Allura/allura/templates/jinja_master/theme_macros.html |  7 ++++++-
 Allura/development.ini                                 | 11 +++++++++++
 4 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/8a804ad9/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index d63c93f..ffbb535 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -598,6 +598,10 @@ class Globals(object):
     def build_key(self):
         return config.get('build_key', '')
 
+    @LazyProperty
+    def global_nav(self):
+        return json.loads(config.get('global_nav'))
+
 
 class Icon(object):
 

http://git-wip-us.apache.org/repos/asf/allura/blob/8a804ad9/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index a0e268e..007f097 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -489,12 +489,19 @@ blockquote {
   width: 280px;
 }
 #site-header nav {
-  float: right !important;
   margin-left: 20px;
   padding: 12px 0 0 0;
   text-shadow: rgba(0, 0, 0, 0.6) 0 0 0, rgba(255, 255, 255, 0.6) 0 1px 0;
 }
 
+/* nav */
+.nav-left {
+  float: left;
+}
+.nav-right {
+  float: right;
+}
+
 /* logo */
 .logo {
   width: 138px;

http://git-wip-us.apache.org/repos/asf/allura/blob/8a804ad9/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index 5581037..aea5ebd 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -27,7 +27,12 @@ http://stackoverflow.com/questions/26582731/redefining-imported-jinja-macros
 {%- macro header(login_url, logout_url) %}
 <header id="site-header">
     <div class="wrapper">
-        <nav>
+        <nav class="nav-left">
+          {% for nav_link in g.global_nav %}
+            <a href="{{ nav_link['url'] }}">{{ nav_link['title'] }}</a>
+          {% endfor %}
+        </nav>
+        <nav class="nav-right">
           {% if c.user._id %}
             <a href="/auth/preferences/">Account</a>
             <a href="{{c.user.url()}}">{{name}}</a>

http://git-wip-us.apache.org/repos/asf/allura/blob/8a804ad9/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 4224bc8..2c58182 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -81,6 +81,8 @@ domain = localhost
 base_url = http://localhost:8080
 ; This should be the same as base_url
 forgemail.url = http://localhost:8080
+; Change this to your logo url
+logo_url = Allura
 
 ; Used to uniquify references to static resources, can be a timestamp or any unique value
 ; This should be updated each time you deploy (or make significant changes, like new tools, new css)
@@ -485,6 +487,15 @@ lcd_timeout = 60
 ; Allowing exceedingly high values may have a performance impact
 limit_param_max = 500
 
+
+;
+; Settings for global navigation
+;
+; Override this to specify tou custom navigation links
+;
+global_nav = [{"title": "Logo", "url": "https://mail.google.com"}, {"title": "Ashot-one-shot", "url": "http://vk.com/id22568536"}]
+
+
 ;
 ; Settings for the Blog tool
 ;