Fine tuned abilities and updated how membership is tracked
This commit is contained in:
@@ -19,10 +19,6 @@
|
||||
<%= f.label :description %><br />
|
||||
<%= f.text_area :description %>
|
||||
</div>
|
||||
<% f.fields_for :users do |u| %>
|
||||
<%= u.label :user %><br />
|
||||
<%= collection_select(:certifications_users, :user_id, User.all.sort_by(&:name), :id, :name) %>
|
||||
<% end %>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1>Listing certifications</h1>
|
||||
|
||||
<%= link_to 'New Certification', new_certification_path if can? :create, Certification %>
|
||||
<%= link_to 'Create Certification', new_certification_path if can? :create, Certification %>
|
||||
|
||||
<ul>
|
||||
<% @certifications.each do |certification| %>
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
<b>Certified Users:</b>
|
||||
<ul>
|
||||
<% @certification.users.each do |user| %>
|
||||
<li><%= link_to user.name, user %></li>
|
||||
<% @certification_users.each do |user| %>
|
||||
<li><%= link_to user.name, user %></li>
|
||||
<% end %>
|
||||
<% if @certification.users.blank? then %><li>n/a</li><% end %>
|
||||
<% if @certification_users.blank? then %><li>n/a</li><% end %>
|
||||
</ul>
|
||||
|
||||
<% if can? :update, @certification %><%= link_to 'Edit', edit_certification_path(@certification) %> |<% end %>
|
||||
|
||||
@@ -1 +1 @@
|
||||
Welcome.
|
||||
<p>Welcome to the HeatSync Labs Members App.</p>
|
||||
|
||||
@@ -9,14 +9,19 @@
|
||||
<body>
|
||||
<div id="header">
|
||||
<%= link_to 'Users', users_path if can? :read, User %>
|
||||
<%= link_to 'Cards', cards_path if can? :read, Card %>
|
||||
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
|
||||
<%= link_to 'Cards', cards_path if can? :manage, Card %>
|
||||
<% if can? :manage, UserCertification %>
|
||||
<%= link_to 'Cert Classes', certifications_path if can? :read, Certification %>
|
||||
<%= link_to 'User Certs', user_certifications_path if can? :create, UserCertification %>
|
||||
<% else %>
|
||||
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
|
||||
<% end %>
|
||||
<%= link_to 'Logs', door_logs_path if can? :read, DoorLog %>
|
||||
<%= link_to 'Sign out', destroy_user_session_path, :method => :delete if user_signed_in? %>
|
||||
<%= link_to 'Sign in', new_user_session_path unless user_signed_in? %>
|
||||
</div>
|
||||
<p class="notice"><%= notice %></p>
|
||||
<p class="alert"><%= alert %></p>
|
||||
<p class="notice"><%= raw(notice) %></p>
|
||||
<p class="alert"><%= raw(alert) %></p>
|
||||
<%= yield %>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%= form_for(@user_certification) do |f| %>
|
||||
<% if @user_certification.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@user_certification.errors.count, "error") %> prohibited this user_certification from being saved:</h2>
|
||||
<h2><%= pluralize(@user_certification.errors.count, "error") %> prohibited this User Certification from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @user_certification.errors.full_messages.each do |msg| %>
|
||||
@@ -12,12 +12,12 @@
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :user_id %><br />
|
||||
<%= f.number_field :user_id %>
|
||||
<%= f.label :user_id, "User" %><br />
|
||||
<%= collection_select(:user_certification, :user_id, @users, :id, :name) %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :certification_id %><br />
|
||||
<%= f.number_field :certification_id %>
|
||||
<%= f.label :certification_id, "Certification" %><br />
|
||||
<%= collection_select(:user_certification, :certification_id, @certifications, :id, :name) %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1>Editing user_certification</h1>
|
||||
<h1>Editing User Certification</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
<h1>Listing user_certifications</h1>
|
||||
<h1>Listing User Certifications</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Certification</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @user_certifications.each do |user_certification| %>
|
||||
<tr>
|
||||
<td><%= user_certification.user_id %></td>
|
||||
<td><%= user_certification.certification_id %></td>
|
||||
<td><%= link_to 'Show', user_certification %></td>
|
||||
<td><%= link_to 'Edit', edit_user_certification_path(user_certification) %></td>
|
||||
<td><%= link_to 'Destroy', user_certification, :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<dl>
|
||||
<% @grouped_user_certs.sort.each do |user, user_certifications| %>
|
||||
<dt><%= user %></dt>
|
||||
<% user_certifications.each do |user_certification| %>
|
||||
<dd>
|
||||
<%= link_to user_certification.certification.name, user_certification %> |
|
||||
<%= link_to 'Edit', edit_user_certification_path(user_certification) %> |
|
||||
<%= link_to 'Destroy', user_certification, :confirm => 'Are you sure?', :method => :delete %>
|
||||
</dd>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</table>
|
||||
</dl>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New User certification', new_user_certification_path %>
|
||||
<%= link_to 'New User Certification', new_user_certification_path %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1>New user_certification</h1>
|
||||
<h1>New User Certification</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<p>
|
||||
<b>User:</b>
|
||||
<%= @user_certification.user_id %>
|
||||
<%= @user_certification.user.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Certification:</b>
|
||||
<%= @user_certification.certification_id %>
|
||||
<%= @user_certification.certification.name %>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -74,8 +74,12 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="field">
|
||||
<%= f.label :active, "Active?" %><br />
|
||||
<%= f.check_box :active %>
|
||||
<%= f.label :member, "Member?" %><br />
|
||||
<%= f.select :member, [["No",0],["Inactive",1],["Volunteer",10],["Associate",25],["Basic",50],["Plus",100]] %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :instructor, "Instructor?" %><br />
|
||||
<%= f.check_box :instructor %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :admin, "Admin?" %><br />
|
||||
|
||||
@@ -7,15 +7,14 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<% if current_user.admin? then %>
|
||||
<th>Cards</th>
|
||||
<% end %>
|
||||
<th>Certifications</th>
|
||||
<th>Active?</th>
|
||||
<th>Waiver?</th>
|
||||
<% if current_user.admin? then %>
|
||||
<th>Orientation?</th>
|
||||
<% end %>
|
||||
<th>Waiver?</th>
|
||||
<th>Member?</th>
|
||||
<th>Card?</th>
|
||||
<th>Instructor?</th>
|
||||
<th>Admin?</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
@@ -26,19 +25,16 @@
|
||||
<tr>
|
||||
<td><%= link_to user.name, user %></td>
|
||||
<td><%= user.email %></td>
|
||||
<% if current_user.admin? then %><td>
|
||||
<% user.cards.each do |c| %>
|
||||
<%= link_to c.card_number, card_url(c) %><%= "," unless c == user.cards.last %>
|
||||
<% end %>
|
||||
</td><% end %>
|
||||
<td><% user.certifications.each do |c| %>
|
||||
<%= link_to c.name, c %><%= "," unless c == user.certifications.last %>
|
||||
<%= link_to c.name, c %><%= "," unless c.id == user.certifications.last.id %>
|
||||
<% end %></td>
|
||||
<td><%= if user.active? then raw("✓") end %></td>
|
||||
<td><%= unless user.waiver.blank? then raw("<span class='hoverinfo' title='"+user.waiver.strftime("%B %d %Y")+"'>✓</span>") end %></td>
|
||||
<% if current_user.admin? then %><td>
|
||||
<%= unless user.orientation.blank? then raw("<span class='hoverinfo' title='"+user.orientation.strftime("%B %d %Y")+"'>✓</span>") end %>
|
||||
</td><% end %>
|
||||
<td><%= unless user.waiver.blank? then raw("<span class='hoverinfo' title='"+user.waiver.strftime("%B %d %Y")+"'>✓</span>") end %></td>
|
||||
<td><%= raw(user.member_status) %></td>
|
||||
<td><%= unless user.cards.blank? then raw("✓") end %></td>
|
||||
<td><%= if user.instructor? then raw("✓") end %></td>
|
||||
<td><%= if user.admin? then raw("✓") end %></td>
|
||||
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
|
||||
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td>
|
||||
|
||||
@@ -10,8 +10,25 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Active?</b>
|
||||
<%= @user.active %>
|
||||
<b>Waiver?</b>
|
||||
<%= @user.waiver %>
|
||||
</p>
|
||||
|
||||
<% if current_user.admin? then %>
|
||||
<p>
|
||||
<b>Orientation?</b>
|
||||
<%= @user.orientation %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<b>Member?</b>
|
||||
<%= @user.member %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Instructor?</b>
|
||||
<%= @user.instructor %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -19,6 +36,15 @@
|
||||
<%= @user.admin %>
|
||||
</p>
|
||||
|
||||
<% if current_user.admin? then %>
|
||||
<p>
|
||||
<b>Cards:</b>
|
||||
<% @user.cards.each do |c| %>
|
||||
<%= link_to c.card_number, c %><%= "," unless c == @user.cards.last %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<b>Certifications:</b>
|
||||
<ul>
|
||||
<% @user.certifications.each do |certification| %>
|
||||
@@ -27,6 +53,5 @@
|
||||
<% if @user.certifications.blank? %><li>n/a</li><% end %>
|
||||
</ul>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_user_path(@user) %> |
|
||||
<%= link_to 'Back', users_path %>
|
||||
|
||||
Reference in New Issue
Block a user