Commit d99faa27fa0fb063b0b06132458b9367e48a7869

Authored by Tallys Martins
1 parent 52f0d711

Added community buttons to profile page

views/blocks/software_information.html.erb
... ... @@ -12,7 +12,7 @@
12 12 <%= link_to profile_image(block.owner, :big) +"\n", profile.url %>
13 13 </span>
14 14 <div class='admin-link'>
15   - <% if current_user && block.owner.admins.include?(current_user.person) %>
  15 + <% if !user.nil? && user.has_permission?('edit_profile', profile) %>
16 16 <%= link_to _('Control panel'), block.owner.admin_url %>
17 17 <% end %>
18 18 </div>
... ...
views/profile/index.html.erb 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +<h1><%= h profile.name %></h1>
  2 +
  3 +<% if @action %>
  4 + <%= render :partial => 'private_profile' %>
  5 +<% else %>
  6 + <% unless profile.description.blank? %>
  7 + <div class='public-profile-description'>
  8 + <%= profile.description %>
  9 + </div>
  10 + <% end %>
  11 +<% end %>
  12 +
  13 +<div class="page-profile-header">
  14 + <%= render "blocks/profile_info_actions/join_leave_community" %>
  15 + <% if !user.nil? && user.has_permission?('edit_profile', profile) %>
  16 + <div class="control-panel-button">
  17 + <%= button :control_panel, _('Control Panel'), profile.admin_url %>
  18 + </div>
  19 + <% end %>
  20 +</div>
  21 +
  22 +<% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %>
  23 + <table class='profile'>
  24 +
  25 + </table>
  26 +<% end %>
... ...