in the getting started featured tags are now followable
This commit is contained in:
parent
494ab8b13b
commit
461cb22109
8 changed files with 55 additions and 25 deletions
|
|
@ -16,6 +16,7 @@ class ApplicationController < ActionController::Base
|
||||||
inflection_method :grammatical_gender => :gender
|
inflection_method :grammatical_gender => :gender
|
||||||
|
|
||||||
helper_method :all_aspects, :all_contacts_count, :my_contacts_count, :only_sharing_count
|
helper_method :all_aspects, :all_contacts_count, :my_contacts_count, :only_sharing_count
|
||||||
|
helper_method :tags, :tag_followings
|
||||||
|
|
||||||
def ensure_http_referer_is_set
|
def ensure_http_referer_is_set
|
||||||
request.env['HTTP_REFERER'] ||= '/aspects'
|
request.env['HTTP_REFERER'] ||= '/aspects'
|
||||||
|
|
@ -117,4 +118,18 @@ class ApplicationController < ActionController::Base
|
||||||
def after_sign_in_path_for(resource)
|
def after_sign_in_path_for(resource)
|
||||||
stored_location_for(:user) || (current_user.getting_started? ? getting_started_path : aspects_path)
|
stored_location_for(:user) || (current_user.getting_started? ? getting_started_path : aspects_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_followings
|
||||||
|
if current_user
|
||||||
|
if @tag_followings == nil
|
||||||
|
@tag_followings = current_user.tag_followings
|
||||||
|
end
|
||||||
|
@tag_followings
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def tags
|
||||||
|
@tags ||= current_user.followed_tags
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ class AspectsController < ApplicationController
|
||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
respond_to :json, :only => [:show, :create]
|
respond_to :json, :only => [:show, :create]
|
||||||
|
|
||||||
helper_method :tags, :tag_followings
|
|
||||||
helper_method :selected_people
|
helper_method :selected_people
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
@ -138,19 +137,6 @@ class AspectsController < ApplicationController
|
||||||
params[:max_time] ||= Time.now + 1
|
params[:max_time] ||= Time.now + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_followings
|
|
||||||
if current_user
|
|
||||||
if @tag_followings == nil
|
|
||||||
@tag_followings = current_user.tag_followings
|
|
||||||
end
|
|
||||||
@tag_followings
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def tags
|
|
||||||
@tags ||= current_user.followed_tags
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def save_sort_order
|
def save_sort_order
|
||||||
if params[:sort_order].present?
|
if params[:sort_order].present?
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ class TagFollowingsController < ApplicationController
|
||||||
flash[:error] = I18n.t('tag_followings.create.failure', :name => params[:name])
|
flash[:error] = I18n.t('tag_followings.create.failure', :name => params[:name])
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to tag_path(:name => params[:name])
|
redirect_to :back
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /tag_followings/1
|
# DELETE /tag_followings/1
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,16 @@ module GettingStartedHelper
|
||||||
t('users.getting_started.welcome')
|
t('users.getting_started.welcome')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_link(tag_name)
|
||||||
|
if tag_followed?(tag_name)
|
||||||
|
link_to "##{tag_name}", tag_followings_path(tag_name), :method => :delete, :class => "featured_tag followed"
|
||||||
|
else
|
||||||
|
link_to "##{tag_name}", tag_tag_followings_path(tag_name), :method => :post, :class => "featured_tag"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def tag_followed?(tag_name)
|
||||||
|
tags.detect{|t| t.name == tag_name}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
= t('aspects.index.tags_following')
|
= t('aspects.index.tags_following')
|
||||||
|
|
||||||
%ul.sub_nav
|
%ul.sub_nav
|
||||||
- if current_user.followed_tags.size > 0
|
- if tags.size > 0
|
||||||
- for tg in current_user.followed_tags
|
- for tg in tags
|
||||||
%li.unfollow{:id => tg.name}
|
%li.unfollow{:id => tg.name}
|
||||||
.unfollow_icon.hidden
|
.unfollow_icon.hidden
|
||||||
= link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name
|
= link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name
|
||||||
|
|
|
||||||
|
|
@ -139,13 +139,9 @@
|
||||||
%h4{:style => "margin-top:7px;"}
|
%h4{:style => "margin-top:7px;"}
|
||||||
= t('.featured_tags')
|
= t('.featured_tags')
|
||||||
%p
|
%p
|
||||||
= link_to "#diaspora", tag_path('diaspora'), :target => "_blank"
|
- ["diaspora", "art", "gif", "french"].each do |tag_name|
|
||||||
|
= tag_link(tag_name)
|
||||||
%br
|
%br
|
||||||
= link_to "#art", tag_path('art'), :target => "_blank"
|
|
||||||
%br
|
|
||||||
= link_to "#gif", tag_path('gif'), :target => "_blank"
|
|
||||||
%br
|
|
||||||
= link_to "#french", tag_path('french'), :target => "_blank"
|
|
||||||
.clearfix
|
.clearfix
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -871,7 +871,7 @@ en:
|
||||||
connect_to: "Connect to"
|
connect_to: "Connect to"
|
||||||
|
|
||||||
find_friends_from_facebook: "find friends from Facebook"
|
find_friends_from_facebook: "find friends from Facebook"
|
||||||
featured_tags: "Featured tags"
|
featured_tags: "Follow featured tags"
|
||||||
find_friends: "Find friends"
|
find_friends: "Find friends"
|
||||||
see_all_featured_users: "See all featured users"
|
see_all_featured_users: "See all featured users"
|
||||||
get_updates_from_core: "Get updates about the project from the core team."
|
get_updates_from_core: "Get updates about the project from the core team."
|
||||||
|
|
|
||||||
|
|
@ -3296,6 +3296,27 @@ ul#getting_started
|
||||||
:background
|
:background
|
||||||
:image url('/images/icons/check_yes_ok.png') !important
|
:image url('/images/icons/check_yes_ok.png') !important
|
||||||
|
|
||||||
|
.featured_tag
|
||||||
|
:background
|
||||||
|
//:image url('/images/icons/check_yes_ok.png')
|
||||||
|
:position center left
|
||||||
|
:repeat no-repeat
|
||||||
|
:display none
|
||||||
|
|
||||||
|
:padding
|
||||||
|
:left 20px
|
||||||
|
|
||||||
|
&.followed
|
||||||
|
:background
|
||||||
|
:image url('/images/icons/check_yes_ok.png')
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
:background
|
||||||
|
:image url('/images/icons/check_yes_ok_lighter.png')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#featured_users_pane
|
#featured_users_pane
|
||||||
:padding 10px 0
|
:padding 10px 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue