Recreated user forms, updated abilities, linked cards and users
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<h1>Listing cards</h1>
|
||||
|
||||
<%= link_to 'New Card', new_card_path %>
|
||||
<%= link_to 'Upload all cards', upload_all_path %>
|
||||
<%= link_to 'New Card', new_card_path if can? :create, Card %>
|
||||
<%= link_to 'Upload all cards', upload_all_path if can? :upload_all, Card %>
|
||||
<table>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
@@ -22,9 +22,9 @@
|
||||
<td><%= card.id %></td>
|
||||
<td><%= card.card_number %></td>
|
||||
<td><%= if card.card_permissions == 1 then "Access" end %></td>
|
||||
<td><%= link_to 'Upload', upload_path(card) %></td>
|
||||
<td><%= link_to 'Edit', edit_card_path(card) %></td>
|
||||
<td><%= link_to 'Destroy', card, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE CARD FROM THE DOOR SYSTEM! DISABLE AND UPLOAD IT FIRST.', :method => :delete %></td>
|
||||
<td><%= link_to 'Upload', upload_path(card) if can? :upload, card %></td>
|
||||
<td><%= link_to 'Edit', edit_card_path(card) if can? :update, card %></td>
|
||||
<td><%= link_to 'Destroy', card, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE CARD FROM THE DOOR SYSTEM! DISABLE AND UPLOAD IT FIRST.', :method => :delete if can? :destroy, card %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<b>Card Note:</b>
|
||||
<%= @card.name %>
|
||||
</p>
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
<%= @card.card_permissions %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Upload to Door', upload_path(@card) %>
|
||||
<%= link_to 'Upload to Door', upload_path(@card) if can? :upload, @card %>
|
||||
<%= link_to 'Edit', edit_card_path(@card) %> |
|
||||
<%= link_to 'Back', cards_path %>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<% if @upload_result %>
|
||||
<p>
|
||||
<b>Upload result:</b>
|
||||
<%= @card.name %> uploaded successfully.
|
||||
<%= @card.card_number %> uploaded successfully.
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
<b>Upload result:</b>
|
||||
Error uploading <%= @card.name %>.
|
||||
Error uploading <%= @card.card_number %>.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user