Sha256: 7c7ce4ab60a781b9f255c15a3e0ec46d8b8235f1affbacfc497b9d381dfd392e

Contents?: true

Size: 1.74 KB

Versions: 29

Compression:

Stored size: 1.74 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

29 entries across 29 versions & 1 rubygems

Version Path
rocket_cms-0.37.1 app/views/search/index.html.haml
rocket_cms-0.37.0 app/views/search/index.html.haml
rocket_cms-0.36.0 app/views/search/index.html.haml
rocket_cms-0.35.0 app/views/search/index.html.haml
rocket_cms-0.34.0 app/views/search/index.html.haml
rocket_cms-0.33.1 app/views/search/index.html.haml
rocket_cms-0.33.0 app/views/search/index.html.haml
rocket_cms-0.32.0 app/views/search/index.html.haml
rocket_cms-0.31.1 app/views/search/index.html.haml
rocket_cms-0.31.0 app/views/search/index.html.haml
rocket_cms-0.30.0 app/views/search/index.html.haml
rocket_cms-0.29.0 app/views/search/index.html.haml
rocket_cms-0.28.0 app/views/search/index.html.haml
rocket_cms-0.27.8 app/views/search/index.html.haml
rocket_cms-0.27.7 app/views/search/index.html.haml
rocket_cms-0.27.6 app/views/search/index.html.haml
rocket_cms-0.27.5 app/views/search/index.html.haml
rocket_cms-0.27.4 app/views/search/index.html.haml
rocket_cms-0.27.3 app/views/search/index.html.haml
rocket_cms-0.27.2 app/views/search/index.html.haml