infusionvlc/infusion

View on GitHub
app/views/activities/index.html.erb

Summary

Maintainability
Test Coverage
<h1>Activities</h1>
<br/>

<% @activities.reverse.each do |activity| %>
    <div class="card">
      <div class="card-container">
        <%= link_to activity.user.username, "/#{activity.user.username}" %>
        <% if activity.objective_type == "Meetup"%>
          <%= I18n.t 'activity.has_done_meetup' %>
          <%= link_to activity.activity_title, meetup_path(activity.objective_id) %>
        <% elsif activity.objective_type == "Assistance"%>
          <%= I18n.t 'activity.has_done_comment' %>
          <% id = Assistance.find(activity.objective_id).session.meetup_id %>
          <%= link_to activity.activity_title.truncate(40), meetup_path(id) %>
          <%= I18n.t 'activity.in_the_meetup' %>
          <%= link_to Meetup.find(id).title, meetup_path(id) %>
        <% else %>
        <%= I18n.t 'activity.has_done_proposal' %>
          <%= link_to activity.activity_title, proposal_path(activity.objective_id) %>
        <% end %>
      </div>
  </div>
<% end %>