community_block.rhtml 2.05 KB
<div class="community-block">
  <div class="community-block-logo">
    <%= link_to profile_image(profile, :big), profile.url %>
  </div>
  <div class="community-block-info">
    <h1 class="community-block-title"><%=profile.name%></h1>
    <div class="community-block-description"><%= profile.description %></div>
  </div>
  <div style="clear:both"></div>
  <div class="community-block-buttons">
    <% if logged_in? %>
        
      <% if profile.members.include?(user) || profile.already_request_membership?(user) %>
          <%= button_without_text(
                :remove, 
                __('Leave community'), 
                profile.leave_url,
                :title => _("Leave community"),
                :style => 'position: relative;') %>
      <% else %>
          <%= button_without_text(
                :add, 
                __('Join community'), 
                profile.join_url,
                :title => _("Join community"),
                :style => 'position: relative;') %>
      <% end %>
      
      <% if profile.enable_contact? %>
        <%= button_without_text(
              :'menu-mail',
              __('Send an e-mail'),
              { :profile => profile.identifier,
                :controller => 'contact',
                :action => 'new' },
                :title => _('Send an e-mail to the administrators'),
                :stle => 'position: relative;') %> 
      <% end %>
      
      <%= report_abuse(profile, :button_without_text) %>

      <% if !user.nil? && user.has_permission?('edit_profile', profile) %>

        <%= button_without_text(
              :'menu-ctrl-panel',
              __('Control Panel'),
              profile.admin_url,
              :title => _('Configure this community'),
              :style => 'position: relative;') %>

      <% end %>

    <% else %>
        <%= button_without_text(
              :add, 
              __('Join community'), 
              profile.join_not_logged_url,
              :title => _("Join community"),
              :style => 'position: relative;') %>
    <% end %>
  </div>
</div>