diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 4af8f7e9f..1a44a8f26 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -35,6 +35,7 @@ class PostsController < ApplicationController respond_to do |format| format.xml{ render :xml => @post.to_diaspora_xml } format.mobile{render 'posts/show.mobile.haml'} + format.json{ render :json => {:posts => @post.as_api_response(:backbone)}, :status => 201 } format.any{render 'posts/show.html.haml'} end diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index effc52129..9ecf343dc 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -5,10 +5,10 @@ .span-20.append-2.prepend-2.last #main_stream.stream.status_message_show - - if @post.is_a?(Photo) - = render 'posts/photo', :post => @post - - else - = render 'shared/stream_element', :post => @post, :commenting_disabled => commenting_disabled?(@post) + /- if @post.is_a?(Photo) + / = render 'posts/photo', :post => @post + /- else + / = render 'shared/stream_element', :post => @post, :commenting_disabled => commenting_disabled?(@post) %br %br %br diff --git a/app/views/templates/comment.ujs b/app/views/templates/comment.ujs index cb5e281f8..718034d34 100644 --- a/app/views/templates/comment.ujs +++ b/app/views/templates/comment.ujs @@ -2,7 +2,9 @@
<% if(author.id === current_user.id) { %> - Deletelabel + + Deletelabel + <% } %>
diff --git a/features/comments.feature b/features/comments.feature index df0509574..74c7feb0d 100644 --- a/features/comments.feature +++ b/features/comments.feature @@ -40,7 +40,7 @@ Feature: commenting Then I should see "hahaha" within "li.comment div.content" And I should see "less than a minute ago" within "li.comment time" - Scenario: delete a comment + Scenario: delete a comment When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page Then I should see "Look at this dog" @@ -48,7 +48,7 @@ Feature: commenting And I fill in "Comment" with "is that a poodle?" And I press "Comment" And I wait for the ajax to finish - When I hover over the ".comment.posted" + When I hover over the ".comment" And I preemptively confirm the alert And I click to delete the first comment And I wait for the ajax to finish @@ -66,7 +66,7 @@ Feature: commenting Then the first comment field should be closed When I focus the comment field Then the first comment field should be open - + Scenario: comment on a status show page When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index d09ea99f6..58770a555 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -7,6 +7,7 @@ end When /^I select only "([^"]*)" aspect$/ do |aspect_name| within('#aspect_nav') do + click_link 'Aspects' click_link 'Select all' if has_link? 'Select all' end diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index cbb6a0154..bc1d1d905 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -66,7 +66,7 @@ When /^I click to delete the first post$/ do end When /^I click to delete the first comment$/ do - page.execute_script('$(".comment.posted").first().find(".comment_delete").click()') + page.execute_script('$(".comment").first().find(".comment_delete").click()') end When /^I click to delete the first uploaded photo$/ do diff --git a/public/javascripts/app/router.js b/public/javascripts/app/router.js index 1b215e347..7ad506786 100644 --- a/public/javascripts/app/router.js +++ b/public/javascripts/app/router.js @@ -6,7 +6,8 @@ App.Router = Backbone.Router.extend({ "mentions": "stream", "people/:id": "stream", "tag_followings": "stream", - "tags/:name": "stream" + "tags/:name": "stream", + "posts/:id": "stream" }, stream: function() { diff --git a/public/javascripts/app/views/comment_view.js b/public/javascripts/app/views/comment_view.js index 2ea5700ee..e8aa7a692 100644 --- a/public/javascripts/app/views/comment_view.js +++ b/public/javascripts/app/views/comment_view.js @@ -4,5 +4,9 @@ App.Views.Comment = App.Views.StreamObject.extend({ events : { "click .comment_delete": "destroyModel" + }, + + postRenderTemplate : function(){ + this.$("time").timeago(); } });