-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-features' into wristband-dist
- Loading branch information
Showing
28 changed files
with
417 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,12 @@ def new | |
|
||
if @user.has_signed_waiver | ||
flash[:notice] = "You have already agreed to the release." | ||
else | ||
@user.start_waiver_timer | ||
end | ||
|
||
|
||
@should_see_video = !@user.is_scc? | ||
|
||
end | ||
|
||
|
||
|
@@ -21,16 +25,21 @@ def create | |
else | ||
@participant = Participant.find params[:participant_id] | ||
end | ||
|
||
|
||
if params[:adult].blank? | ||
|
||
if @participant.is_waiver_cheater? | ||
@participant.start_waiver_timer | ||
redirect_to '/cheating.html' | ||
elsif params[:adult].blank? | ||
flash[:error] = "You must be 18 or older to sign the electronic waiver. Please contact Andrew Greenwald (<a target='_blank' href='mailto:[email protected]'>[email protected]</a>)." | ||
redirect_to action: :new | ||
elsif params[:agree].blank? | ||
flash[:error] = "You must agree to the terms of the release." | ||
redirect_to action: :new | ||
elsif params[:phone_number] == "" | ||
flash[:error] = "You must provide a mobile phone number" | ||
flash[:error] = "You must provide a mobile phone number." | ||
redirect_to action: :new | ||
elsif params[:signature] != @participant.name | ||
flash[:error] = "You must electronically sign the waiver with your full name as it appears on the waiver." | ||
redirect_to action: :new | ||
else | ||
@participant.phone_number = params[:phone_number] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
<% if can?(:update, @charge) %> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
|
||
<%= render 'form' %> | ||
<%= render 'form' %> | ||
|
||
<% else %> | ||
<h3>Not Authorized!</h3> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
<% if can?(:create, @charge) %> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
|
||
<%= render 'form' %> | ||
<%= render 'form' %> | ||
|
||
<% else %> | ||
<h3>Not Authorized!</h3> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,53 @@ | ||
<% if can?(:read, @charge) %> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1 <%= raw('class="text-muted"') unless @charge.is_approved? %>><%= @charge.charge_type.name %></h1> | ||
</div> | ||
<%- model_class = Charge -%> | ||
<div class="page-header"> | ||
<h1 <%= raw('class="text-muted"') unless @charge.is_approved? %>><%= @charge.charge_type.name %></h1> | ||
</div> | ||
|
||
<dl class="dl-horizontal"> | ||
<dt><strong><%= model_class.human_attribute_name(:description) %>:</strong></dt> | ||
<dd><%= @charge.description %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:amount) %>:</strong></dt> | ||
<dd><%= number_to_currency @charge.amount %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:organization) %>:</strong></dt> | ||
<dd><%= link_to @charge.organization.name, @charge.organization %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:issuing_participant) %>:</strong></dt> | ||
<dd><%= link_to @charge.issuing_participant.formatted_name, @charge.issuing_participant %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:receiving_participant) %>:</strong></dt> | ||
<dd><%= link_to @charge.receiving_participant.formatted_name, @charge.receiving_participant unless @charge.receiving_participant.nil? %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:charged_at) %>:</strong></dt> | ||
<dd><%= date_and_time @charge.charged_at %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:is_approved) %></strong></dt> | ||
<dd><%= format_boolean @charge.is_approved %></dd> | ||
</dl> | ||
<dl class="dl-horizontal"> | ||
<dt><strong><%= model_class.human_attribute_name(:description) %>:</strong></dt> | ||
<dd><%= @charge.description %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:amount) %>:</strong></dt> | ||
<dd><%= number_to_currency @charge.amount %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:organization) %>:</strong></dt> | ||
<dd><%= link_to @charge.organization.name, @charge.organization %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:issuing_participant) %>:</strong></dt> | ||
<dd><%= link_to @charge.issuing_participant.formatted_name, @charge.issuing_participant %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:receiving_participant) %>:</strong></dt> | ||
<dd><%= link_to @charge.receiving_participant.formatted_name, @charge.receiving_participant unless @charge.receiving_participant.nil? %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:charged_at) %>:</strong></dt> | ||
<dd><%= date_and_time @charge.charged_at %></dd> | ||
<dt><strong><%= model_class.human_attribute_name(:is_approved) %></strong></dt> | ||
<dd><%= format_boolean @charge.is_approved %></dd> | ||
</dl> | ||
|
||
<div class="form-actions"> | ||
<div class="form-actions"> | ||
<%= link_to t('.back', :default => t("helpers.links.back")), | ||
charges_path, :class => 'btn btn-default' %> | ||
|
||
<% if can?(:approve, Charge) %> | ||
<% unless @charge.is_approved? %> | ||
<%= form_tag approve_charge_path(@charge), method: :put, style: "display: inline;", role: "form" do -%> | ||
<%= hidden_field_tag 'url', request.original_fullpath %> | ||
<%= submit_tag 'Approve', :class => 'btn btn-success', :type => 'submit' %> | ||
<% end -%> | ||
<% else %> | ||
<%= form_tag approve_charge_path(@charge), method: :put, style: "display: inline;", role: "form" do -%> | ||
<%= hidden_field_tag 'url', request.original_fullpath %> | ||
<%= submit_tag 'Un-Approve', :class => 'btn btn-danger', :type => 'submit' %> | ||
<% end -%> | ||
<% end %> | ||
<% if can?(:approve, Charge) %> | ||
<% unless @charge.is_approved? %> | ||
<%= form_tag approve_charge_path(@charge), method: :put, style: "display: inline;", role: "form" do -%> | ||
<%= hidden_field_tag 'url', request.original_fullpath %> | ||
<%= submit_tag 'Approve', :class => 'btn btn-success', :type => 'submit' %> | ||
<% end -%> | ||
<% else %> | ||
<%= form_tag approve_charge_path(@charge), method: :put, style: "display: inline;", role: "form" do -%> | ||
<%= hidden_field_tag 'url', request.original_fullpath %> | ||
<%= submit_tag 'Un-Approve', :class => 'btn btn-danger', :type => 'submit' %> | ||
<% end -%> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if can?(:update, @charge) %> | ||
<%= link_to t('.edit', :default => t("helpers.links.edit")), | ||
edit_charge_path(@charge), :class => 'btn btn-primary' %> | ||
<% end %> | ||
<% if can?(:update, @charge) %> | ||
<%= link_to t('.edit', :default => t("helpers.links.edit")), | ||
edit_charge_path(@charge), :class => 'btn btn-primary' %> | ||
<% end %> | ||
|
||
<% if can?(:destroy, @charge) %> | ||
<%= link_to t('.destroy', :default => t("helpers.links.destroy")), | ||
charge_path(@charge), | ||
:method => 'delete', | ||
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, | ||
:class => 'btn btn-danger' %> | ||
<% end %> | ||
</div> | ||
|
||
<% else %> | ||
<h3>Not Authorized!</h3> | ||
<% end %> | ||
<% if can?(:destroy, @charge) %> | ||
<%= link_to t('.destroy', :default => t("helpers.links.destroy")), | ||
charge_path(@charge), | ||
:method => 'delete', | ||
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, | ||
:class => 'btn btn-danger' %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
<% if can?(:read, Checkout) %> | ||
<%- model_class = Checkout -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1> | ||
</div> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th><%= model_class.human_attribute_name(:id) %></th> | ||
<th><%= model_class.human_attribute_name(:tool) %></th> | ||
<th><%= model_class.human_attribute_name(:checked_out_at) %></th> | ||
<th><%= model_class.human_attribute_name(:checked_in_at) %></th> | ||
<th><%= model_class.human_attribute_name(:participant_id) %></th> | ||
<th><%= model_class.human_attribute_name(:organization_id) %></th> | ||
<%- model_class = Checkout -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1> | ||
</div> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th><%= model_class.human_attribute_name(:id) %></th> | ||
<th><%= model_class.human_attribute_name(:tool) %></th> | ||
<th><%= model_class.human_attribute_name(:checked_out_at) %></th> | ||
<th><%= model_class.human_attribute_name(:checked_in_at) %></th> | ||
<th><%= model_class.human_attribute_name(:participant_id) %></th> | ||
<th><%= model_class.human_attribute_name(:organization_id) %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @checkouts.each do |checkout| %> | ||
<% if can?(:read, checkout) %> | ||
<tr> | ||
<td><%= checkout.id %></td> | ||
<td><%= checkout.tool.name %></td> | ||
<td><%= date_and_time(checkout.checked_out_at) unless checkout.checked_out_at.nil? %></td> | ||
<td><%= date_and_time(checkout.checked_in_at) unless checkout.checked_in_at.nil? %></td> | ||
<td><%= checkout.participant.andrewid unless checkout.participant.nil? %></td> | ||
<td><%= checkout.organization.name unless checkout.organization.nil?%></td> | ||
</tr> | ||
<% end %> | ||
</thead> | ||
<tbody> | ||
<% @checkouts.each do |checkout| %> | ||
<% if can?(:read, checkout) %> | ||
<tr> | ||
<td><%= checkout.id %></td> | ||
<td><%= checkout.tool.name %></td> | ||
<td><%= date_and_time(checkout.checked_out_at) unless checkout.checked_out_at.nil? %></td> | ||
<td><%= date_and_time(checkout.checked_in_at) unless checkout.checked_in_at.nil? %></td> | ||
<td><%= checkout.participant.andrewid unless checkout.participant.nil? %></td> | ||
<td><%= checkout.organization.name unless checkout.organization.nil?%></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<h3>Not Authorized!</h3> | ||
<% end %> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
<% if can?(:update, @document) %> | ||
<%- model_class = Document -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
<%- model_class = Document -%> | ||
<div class="page-header"> | ||
<h1><%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human %></h1> | ||
</div> | ||
|
||
<%= render 'form' %> | ||
<%= render 'form' %> | ||
|
||
<% else %> | ||
<h3>Not Authorized!</h3> | ||
<% end %> |
Oops, something went wrong.