Commit 84b005a1 by Arjun Singh

Removing tags for now

parent c51967ab
...@@ -3,7 +3,10 @@ if Backbone? ...@@ -3,7 +3,10 @@ if Backbone?
events: events:
"click .discussion-submit-post": "submitComment" "click .discussion-submit-post": "submitComment"
"click .thread-tag": "tagSelected"
# TODO tags
# Until we decide what to do w/ tags, removing them.
#"click .thread-tag": "tagSelected"
$: (selector) -> $: (selector) ->
@$el.find(selector) @$el.find(selector)
...@@ -23,7 +26,11 @@ if Backbone? ...@@ -23,7 +26,11 @@ if Backbone?
@renderShowView() @renderShowView()
@renderAttrs() @renderAttrs()
@renderTags()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#@renderTags()
@$("span.timeago").timeago() @$("span.timeago").timeago()
@makeWmdEditor "reply-body" @makeWmdEditor "reply-body"
@renderResponses() @renderResponses()
...@@ -33,16 +40,20 @@ if Backbone? ...@@ -33,16 +40,20 @@ if Backbone?
if @responsesRequest? if @responsesRequest?
@responsesRequest.abort() @responsesRequest.abort()
renderTags: -> # TODO tags
# tags # Until we decide what to do w/ tags, removing them.
for tag in @model.get("tags") #renderTags: ->
if !tags # # tags
tags = $('<div class="thread-tags">') # for tag in @model.get("tags")
tags.append("<a href='#' class='thread-tag'>#{tag}</a>") # if !tags
@$(".post-body").after(tags) # tags = $('<div class="thread-tags">')
# tags.append("<a href='#' class='thread-tag'>#{tag}</a>")
tagSelected: (e) -> # @$(".post-body").after(tags)
@trigger "tag:selected", $(e.target).html()
# TODO tags
# Until we decide what to do w tags, removing them.
#tagSelected: (e) ->
# @trigger "tag:selected", $(e.target).html()
renderResponses: -> renderResponses: ->
setTimeout(=> setTimeout(=>
...@@ -102,9 +113,12 @@ if Backbone? ...@@ -102,9 +113,12 @@ if Backbone?
update: (event) => update: (event) =>
newTitle = @editView.$(".edit-post-title").val() newTitle = @editView.$(".edit-post-title").val()
newTags = @editView.$(".edit-post-tags").val()
newBody = @editView.$(".edit-post-body textarea").val() newBody = @editView.$(".edit-post-body textarea").val()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#newTags = @editView.$(".edit-post-tags").val()
url = DiscussionUtil.urlFor('update_thread', @model.id) url = DiscussionUtil.urlFor('update_thread', @model.id)
DiscussionUtil.safeAjax DiscussionUtil.safeAjax
...@@ -117,7 +131,11 @@ if Backbone? ...@@ -117,7 +131,11 @@ if Backbone?
data: data:
title: newTitle title: newTitle
body: newBody body: newBody
tags: newTags
# TODO tags
# Until we decide what to do w/ tags, removing them.
#tags: newTags
error: DiscussionUtil.formErrorHandler(@$(".edit-post-form-errors")) error: DiscussionUtil.formErrorHandler(@$(".edit-post-form-errors"))
success: (response, textStatus) => success: (response, textStatus) =>
# TODO: Move this out of the callback, this makes it feel sluggish # TODO: Move this out of the callback, this makes it feel sluggish
...@@ -134,7 +152,10 @@ if Backbone? ...@@ -134,7 +152,10 @@ if Backbone?
@createShowView() @createShowView()
@renderShowView() @renderShowView()
@renderTags()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#@renderTags()
createEditView: () -> createEditView: () ->
......
...@@ -28,7 +28,10 @@ if Backbone? ...@@ -28,7 +28,10 @@ if Backbone?
@delegateEvents() @delegateEvents()
@renderShowView() @renderShowView()
@renderAttrs() @renderAttrs()
@renderTags() #TODO: Decide if we want to show tags on inline threads
# TODO tags commenting out til we decide what to do with tags
#@renderTags()
@$("span.timeago").timeago() @$("span.timeago").timeago()
@$el.find('.post-extended-content').hide() @$el.find('.post-extended-content').hide()
if @expanded if @expanded
......
...@@ -63,9 +63,11 @@ ...@@ -63,9 +63,11 @@
<div class="form-row"> <div class="form-row">
<div class="edit-post-body" name="body">${"<%- body %>"}</div> <div class="edit-post-body" name="body">${"<%- body %>"}</div>
</div> </div>
<div class="form-row"> ## TODO tags
<input type="text" class="edit-post-tags" name="tags" placeholder="Tags" value="${"<%- tags %>"}"> ## Until we decide what to do with tags, commenting them out.
</div> ##<div class="form-row">
## <input type="text" class="edit-post-tags" name="tags" placeholder="Tags" value="${"<%- tags %>"}">
##</div>
<input type="submit" class="post-update" value="Update post"> <input type="submit" class="post-update" value="Update post">
<a href="#" class="post-cancel">Cancel</a> <a href="#" class="post-cancel">Cancel</a>
</div> </div>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="sidebar"></div> <div class="sidebar"></div>
<div class="discussion-column"> <div class="discussion-column">
<div class="discussion-article blank-slate"> <div class="discussion-article blank-slate">
<h1>${course.title} discussions</h1> <h1>${course.title} Discussion</h1>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment