2014-01-21 04:51:49 +00:00
|
|
|
%table#myTable.tablesorter.advisories.static-search{cellspacing: "0", cellpadding: "0"}
|
2012-05-05 18:18:29 +01:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th.th1= t("activerecord.attributes.advisory.advisory_id")
|
|
|
|
%th.th2= t("layout.advisories.affected_versions")
|
|
|
|
%th.th3= t("activerecord.attributes.advisory.description")
|
2012-06-20 18:51:08 +01:00
|
|
|
%tr.search
|
|
|
|
-# TODO: change filter to Backbone.js
|
2014-01-21 04:51:49 +00:00
|
|
|
%th{colspan: 3, rowspan: 1}
|
|
|
|
= form_tag advisories_path, method: :get do |f|
|
2014-02-12 19:51:10 +00:00
|
|
|
= text_field_tag('q', params[:q], placeholder: t('layout.advisories.search'), class: params[:q].present? ? 'black' : 'gray', style: 'width:600px;')
|
2014-01-21 04:51:49 +00:00
|
|
|
= submit_tag t('layout.search.header'), data: {'disable-with' => t('layout.processing')}
|
|
|
|
=# link_to t('layout.back'), advisories_path, class: 'button'
|
|
|
|
= button_to t('layout.clear'), {action: :index} , method: :get
|
2012-06-20 18:51:08 +01:00
|
|
|
|
2012-05-05 18:18:29 +01:00
|
|
|
%tbody
|
2012-06-20 18:51:08 +01:00
|
|
|
- if list.size > 0
|
2014-01-21 04:51:49 +00:00
|
|
|
= render partial: 'list_item', collection: list, as: :advisory
|
2012-06-20 18:51:08 +01:00
|
|
|
- else
|
|
|
|
%tr.odd
|
2014-01-21 04:51:49 +00:00
|
|
|
%td.no_results{colspan: 3}
|
|
|
|
= t("layout.search.no_results", query: params[:q])
|
2012-06-20 18:51:08 +01:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
var $search = $('tr.search > th input[type="text"]');
|
|
|
|
$search.on('blur focus', function() {
|
|
|
|
if ($search.val() === '') {
|
|
|
|
$search.toggleClass('gray black');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|