Mission: <%= @mission.title %>

Details: <%= @mission.description %>


Agent List

<% if @mission.mission_agents.length > 0 %>
<% @agent_number = 1 %> <% @mission.mission_agents.order(:created_at => :asc).each do |agent| %> <% if agent.mission_agent_invites.last != nil %> <% if agent.mission_agent_invites.last.status == 'accepted' %> <% @status_label = 'label-success'%> <% elsif agent.mission_agent_invites.last.status == 'denied' %> <% @status_label = 'label-important'%> <% elsif agent.mission_agent_invites.last.status == 'Completed' %> <% @status_label = 'label-success'%> <% @agent_status = 'closed'%> <% else%> <% @status_label = 'label-default'%> <% end %> <% if agent.mission_agent_steps.length == 0 %> <% @agent_status = 'empty'%> <% end %> <% else %> <% @status_label = 'label-important'%> <% @agent_status = 'missing'%> <% end %>
<% @step = 1 %> <% @line_step = 0%> <% agent.mission_agent_steps.order(:created_at => :asc).each do |step| %> <% if @line_step == 0 %>
    <% end %>
  • Step <%= @step %> <%= render 'mission_agent_step_status', :step => step %>

    <%= step.description %>

    <% if step.status == 'Waiting Validation'%>

    Response: <%= step.proof %>

    <%= link_to 'Invalidade', step_invalidate_check_path(step.id), :class => 'btn btn-danger btn-mini' %> <%= link_to 'Validade', step_validate_check_path(step.id), :class => 'btn btn-success btn-mini', :style => 'margin-right: 5px;' %>
    <% end %>
  • <% @step = @step + 1 %> <% @line_step = @line_step + 1%> <% if @line_step == 3 %> <% @line_step = 0%>
<% end %> <% end %>
<% @agent_number = @agent_number + 1 %> <% end %> <% else %>
No agents were assigned for this mission! Please edit mission settings and add agents in the form. <% end %>