allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [02/16] allura git commit: [#8230] Add interactive checkbox support for ForgeGit merge requests
Date Mon, 15 Oct 2018 16:02:26 GMT
[#8230] Add interactive checkbox support for ForgeGit merge requests


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

Branch: refs/heads/master
Commit: 81ac3b16b29988a29213699f5ea5f9648f6711a6
Parents: 521c680
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Sat Oct 13 20:30:35 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Oct 15 15:50:29 2018 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py         | 22 ++++++++++++++++++++
 Allura/allura/templates/repo/merge_request.html |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/81ac3b16/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 72de27c..ce7faa7 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -480,6 +480,28 @@ class MergeRequestController(object):
                                        related_nodes=[c.project], tags=['merge-request'])
         self.refresh()
 
+    @without_trailing_slash
+    @expose('json:')
+    @require_post()
+    def update_markdown(self, text=None, **kw):  
+        if has_access(self.req, 'write'):
+            self.req.description = text
+            self.req.commit()
+            g.director.create_activity(c.user, 'updated', self.req,
+                                       related_nodes=[c.project], tags=['merge-request'])
+            return {
+                'status' : 'success'
+            }
+        else:
+            return {
+                'status' : 'no_permission'
+            }
+
+    @expose()
+    @without_trailing_slash
+    def get_markdown(self):
+        return self.req.description
+
     @expose()
     @require_post()
     @validate(mr_dispose_form)

http://git-wip-us.apache.org/repos/asf/allura/blob/81ac3b16/Allura/allura/templates/repo/merge_request.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_request.html b/Allura/allura/templates/repo/merge_request.html
index 2b8e70d..3bee892 100644
--- a/Allura/allura/templates/repo/merge_request.html
+++ b/Allura/allura/templates/repo/merge_request.html
@@ -65,7 +65,7 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
       {{lib.abbr_date(req.mod_date)}}
     </p>
 
-    <div>{{g.markdown.convert(req.description)}}</div>
+    <div{% if h.has_access(req, 'write') %} class="active-md" data-markdownlink="" {%
endif %}>{{g.markdown.convert(req.description)}}</div>
 
     {% if error %}
       <div class='grid-19 error'>


Mime
View raw message