You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/03/07 19:01:53 UTC

git commit: [#5864] ticket:285 Admin tool the last tool for all projects

Updated Branches:
  refs/heads/master ef117186f -> 74dbc8e12


[#5864] ticket:285 Admin tool the last tool for all projects


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

Branch: refs/heads/master
Commit: 74dbc8e12cbc4933bb5f8d7a26b9c33707e55946
Parents: ef11718
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed Mar 6 13:17:27 2013 +0400
Committer: Cory Johns <jo...@geek.net>
Committed: Thu Mar 7 18:01:30 2013 +0000

----------------------------------------------------------------------
 .../allura/ext/admin/templates/project_tools.html  |    2 +-
 Allura/allura/model/project.py                     |    1 +
 Allura/allura/tests/model/test_project.py          |    7 +++++++
 3 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/74dbc8e1/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
index 1029e31..30005e3 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -52,7 +52,7 @@
             {% set links = app.admin_menu() %}
             {% set label = mount['ac'].options['mount_label'] if mount['ac'].options['mount_label'] != 'Tool Name' else mount['ac'].options['mount_point'] %}
 
-            <div class="fleft {%if app.tool_label.lower() in app.project.neighborhood.get_anchored_tools().keys()%}isnt_sorted{%endif%}">
+            <div class="fleft {%if app.tool_label.lower()=='admin' or (app.tool_label.lower() in app.project.neighborhood.get_anchored_tools().keys())%}isnt_sorted{%endif%}">
                 <ul class="deck">
                     <li class="tcenter">
                         <span class="tool_title">{{ label }}</span><br />

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/74dbc8e1/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index d894ae0..9f07f67 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -395,6 +395,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         anchored_tools = self.neighborhood.get_anchored_tools()
         i = len(anchored_tools)
         new_tools = self.install_anchored_tools()
+        self.app_config('admin').options.ordinal = 100
 
         # Set menu mode
         delta_ordinal = i

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/74dbc8e1/Allura/allura/tests/model/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_project.py b/Allura/allura/tests/model/test_project.py
index 5303928..5277d34 100644
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -78,3 +78,10 @@ def test_anchored_tools():
     assert c.project.sitemap()[0].label == 'Wiki'
     assert c.project.install_app.call_args[0][0] == 'tickets'
     assert c.project.ordered_mounts()[0]['ac'].tool_name == 'Wiki'
+
+
+def test_set_ordinal_to_admin_tool():
+    assert c.project.sitemap()
+    assert c.project.app_config('admin').options.ordinal == 100
+
+