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 34 35 36 37 38 39 40 41
|
- editing ||= false
- edit_sidebar_text = @sidebar_page ? s_('Wiki|Edit custom sidebar') : s_('Wiki|Add custom sidebar')
- has_wiki_pages = @wiki_pages_count && @wiki_pages_count > 0
%aside.right-sidebar.right-sidebar-expanded.wiki-sidebar.js-wiki-sidebar.js-right-sidebar.gl-hidden{ data: { "offset-top" => "50", "spy" => "affix" }, 'aria-label': _('Wiki') }
.js-wiki-sidebar-resizer
.sidebar-container
.block.gl-mb-3.gl-mx-5.gl-mt-5.gl-block.sm:gl-hidden{ class: '!gl-pt-0' }
%a.gutter-toggle.gl-float-right.gl-block.md:gl-hidden.js-sidebar-wiki-toggle{ href: "#" }
= sprite_icon('chevron-double-lg-right', css_class: 'gl-icon')
- if @sidebar_error.present?
= render 'shared/alert_info', body: s_('Wiki|The sidebar failed to load. You can reload the page to try again.')
- if !editing
.js-wiki-toc
.blocks-container{ class: '!gl-px-3 !gl-my-5' }
.gl-flex.gl-place-content-between.gl-items-center.gl-pb-3.gl-pr-1{ class: (@sidebar_page ? 'js-wiki-expand-pages-list wiki-list collapsed gl-pl-0' : 'gl-pl-3') }
.gl-flex.gl-items-center
- if @sidebar_page
= render Pajamas::ButtonComponent.new(category: :tertiary, size: :small, icon: 'chevron-right', button_options: { class: "js-wiki-list-expand-button wiki-list-expand-button gl-mr-2", data: { testid: 'expand-pages-list' } })
= render Pajamas::ButtonComponent.new(category: :tertiary, size: :small, icon: 'chevron-down', button_options: { class: "js-wiki-list-collapse-button wiki-list-collapse-button gl-mr-2", data: { testid: 'expand-pages-list' } })
%h2.gl-text-lg.gl-my-0.gl-mr-3= s_('Wiki|Pages')
= gl_badge_tag @wiki_pages_count
- if has_wiki_pages && can?(current_user, :create_wiki, @wiki)
- edit_sidebar_url = wiki_page_path(@wiki, Wiki::SIDEBAR, action: :edit)
- sidebar_link_class = (editing && @page&.slug == Wiki::SIDEBAR) ? 'active' : ''
= render Pajamas::ButtonComponent.new(href: edit_sidebar_url, category: :tertiary, size: :small, icon: 'settings', button_options: { class: "gl-border-l gl-pl-3 has-tooltip #{sidebar_link_class}", title: edit_sidebar_text, aria: { label: edit_sidebar_text }})
#js-wiki-sidebar-entries{
data: {
has_custom_sidebar: @sidebar_page ? 'true' : 'false',
can_create: can?(current_user, :create_wiki, @wiki).to_s,
view_all_pages_path: wiki_path(@wiki, action: :pages),
}
}
- if @sidebar_page
.gl-px-4.gl-pt-4.gl-pb-2
= render_wiki_content(@sidebar_page)
|