You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/10/06 09:28:56 UTC

[05/13] allura git commit: [#7919] Add markup to support the NavBar

[#7919] Add markup to support the NavBar


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

Branch: refs/heads/hs/7919
Commit: c0efa47e2b7faca00e6d3f0f9a9dd0c04dbb71db
Parents: 8f6627f
Author: Heith Seewald <hs...@hsmb.local>
Authored: Tue Oct 6 03:10:38 2015 -0400
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Tue Oct 6 03:10:38 2015 -0400

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/master.html  | 18 ++++++++++++++++++
 Allura/allura/templates/jinja_master/top_nav.html |  5 +++++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c0efa47e/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index 4fde7ab..ac87d77 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -22,8 +22,14 @@
 {% if g.theme.jinja_macros %}
     {% import g.theme.jinja_macros as theme_macros with context %}
 {% endif %}
+{% set is_admin = c.project and h.has_access(c.project, 'admin')() %}
 {% do g.register_forge_js('js/jquery-base.js', location='head_js') %}
 {% do g.register_forge_js('js/jquery.notify.js') %}
+{% do g.register_forge_js('js/browser-polyfill.js') %}
+{% do g.register_forge_js('js/underscore-min.js') %}
+{% do g.register_forge_js('js/react-with-addons.min.js') %}
+{% do g.register_forge_js("js/react-drag.js") %}
+{% do g.register_forge_js('js/react-reorderable.js') %}
 {% do g.register_forge_js('js/jquery.tooltipster.js') %}
 {% do g.register_forge_js('js/modernizr.js') %}
 {% do g.register_forge_js('js/sylvester.js') %}
@@ -32,6 +38,7 @@
 {% do g.register_forge_js('js/build/transpiled.js') %}
 {% do g.register_forge_css('css/forge/hilite.css') %}
 {% do g.register_forge_css('css/forge/tooltipster.css') %}
+{% if is_admin %}{% do g.register_forge_css('css/navbar.css') %}{% endif %}
 {% do g.register_forge_css('css/font-awesome.min.css', compress=False) %}
 {% do g.register_css('/nf/tool_icon_css?' + g.build_key, compress=False) %}
 {% do g.theme.require() %}
@@ -181,5 +188,16 @@
         });
     })
 </script>
+{% if is_admin %}
+    <script>
+        'use strict';
+        $(document).ready(function () {
+            React.render(React.createElement(Main, {
+                initialData: {{ c.project.json_nav()|safe }}
+            }), document.getElementById("top_nav_admin"));
+        });
+    </script>
+{% endif %}
+{% do g.register_forge_js('/') %}
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/allura/blob/c0efa47e/Allura/allura/templates/jinja_master/top_nav.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/top_nav.html b/Allura/allura/templates/jinja_master/top_nav.html
index 8fdfb34..c433991 100644
--- a/Allura/allura/templates/jinja_master/top_nav.html
+++ b/Allura/allura/templates/jinja_master/top_nav.html
@@ -17,6 +17,10 @@
        under the License.
 -#}
 {% if c.project %}
+{% if h.has_access(c.project, 'admin')() %}
+    <div id="top_nav_admin"></div>
+    {#        {{ c.app.admin_modal.display() }}  <-- Currently Does not work on non-admin urls #}
+{% else %}
 <ul class="dropdown">
   {% for s in c.project.grouped_navbar_entries() %}
     <li class="{% if s.matches_url(request) %}selected{% endif %}">
@@ -35,3 +39,4 @@
 	{% endfor %}
 </ul>
 {% endif %}
+{% endif %}