File: index.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (28 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
- page_title _("Topics")
- add_page_specific_style 'page_bundles/search'
- search = params[:search]
- show_empty_search = @topics.empty? && search
- show_empty_state = @topics.empty? && !search

- if show_empty_state
  = render 'shared/empty_states/topics', button_text: _('New topic'), button_path: new_admin_topic_path
- else
  = render ::Layouts::PageHeadingComponent.new(_('Topics'), options: { data: { event_tracking_load: 'true', event_tracking: 'view_admin_topics_pageload' } }) do |c|
    - c.with_actions do
      .js-merge-topics{ data: { path: merge_admin_topics_path } }
      = render Pajamas::ButtonComponent.new(href: new_admin_topic_path, variant: 'confirm') do
        = _('New topic')

  .gl-flex.gl-min-w-0.gl-grow.row-content-block
    = form_tag admin_topics_path, method: :get, class: 'gl-w-full' do |f|
      - search = params.fetch(:search, nil)
      .search-field-holder
        = search_field_tag :search, search, class: "form-control gl-form-input search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: _('Search by name')
        = sprite_icon('search', css_class: 'search-icon')

  - if show_empty_search
    = render ::Layouts::EmptyResultComponent.new(type: :search)
  - else
    %ul.content-list
      = render partial: 'topic', collection: @topics
    = paginate_collection @topics