|
<div class="page-header">
<h1>
<%= @mission.title %> <small>(Mission Details)</small>
<%= render 'mission_status', :mission => @mission, :big => true %>
</h1>
<small>Director: <%= link_to @mission.owner.username, agent_profile_path(@mission.owner.id) %></small>
</div>
<p class="lead"><strong>Details: </strong><%= @mission.description %></p>
<% if @agent.first != nil %>
<p class="lead"><strong>Objective: </strong><%= @agent.first.description %></p>
<% end %>
<ul class="thumbnails">
<% @step = 1 %>
<% if @agent.length > 0 %>
<% @agent.first.mission_agent_steps.order(:step => :asc).each do |step| %>
<li class="span4">
<div class="thumbnail" style= "padding: 5px;">
<h3 style= "padding: 5px;">Step <%= @step %> <%= render 'mission_agent_step_status', :step => step %></h3>
<p style= "padding: 5px; height: 50px;"><%= step.description %></p>
<% if step.validated != true || step.completed != true %>
<a href="#myModal<%= @step %>" role="button" class="btn btn-block btn-default" data-toggle="modal">Validate</a>
<% end %>
</li>
<% @step = @step + 1 %>
<% end %>
<% end %>
</ul>
<% if @agent.first != nil %>
<% @step = 1 %>
<% @agent.first.mission_agent_steps.order(:step => :asc).each do |step| %>
<!-- Modal -->
<div id="myModal<%= @step %>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Validate Step <%= @step %> </h3>
</div>
<%= simple_form_for(step) do |f| %>
<div class="modal-body">
<%= f.error_notification %>
<div class="form-inputs">
<%= f.hidden_field :id %>
<%= f.input :proof, :label => 'Answer', :input_html => { :class => 'span5'} %>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<%= f.button :submit, 'Validate', :class => 'btn btn-success' %>
</div>
<% end %>
</div>
<% @step = @step + 1 %>
<% end %>
<% end %>
|