Finishing contracts, changing from s3.yml to .env

This commit is contained in:
2014-03-02 19:06:39 -07:00
parent c74da562bc
commit cac59e9de5
19 changed files with 118 additions and 41 deletions

View File

@@ -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 %>

View File

@@ -0,0 +1,4 @@
<h1>Edit Contract
<%= link_to 'Back', contracts_path, class: "btn btn-default" %>
</h1>
<%= render 'form' %>

View File

@@ -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 />

View 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 />