web/views/expected_failures.erb in sidekiq-expected_failures-0.0.1 vs web/views/expected_failures.erb in sidekiq-expected_failures-0.2.0
- old
+ new
@@ -1,28 +1,47 @@
-<%= js :expected %>
-<%= js :bootstrap %>
+<script type="text/javascript">
+ <%= @javascript %>
+</script>
<h3>Expected failures log
<% if @date %>
<small>(<%= @date %>)</small>
<% end %>
</h3>
<% unless @counters.empty? %>
- <div class="well well-sm clearfix">
- <a href="<%= root_path %>expected_failures/clear/counters" class="btn btn-default btn-sm pull-right">Clear counters</span></a>
-
+ <div class="well well-sm">
<dl class="dl-horizontal" style="margin: 0">
<% @counters.each do |exception, count| %>
<dt><%= exception %></dt>
<dd><%= count %></dd>
<% end %>
</dl>
</div>
<% end %>
+<% if @jobs.any? || @counters.any? %>
+ <form id="clear-jobs" method="post" class="form-inline pull-right" action="<%= root_path %>expected_failures/clear">
+ <label>Clear:</label>
+ <select name="what">
+ <option selected>Choose...</option>
+ <% if @jobs.any? %>
+ <optgroup label="Jobs">
+ <option value="old">Older than today</option>
+ <option value="all">All failed</option>
+ </optgroup>
+ <% end %>
+ <% if @counters.any? %>
+ <optgroup label="Counters">
+ <option value="counters">All counters</option>
+ </optgroup>
+ <% end %>
+ </select>
+ </form>
+<% end %>
+
<% if @jobs.any? %>
<div class="modal fade" id="job-details">
<div class="modal-dialog">
<div class="modal-content">
@@ -54,17 +73,14 @@
<option value="<%= date %>" <%= "selected" if date == @date %>><%= date %> (<%= count %>)</option>
<% end %>
</select>
</form>
- <div class="pull-right">
- <a href="<%= root_path %>expected_failures/clear/old" class="btn btn-default btn-sm">Clear older than today</a>
- <a href="<%= root_path %>expected_failures/clear/all" class="btn btn-default btn-sm">Clear all failed</a>
- </div>
-
<p class="clearfix"></p>
+ <%= erb :_paging, :locals => { :url => "#{root_path}expected_failures/#{@date}" } %>
+
<table id="expected" class="queues table table-hover table-bordered table-striped table-white">
<thead>
<th>Datetime</th>
<th>Worker</th>
<th>Exception</th>
@@ -83,9 +99,10 @@
</table>
<%= erb :_paging, :locals => { :url => "#{root_path}expected_failures/#{@date}" } %>
<% else %>
+ <p class="clearfix"></p>
<div class="alert alert-success">
No failed jobs found.
</div>
<% end %>