allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [21/46] allura git commit: [#7919] Add markup to support the NavBar
Date Fri, 16 Oct 2015 17:07:17 GMT
[#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/d7823062
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d7823062
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d7823062

Branch: refs/heads/db/7919
Commit: d7823062a217bf2e89080e6c100fa72af985edc1
Parents: 9475ba9
Author: Heith Seewald <hseewald@hsmb.local>
Authored: Tue Oct 6 03:10:38 2015 -0400
Committer: Heith Seewald <hseewald@hsmb.local>
Committed: Thu Oct 15 15:00:16 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/d7823062/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/d7823062/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 %}


Mime
View raw message