Skip to content
Extraits de code Groupes Projets
Valider 3f49bc52 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

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

Add followed tags to the mobile menu

Conflicts:
	Changelog.md
parents e94e9add 3ff29860
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -137,6 +137,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a ...@@ -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) * 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) * 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) * 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 # 0.4.1.2
......
...@@ -40,6 +40,12 @@ $(document).ready(function(){ ...@@ -40,6 +40,12 @@ $(document).ready(function(){
$("#all_aspects + li").toggleClass('hide'); $("#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 */ /* Heart toggle */
$(".like_action", ".stream").bind("tap click", function(evt){ $(".like_action", ".stream").bind("tap click", function(evt){
evt.preventDefault(); evt.preventDefault();
......
module TagsHelper module TagsHelper
def looking_for_tag_link 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 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
end end
def normalized_tag_name def normalize_tag_name(tag)
ActsAsTaggableOn::Tag.normalize(search_query) ActsAsTaggableOn::Tag.normalize(tag.to_s)
end end
def tag_link def tag_link(tag)
tag = normalized_tag_name link_to("##{tag}", tag_path(name: normalize_tag_name(tag)))
link_to("##{tag}", tag_path(:name => tag))
end end
end end
...@@ -91,6 +91,13 @@ ...@@ -91,6 +91,13 @@
- current_user.aspects.each do |aspect| - current_user.aspects.each do |aspect|
%li %li
= link_to aspect.name, aspects_stream_path(a_ids: [aspect.id]) = 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 %li
= link_to user_profile_path(current_user.username) do = link_to user_profile_path(current_user.username) do
= t('layouts.header.profile') = t('layouts.header.profile')
......
@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"
...@@ -175,7 +175,7 @@ end ...@@ -175,7 +175,7 @@ end
When /^I search for "([^\"]*)"$/ do |search_term| When /^I search for "([^\"]*)"$/ do |search_term|
fill_in "q", :with => search_term fill_in "q", :with => search_term
find_field("q").native.send_key(:enter) find_field("q").native.send_key(:enter)
find("#tags_show .span3") have_content(search_term)
end end
Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value| Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|
......
...@@ -14,7 +14,7 @@ describe TagsHelper, :type => :helper do ...@@ -14,7 +14,7 @@ describe TagsHelper, :type => :helper do
it 'returns a link to the tag otherwise' do it 'returns a link to the tag otherwise' do
allow(helper).to receive(:search_query).and_return('foo') 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 end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter