Commit b1c75feb4a3e90d1c69a2ed4dd65fe79668bc0f0
Committed by
Gabriel Silva
1 parent
6a5304ec
Exists in
federation_followers_backend
Create link to modal follow-option
Signed-off-by: Artur Bersan de Faria <artur_bersan@hotmail.com> Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
4 changed files
with
9 additions
and
4 deletions
Show diff stats
app/models/person.rb
... | ... | @@ -601,7 +601,7 @@ class Person < Profile |
601 | 601 | protected |
602 | 602 | |
603 | 603 | def followed_by?(profile) |
604 | - self == profile || self.is_a_friend?(profile) || self.followers.include(profile) | |
604 | + self == profile || self.is_a_friend?(profile) || self.followers.include?(profile) | |
605 | 605 | end |
606 | 606 | |
607 | 607 | end | ... | ... |
app/views/blocks/profile_info_actions/_person.html.erb
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | <% if profile.follows?(user) %> |
12 | 12 | <%= button(:unfollow, content_tag('span', _('Unfollow')), "#", :class => 'add-friend', :title => _("Unfollow"), :style => 'position: relative;') %> |
13 | 13 | <% else %> |
14 | - <%= button(:follow, content_tag('span', _('Follow')), "#", :class => 'add-friend', :title => _("Follow"), :style => 'position: relative;') %> | |
14 | + <%= modal_button(:follow, _('Follow'),{ :profile => profile.identifier, :controller => 'followed_people', :action => 'set_category'}, :title => _("Follow"), :style => 'position: relative;') %> | |
15 | 15 | <% end %> |
16 | 16 | </li> |
17 | 17 | ... | ... |
app/views/followed_people/_profile_list.html.erb
... | ... | @@ -3,6 +3,9 @@ |
3 | 3 | <li> |
4 | 4 | <%= link_to_profile profile_image(profile) + tag('br') + profile.short_name, |
5 | 5 | profile.identifier, :class => 'profile-link' %> |
6 | + <div id="category-name"> | |
7 | + <%= _(Category) %> | |
8 | + </div> | |
6 | 9 | <div class="controll"> |
7 | 10 | <%= button_without_text :remove, content_tag('span',_('remove')), |
8 | 11 | { :action => 'remove', :id => profile.id }, | ... | ... |
app/views/followed_people/_set_category_modal.html.erb
... | ... | @@ -2,7 +2,9 @@ |
2 | 2 | <h2><%= _("Select a category") %></h2> |
3 | 3 | <form> |
4 | 4 | <%= labelled_text_field _("Category: "), "person_category" %> |
5 | - <%= submit_button('save', _('Save')) %> | |
6 | - <%= modal_close_button _("Cancel") %> | |
5 | + <div> | |
6 | + <%= submit_button('save', _('Save')) %> | |
7 | + <%= modal_close_button _("Cancel") %> | |
8 | + </div> | |
7 | 9 | </form> |
8 | 10 | </div> | ... | ... |