Skip to content

Instantly share code, notes, and snippets.

@wolfieorama
Created July 5, 2016 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfieorama/9eecd1c9428b6493575f6c8168a8cd60 to your computer and use it in GitHub Desktop.
Save wolfieorama/9eecd1c9428b6493575f6c8168a8cd60 to your computer and use it in GitHub Desktop.
<div class="col-md-8 col-md-offset-1">
<div class="panel panel-default">
<%= form_for(@weekly_performance_review) do |f| %>
<% if @weekly_performance_review.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@weekly_performance_review.errors.count, "error") %> prohibited this weekly_performance_review from being saved:</h2>
<ul>
<% @weekly_performance_review.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="panel panel-body">
<div class="field">
<%= f.collection_select(:user_id, current_admin.users.all, :id, :name) %>
</div>
<hr>
<div class="row">
<div class="field">
<%= f.label :Date %>
<%= f.datetime_select(:week_start, order: [:day, :year, :month]) %>
</div>
</div>
<hr>
<div class="job_queues">
<div>
<%= f.fields_for :job_queues do |job_queue| %>
<%= render 'job_queue_fields', f: job_queue %>
<% end %>
</div>
<div class="links">
<%= link_to_add_association 'New Queue', f, :job_queues, class: "btn btn-primary add-button" %>
</div>
</div>
<div class="coaching_forms">
<h2>Coaching Sessions</h2>
<%= f.fields_for :coaching_forms do |coaching_form, index| %>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse<%= index.to_s %>" aria-expanded="true" aria-controls="collapseOne">
<h4>New coaching form</h4>
</a>
</h4>
</div>
<div id="collapse<%= index.to_s %>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="coaching_form">
<%= render 'coaching_form_fields', f: coaching_form %>
</div>
</div>
</div>
</div>
</div>
<% end %>
<br>
<div class="links">
<%= link_to_add_association 'New Coaching session', f, :coaching_forms, class: "btn btn-primary add-button" %>
</div>
<br>
<div>
<br>
<div class="actions">
<%= f.submit %>
</div>
</div>
<% end %>
</div>
</div>
<div class="nested-fields">
<div class="panel panel-body">
<div class="field">
</div>
<hr>
<div class="row">
<div>
<h4 style="text-align: center">Select Job Queue</h4><br>
<div class="field">
<%= f.label :project_name %><br>
<%= f.collection_select(:project_id, Project.order(:project_name), :id, :project_name, include_blank: true) %>
</div><br>
<div class="field">
<%= f.label :job_name %><br>
<%= f.grouped_collection_select(:job_id, Project.order(:project_name), :jobs, :project_name, :id, :job_name, include_blank: true) %>
</div>
</div>
<hr>
<div class="col-md-6">
<h4 style="text-align: center">Actual score</h4>
<div class="field">
<%= f.label :Quality %><br>
<%= f.number_field :kpi_quality_actual %>
</div>
<div class="field">
<%= f.label :Adherence %><br>
<%= f.number_field :kpi_adherence_actual %>
</div>
<div class="field">
<%= f.label :Production %><br>
<%= f.number_field :kpi_production_actual %>
</div>
</div>
<div class="col-md-6">
<h4 style="text-align: center">Next target score</h4>
<div class="field">
<%= f.label :Quality %><br>
<%= f.number_field :kpi_quality_next_target %>
</div>
<div class="field">
<%= f.label :Adherence %><br>
<%= f.number_field :kpi_adherence_next_target %>
</div>
<div class="field">
<%= f.label :Production %><br>
<%= f.number_field :kpi_production_next_target %>
</div>
<br>
<%= link_to_remove_association "Remove Queue", f, class: "form-button btn btn-danger" %>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment