diff --git a/lms/static/coffee/src/discussion/views/discussion_content_view.coffee b/lms/static/coffee/src/discussion/views/discussion_content_view.coffee index 98f0eb6137..7a7ae55249 100644 --- a/lms/static/coffee/src/discussion/views/discussion_content_view.coffee +++ b/lms/static/coffee/src/discussion/views/discussion_content_view.coffee @@ -4,8 +4,12 @@ if Backbone? attrRenderer: endorsed: (endorsed) -> if endorsed - @$(".action-endorse").addClass("is-endorsed") + @$(".action-endorse").show().addClass("is-endorsed") else + if not @model.get('ability').can_endorse + @$(".action-endorse").hide() + else + @$(".action-endorse").show() @$(".action-endorse").removeClass("is-endorsed") closed: (closed) -> @@ -47,8 +51,14 @@ if Backbone? enable: -> @$(".action-delete").closest("li").show() disable: -> @$(".action-delete").closest("li").hide() can_endorse: - enable: -> @$(".action-endorse").css("cursor", "auto") - disable: -> @$(".action-endorse").css("cursor", "default") + enable: -> + @$(".action-endorse").show().css("cursor", "auto") + disable: -> + @$(".action-endorse").css("cursor", "default") + if not @model.get('endorsed') + @$(".action-endorse").hide() + else + @$(".action-endorse").show() can_openclose: enable: -> @$(".action-openclose").closest("li").show() disable: -> @$(".action-openclose").closest("li").hide() diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index ea70ac2910..f62e65a4bf 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -92,7 +92,7 @@