diff --git a/Changelog.md b/Changelog.md index 3de3e3bd838cbb9aaf7d29142c351b8dd898e98c..06ee0d61d1a608d60ae609ddaf300113b42811ae 100644 --- a/Changelog.md +++ b/Changelog.md @@ -129,7 +129,7 @@ This is disabled by default since it requires the installation of additional pac * Make the source code URL configurable [#5410](https://github.com/diaspora/diaspora/pull/5410) * Prefill publisher on the tag pages [#5442](https://github.com/diaspora/diaspora/pull/5442) * Allows users to export their data in JSON format from their user settings page [#5354](https://github.com/diaspora/diaspora/pull/5354) - +* Add followed tags in the mobile menu [#5468](https://github.com/diaspora/diaspora/pull/5468) # 0.4.1.2 diff --git a/app/assets/javascripts/mobile.js b/app/assets/javascripts/mobile.js index 3584bf001e9b675f157f34600bb4d1d13f7bd8de..53177a20ffa6c678d1d29e7d5bd4d0cbc9a7556f 100644 --- a/app/assets/javascripts/mobile.js +++ b/app/assets/javascripts/mobile.js @@ -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(); diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index a01acd3615f1016fef57bc7f7fde57dac1a61fd7..28f46f71917e89f6e2133263547db3cef2140bcf 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -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 diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 967a8f63fc4a73631247243aa9af6db5f41ddf83..77d722894c8f8766ba4579d5076132dc7d639aef 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -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')