Sha256: dc6b8f812bb6a1f20f71c46b30b4cd2b8bc1cdbb139cfd3b22eba4a67c4e3f40

Contents?: true

Size: 1.75 KB

Versions: 53

Compression:

Stored size: 1.75 KB

Contents

.rs-search-results
  %h1 Результаты поиска
  = form_tag search_path, method: :get, class: 'nav_search' do
    = text_field_tag 'query', params[:query], placeholder: "Поиск"
    = submit_tag 'Найти'
  %ol
    - any = false
    - @results.each do |r|
      - any = true
      %li
        -if RocketCMS.mongoid?
          - u = app_url(r)
          - next if u.nil?
          - next if u.respond_to?(:enabled) && !u.searchable.enabled
          - any = true
          .title
            %a{href: u}
              %strong= raw (r._highlight.nil? || r._highlight['name'].nil?) ? r.name : r._highlight['name'].join(' ... ')
              (#{r.class.model_name.human})
          .text
            = raw (r._highlight.nil? || r._highlight['content'].nil?) ? (r.content.blank? ? '' : SmartExcerpt.truncate(r.content)) : r._highlight['content'].join(' ... ')
            %span.more= link_to '', url_for(r)
        - else
          - u = app_url(r.searchable)
          - next if u.nil?
          - next if r.searchable.respond_to?(:enabled) && !r.searchable.enabled
          - any = true
          .title
            %a{href: u}
              %strong= raw highlight(r.searchable.name, params[:query], highlighter: '<em>\1</em>')
              (#{r.searchable.class.model_name.human})
          .text
            - ex = excerpt(strip_tags(r.searchable.content), params[:query], radius: 150)
            - if ex.nil?
              = raw strip_tags(SmartExcerpt.h.smart_truncate(r.searchable.content, words: 20))
            - else
              = raw highlight(ex, params[:query], highlighter: '<em>\1</em>')
            %span.more= link_to '', u
  - unless any
    .rs-search-no-results К сожалению, ничего не найдено

  = paginate @results if any

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
rocket_cms-0.24.0 app/views/search/index.html.haml
rocket_cms-0.22.0 app/views/search/index.html.haml
rocket_cms-0.21.1 app/views/search/index.html.haml
rocket_cms-0.21.0 app/views/search/index.html.haml
rocket_cms-0.20.1 app/views/search/index.html.haml
rocket_cms-0.20.0 app/views/search/index.html.haml
rocket_cms-0.19.8 app/views/search/index.html.haml
rocket_cms-0.19.7 app/views/search/index.html.haml
rocket_cms-0.19.6 app/views/search/index.html.haml
rocket_cms-0.19.4 app/views/search/index.html.haml
rocket_cms-0.19.3 app/views/search/index.html.haml
rocket_cms-0.19.2 app/views/search/index.html.haml
rocket_cms-0.19.1 app/views/search/index.html.haml
rocket_cms-0.19.0 app/views/search/index.html.haml
rocket_cms-0.18.5 app/views/search/index.html.haml
rocket_cms-0.18.4 app/views/search/index.html.haml
rocket_cms-0.18.3 app/views/search/index.html.haml
rocket_cms-0.18.2 app/views/search/index.html.haml
rocket_cms-0.18.1 app/views/search/index.html.haml
rocket_cms-0.18.0 app/views/search/index.html.haml