File: templates.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 (33 lines) | stat: -rw-r--r-- 1,549 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
29
30
31
32
33
- add_to_breadcrumbs _('Wiki'), wiki_path(@wiki)
- breadcrumb_title s_("Wiki|Templates")
- page_title s_("Wiki|Templates"), _("Wiki")
- add_page_specific_style 'page_bundles/wiki'

= render ::Layouts::PageHeadingComponent.new(s_("Wiki|Wiki templates")) do |c|
  - c.with_actions do
    .dropdown.gl-inline-block.wiki-sort-dropdown
      .btn-group{ role: 'group' }
        = wiki_sort_controls(@wiki, params[:direction], action: :templates)

    #js-vue-wiki-more-actions{ data: {
      clone_ssh_url: ssh_clone_url_to_repo(@wiki),
      clone_http_url: http_clone_url_to_repo(@wiki),
      wiki_url: wiki_path(@wiki),
      new_url: wiki_page_path(@wiki, "#{Wiki::TEMPLATES_DIR}/#{SecureRandom.uuid}", random_title: true),
      templates_url: wiki_page_path(@wiki, Wiki::TEMPLATES_DIR),
    } }

= render ::Layouts::CrudComponent.new(s_("Wiki|Templates"), count: @wiki_entries_count, icon: 'template', body_options: { class: '' }) do |c|
  - c.with_actions do
    = render Pajamas::ButtonComponent.new(href: wiki_page_path(@wiki, "#{Wiki::TEMPLATES_DIR}/#{SecureRandom.uuid}", random_title: true), size: :small) do
      = s_("Wiki|New template")
  - c.with_body do
    %ul.wiki-pages-list.content-list.wiki-templates-list.content-list-items-padding
      - if @templates_list.empty?
        %li.no-wiki-pages.gl-px-3
          = s_("Wiki|No templates found")
      - @wiki_entries.each do |entry|
        = render partial: entry.to_partial_path, object: entry, locals: { context: 'pages' }

.gl-pt-3
  = paginate @templates_list, theme: 'gitlab'