Add followed tags to the mobile menu

This commit is contained in:
Flaburgan 2014-12-09 15:39:48 +01:00 committed by flaburgan
parent 731adffa78
commit f9e9a0521d
4 changed files with 20 additions and 8 deletions

View file

@ -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

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')