fix conflit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
json.extract! commissioner, :id, :created_at, :updated_at
|
||||
json.url commissioner_url(commissioner, format: :json)
|
||||
14
app/views/origami/commissioners/_form.html.erb
Normal file
14
app/views/origami/commissioners/_form.html.erb
Normal 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 %>
|
||||
10
app/views/origami/commissioners/edit.html.erb
Normal file
10
app/views/origami/commissioners/edit.html.erb
Normal 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>
|
||||
46
app/views/origami/commissioners/index.html.erb
Normal file
46
app/views/origami/commissioners/index.html.erb
Normal 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>
|
||||
1
app/views/origami/commissioners/index.json.jbuilder
Normal file
1
app/views/origami/commissioners/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @commissioners, partial: 'commissioners/commissioner', as: :commissioner
|
||||
10
app/views/origami/commissioners/new.html.erb
Normal file
10
app/views/origami/commissioners/new.html.erb
Normal 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>
|
||||
39
app/views/origami/commissioners/show.html.erb
Normal file
39
app/views/origami/commissioners/show.html.erb
Normal 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>
|
||||
1
app/views/origami/commissioners/show.json.jbuilder
Normal file
1
app/views/origami/commissioners/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "commissioners/commissioner", commissioner: @commissioner
|
||||
2
app/views/origami/commissions/_commission.json.jbuilder
Normal file
2
app/views/origami/commissions/_commission.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! commission, :id, :created_at, :updated_at
|
||||
json.url commission_url(commission, format: :json)
|
||||
10
app/views/origami/commissions/_form.html.erb
Normal file
10
app/views/origami/commissions/_form.html.erb
Normal 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 %>
|
||||
6
app/views/origami/commissions/edit.html.erb
Normal file
6
app/views/origami/commissions/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Commission</h1>
|
||||
|
||||
<%= render 'form', commission: @commission %>
|
||||
|
||||
<%= link_to 'Show', @commission %> |
|
||||
<%= link_to 'Back', commissions_path %>
|
||||
25
app/views/origami/commissions/index.html.erb
Normal file
25
app/views/origami/commissions/index.html.erb
Normal 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 %>
|
||||
1
app/views/origami/commissions/index.json.jbuilder
Normal file
1
app/views/origami/commissions/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @commissions, partial: 'commissions/commission', as: :commission
|
||||
5
app/views/origami/commissions/new.html.erb
Normal file
5
app/views/origami/commissions/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Commission</h1>
|
||||
|
||||
<%= render 'form', commission: @commission %>
|
||||
|
||||
<%= link_to 'Back', origami_commissions_path %>
|
||||
4
app/views/origami/commissions/show.html.erb
Normal file
4
app/views/origami/commissions/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_commission_path(@commission) %> |
|
||||
<%= link_to 'Back', commissions_path %>
|
||||
1
app/views/origami/commissions/show.json.jbuilder
Normal file
1
app/views/origami/commissions/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "commissions/commission", commission: @commission
|
||||
Reference in New Issue
Block a user