allura-commits mailing list archives

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


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

Branch: refs/heads/master
Commit: 84100613a3f7543c0d73d05650163290998662d1
Parents: 0d65263
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Wed Oct 10 21:44:20 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Oct 15 15:50:29 2018 +0000

----------------------------------------------------------------------
 .../templates/discussionforums/thread.html      | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/84100613/ForgeDiscussion/forgediscussion/templates/discussionforums/thread.html
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/templates/discussionforums/thread.html b/ForgeDiscussion/forgediscussion/templates/discussionforums/thread.html
index 90a2ff5..6af3679 100644
--- a/ForgeDiscussion/forgediscussion/templates/discussionforums/thread.html
+++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/thread.html
@@ -41,3 +41,25 @@
 {% block content %}
   {{c.thread.display(value=thread, page=page, limit=limit, count=count)}}
 {% endblock %}
+
+{% block extra_js %}
+    {% if h.has_access(thread, 'moderate') %}
+        <script>
+                new Checklists(".active-md", function(checkbox, callback) {
+                var uri = $(checkbox).closest('.active-md').data('markdownlink');
+                $.get(uri + 'get_markdown', callback);
+            }, function(markdown, checkbox, callback) {
+                var uri = $(checkbox).closest('.active-md').data('markdownlink');
+                $.ajax({
+                    type: 'post',
+                    url: uri + 'update_markdown',
+                    data: {
+                        'text' : markdown,
+                        '_session_id' : $.cookie('_session_id')
+                    },
+                    success: callback
+                });
+            });
+        </script>
+    {% endif %}
+{% endblock %}


Mime
View raw message