diff options
Diffstat (limited to 'app/views/shared/wikis')
-rw-r--r-- | app/views/shared/wikis/_sidebar_wiki_page.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/wikis/_wiki_directory.html.haml | 10 | ||||
-rw-r--r-- | app/views/shared/wikis/diff.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/wikis/empty.html.haml | 10 |
4 files changed, 24 insertions, 6 deletions
diff --git a/app/views/shared/wikis/_sidebar_wiki_page.html.haml b/app/views/shared/wikis/_sidebar_wiki_page.html.haml index 38a7e6fc813..2c5c3aa68a3 100644 --- a/app/views/shared/wikis/_sidebar_wiki_page.html.haml +++ b/app/views/shared/wikis/_sidebar_wiki_page.html.haml @@ -1,3 +1,7 @@ +- wiki_path = wiki_page_path(@wiki, wiki_page) + %li{ class: active_when(params[:id] == wiki_page.slug) } - = link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do - = wiki_page.human_title + .gl-relative.gl-display-flex.gl-align-items-center.js-wiki-list-toggle.wiki-list{ data: { testid: 'wiki-list' } } + = render Pajamas::ButtonComponent.new(icon: 'plus', href: "#{wiki_path}/{new_page_title}", button_options: { class: 'wiki-list-create-child-button gl-bg-transparent! gl-hover-bg-gray-50! gl-focus-bg-gray-50! gl-absolute gl-top-half gl-translate-y-n50 gl-cursor-pointer gl-right-3' }) + = link_to wiki_path, data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do + = wiki_page.human_title diff --git a/app/views/shared/wikis/_wiki_directory.html.haml b/app/views/shared/wikis/_wiki_directory.html.haml index 5c2233a4db2..6a066e0a838 100644 --- a/app/views/shared/wikis/_wiki_directory.html.haml +++ b/app/views/shared/wikis/_wiki_directory.html.haml @@ -1,6 +1,12 @@ +- wiki_path = wiki_page_path(@wiki, wiki_directory) + %li{ class: active_when(params[:id] == wiki_directory.slug), data: { qa_selector: 'wiki_directory_content' } } - = link_to wiki_page_path(@wiki, wiki_directory), data: { qa_selector: 'wiki_dir_page_link', qa_page_name: wiki_directory.title } do - = wiki_directory.title + .gl-relative.gl-display-flex.gl-align-items-center.js-wiki-list-toggle.wiki-list{ data: { testid: 'wiki-list' } }< + = sprite_icon('chevron-right', css_class: 'js-wiki-list-expand-button wiki-list-expand-button gl-mr-2 gl-cursor-pointer') + = sprite_icon('chevron-down', css_class: 'js-wiki-list-collapse-button wiki-list-collapse-button gl-mr-2 gl-cursor-pointer') + = render Pajamas::ButtonComponent.new(icon: 'plus', href: "#{wiki_path}/{new_page_title}", button_options: { class: 'wiki-list-create-child-button gl-bg-transparent! gl-hover-bg-gray-50! gl-focus-bg-gray-50! gl-absolute gl-top-half gl-translate-y-n50 gl-cursor-pointer gl-right-3' }) + = link_to wiki_path, data: { qa_selector: 'wiki_dir_page_link', qa_page_name: wiki_directory.title } do + = wiki_directory.title %ul - wiki_directory.entries.each do |entry| = render partial: entry.to_partial_path, object: entry, locals: { context: context } diff --git a/app/views/shared/wikis/diff.html.haml b/app/views/shared/wikis/diff.html.haml index c39739ac422..ee6c7f307a7 100644 --- a/app/views/shared/wikis/diff.html.haml +++ b/app/views/shared/wikis/diff.html.haml @@ -28,5 +28,5 @@ %pre.commit-description< = preserve(markdown_field(commit, :description)) -= render 'projects/diffs/diffs', diffs: @diffs += render 'projects/diffs/diffs', diffs: @diffs, diff_page_context: "is-wiki" = render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/empty.html.haml b/app/views/shared/wikis/empty.html.haml index c52ead74b4c..d30a37aaa3e 100644 --- a/app/views/shared/wikis/empty.html.haml +++ b/app/views/shared/wikis/empty.html.haml @@ -2,4 +2,12 @@ - @right_sidebar = false - add_page_specific_style 'page_bundles/wiki' -= render 'shared/empty_states/wikis' +- if @error.present? + = render Pajamas::AlertComponent.new(alert_options: { id: 'error_explanation', class: 'gl-mb-3'}, + dismissible: false, + variant: :danger) do |c| + = c.body do + %ul.gl-pl-4 + = @error + += render 'shared/empty_states/wikis', hide_create: @error.present? |