allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [03/50] [abbrv] allura git commit: [#7919] Add markup to support the NavBar
Date Fri, 30 Oct 2015 20:55:22 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/f645bd73
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f645bd73
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f645bd73

Branch: refs/heads/db/7919
Commit: f645bd7334548dc07214f4b29e2d2eda675bcfe3
Parents: f53fc0f
Author: Heith Seewald <hseewald@hsmb.local>
Authored: Tue Oct 6 03:10:38 2015 -0400
Committer: Heith Seewald <hseewald@hsmb.local>
Committed: Thu Oct 29 20:21:29 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/allura/blob/f645bd73/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 fd5a83e..1a7f11c 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.theme.require() %}
 {% do g.resource_manager.register_widgets(c) %}
@@ -180,5 +187,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/f645bd73/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 f609bd6..c433991 100644
--- a/Allura/allura/templates/jinja_master/top_nav.html
+++ b/Allura/allura/templates/jinja_master/top_nav.html
@@ -17,10 +17,14 @@
        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 %}">
-        <a href="{{s.url}}" class="tool-{{(s.tool_name or 'unknown').lower()}}">
+        <a href="{{s.url}}" class="ui-icon-tool-{{(s.tool_name or 'admin').lower()}}-32">
             {{s.label}}
         </a>
         {% set grouped_tool_count = s.matching_urls|length %}
@@ -34,4 +38,5 @@
     </li>
 	{% endfor %}
 </ul>
-{% endif %}
\ No newline at end of file
+{% endif %}
+{% endif %}


Mime
View raw message