Noosfero/noosfero

View on GitHub
app/views/profile/_profile_scraps.html.erb

Summary

Maintainability
Test Coverage
<li class="<%= kindify_class(scrap.sender, 'profile-activity-item') %>" id='profile-activity-item-<%= scrap.id %>'>
  <div class='profile-activity-image'>
    <%= link_to(profile_image(scrap.sender, :minor), scrap.sender.url) %>
  </div>
  <div class='profile-activity-description'>
    <p class='profile-activity-sender'>
      <%= link_to scrap.sender.name, scrap.sender.url, class: 'profile-name' %>
      <%= time_ago scrap %>
    </p>
    <p class='profile-activity-text'><%= txt2html scrap.content %></p>
    <% if logged_in? && current_person.follows?(scrap.sender) %>
      <span class='profile-activity-send-reply'>
        <%= link_to_function font_awesome(:reply, s_('profile|Comment')).html_safe, 'show_scrap_reply_form(this)', { :class => "profile-send-reply", "data-scrap-id" => "#{scrap.id}" } %>
      </span>
    <% end %>
    <% if scrap.replies.count > 0 %>
      <span id="profile-wall-activities-comments-more-<%= activity.id %>" class="profile-wall-activities-comments">
        <span class='view-all-comments'>
          <span class="bullet-separator">•</span>
          <%= link_to(font_awesome(:comments, n_('View comment', "View %s comments".html_safe, scrap.replies.count) % scrap.replies.count), :profile => profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (1)) %>
        </span>
      </span>
    <% end %>
    <ul id="profile-wall-activities-comments-<%= activity.id %>" class="profile-wall-activities-comments scrap-replies"></ul>
    <%= render :partial => 'profile_scrap_reply_form', :locals => { :scrap => scrap } if allow_comment? %>
  </div>
  <div class='profile-wall-actions'>
    <%= link_to_function(font_awesome(:remove), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_scrap, :scrap_id => scrap.id, :view => params[:view]), _('Are you sure you want to remove this scrap and all its replies?')]) if logged_in? && user.can_control_scrap?(scrap) %>
  </div>
</li>