Merge pull request #5468 from Flaburgan/add-followed-tags-to-mobile-menu

Add followed tags to the mobile menu

Conflicts:
	Changelog.md
This commit is contained in:
Jonne Haß 2015-01-06 14:35:37 +01:00
commit 3f49bc52f4
7 changed files with 109 additions and 9 deletions

View file

@ -137,6 +137,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
* Allows users to export their data in JSON format from their user settings page [#5354](https://github.com/diaspora/diaspora/pull/5354)
* Don't include the content of non-public posts into notification mails [#5494](https://github.com/diaspora/diaspora/pull/5494)
* Allow to set unhosted button and currency for paypal donation [#5452](https://github.com/diaspora/diaspora/pull/5452)
* Add followed tags in the mobile menu [#5468](https://github.com/diaspora/diaspora/pull/5468)
# 0.4.1.2

View file

@ -40,6 +40,12 @@ $(document).ready(function(){
$("#all_aspects + li").toggleClass('hide');
});
/* Show / hide followed tags in the drawer */
$('#followed_tags').bind("tap click", function(evt){
evt.preventDefault();
$("#followed_tags + li").toggleClass('hide');
});
/* Heart toggle */
$(".like_action", ".stream").bind("tap click", function(evt){
evt.preventDefault();

View file

@ -1,17 +1,16 @@
module TagsHelper
def looking_for_tag_link
return if search_query.include?('@') || normalized_tag_name.blank?
return if search_query.include?('@') || normalize_tag_name(search_query).blank?
content_tag('small') do
t('people.index.looking_for', :tag_link => tag_link).html_safe
t('people.index.looking_for', tag_link: tag_link(search_query)).html_safe
end
end
def normalized_tag_name
ActsAsTaggableOn::Tag.normalize(search_query)
def normalize_tag_name(tag)
ActsAsTaggableOn::Tag.normalize(tag.to_s)
end
def tag_link
tag = normalized_tag_name
link_to("##{tag}", tag_path(:name => tag))
def tag_link(tag)
link_to("##{tag}", tag_path(name: normalize_tag_name(tag)))
end
end

View file

@ -91,6 +91,13 @@
- current_user.aspects.each do |aspect|
%li
= link_to aspect.name, aspects_stream_path(a_ids: [aspect.id])
%li#followed_tags
= link_to t('streams.followed_tag.title'), "#"
%li.no_border.hide
%ul
- current_user.followed_tags.each do |tag|
%li
= tag_link(tag)
%li
= link_to user_profile_path(current_user.username) do
= t('layouts.header.profile')

View file

@ -0,0 +1,87 @@
@javascript
Feature: Naviguate between pages using the header menu and the drawer
As a user
I want to be able naviguate between the pages of the mobile version
Background:
Given following users exist:
| username | email |
| Bob Jones | bob@bob.bob |
| Alice Smith | alice@alice.alice |
And I sign in as "alice@alice.alice"
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And I search for "#boss"
And I press "Follow #boss"
And I toggle the mobile view
Scenario: naviguate to the stream page
When I open the drawer
And I follow "My Activity"
And I click on selector "#header_title"
Then I should see "There are no posts yet." within "#main_stream"
Scenario: naviguate to the notification page
When I click on selector "#notification_badge"
Then I should see "Notifications" within "#main"
Scenario: naviguate to the conversation page
When I click on selector "#conversations_badge"
Then I should see "Inbox" within "#main"
Scenario: naviguate to the publisher page
When I click on selector "#compose_badge"
Then I should see "All Aspects" within "#new_status_message"
Scenario: search a user
When I open the drawer
And I search for "Bob"
Then I should see "Users matching Bob" within "#search_title"
Scenario: search for a tag
When I open the drawer
And I search for "#bob"
Then I should see "#bob" within "#main > h1"
Scenario: naviguate to my activity page
When I open the drawer
And I follow "My Activity"
Then I should see "My Activity" within "#main"
Scenario: naviguate to my mentions page
Given Alice has a post mentioning Bob
And I sign in as "bob@bob.bob"
When I open the drawer
And I follow "@Mentions"
Then I should see "Bob Jones" within ".stream_element"
Scenario: naviguate to my aspects page
Given "bob@bob.bob" has a public post with text "bob's text"
When I open the drawer
And I follow "My Aspects"
Then I should see "Besties" within "#all_aspects + li > ul"
And I follow "Besties"
Then I should see "bob's text" within "#main_stream"
Scenario: naviguate to the followed tags page
Given "bob@bob.bob" has a public post with text "bob is da #boss"
When I open the drawer
And I follow "#Followed Tags"
Then I should see "#boss" within "#followed_tags + li > ul"
And I follow "#boss"
Then I should see "bob is da #boss" within "#main_stream"
Scenario: naviguate to my profile page
When I open the drawer
And I follow "Profile"
Then I should see "Alice" within "#author_info"
Scenario: naviguate to my mentions page
When I open the drawer
And I follow "Contacts"
Then I should see "Contacts" within "#main"
Scenario: naviguate to my mentions page
When I open the drawer
And I follow "Settings"
Then I should see "Settings" within "#main"

View file

@ -175,7 +175,7 @@ end
When /^I search for "([^\"]*)"$/ do |search_term|
fill_in "q", :with => search_term
find_field("q").native.send_key(:enter)
find("#tags_show .span3")
have_content(search_term)
end
Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|

View file

@ -14,7 +14,7 @@ describe TagsHelper, :type => :helper do
it 'returns a link to the tag otherwise' do
allow(helper).to receive(:search_query).and_return('foo')
expect(helper.looking_for_tag_link).to include(helper.tag_link)
expect(helper.looking_for_tag_link).to include(helper.tag_link('foo'))
end
end
end