allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [4/5] allura git commit: [#8071] Fix "Create Wiki Page" ACL issue for non-admin groups
Date Thu, 14 Apr 2016 22:30:00 GMT
[#8071] Fix "Create Wiki Page" ACL issue for non-admin groups


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

Branch: refs/heads/hs/8071
Commit: 35eb0ea8e57509237fae447deb30204e98723147
Parents: 9585780
Author: Heith Seewald <heiths@gmail.com>
Authored: Tue Apr 12 12:44:00 2016 -0400
Committer: Heith Seewald <heiths@gmail.com>
Committed: Thu Apr 14 17:36:19 2016 -0400

----------------------------------------------------------------------
 .../allura/templates/jinja_master/master.html   |  4 +--
 .../templates/wiki/admin_add_page.html          | 34 --------------------
 .../forgewiki/templates/wiki/create_page.html   | 34 ++++++++++++++++++++
 ForgeWiki/forgewiki/wiki_main.py                | 12 +++----
 4 files changed, 42 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/35eb0ea8/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 f4ec78f..8e9754e 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -33,9 +33,9 @@
 {% do g.register_forge_css('css/forge/tooltipster.css') %}
 {% do g.register_forge_css('css/font-awesome.min.css', compress=False) %}
 {% do g.theme.require() %}
+{% do g.register_forge_js('js/admin_modal.js') %}
+{% do g.register_js('js/jquery.lightbox_me.js') %}
 {% if h.has_access(c.project, 'admin')() %}
-    {% do g.register_forge_js('js/admin_modal.js') %}
-    {% do g.register_js('js/jquery.lightbox_me.js') %}
     {# this would be better placed in top_nav.html but that file is included later so its
too late for it to register
        any css.  (Unlike other html files which are the top-level file and extend this master.html)
#}
     {% do g.register_forge_css('css/navbar.css') %}

http://git-wip-us.apache.org/repos/asf/allura/blob/35eb0ea8/ForgeWiki/forgewiki/templates/wiki/admin_add_page.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/admin_add_page.html b/ForgeWiki/forgewiki/templates/wiki/admin_add_page.html
deleted file mode 100644
index ae3c0aa..0000000
--- a/ForgeWiki/forgewiki/templates/wiki/admin_add_page.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{#-
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
--#}
-<script type="text/javascript">
-    $(function () {
-        $("form").submit(function () {
-            location.href = '{{ app.url }}' +
-                    encodeURIComponent($('input[name=name]', $(this)).val().replace(new RegExp('/',
'g'), '-')) + '/edit';
-            return false;
-        });
-    });
-</script>
-
-<form class="grid-10" method="POST">
-    <label class="grid-2">Name</label>
-    <div class="grid-7"><input type="text" name="name"></div>
-    <label class="grid-2">&nbsp;</label>
-    <div class="grid-7"><input type="submit" value="Create page"></div>
-</form>

http://git-wip-us.apache.org/repos/asf/allura/blob/35eb0ea8/ForgeWiki/forgewiki/templates/wiki/create_page.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/create_page.html b/ForgeWiki/forgewiki/templates/wiki/create_page.html
new file mode 100644
index 0000000..4a36879
--- /dev/null
+++ b/ForgeWiki/forgewiki/templates/wiki/create_page.html
@@ -0,0 +1,34 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+<script type="text/javascript">
+    $(function () {
+        $("form").submit(function () {
+            location.href = '{{ c.app.url }}' +
+                    encodeURIComponent($('input[name=name]', $(this)).val().replace(new RegExp('/',
'g'), '-')) + '/edit';
+            return false;
+        });
+    });
+</script>
+
+<form class="grid-10" method="POST">
+    <label class="grid-2">Name</label>
+    <div class="grid-7"><input type="text" name="name"></div>
+    <label class="grid-2">&nbsp;</label>
+    <div class="grid-7"><input type="submit" value="Create page"></div>
+</form>

http://git-wip-us.apache.org/repos/asf/allura/blob/35eb0ea8/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 1621f62..0c87a3c 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -219,7 +219,7 @@ The wiki uses [Markdown](%s) syntax.
     def create_common_wiki_menu(self, has_create_access, admin_menu=False):
         links = []
         if has_create_access:
-            links += [SitemapEntry('Create Page', self.admin_url + 'create_wiki_page',
+            links += [SitemapEntry('Create Page', self.url + 'create_wiki_page/',
                                    ui_icon=g.icons['add'],
                                    className='admin_modal')]
         if not admin_menu:
@@ -488,6 +488,11 @@ class RootController(BaseController, DispatchIndex, FeedController):
                     name_labels=name_labels[start:start + limit])
 
     @with_trailing_slash
+    @expose('jinja:forgewiki:templates/wiki/create_page.html')
+    def create_wiki_page(self):
+        return dict(allow_create=has_access(c.app, 'create')())
+
+    @with_trailing_slash
     @expose('jinja:allura:templates/markdown_syntax.html')
     def markdown_syntax(self):
         'Display a page about how to use markdown.'
@@ -887,11 +892,6 @@ class WikiAdminController(DefaultAdminController):
                     home=self.app.root_page_name,
                     allow_config=has_access(self.app, 'configure')())
 
-    @expose('jinja:forgewiki:templates/wiki/admin_add_page.html')
-    def create_wiki_page(self):
-        return dict(app=self.app,
-                    allow_config=has_access(self.app, 'configure')())
-
     @without_trailing_slash
     @expose('jinja:forgewiki:templates/wiki/admin_options.html')
     def options(self):


Mime
View raw message