Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ok wayne

  • Loading branch information...
commit 47c4bfac0b77b3d5da67e22ba398659500f6b533 1 parent 66a8872
@erosen erosen authored
View
3  app/controllers/rule_sets_controller.rb
@@ -5,6 +5,9 @@ def index
@rule_sets = RuleSet.all
@condition_sets = ConditionSet.all
@action_sets = ActionSet.all
+ @conditions = Condition.all
+ @actions = Action.all
+
respond_to do |format|
format.html # index.html.erb
View
40 app/views/actions/_table.html.erb
@@ -0,0 +1,40 @@
+<div class="grid12">
+ <div class="block-border">
+ <div class="block-header">
+ <h1>List of Actions</h1>
+ <p align="right"><%= link_to 'New Action', new_action_path %>&nbsp;&nbsp;&nbsp;</p>
+ </div>
+ <div class="block-content">
+ <table id="table-actions" class="table">
+ <thead>
+ <tr>
+ <th>Action set</th>
+ <th>Device</th>
+ <th>Value</th>
+ <th>Duration</th>
+ <th>Json data</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+</thead>
+<tbody>
+<% @actions.each do |action| %>
+ <tr>
+ <td><%= link_to action.action_set.name, action_set_path(action.action_set) %></td>
+ <td><%= link_to action.device.name, device_path(action.device) %></td>
+ <td><%= action.value.to_s + ' ' + action.device.device_type.unit %></td>
+ <td><%= action.duration %></td>
+ <td><%= action.json_data %></td>
+ <td><%= link_to 'Show', action %></td>
+ <td><%= link_to 'Edit', edit_action_path(action) %></td>
+ <td><%= link_to 'Delete', action, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div> <!--block-content-->
+ </div> <!--block-border-->
+</div> <!--grid12-->
+
+<% content_for :ready_js do "$('#table-actions').dataTable();" end %>
View
3  app/views/condition_sets/_table.html.erb
@@ -34,9 +34,6 @@
</div>
</div>
-
-<br />
-
<div class="clear height-fix"></div>
<% content_for :ready_js do "$('#table-condition-sets').dataTable();" end %>
View
40 app/views/conditions/_table.html.erb
@@ -0,0 +1,40 @@
+<div class="grid12">
+ <div class="block-border">
+ <div class="block-header">
+ <h1>List of Conditions</h1>
+ <p align="right"><%= link_to 'New Condition', new_condition_path %>&nbsp;&nbsp;&nbsp;</p>
+ </div>
+ <div class="block-content">
+ <table id="table-conditions" class="table">
+ <thead>
+ <tr>
+ <th>Condition set</th>
+ <th>Device</th>
+ <th>Comparison</th>
+ <th>Value</th>
+ <th>Json data</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+</thead>
+<tbody>
+<% @conditions.each do |condition| %>
+ <tr>
+ <td><%= link_to condition.condition_set.name, condition_set_path(condition.condition_set) %></td>
+ <td><%= link_to condition.device.name, device_path(condition.device) %></td>
+ <td><%= condition.comparison_string %></td>
+ <td><%= condition.value.to_s + " " + condition.device.device_type.unit %></td>
+ <td><%= condition.json_data %></td>
+ <td><%= link_to 'Show', condition %></td>
+ <td><%= link_to 'Edit', edit_condition_path(condition) %></td>
+ <td><%= link_to 'Delete', condition, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+ </tbody>
+ </table>
+ </div> <!--block-content-->
+ </div> <!--block-border-->
+</div> <!--grid12-->
+
+<% content_for :ready_js do "$('#table-conditions').dataTable();" end %>
View
1  app/views/rule_sets/_table.html.erb
@@ -1,4 +1,3 @@
-
<div class="grid_12">
<div class="block-border">
<div class="block-header">
View
6 app/views/rule_sets/index.html.erb
@@ -2,6 +2,8 @@
<h1>Configure Rules</h1>
<%= render 'rule_sets_table' %>
-<%= render 'condition_sets/condition_sets_table' %>
-<%= render 'action_sets/action_sets_table' %>
+<%= render 'condition_sets/table' %>
+<%= render 'conditions/table' %>
+<%= render 'action_sets/table' %>
+<%= render 'actions/table' %>
Please sign in to comment.
Something went wrong with that request. Please try again.