Finishing contracts, changing from s3.yml to .env
This commit is contained in:
@@ -11,26 +11,31 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<div class="form-group">
|
||||
<%= f.label :first_name %><br />
|
||||
<%= f.text_field :first_name, class: "form-control" %>
|
||||
</p>
|
||||
<p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :last_name %><br />
|
||||
<%= f.text_field :last_name, class: "form-control" %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<div class="form-group">
|
||||
<%= f.label :user_id, "User" %><br />
|
||||
<%= collection_select(:contract, :user_id, @users, :id, :name, :include_blank => true) %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.label :signed_at %><br />
|
||||
<%= f.date_select :signed_at, class: "form-control" %>
|
||||
</p>
|
||||
<%= f.date_select :signed_at %>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<div class="form-group">
|
||||
<%= f.label :document %><br />
|
||||
<%= f.file_field :document %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<div class="form-group">
|
||||
<%= f.submit nil, class: "btn btn-primary" %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
4
app/views/contracts/edit.html.erb
Normal file
4
app/views/contracts/edit.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<h1>Edit Contract
|
||||
<%= link_to 'Back', contracts_path, class: "btn btn-default" %>
|
||||
</h1>
|
||||
<%= render 'form' %>
|
||||
@@ -4,18 +4,32 @@
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<% @contracts.sort_by{|r| [r.last_name] }.each do |contract| %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<%= contract.last_name %>
|
||||
<%= contract.first_name %>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>User</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @contracts.sort_by{|r| [r.last_name] }.each do |contract| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= contract.last_name %>,
|
||||
<%= contract.first_name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to contract.user.name, contract.user if contract.user %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contract.signed_at.to_date.to_s(:long) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to "View", contract, class: "btn btn-primary" %>
|
||||
<%= link_to "Edit", edit_contract_path(contract), class: "btn btn-default" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
|
||||
28
app/views/contracts/show.html.erb
Normal file
28
app/views/contracts/show.html.erb
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="row">
|
||||
<h1 class="col-md-8">
|
||||
Contract
|
||||
<%= link_to 'Back', contracts_path, :class => "btn btn-default" %>
|
||||
<%= link_to 'Delete', contract_path(@contract), {:confirm => 'Are you sure you want to delete this forever?', :method => :delete, :class => "btn btn-danger"} if can? :destroy, @contract %>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>
|
||||
<%= @contract.full_name %>
|
||||
<%= link_to "(#{@contract.user.name})", @contract.user if @contract.user %>
|
||||
<small>
|
||||
signed
|
||||
<%= @contract.signed_at.to_date.to_s(:long) %>
|
||||
</small>
|
||||
</h2>
|
||||
|
||||
|
||||
<p><%= link_to "Download Contract", @contract.document.url %>
|
||||
<div class="col-xs-12">
|
||||
<iframe src="<%= @contract.document.url %>" width="100%" height="600"></iframe>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<span class="col-md-2 col-xs-6">
|
||||
<h3>Featured item:</h3>
|
||||
<%= render @featured_resource %>
|
||||
<%= render @featured_resource unless @featured_resource.blank? %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -170,7 +170,13 @@ margin-right: auto;
|
||||
|
||||
<p>
|
||||
<b>Waiver?</b>
|
||||
<%= @user.waiver.strftime("%B %d %Y") unless @user.waiver.blank? %>
|
||||
<%= @user.waiver.strftime("%B %d %Y") unless @user.waiver.blank? %><br/>
|
||||
<b>Contracts:</b> <%= link_to "+ Add", new_contract_path, :class => 'btn' if can? :create, Contract %>
|
||||
<ul>
|
||||
<% @user.contracts.each do |contract| %>
|
||||
<li><%= link_to contract.signed_at.strftime("%B %d %Y"), contract %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user