fix conflit

This commit is contained in:
yamin
2017-08-21 16:35:15 +06:30
20 changed files with 312 additions and 142 deletions

View File

@@ -0,0 +1,2 @@
json.extract! commissioner, :id, :created_at, :updated_at
json.url commissioner_url(commissioner, format: :json)

View File

@@ -0,0 +1,14 @@
<%= simple_form_for(@commissioner) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.collection_select :emp_id, Employee.all.order('name asc'), :emp_id, :name, {prompt: "Select an Employee"}, {class: "form-control"} %>
<%= f.input :commission_type %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>

View File

@@ -0,0 +1,46 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Commissioner</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_commissioner_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Employee Name</th>
<th>Commission type</th>
<th>Active</th>
<th>Created By</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissioners.each do |commissioner| %>
<tr>
<td><%= commissioner.name %></td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?',commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td>
<td><%= commissioner.commission_type %></td>
<td><%= commissioner.is_active %></td>
<td><%= current_user.name %></td>
<td><%= link_to 'Show', commissioner_path(commissioner) %></td>
<td><%= link_to 'Edit', edit_commissioner_path(commissioner) %></td>
<td><%= link_to 'Destroy', commissioner_path(commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @commissioners, partial: 'commissioners/commissioner', as: :commissioner

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>

View File

@@ -0,0 +1,39 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= commissioners_path %>">Commissioners</a></li>
<span style="float: right">
</span>
</ul>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Commissioner</h4>
<table class="table">
<tbody>
<tr><td style="width:20%">Name</td><td><%= @commissioner.name %></td></tr>
<tr><td style="width:20%">Employee Name</td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?',@commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td></tr>
<tr><td style="width:20%">Commission Type</td><td><%= @commissioner.commission_type %></td></tr>
<tr><td style="width:20%">Active</td><td><%= @commissioner.is_active %></td></tr>
<tr><td style="width:20%">Created By</td><td><%= current_user.name %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_commissioner_path(@commissioner) %></td><td><%= link_to 'Destroy', commissioner_path(@commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
</tbody>
</table>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "commissioners/commissioner", commissioner: @commissioner

View File

@@ -0,0 +1,2 @@
json.extract! commission, :id, :created_at, :updated_at
json.url commission_url(commission, format: :json)

View File

@@ -0,0 +1,10 @@
<%= simple_form_for([:origami,@commission]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing Commission</h1>
<%= render 'form', commission: @commission %>
<%= link_to 'Show', @commission %> |
<%= link_to 'Back', commissions_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Commissions</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissions.each do |commission| %>
<tr>
<td><%= link_to 'Show', commission %></td>
<td><%= link_to 'Edit', edit_origami_commission_path(commission) %></td>
<td><%= link_to 'Destroy', commission, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Commission', new_origami_commission_path %>

View File

@@ -0,0 +1 @@
json.array! @commissions, partial: 'commissions/commission', as: :commission

View File

@@ -0,0 +1,5 @@
<h1>New Commission</h1>
<%= render 'form', commission: @commission %>
<%= link_to 'Back', origami_commissions_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_commission_path(@commission) %> |
<%= link_to 'Back', commissions_path %>

View File

@@ -0,0 +1 @@
json.partial! "commissions/commission", commission: @commission