- content_for :navigation do = render partial: 'admin_navigation', locals: { active: :news } - content_for :title do Новости - content_for :main do %table.table.table-hover %thead %tr %th{:style => "width: 20%"} Опубликована %th{:style => "width: 80%"} Заголовок %th %tbody - @news_items.each do |news_item| %tr %td= I18n.l(news_item.published_at, :format => :default_date_only_of).gsub(/^0/, '') %td %a{:href => edit_admin_news_item_path(news_item)}= news_item.title - if not news_item.published %span.label.label-warning Черновик - if news_item.published_at.future? %span.label.label-info Отложена %td =link_to admin_news_item_path(news_item), method: :delete, data: {confirm: 'Вы действительно хотите удалить статью "'+news_item.title+'"?'}, class: "btn-dts-remove" do %span.glyphicon.glyphicon-remove = paginate @news_items, :theme => 'bootstrap', :window => 2 - content_for :manage do %a.btn.btn-default{:href => new_admin_news_item_path} Новая статья - content_for :filter do = search_form_for [:admin, @q] do |f| %fieldset .form-group = f.label :title_or_body_or_description_cont, "Текст" = f.text_field :title_or_body_or_description_cont, class: 'form-control' .form-group = f.label :published_at_gt, "Дата публикации" - published_at_gt_value = l(f.object.published_at_gt, :format => :default_date_only).gsub(/^0/, '') rescue nil - published_at_lt_value = l(f.object.published_at_lt, :format => :default_date_only).gsub(/^0/, '') rescue nil = f.text_field :published_at_gt, placeholder: 'От', class: 'datepicker form-control', value: published_at_gt_value = f.text_field :published_at_lt, placeholder: 'До', class: 'datepicker form-control', value: published_at_lt_value .form-group = f.label :published_eq, "Публикация" = f.select :published_eq, options_for_select([['Черновик', false], ['Опубликована', true]], f.object.published_eq), include_blank: true, class: 'form-control' = f.submit "Фильтровать", :class => 'btn btn-default' %a.btn.btn-danger{:href => admin_news_items_path} Сбросить