allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [01/14] allura git commit: [#6107] ticket:748 Added option for allowing email postings to ForgeWiki app
Date Fri, 15 May 2015 16:07:41 GMT
Repository: allura
Updated Branches:
  refs/heads/master 31189d43d -> 7ee69bf9a


[#6107] ticket:748 Added option for allowing email postings to ForgeWiki app


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

Branch: refs/heads/master
Commit: 17fe2630817e38379c5a1cc71ab04c9fc2d57fd5
Parents: 5fb3693
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Sun Apr 26 22:50:14 2015 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Wed Apr 29 09:40:22 2015 +0000

----------------------------------------------------------------------
 .../forgewiki/templates/wiki/admin_options.html    |  8 ++++++++
 ForgeWiki/forgewiki/wiki_main.py                   | 17 +++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/17fe2630/ForgeWiki/forgewiki/templates/wiki/admin_options.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/admin_options.html b/ForgeWiki/forgewiki/templates/wiki/admin_options.html
index 4972422..969d209 100644
--- a/ForgeWiki/forgewiki/templates/wiki/admin_options.html
+++ b/ForgeWiki/forgewiki/templates/wiki/admin_options.html
@@ -42,6 +42,14 @@
         <span>{{app.show_right_bar}}</span>
       {% endif %}
     </div>
+    <label class="grid-4">Allow posting replies via email:</label>
+    <div class="grid-9">
+      {% if allow_config %}
+        <input type="checkbox" name="allow_email_posting" id="allow_email_posting"{% if
app.allow_email_posting %} checked="checked"{% endif %}/>
+      {% else %}
+        <span>{{app.allow_email_posting}}</span>
+      {% endif %}
+    </div>
     <div class="grid-13">&nbsp;</div>
     <hr>
     <div class="grid-13">&nbsp;</div>

http://git-wip-us.apache.org/repos/asf/allura/blob/17fe2630/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index a5b3d3e..9a2da41 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -33,7 +33,7 @@ from ming.orm import session
 # Pyforge-specific imports
 from allura import model as M
 from allura.lib import helpers as h
-from allura.app import Application, SitemapEntry, DefaultAdminController
+from allura.app import Application, SitemapEntry, DefaultAdminController, ConfigOption
 from allura.lib.search import search_app
 from allura.lib.decorators import require_post
 from allura.lib.security import require_access, has_access
@@ -93,6 +93,9 @@ class ForgeWikiApp(Application):
         'delete': 'Delete wiki pages.',
         'admin': 'Set permissions. Configure options. Set wiki home page.',
     }
+    config_options = Application.config_options + [
+        ConfigOption('AllowEmailPosting', bool, True)
+    ]
     searchable = True
     exportable = True
     tool_label = 'Wiki'
@@ -183,6 +186,14 @@ The wiki uses [Markdown](%s) syntax.
     def show_right_bar(self, show):
         self.config.options['show_right_bar'] = bool(show)
 
+    @Property
+    def allow_email_posting():
+        def fget(self):
+            return self.config.options.get('AllowEmailPosting', True)
+
+        def fset(self, show):
+            self.config.options['AllowEmailPosting'] = bool(show)
+
     def main_menu(self):
         '''Apps should provide their entries to be added to the main nav
         :return: a list of :class:`SitemapEntries <allura.app.SitemapEntry>`
@@ -842,9 +853,11 @@ class WikiAdminController(DefaultAdminController):
     @without_trailing_slash
     @expose()
     @require_post()
-    def set_options(self, show_discussion=False, show_left_bar=False, show_right_bar=False):
+    def set_options(self, show_discussion=False, show_left_bar=False, show_right_bar=False,
+                    allow_email_posting=False):
         self.app.show_discussion = show_discussion
         self.app.show_left_bar = show_left_bar
         self.app.show_right_bar = show_right_bar
+        self.app.allow_email_posting = allow_email_posting
         flash('Wiki options updated')
         redirect(c.project.url() + 'admin/tools')


Mime
View raw message