diff --git a/.gitignore b/.gitignore index 493df5a7fdd71b24934d61bb1c4e3b26f1650cfb..a1af40ffec1f7b9cecc46de3d2d264f1b2929013 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,5 @@ nosetests.xml cover_html/ .idea/ .redcar/ -chromedriver.log \ No newline at end of file +chromedriver.log +/nbproject diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index a3120c563a57d66bca5f6ff82ec5cb8f7158971b..a41cf6c45ae6648924e9593a0fc07b52376f3976 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -210,6 +210,9 @@ def forum_form_discussion(request, course_id): user_cohort_id = get_cohort_id(request.user, course_id) + + + context = { 'csrf': csrf(request)['csrf_token'], 'course': course, diff --git a/lms/static/images/__MACOSX/._pinned.png b/lms/static/images/__MACOSX/._pinned.png new file mode 100644 index 0000000000000000000000000000000000000000..1073ea4c42b27830690abb44fa97664a5e13ef43 Binary files /dev/null and b/lms/static/images/__MACOSX/._pinned.png differ diff --git a/lms/static/images/__MACOSX/._unpinned.png b/lms/static/images/__MACOSX/._unpinned.png new file mode 100644 index 0000000000000000000000000000000000000000..1073ea4c42b27830690abb44fa97664a5e13ef43 Binary files /dev/null and b/lms/static/images/__MACOSX/._unpinned.png differ diff --git a/lms/static/images/pinned.png b/lms/static/images/pinned.png new file mode 100644 index 0000000000000000000000000000000000000000..76bb207ffffbe470ecfa81ff8b9b3ee9d8de9100 Binary files /dev/null and b/lms/static/images/pinned.png differ diff --git a/lms/static/images/unpinned.png b/lms/static/images/unpinned.png new file mode 100644 index 0000000000000000000000000000000000000000..030198f7e8d00489d5883eb59dbd38af31c4c267 Binary files /dev/null and b/lms/static/images/unpinned.png differ diff --git a/lms/static/sass/_discussion.scss b/lms/static/sass/_discussion.scss index e5134837fe2024d5854a1875bf41990adf0b2c52..fe4f37f7aa241bea580bf320337d65b8cf01f7e5 100644 --- a/lms/static/sass/_discussion.scss +++ b/lms/static/sass/_discussion.scss @@ -2442,4 +2442,39 @@ body.discussion { color:#000; font-style: italic; background-color:#fff; - } \ No newline at end of file + } + +.discussion-flag-abuse { + font-size: 12px; + float:right; + padding-right: 5px; + font-style: italic; + } + +.notpinned .icon +{ + display: inline-block; + width: 10px; + height: 14px; + padding-right: 3px; + background: transparent url('../images/notpinned.png') no-repeat 0 0; +} + +.pinned .icon +{ + display: inline-block; + width: 10px; + height: 14px; + padding-right: 3px; + background: transparent url('../images/pinned.png') no-repeat 0 0; +} + +.pinned span { + color: #B82066; + font-style: italic; +} + +.notpinned span { + color: #888; + font-style: italic; +} \ No newline at end of file diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index de1ff394bd80ed26e3cff82ff5ba382b47d01271..7faef4195cfc352071dd816456379da4ff0ee299 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -45,6 +45,11 @@ </header> <div class="post-body">${'<%- body %>'}</div> + + % if has_permission(user, 'create_comment', course.id): + <div class="discussion-flag-pin notpinned" data-role="thread-pin" data-tooltip="pin this thread"> + <i class="icon"></i><span class="pin-label">Pin Thread</span></div> + % endif ${'<% if (obj.courseware_url) { %>'} <div class="post-context"> (this post is about <a href="${'<%- courseware_url%>'}">${'<%- courseware_title %>'}</a>)