Commit 25603bbbf868725770fe004a094cf8221c0df163
1 parent
c30872d6
Exists in
federation_followers_backend
Manage control panel
Signed-off-by: Artur Bersan de Faria <artur_bersan@hotmail.com>
Showing
9 changed files
with
63 additions
and
61 deletions
Show diff stats
app/controllers/my_profile/followers_controller.rb
1 | -class FollowedPeopleController < MyProfileController | 1 | +class FollowersController < MyProfileController |
2 | 2 | ||
3 | def index | 3 | def index |
4 | @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage]) | 4 | @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage]) |
app/views/followed_people/_profile_list.html.erb
@@ -1,18 +0,0 @@ | @@ -1,18 +0,0 @@ | ||
1 | -<ul class="profile-list"> | ||
2 | - <% profiles.each do |profile| %> | ||
3 | - <li> | ||
4 | - <%= link_to_profile profile_image(profile) + tag('br') + profile.short_name, | ||
5 | - profile.identifier, :class => 'profile-link' %> | ||
6 | - <div id="category-name"> | ||
7 | - <%= _(Category) %> | ||
8 | - </div> | ||
9 | - <div class="controll"> | ||
10 | - <%= button_without_text :remove, content_tag('span',_('remove')), | ||
11 | - { :action => 'remove', :id => profile.id }, | ||
12 | - :title => _('remove') %> | ||
13 | - <%= modal_icon_button :change_categoy, content_tag('span',_('change category')), | ||
14 | - profile.url.merge(:controller => 'followed_people', :action => 'set_category', :profile => profile.identifier)%> | ||
15 | - </div><!-- end class="controll" --> | ||
16 | - </li> | ||
17 | - <% end %> | ||
18 | -</ul> |
app/views/followed_people/_set_category_modal.html.erb
@@ -1,10 +0,0 @@ | @@ -1,10 +0,0 @@ | ||
1 | -<div class='set-category-content'> | ||
2 | - <h2><%= _("Select a category") %></h2> | ||
3 | - <form> | ||
4 | - <%= labelled_text_field _("Category: "), "person_category" %> | ||
5 | - <div> | ||
6 | - <%= submit_button('save', _('Save')) %> | ||
7 | - <%= modal_close_button _("Cancel") %> | ||
8 | - </div> | ||
9 | - </form> | ||
10 | -</div> |
app/views/followed_people/index.html.erb
@@ -1,25 +0,0 @@ | @@ -1,25 +0,0 @@ | ||
1 | -<div id="manage_followed people"> | ||
2 | - | ||
3 | -<h1><%= _("%s following") % profile.name %></h1> | ||
4 | - | ||
5 | -<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> | ||
6 | - <% if @followed_people.empty? %> | ||
7 | - <p> | ||
8 | - <em> | ||
9 | - <%= _("You don't follow anybody yet.") %> | ||
10 | - </em> | ||
11 | - </p> | ||
12 | - <% end %> | ||
13 | - | ||
14 | - <%= button_bar do %> | ||
15 | - <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> | ||
16 | - <%= button(:search, _('Find people'), :controller => 'search', :action => 'assets', :asset => 'people') %> | ||
17 | - <% end %> | ||
18 | - | ||
19 | - <%= render :partial => 'profile_list', :locals => { :profiles => @followed_people } %> | ||
20 | - | ||
21 | - <br style="clear:both" /> | ||
22 | - <%= pagination_links @followed_people, :param_name => 'npage' %> | ||
23 | -<% end %> | ||
24 | - | ||
25 | -</div> |
@@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
1 | +<ul class="profile-list"> | ||
2 | + <% profiles.each do |profile| %> | ||
3 | + <li> | ||
4 | + <%= link_to_profile profile_image(profile) + tag('br') + profile.short_name, | ||
5 | + profile.identifier, :class => 'profile-link' %> | ||
6 | + <div id="category-name"> | ||
7 | + <%= _(Category) %> | ||
8 | + </div> | ||
9 | + <div class="controll"> | ||
10 | + <%= button_without_text :remove, content_tag('span',_('unfollow')), | ||
11 | + { :controller => "profile", :profile => profile.identifier , :action => 'unfollow', :redirect_to => "gabriel" }, | ||
12 | + :title => _('remove') %> | ||
13 | + <%= modal_icon_button :change_categoy, content_tag('span',_('change category')), | ||
14 | + profile.url.merge(:controller => 'followers', :action => 'set_category', :profile => profile.identifier)%> | ||
15 | + </div><!-- end class="controll" --> | ||
16 | + </li> | ||
17 | + <% end %> | ||
18 | +</ul> |
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +<div class='set-category-content'> | ||
2 | + <h2><%= _("Select a category") %></h2> | ||
3 | + <form> | ||
4 | + <%= labelled_text_field _("Category: "), "person_category" %> | ||
5 | + <div> | ||
6 | + <%= submit_button('save', _('Save')) %> | ||
7 | + <%= modal_close_button _("Cancel") %> | ||
8 | + </div> | ||
9 | + </form> | ||
10 | +</div> |
@@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
1 | +<div id="manage_followed people"> | ||
2 | + | ||
3 | +<h1><%= _("%s following") % profile.name %></h1> | ||
4 | + | ||
5 | +<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> | ||
6 | + <% if @followed_people.empty? %> | ||
7 | + <p> | ||
8 | + <em> | ||
9 | + <%= _("You don't follow anybody yet.") %> | ||
10 | + </em> | ||
11 | + </p> | ||
12 | + <% end %> | ||
13 | + | ||
14 | + <%= button_bar do %> | ||
15 | + <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> | ||
16 | + <%= button(:search, _('Find people'), :controller => 'search', :action => 'assets', :asset => 'people') %> | ||
17 | + <% end %> | ||
18 | + | ||
19 | + <%= render :partial => 'profile_list', :locals => { :profiles => @followed_people } %> | ||
20 | + | ||
21 | + <br style="clear:both" /> | ||
22 | + <%= pagination_links @followed_people, :param_name => 'npage' %> | ||
23 | +<% end %> | ||
24 | + | ||
25 | +</div> |
app/views/profile_editor/index.html.erb
@@ -72,6 +72,8 @@ | @@ -72,6 +72,8 @@ | ||
72 | 72 | ||
73 | <%= control_panel_button(_('Email Templates'), 'email-templates', :controller => :profile_email_templates) if profile.organization? %> | 73 | <%= control_panel_button(_('Email Templates'), 'email-templates', :controller => :profile_email_templates) if profile.organization? %> |
74 | 74 | ||
75 | + <%= control_panel_button(_('Manage followed people'), 'manage-followed-people', :controller => :followers) %> | ||
76 | + | ||
75 | <% @plugins.dispatch(:control_panel_buttons).each do |button| %> | 77 | <% @plugins.dispatch(:control_panel_buttons).each do |button| %> |
76 | <%= control_panel_button(button[:title], button[:icon], button[:url], button[:html_options]) %> | 78 | <%= control_panel_button(button[:title], button[:icon], button[:url], button[:html_options]) %> |
77 | <% end %> | 79 | <% end %> |
public/stylesheets/profile-list.scss
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | } | 23 | } |
24 | .controller-favorite_enterprises .profile-list a.profile-link, | 24 | .controller-favorite_enterprises .profile-list a.profile-link, |
25 | .controller-friends .profile-list a.profile-link, | 25 | .controller-friends .profile-list a.profile-link, |
26 | -.controller-followed_people .profile-list a.profile-link, | 26 | +.controller-followers .profile-list a.profile-link, |
27 | .list-profile-connections .profile-list a.profile-link, | 27 | .list-profile-connections .profile-list a.profile-link, |
28 | .profiles-suggestions .profile-list a.profile-link { | 28 | .profiles-suggestions .profile-list a.profile-link { |
29 | text-decoration: none; | 29 | text-decoration: none; |
@@ -33,13 +33,13 @@ | @@ -33,13 +33,13 @@ | ||
33 | } | 33 | } |
34 | .controller-favorite_enterprises .profile-list a.profile-link:hover, | 34 | .controller-favorite_enterprises .profile-list a.profile-link:hover, |
35 | .controller-friends .profile-list a.profile-link:hover, | 35 | .controller-friends .profile-list a.profile-link:hover, |
36 | -.controller-followed_people .profile-list a.profile-link:hover, | 36 | +.controller-followers .profile-list a.profile-link:hover, |
37 | .profiles-suggestions .profile-list a.profile-link:hover { | 37 | .profiles-suggestions .profile-list a.profile-link:hover { |
38 | color: #FFF; | 38 | color: #FFF; |
39 | } | 39 | } |
40 | .controller-favorite_enterprises .profile-list .profile_link span, | 40 | .controller-favorite_enterprises .profile-list .profile_link span, |
41 | .controller-friends .profile-list .profile_link span, | 41 | .controller-friends .profile-list .profile_link span, |
42 | -.controller-followed_people .profile-list .profile_link span, | 42 | +.controller-followers .profile-list .profile_link span, |
43 | .box-1 .profiles-suggestions .profile-list .profile_link span { | 43 | .box-1 .profiles-suggestions .profile-list .profile_link span { |
44 | width: 80px; | 44 | width: 80px; |
45 | display: block; | 45 | display: block; |
@@ -47,14 +47,14 @@ | @@ -47,14 +47,14 @@ | ||
47 | } | 47 | } |
48 | .controller-favorite_enterprises .profile-list, | 48 | .controller-favorite_enterprises .profile-list, |
49 | .controller-friends .profile-list, | 49 | .controller-friends .profile-list, |
50 | -.controller-followed_people .profile-list, | 50 | +.controller-followers .profile-list, |
51 | .profiles-suggestions .profile-list { | 51 | .profiles-suggestions .profile-list { |
52 | position: relative; | 52 | position: relative; |
53 | } | 53 | } |
54 | 54 | ||
55 | .controller-favorite_enterprises .profile-list .controll, | 55 | .controller-favorite_enterprises .profile-list .controll, |
56 | .controller-friends .profile-list .controll, | 56 | .controller-friends .profile-list .controll, |
57 | -.controller-followed_people .profile-list .controll, | 57 | +.controller-followers .profile-list .controll, |
58 | .profiles-suggestions .profile-list .controll { | 58 | .profiles-suggestions .profile-list .controll { |
59 | position: absolute; | 59 | position: absolute; |
60 | top: 7px; | 60 | top: 7px; |
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
62 | } | 62 | } |
63 | .controller-favorite_enterprises .profile-list .controll a, | 63 | .controller-favorite_enterprises .profile-list .controll a, |
64 | .controller-friends .profile-list .controll a, | 64 | .controller-friends .profile-list .controll a, |
65 | -.controller-followed_people .profile-list .controll a, | 65 | +.controller-followers .profile-list .controll a, |
66 | .profiles-suggestions .profile-list .controll a { | 66 | .profiles-suggestions .profile-list .controll a { |
67 | display: block; | 67 | display: block; |
68 | margin-bottom: 2px; | 68 | margin-bottom: 2px; |
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
75 | } | 75 | } |
76 | .controller-favorite_enterprises .button-bar, | 76 | .controller-favorite_enterprises .button-bar, |
77 | .controller-friends .button-bar, | 77 | .controller-friends .button-bar, |
78 | -.controller-followed_people .button-bar, | 78 | +.controller-followers .button-bar, |
79 | .profiles-suggestions .button-bar { | 79 | .profiles-suggestions .button-bar { |
80 | clear: both; | 80 | clear: both; |
81 | padding-top: 20px; | 81 | padding-top: 20px; |