Got door logs working

This commit is contained in:
2012-08-24 23:28:00 -07:00
parent b28efe046c
commit 8b775d9172
22 changed files with 324 additions and 241 deletions

View File

@@ -0,0 +1,25 @@
<%= form_for(@door_log) do |f| %>
<% if @door_log.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@door_log.errors.count, "error") %> prohibited this door_log from being saved:</h2>
<ul>
<% @door_log.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :key %><br />
<%= f.text_field :key %>
</div>
<div class="field">
<%= f.label :data %><br />
<%= f.number_field :data %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,8 @@
<p id="notice"><%= notice %></p>
<p>
<b>Download results:</b>
<%= @results.inspect %>
</p>
<%= link_to 'Back', door_logs_path %>

View File

@@ -0,0 +1,6 @@
<h1>Editing door_log</h1>
<%= render 'form' %>
<%= link_to 'Show', @door_log %> |
<%= link_to 'Back', door_logs_path %>

View File

@@ -0,0 +1,22 @@
<h1>Listing door_logs</h1>
<%= link_to 'Download Door Logs', download_path %>
<table>
<tr>
<th>Key</th>
<th>Data</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @door_logs.each do |door_log| %>
<tr>
<td><%= door_log.key %></td>
<td><%= door_log.data %></td>
</tr>
<% end %>
</table>
<br />

View File

@@ -0,0 +1,5 @@
<h1>New door_log</h1>
<%= render 'form' %>
<%= link_to 'Back', door_logs_path %>

View File

@@ -0,0 +1,15 @@
<p id="notice"><%= notice %></p>
<p>
<b>Key:</b>
<%= @door_log.key %>
</p>
<p>
<b>Data:</b>
<%= @door_log.data %>
</p>
<%= link_to 'Edit', edit_door_log_path(@door_log) %> |
<%= link_to 'Back', door_logs_path %>

View File

@@ -7,7 +7,10 @@
<%= csrf_meta_tags %>
</head>
<body>
<div id="header">
<a href="/users">Users</a>
<a href="/door_logs">Logs</a>
</div>
<%= yield %>
</body>

View File

@@ -1,5 +1,7 @@
<h1>Listing users</h1>
<%= link_to 'New User', new_user_path %>
<%= link_to 'Upload all users', upload_all_path %>
<table>
<tr>
<th>Name</th>
@@ -26,4 +28,3 @@
<br />
<%= link_to 'New User', new_user_path %>

View File

@@ -20,6 +20,6 @@
<%= @user.card_permissions %>
</p>
<%= link_to 'Upload to Door', upload_path(user) %>
<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>