allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject [05/11] allura git commit: [#5461] subscription option for new forum topics
Date Thu, 03 Jan 2019 14:57:10 GMT
[#5461] subscription option for new forum topics


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

Branch: refs/heads/master
Commit: 98aed3e846f65d9fa026edb23c270a6f711dc6b5
Parents: b930834
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Dec 18 17:10:39 2018 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Dec 19 12:08:05 2018 -0500

----------------------------------------------------------------------
 .../ext/user_profile/templates/send_message_form.html       | 2 +-
 Allura/allura/templates/widgets/new_topic_post.html         | 9 ++++++++-
 ForgeDiscussion/forgediscussion/controllers/root.py         | 4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/98aed3e8/Allura/allura/ext/user_profile/templates/send_message_form.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/send_message_form.html b/Allura/allura/ext/user_profile/templates/send_message_form.html
index 06e4330..279572f 100644
--- a/Allura/allura/ext/user_profile/templates/send_message_form.html
+++ b/Allura/allura/ext/user_profile/templates/send_message_form.html
@@ -48,7 +48,7 @@
             {{widget.display_field(widget.fields.cc)}}
         </div>
         <div class="grid-19">&nbsp;</div>
-        <div class="grid-19">
+        <div class="grid-12">
             {{buttons[0].display()}}
             <a href="{{c.app.url}}" class="btn link cancel_form">Cancel</a>
         </div>

http://git-wip-us.apache.org/repos/asf/allura/blob/98aed3e8/Allura/allura/templates/widgets/new_topic_post.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/new_topic_post.html b/Allura/allura/templates/widgets/new_topic_post.html
index 12f74da..46c806b 100644
--- a/Allura/allura/templates/widgets/new_topic_post.html
+++ b/Allura/allura/templates/widgets/new_topic_post.html
@@ -48,7 +48,14 @@
     </div>
     <div class="grid-19">&nbsp;</div>
     <div class="grid-19">
-      <input type="submit" value="{{submit_text}}"> <a href=".." class="btn link">Cancel</a>
+      <input type="submit" value="{{submit_text}}">
+      {% if c.user and c.user != c.user.anonymous() %}
+          {# TODO: if not already subscribed to whole tool, or to forum #}
+        <label class="subscribe">
+          <input type="checkbox" checked name="subscribe">Subscribe to this topic
+        </label>
+      {% endif %}
+      <a href=".." class="btn link cancel_form">Cancel</a>
     </div>
   {% if widget.antispam %}{% for fld in g.antispam.extra_fields() %}
   {{fld}}{% endfor %}{% endif %}

http://git-wip-us.apache.org/repos/asf/allura/blob/98aed3e8/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 0b5add6..bc70dbe 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -127,7 +127,7 @@ class RootController(BaseController, DispatchIndex, FeedController):
     @require_post()
     @validate(W.new_topic, error_handler=create_topic)
     @AntiSpam.validate('Spambot protection engaged')
-    def save_new_topic(self, subject=None, text=None, forum=None, **kw):
+    def save_new_topic(self, subject=None, text=None, forum=None, subscribe=False, **kw):
         self.rate_limit(model.ForumPost, 'Topic creation', request.referer)
         discussion = model.Forum.query.get(
             app_config_id=c.app.config._id,
@@ -138,7 +138,7 @@ class RootController(BaseController, DispatchIndex, FeedController):
         require_access(discussion, 'post')
         thd = discussion.get_discussion_thread(dict(
             headers=dict(Subject=subject)))[0]
-        p = thd.post(subject, text)
+        p = thd.post(subject, text, subscribe=subscribe)
         if 'attachment' in kw:
             p.add_multiple_attachments(kw['attachment'])
         thd.post_to_feed(p)


Mime
View raw message