app/views/extface/devices/show.html.erb in extface-0.0.5 vs app/views/extface/devices/show.html.erb in extface-0.0.6

- old
+ new

@@ -1,37 +1,72 @@ -<p id="notice"><%= notice %></p> +<div class="page-header nav"> + <%= link_to 'Edit', edit_device_path(@device), class: 'btn btn-primary navbar-btn pull-right' %> + <h3 class='navbar-text'> + <%= link_to extface.root_path do %> + Extface<sup>&hearts;</sup> + <% end %> + &raquo; + <%= link_to t('.devices'), devices_path %> + &raquo; + <%= @device.name %> + </h3> +</div> +<br /> +<% if @job.present? %> + <div class='alert alert-info job-monitor'> + See job #<%= @job.id %> execution progress at: <%= link_to job_url(@job), job_path(@job), target: :_blank %> + <div> + <div class='text-danger'>You need multi-threaded server to do that!</div> + <small>(Easiest workaraund: Include <%= link_to 'unicorn-rails', 'https://github.com/samuelkadolph/unicorn-rails', target: :_blank %> in your application)</small> + </div> + </div> +<% end %> +<div class='row'> + <div class='col-sm-6'> + <dl class="dl-horizontal"> + <dt><%= t('.name') %></dt> + <dd><%= @device.name %></dd> + + <dt><%= t('.parent') %></dt> + <dd><%= @device.extfaceable.composite_id %></dd> + + <dt><%= t('.driver') %></dt> + <dd><%= @device.driver_name %></dd> + </dl> + </div> + <div class='col-sm-6'> + <dl class="dl-horizontal"> + <dt><%= t('.created') %></dt> + <dd><%= distance_of_time_in_words_to_now @device.created_at %> ago</dd> + + <dt><%= t('.successful_jobs') %></dt> + <dd> + <%= @device.jobs.count %> + (<%= t('.last') %>: <%= distance_of_time_in_words_to_now @device.jobs.maximum(:completed_at) %> ago) + </dd> + + <dt><%= t('.failures') %></dt> + <dd> + <%= @device.jobs.count %> + (<%= t('.last') %>: <%= distance_of_time_in_words_to_now @device.jobs.maximum(:failed_at) %> ago) + </dd> + -<p> - <strong>Uuid:</strong> - <%= @device.uuid %> -</p> + </dl> + </div> +</div> -<p> - <strong>Name:</strong> - <%= @device.name %> -</p> +<dl class="dl-horizontal"> + <dt><%= t('.client_pull_url') %></dt> + <dd><pre><%= extface.pull_url(@device.uuid) %></pre></dd> +</dl> -<p> - <strong>Extfaceable:</strong> - <%= @device.extfaceable %> -</p> +<hr /> +<% if @device.print? %> + <%= button_to 'Print Test Page', test_page_device_path(@device), remote: true, name: :test_page, value: true, class: 'btn btn-warning' %> +<% end %> -<p> - <strong>Driveable:</strong> - <%= @device.driveable %> -</p> - -<%= link_to 'Edit', edit_device_path(@device) %> | -<%= link_to 'Back', devices_path %> -<br /> -Client Pull URL: -<br /> - <%= extface.pull_url(@device.uuid) %> -<br /> -<%= link_to 'Print Test Page', test_page_device_path(@device), remote:true %> - - <h1>Jobs</h1> <table class='table'> <thead> <tr class='active'> <th>Id</th> @@ -41,10 +76,10 @@ <th>Failed</th> <th>Completed</th> <th>Connected</th> </tr> </thead> - <% @device.jobs.last(10).each do |job|%> + <% @device.jobs.last(10).reverse.each do |job|%> <tr> <td><%= job.id %></td> <td><%= job.created_at %></td> <td><%= job.description %></td> <td><%= job.error %></td>