diff --git a/Changelog.md b/Changelog.md index 4978cd8e1902aceaf810a98a38af2436af13e331..465cc3ef455ad1eda6651a940b62ca88ea468b94 100644 --- a/Changelog.md +++ b/Changelog.md @@ -45,6 +45,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure. * Replace MBP.autogrow with autosize on mobile [#6261](https://github.com/diaspora/diaspora/pull/6261) * Improve mobile drawer transition [#6233](https://github.com/diaspora/diaspora/pull/6233) * Remove unused header icons and an unused favicon [#6283](https://github.com/diaspora/diaspora/pull/6283) +* Replace mobile icons for post interactions with Entypo icons [#6291](https://github.com/diaspora/diaspora/pull/6291) ## Bug fixes * Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) diff --git a/app/assets/images/mobile/heart_mobile_grey.png b/app/assets/images/mobile/heart_mobile_grey.png deleted file mode 100644 index 9e5ce387c799b31842aaafe0aa52b505fb503d3f..0000000000000000000000000000000000000000 Binary files a/app/assets/images/mobile/heart_mobile_grey.png and /dev/null differ diff --git a/app/assets/images/mobile/heart_mobile_red.png b/app/assets/images/mobile/heart_mobile_red.png deleted file mode 100644 index e2b5dc42b4980044bd89fdcda16985f7da83e37f..0000000000000000000000000000000000000000 Binary files a/app/assets/images/mobile/heart_mobile_red.png and /dev/null differ diff --git a/app/assets/images/mobile/reshare_mobile.png b/app/assets/images/mobile/reshare_mobile.png deleted file mode 100644 index 91883ea03128cc87f3b14068551e6fdf52c09b93..0000000000000000000000000000000000000000 Binary files a/app/assets/images/mobile/reshare_mobile.png and /dev/null differ diff --git a/app/assets/images/mobile/reshare_mobile_active.png b/app/assets/images/mobile/reshare_mobile_active.png deleted file mode 100644 index 71a1feb5b77275bbf0b0678a09e56970f7f14f74..0000000000000000000000000000000000000000 Binary files a/app/assets/images/mobile/reshare_mobile_active.png and /dev/null differ diff --git a/app/assets/javascripts/mobile/mobile.js b/app/assets/javascripts/mobile/mobile.js index 0a00b723b5c637e35af33e63c70ce3469f858aff..aeda97c76d902231c52ae8caf3e3c8e6e54a277c 100644 --- a/app/assets/javascripts/mobile/mobile.js +++ b/app/assets/javascripts/mobile/mobile.js @@ -56,7 +56,7 @@ $(document).ready(function(){ }); /* Heart toggle */ - $(".like_action", ".stream").bind("tap click", function(evt){ + $(".like-action", ".stream").bind("tap click", function(evt){ evt.preventDefault(); var link = $(this), likeCounter = $(this).closest(".stream_element").find("like_count"), @@ -99,7 +99,7 @@ $(document).ready(function(){ }); /* Reshare */ - $(".reshare_action", ".stream").bind("tap click", function(evt){ + $(".reshare-action", ".stream").bind("tap click", function(evt){ evt.preventDefault(); var link = $(this), diff --git a/app/assets/javascripts/mobile/mobile_comments.js b/app/assets/javascripts/mobile/mobile_comments.js index e2c1f6673bec7ee387bb1d1857793a808944a1db..ed50b4d7f7045d197044a9606118cd8e1d295b78 100644 --- a/app/assets/javascripts/mobile/mobile_comments.js +++ b/app/assets/javascripts/mobile/mobile_comments.js @@ -39,7 +39,7 @@ $(document).ready(function() { var bottomBar = toggleReactionsLink.closest(".bottom_bar").first(), commentsContainer = commentsContainerLazy(bottomBar), existingCommentsContainer = commentsContainer(), - commentActionLink = bottomBar.find("a.comment_action"); + commentActionLink = bottomBar.find("a.comment-action"); if (existingCommentsContainer.length > 0) { showLoadedComments(toggleReactionsLink, existingCommentsContainer, commentActionLink); } else { @@ -73,7 +73,7 @@ $(document).ready(function() { }; } - $(".stream").on("tap click", "a.comment_action", function(evt) { + $(".stream").on("tap click", "a.comment-action", function(evt) { evt.preventDefault(); showCommentBox(this); var bottomBar = $(this).closest(".bottom_bar").first(); @@ -157,7 +157,7 @@ $(document).ready(function() { function handleCommentShowing(form, bottomBar) { var formContainer = form.parent(); formContainer.remove(); - var commentActionLink = bottomBar.find("a.comment_action").first(); + var commentActionLink = bottomBar.find("a.comment-action").first(); commentActionLink.addClass("inactive"); var toggleReactionsLink = bottomBar.find(".show_comments").first(); showComments(toggleReactionsLink); diff --git a/app/assets/stylesheets/mobile/comments.scss b/app/assets/stylesheets/mobile/comments.scss new file mode 100644 index 0000000000000000000000000000000000000000..02aa6a6386982ae64dab93555734ebd8f3b8f0ab --- /dev/null +++ b/app/assets/stylesheets/mobile/comments.scss @@ -0,0 +1,51 @@ +.bottom_bar { + border-radius: 0 0 5px 5px; + z-index: 3; + display: block; + position: relative; + padding: 8px 10px 10px; + background: $background-grey; + margin-top: 10px; + border-top: 1px solid $border-grey; + min-height: 22px; + + > a, .show_comments { + @include transition(color); + color: $text-grey; + font-weight: bold; + } + + .show_comments { + position: relative; + top: 3px; + } + + a.show_comments.active:not(.bottom_collapse) { + color: $text; + padding-right: 14px; + background: { + image: image-url("mobile/arrow_down_small.png"); + position: center right; + repeat: no-repeat; + } + } + + .floater { + top: -5px; + float: right; + height: 28px; + overflow: hidden; + position: relative; + + [class^="entypo"] { + height: 90%; + margin: 0 4px; + color: $text-grey; + font-size: 24px; + &:hover, &:active, &:focus{ text-decoration: none; } + &:last-child { margin-right: 1px; } + &.entypo-reshare.active { color: $blue; } + &.entypo-heart.active { color: $red; } + } + } +} diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index b4e4e87a077058e2f58a2f0b81c6f6daeb2f1a0e..6462b31d02e58217859569cb1a6066220be0aebe 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -11,6 +11,7 @@ @import "mobile/conversations"; @import "mobile/settings"; @import "mobile/stream_element"; +@import "mobile/comments"; a { color: #2489ce; @@ -369,87 +370,6 @@ h3 { margin-top: 0; } float: right; } -.bottom_bar { - border-radius: 0 0 5px 5px; - z-index: 3; - display: block; - position: relative; - padding: 10px; - padding-top: 8px; - background: $background-grey; - - margin: { - top: 10px; }; - - border: { - top: 1px solid $border-grey; - }; - - min-height: 22px; - - > a, - .show_comments { - @include transition(color); - color: $text-grey; - font-weight: bold; - } - - .show_comments { - position: relative; - top: 3px; - color: #ccc; - } - - a.show_comments { - color: $text-grey; - - &.active:not(.bottom_collapse) { - color: #444; - padding: { - right: 14px; - } - background: { - image: image-url("mobile/arrow_down_small.png"); - position: center right; - repeat: no-repeat; - } - } - } - - #bottom_bar_tabs { - display: table; - width: 100%; - text: { - align: center; - } - border: { - bottom: 1px solid #ccc; - } - font: { - size: 28px; - } - color: #ccc; - - .tab { - display: table-cell; - position:relative; - top: -5px; - - border: { - right: 1px solid #ccc; - } - - &:last-child { - border: none; - } - } - } -} - -.floater { - float: right; -} - .photo_area { border-radius: 3px; text-align: center; } @@ -476,27 +396,6 @@ h3 { margin-top: 0; } } } -.reshare_action { - background-image: image-url("mobile/reshare_mobile.png"); - &.active { - background-image: image-url("mobile/reshare_mobile_active.png"); - } -} - -.like_action { - background-image: image-url("mobile/heart_mobile_grey.png"); - &.active { - background-image: image-url("mobile/heart_mobile_red.png"); - } -} - -.comment_action.image_link { - background-image: image-url("mobile/pencil_mobile_grey_active.png"); - &.inactive { - background-image: image-url("mobile/pencil_mobile_grey.png"); - } -} - #new_status_message { margin: 0; diff --git a/app/helpers/mobile_helper.rb b/app/helpers/mobile_helper.rb index 470038b4a881d2ac76c6a1d95e888485c437b5ca..d64fdcee0fba95797ca18e5783bc109ebf9996b1 100644 --- a/app/helpers/mobile_helper.rb +++ b/app/helpers/mobile_helper.rb @@ -1,41 +1,40 @@ module MobileHelper - def aspect_select_options(aspects, selected) - selected_id = selected == :all ? "" : selected.id - '<option value="" >All</option>\n'.html_safe + options_from_collection_for_select(aspects, "id", "name", selected_id) - end - def mobile_reshare_icon(post) if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person) absolute_root = reshare?(post) ? post.absolute_root : post if absolute_root && absolute_root.author != current_user.person - reshare = Reshare.where(:author_id => current_user.person_id, - :root_guid => absolute_root.guid).first + reshare = Reshare.where(author_id: current_user.person_id, + root_guid: absolute_root.guid).first klass = reshare.present? ? "active" : "inactive" - link_to '', reshares_path(:root_guid => absolute_root.guid), :title => t('reshares.reshare.reshare_confirmation', :author => absolute_root.author_name), :class => "image_link reshare_action #{klass}" + link_to "", reshares_path(root_guid: absolute_root.guid), + title: t("reshares.reshare.reshare_confirmation", author: absolute_root.author_name), + class: "entypo-reshare reshare-action #{klass}" end end end def mobile_like_icon(post) if current_user && current_user.liked?(post) - link_to '', post_like_path(post.id, current_user.like_for(post).id), :class => "image_link like_action active" + link_to "", post_like_path(post.id, current_user.like_for(post).id), class: "entypo-heart like-action active" else - link_to '', post_likes_path(post.id), :class => "image_link like_action inactive" + link_to "", post_likes_path(post.id), class: "entypo-heart like-action inactive" end end def mobile_comment_icon(post) - link_to '', new_post_comment_path(post), :class => "image_link comment_action inactive" + link_to "", new_post_comment_path(post), class: "entypo-comment comment-action inactive" end def reactions_link(post) reactions_count = post.comments_count + post.likes_count if reactions_count > 0 - link_to "#{t('reactions', :count => reactions_count)}", post_comments_path(post, :format => "mobile"), :class => 'show_comments' + link_to "#{t('reactions', count: reactions_count)}", + post_comments_path(post, format: "mobile"), + class: "show_comments" else html = "<span class='show_comments'>" - html << "#{t('reactions', :count => reactions_count)}" + html << "#{t('reactions', count: reactions_count)}" html << "</span>" end end diff --git a/features/mobile/activity_stream.feature b/features/mobile/activity_stream.feature index dcb9f615a7e88071f505851a741d5a14e7a1e031..d63961290d6a46d9cf74ac6368c83dd6c6922cbe 100644 --- a/features/mobile/activity_stream.feature +++ b/features/mobile/activity_stream.feature @@ -16,7 +16,7 @@ Feature: Viewing my activity on the steam mobile page And I should not see "Hello! I am #newhere" Scenario: Show post on my activity - When I click on selector "a.image_link.like_action.inactive" + When I click on selector "a.like-action.inactive" And I open the drawer And I follow "My activity" Then I should see "My activity" diff --git a/features/mobile/logged_out_browsing.feature b/features/mobile/logged_out_browsing.feature index cbab125a42a171327c1c17a7dd20db5cd5e11376..0eedca98307cc8044bc691a7f5a358e499792ffe 100644 --- a/features/mobile/logged_out_browsing.feature +++ b/features/mobile/logged_out_browsing.feature @@ -8,7 +8,7 @@ Feature: Browsing Diaspora as a logged out user mobile Given a user named "Bob Jones" with email "bob@bob.bob" And "bob@bob.bob" has a public post with text "public stuff" And I sign in as "bob@bob.bob" - And I click on selector "a.image_link.comment_action.inactive" + And I click on selector "a.comment-action.inactive" And I fill in the following: | text | this also | And I press "Comment" diff --git a/features/mobile/not_safe_for_work.feature b/features/mobile/not_safe_for_work.feature index ad510329c1ae5d2971568120d741c53bab30fb16..4a4e784b2eaee1dcf3b7af2efa71c25582c24907 100644 --- a/features/mobile/not_safe_for_work.feature +++ b/features/mobile/not_safe_for_work.feature @@ -45,7 +45,7 @@ Feature: Not safe for work And I toggle all nsfw posts And I follow "Reshare" And I confirm the alert - Then I should see a "a.image_link.reshare_action.active" + Then I should see a "a.reshare-action.active" When I go to the home page Then I should not see "Sexy Senators Gone Wild!" @@ -59,7 +59,7 @@ Feature: Not safe for work And I toggle all nsfw posts And I follow "Reshare" And I confirm the alert - Then I should see a "a.image_link.reshare_action.active" + Then I should see a "a.reshare-action.active" When I go to the home page Then I should not see "Sexy Senators Gone Wild!" @@ -73,7 +73,7 @@ Feature: Not safe for work And I toggle all nsfw posts And I follow "Reshare" And I confirm the alert - Then I should see a "a.image_link.reshare_action.active" + Then I should see a "a.reshare-action.active" When I go to the home page Then I should not see "Sexy Senators Gone Wild!" diff --git a/features/mobile/reactions.feature b/features/mobile/reactions.feature index f6ff67f9d8ed986bbd25a5e079739163b0e1b723..20e09f0dd5da5e78501eef09d105677b92359382 100644 --- a/features/mobile/reactions.feature +++ b/features/mobile/reactions.feature @@ -16,15 +16,15 @@ Feature: reactions mobile post Scenario: like on a mobile post When I should see "No reactions" within ".show_comments" And I click on selector "span.show_comments" - And I click on selector "a.image_link.like_action.inactive" - Then I should see a "a.image_link.like_action.active" + And I click on selector "a.like-action.inactive" + Then I should see a "a.like-action.active" When I go to the stream page And I should see "1 reaction" within ".show_comments" And I click on selector "a.show_comments" Then I should see "1" within ".like_count" Scenario: comment and delete a mobile post - When I click on selector "a.image_link.comment_action.inactive" + When I click on selector "a.comment-action.inactive" And I fill in the following: | text | is that a poodle? | And I press "Comment" @@ -33,7 +33,7 @@ Feature: reactions mobile post And I should see "1 reaction" within ".show_comments" And I click on selector "a.show_comments" And I should see "1" within ".comment_count" - When I click on selector "a.image_link.comment_action" + When I click on selector "a.comment-action" And I click on selector "a.remove" And I confirm the alert Then I should not see "1 reaction" within ".show_comments" diff --git a/features/mobile/reshare.feature b/features/mobile/reshare.feature index a072b97e182393ce5ec1ebd24591c31f0090bc50..1a84b70793d16af896678492db31365be10f272a 100644 --- a/features/mobile/reshare.feature +++ b/features/mobile/reshare.feature @@ -16,18 +16,18 @@ Feature: resharing from the mobile And I sign in as "alice@alice.alice" Scenario: Resharing a post from a single post page - And I click on selector "a.image_link.reshare_action.inactive" + And I click on selector "a.reshare-action.inactive" And I confirm the alert - Then I should see a "a.image_link.reshare_action.active" + Then I should see a "a.reshare-action.active" When I go to the stream page Then I should see "Reshared via" within ".reshare_via" Scenario: Resharing a post from a single post page that is reshared Given the post with text "reshare this!" is reshared by "eve@eve.eve" And a user with email "alice@alice.alice" is connected with "eve@eve.eve" - And I click on the first selector "a.image_link.reshare_action.inactive" + And I click on the first selector "a.reshare-action.inactive" And I confirm the alert - Then I should see a "a.image_link.reshare_action.active" + Then I should see a "a.reshare-action.active" When I go to the stream page Then I should see "Reshared via" within ".reshare_via" diff --git a/spec/helpers/mobile_helper_spec.rb b/spec/helpers/mobile_helper_spec.rb deleted file mode 100644 index c506b3b3ce6fdafc18bb8af09280e6908ba459a8..0000000000000000000000000000000000000000 --- a/spec/helpers/mobile_helper_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe MobileHelper, :type => :helper do - - describe "#aspect_select_options" do - it "adds an all option to the list of aspects" do - # options_from_collection_for_select(@aspects, "id", "name", @aspect.id) - - n = FactoryGirl.create(:aspect) - - options = aspect_select_options([n], n).split('\n') - expect(options.first).to match(/All/) - end - end -end \ No newline at end of file