rosa-build/app/views/advisories/_list.html.haml

33 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-01-21 04:51:49 +00:00
%table#myTable.tablesorter.advisories.static-search{cellspacing: "0", cellpadding: "0"}
%thead
%tr
%th.th1= t("activerecord.attributes.advisory.advisory_id")
%th.th2= t("layout.advisories.affected_versions")
%th.th3= t("activerecord.attributes.advisory.description")
%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|
= 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
%tbody
- if list.size > 0
2014-01-21 04:51:49 +00:00
= render partial: 'list_item', collection: list, as: :advisory
- else
%tr.odd
2014-01-21 04:51:49 +00:00
%td.no_results{colspan: 3}
= t("layout.search.no_results", query: params[:q])
:javascript
$(function() {
var $search = $('tr.search > th input[type="text"]');
$search.on('blur focus', function() {
if ($search.val() === '') {
$search.toggleClass('gray black');
}
});
});