File: _wikis.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 (31 lines) | stat: -rw-r--r-- 1,288 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
- messages = wiki_empty_state_messages(@wiki)
- hide_create = local_assigns[:hide_create]

- illustration = 'illustrations/empty-state/empty-wiki-md.svg'
- title = messages.dig(:readonly, :title)
- description = messages.dig(:readonly, :body)
- primary_button_text = nil
- primary_button_link = nil
- secondary_button_text = nil
- secondary_button_link = nil

- if !hide_create && can?(current_user, :create_wiki, @wiki.container)
  - title = messages.dig(:writable, :title)
  - primary_button_text = s_('WikiEmpty|Create your first page')
  - primary_button_link = wiki_page_path(@wiki, params[:id], view: 'create')
  - description = messages.dig(:writable, :body)

  - if show_enable_confluence_integration?(@wiki.container)
    - secondary_button_text = s_('WikiEmpty|Enable the Confluence Wiki integration')
    - secondary_button_link = edit_project_settings_integration_path(@project, :confluence)

= render Pajamas::EmptyStateComponent.new(svg_path: illustration,
  title: title,
  primary_button_text: primary_button_text,
  primary_button_link: primary_button_link,
  secondary_button_text: secondary_button_text,
  secondary_button_link: secondary_button_link,
  empty_state_options: { data: { testid: 'wiki-empty-state' } }) do |c|

  - c.with_description do
    = description