Return-Path: X-Original-To: apmail-allura-commits-archive@www.apache.org Delivered-To: apmail-allura-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2545E17CA8 for ; Fri, 15 May 2015 16:07:42 +0000 (UTC) Received: (qmail 85828 invoked by uid 500); 15 May 2015 16:07:42 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 85808 invoked by uid 500); 15 May 2015 16:07:42 -0000 Mailing-List: contact commits-help@allura.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@allura.apache.org Delivered-To: mailing list commits@allura.apache.org Received: (qmail 85755 invoked by uid 99); 15 May 2015 16:07:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2015 16:07:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DE620E0978; Fri, 15 May 2015 16:07:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heiths@apache.org To: commits@allura.apache.org Date: Fri, 15 May 2015 16:07:41 -0000 Message-Id: <15fadc5600f24faf965442e3ffe5f9df@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/14] allura git commit: [#6107] ticket:748 Added option for allowing email postings to ForgeWiki app 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 Authored: Sun Apr 26 22:50:14 2015 +0300 Committer: Igor Bondarenko 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 @@ {{app.show_right_bar}} {% endif %} + +
+ {% if allow_config %} + + {% else %} + {{app.allow_email_posting}} + {% endif %} +
 

 
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 ` @@ -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')