infusionvlc/infusion

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

Summary

Maintainability
Test Coverage
<% @notifications.where(read: false).reverse.each do |notification| %>
  <% activity = notification.activity %>
      <p>
        <%= 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 %>
      </p>
  <hr/>
<% end %>