diff --git a/Changelog.md b/Changelog.md index 42102ecd1..8cc0b22b2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -52,6 +52,7 @@ * Implement tag search autocomplete in header search box [#4169](https://github.com/diaspora/diaspora/issues/4169) * Uncheck 'make contacts visible to each other' by default when adding new aspect. [#4343](https://github.com/diaspora/diaspora/issues/4343) * Add possibility to ask for Bitcoin donations [#4375](https://github.com/diaspora/diaspora/pull/4375) +* Remove posts and private conversations from the mobile site. [#4408](https://github.com/diaspora/diaspora/pull/4408) # 0.1.1.0 diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 1accee538..76c3795ba 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -1272,3 +1272,10 @@ input#q.search { } } } + +.remove_post { + position: absolute; + top: 2px; + right: 5px; + opacity: 0.5; +} diff --git a/app/views/conversations/_show.mobile.haml b/app/views/conversations/_show.mobile.haml new file mode 100644 index 000000000..907c4c423 --- /dev/null +++ b/app/views/conversations/_show.mobile.haml @@ -0,0 +1,27 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.conversation_participants + .right + = link_to(image_tag('deletelabel.png'), conversation_visibility_path(conversation), :method => 'delete', :data => { :confirm => "#{t('.delete')}?" }, :class => "remove") + + %h3{ :class => direction_for(conversation.subject) } + = conversation.subject + + - for participant in conversation.participants + = person_image_link(participant, :size => :thumb_small) + +.span-15.last + .stream + = render :partial => 'messages/message', :collection => conversation.messages + + .stream_element.new_message + .media + .img + = owner_image_tag(:thumb_small) + + .bd + = form_for [conversation, Message.new] do |message| + = message.text_area :text, :rows => 5, :tabindex => 1 + = message.submit t('.reply').capitalize, 'data-disable-with' => t('.replying'), :class => 'button creation', :tabindex => 2 diff --git a/app/views/shared/_post_info.mobile.haml b/app/views/shared/_post_info.mobile.haml index b1c7bdfe8..dce2721be 100644 --- a/app/views/shared/_post_info.mobile.haml +++ b/app/views/shared/_post_info.mobile.haml @@ -5,6 +5,11 @@ .from = person_image_link(post.author, :size => :thumb_small) = person_link(post.author) + + .remove_post + - if post.author == current_user.person + = link_to(image_tag('deletelabel.png'), post_path(post), :method => :delete, :data => { :confirm => "#{t('are_you_sure')}" }, :class => "remove") + .info %span.time{:integer => post.created_at.to_i} = link_to(t('ago', :time => time_ago_in_words(post.created_at)), post_path(post)) diff --git a/features/conversations_mobile.feature b/features/conversations_mobile.feature index 6f15050b1..f365c68ca 100644 --- a/features/conversations_mobile.feature +++ b/features/conversations_mobile.feature @@ -11,7 +11,7 @@ Feature: private messages mobile And a user with username "bob" is connected with "alice_awesome" And I toggle the mobile view - Scenario: send a mobile message + Scenario: send and delete a mobile message Given I send a mobile message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" Then I should see "Greetings" within ".ltr" And I should see "Greetings" within ".ltr" @@ -22,3 +22,6 @@ Feature: private messages mobile And I reply with "hey, how you doing?" And I press the first ".ltr" within ".conversation" Then I should see "hey, how you doing?" + When I click on selector "a.remove" + And I confirm the alert + Then I should not see "hey, how you doing" diff --git a/features/posts_from_main_page_mobile.feature b/features/posts_from_main_page_mobile.feature index 5c5356b7c..9a62b544e 100644 --- a/features/posts_from_main_page_mobile.feature +++ b/features/posts_from_main_page_mobile.feature @@ -18,13 +18,16 @@ Feature: posting from the mobile main page And I have user with username "alice" in an aspect called "PostingTo" And I have user with username "alice" in an aspect called "NotPostingThingsHere" - Scenario: posting some text + Scenario: post and delete some text Given I publisher mobile page And I append "I am eating yogurt" to the publisher mobile And I select "Unicorns" from "aspect_ids_" And I press "Share" When I visit the mobile stream page Then I should see "I am eating yogurt" + When I click on selector "a.remove" + And I confirm the alert + Then I should not see "I am eating yogurt" Scenario: post a photo without text Given I publisher mobile page