diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/views/shared/wikis | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/views/shared/wikis')
-rw-r--r-- | app/views/shared/wikis/_form.html.haml | 26 | ||||
-rw-r--r-- | app/views/shared/wikis/_main_links.html.haml | 9 | ||||
-rw-r--r-- | app/views/shared/wikis/_pages_wiki_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/wikis/_sidebar.html.haml | 11 | ||||
-rw-r--r-- | app/views/shared/wikis/_wiki_directory.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/wikis/diff.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/wikis/edit.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/wikis/empty.html.haml | 1 | ||||
-rw-r--r-- | app/views/shared/wikis/history.html.haml | 1 | ||||
-rw-r--r-- | app/views/shared/wikis/pages.html.haml | 5 | ||||
-rw-r--r-- | app/views/shared/wikis/show.html.haml | 11 |
11 files changed, 41 insertions, 35 deletions
diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index 66c0f64c32c..dde1b3afa2d 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -17,10 +17,10 @@ = f.hidden_field :last_commit_sha, value: @page.last_commit_sha .form-group.row - .col-sm-12= f.label :title, class: 'control-label-full-width' - .col-sm-12 + .col-sm-2.col-form-label= f.label :title, class: 'control-label-full-width' + .col-sm-10 = f.text_field :title, class: 'form-control qa-wiki-title-textbox', value: @page.title, required: true, autofocus: !@page.persisted?, placeholder: s_('Wiki|Page title') - %span.d-inline-block.mw-100.gl-mt-2 + %span.gl-display-inline-block.gl-max-w-full.gl-mt-2.gl-text-gray-600 = sprite_icon('bulb', size: 12, css_class: 'gl-mr-n1') - if @page.persisted? = s_("WikiEditPageTip|Tip: You can move this page by adding the path to the beginning of the title.") @@ -29,18 +29,18 @@ - else = s_("WikiNewPageTip|Tip: You can specify the full path for the new file. We will automatically create any missing directories.") = succeed '.' do - = link_to _('Learn more'), help_page_path('user/project/wiki/index', anchor: 'creating-a-new-wiki-page'), + = link_to _('More information'), help_page_path('user/project/wiki/index', anchor: 'creating-a-new-wiki-page'), target: '_blank', rel: 'noopener noreferrer' .form-group.row - .col-sm-12= f.label :format, class: 'control-label-full-width' - .col-sm-12 + .col-sm-2.col-form-label= f.label :format, class: 'control-label-full-width' + .col-sm-10 .select-wrapper = f.select :format, options_for_select(Wiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control' = icon('chevron-down') .form-group.row - .col-sm-12= f.label :content, class: 'control-label-full-width' - .col-sm-12 + .col-sm-2.col-form-label= f.label :content, class: 'control-label-full-width' + .col-sm-10 = render layout: 'shared/md_preview', locals: { url: wiki_page_path(@wiki, @page, action: :preview_markdown) } do = render 'shared/zen', f: f, attr: :content, classes: 'note-textarea qa-wiki-content-textarea', placeholder: s_("WikiPage|Write your content or drag files hereā¦") = render 'shared/notes/hints' @@ -48,7 +48,7 @@ .clearfix .error-alert - .form-text.text-muted + .form-text.gl-text-gray-600 = succeed '.' do - case @page.format.to_s - when 'rdoc' @@ -65,15 +65,15 @@ = (s_("WikiMarkdownDocs|More examples are in the %{docs_link}") % { docs_link: markdown_link }).html_safe .form-group.row - .col-sm-12= f.label :commit_message, class: 'control-label-full-width' - .col-sm-12= f.text_field :message, class: 'form-control qa-wiki-message-textbox', rows: 18, value: nil + .col-sm-2.col-form-label= f.label :commit_message, class: 'control-label-full-width' + .col-sm-10= f.text_field :message, class: 'form-control qa-wiki-message-textbox', rows: 18, value: nil .form-actions - if @page && @page.persisted? = f.submit _("Save changes"), class: 'btn-success btn qa-save-changes-button' .float-right - = link_to _("Cancel"), wiki_page_path(@wiki, @page), class: 'btn btn-cancel btn-grouped' + = link_to _("Cancel"), wiki_page_path(@wiki, @page), class: 'btn gl-button btn-cancel btn-grouped' - else = f.submit s_("Wiki|Create page"), class: 'btn-success btn qa-create-page-button rspec-create-page-button' .float-right - = link_to _("Cancel"), wiki_path(@wiki), class: 'btn btn-cancel' + = link_to _("Cancel"), wiki_path(@wiki), class: 'btn gl-button btn-cancel' diff --git a/app/views/shared/wikis/_main_links.html.haml b/app/views/shared/wikis/_main_links.html.haml index e173ef72d11..8568c36559a 100644 --- a/app/views/shared/wikis/_main_links.html.haml +++ b/app/views/shared/wikis/_main_links.html.haml @@ -1,9 +1,6 @@ - if @page&.persisted? + = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button", role: "button", data: { qa_selector: 'page_history_button' } do + = s_("Wiki|Page history") - if can?(current_user, :create_wiki, @wiki.container) - = link_to wiki_path(@wiki, action: :new), class: "btn btn-success", role: "button", data: { qa_selector: 'new_page_button' } do + = link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-success btn-inverted", role: "button", data: { qa_selector: 'new_page_button' } do = s_("Wiki|New page") - = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn", role: "button", data: { qa_selector: 'page_history_button' } do - = s_("Wiki|Page history") - - if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding - = link_to wiki_page_path(@wiki, @page, action: :edit), class: "btn js-wiki-edit", role: "button", data: { qa_selector: 'edit_page_button' } do - = _("Edit") diff --git a/app/views/shared/wikis/_pages_wiki_page.html.haml b/app/views/shared/wikis/_pages_wiki_page.html.haml index b56ae2bf9b1..fb6f58d044d 100644 --- a/app/views/shared/wikis/_pages_wiki_page.html.haml +++ b/app/views/shared/wikis/_pages_wiki_page.html.haml @@ -1,5 +1,5 @@ %li - = link_to wiki_page.title, wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.slug } + = link_to wiki_page.human_title, wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.slug } %small (#{wiki_page.format}) .float-right - if wiki_page.last_version diff --git a/app/views/shared/wikis/_sidebar.html.haml b/app/views/shared/wikis/_sidebar.html.haml index 54f285671a1..893661755ab 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -4,10 +4,11 @@ %a.gutter-toggle.float-right.d-block.d-sm-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" } = sprite_icon('chevron-double-lg-right', css_class: 'gl-icon') - - git_access_url = wiki_path(@wiki, action: :git_access) - = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do - = sprite_icon('download', css_class: 'gl-mr-2') - %span= _("Clone repository") + - if @wiki.container.is_a?(Project) + - git_access_url = wiki_path(@wiki, action: :git_access) + = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do + = sprite_icon('download', css_class: 'gl-mr-2') + %span= _("Clone repository") .blocks-container .block.block-first.w-100 @@ -18,5 +19,5 @@ = render @sidebar_wiki_entries, context: 'sidebar' .block.w-100 - if @sidebar_limited - = link_to wiki_path(@wiki, action: :pages), class: 'btn btn-block', data: { qa_selector: 'view_all_pages_button' } do + = link_to wiki_path(@wiki, action: :pages), class: 'btn gl-button btn-block', data: { qa_selector: 'view_all_pages_button' } do = s_("Wiki|View All Pages") diff --git a/app/views/shared/wikis/_wiki_directory.html.haml b/app/views/shared/wikis/_wiki_directory.html.haml index 21e829d86a6..a492d1e5aa0 100644 --- a/app/views/shared/wikis/_wiki_directory.html.haml +++ b/app/views/shared/wikis/_wiki_directory.html.haml @@ -1,4 +1,4 @@ %li{ data: { qa_selector: 'wiki_directory_content' } } - = wiki_directory.slug + = wiki_directory.title %ul - = render wiki_directory.pages, context: context + = render wiki_directory.entries, context: context diff --git a/app/views/shared/wikis/diff.html.haml b/app/views/shared/wikis/diff.html.haml index 6fce3f5894e..68bbbd66f4a 100644 --- a/app/views/shared/wikis/diff.html.haml +++ b/app/views/shared/wikis/diff.html.haml @@ -1,4 +1,5 @@ - wiki_page_title @page, _('Changes') +- add_page_specific_style 'page_bundles/wiki' - commit = @diffs.diffable .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row @@ -12,7 +13,7 @@ = _('Changes') .nav-controls.pb-md-3.pb-lg-0 - = link_to wiki_page_path(@wiki, @page, action: :history), class: 'btn', role: 'button', data: { qa_selector: 'page_history_button' } do + = link_to wiki_page_path(@wiki, @page, action: :history), class: 'btn gl-button', role: 'button', data: { qa_selector: 'page_history_button' } do = s_('Wiki|Page history') .page-content-header diff --git a/app/views/shared/wikis/edit.html.haml b/app/views/shared/wikis/edit.html.haml index 64a4816def6..834749caaba 100644 --- a/app/views/shared/wikis/edit.html.haml +++ b/app/views/shared/wikis/edit.html.haml @@ -1,4 +1,5 @@ - wiki_page_title @page, @page.persisted? ? _('Edit') : _('New') +- add_page_specific_style 'page_bundles/wiki' = wiki_page_errors(@error) @@ -17,8 +18,6 @@ .nav-controls.pb-md-3.pb-lg-0 - if @page.persisted? - = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn" do - = s_("Wiki|Page history") - if can?(current_user, :admin_wiki, @wiki.container) #delete-wiki-modal-wrapper{ data: { delete_wiki_url: wiki_page_path(@wiki, @page), page_title: @page.human_title } } diff --git a/app/views/shared/wikis/empty.html.haml b/app/views/shared/wikis/empty.html.haml index 62fa6e1907b..c52ead74b4c 100644 --- a/app/views/shared/wikis/empty.html.haml +++ b/app/views/shared/wikis/empty.html.haml @@ -1,4 +1,5 @@ - page_title _("Wiki") - @right_sidebar = false +- add_page_specific_style 'page_bundles/wiki' = render 'shared/empty_states/wikis' diff --git a/app/views/shared/wikis/history.html.haml b/app/views/shared/wikis/history.html.haml index f9d21c8fb57..50ccfdeabd5 100644 --- a/app/views/shared/wikis/history.html.haml +++ b/app/views/shared/wikis/history.html.haml @@ -1,4 +1,5 @@ - wiki_page_title @page, _('History') +- add_page_specific_style 'page_bundles/wiki' .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row = wiki_sidebar_toggle_button diff --git a/app/views/shared/wikis/pages.html.haml b/app/views/shared/wikis/pages.html.haml index 35a62ec2bb4..76fc9510740 100644 --- a/app/views/shared/wikis/pages.html.haml +++ b/app/views/shared/wikis/pages.html.haml @@ -2,6 +2,7 @@ - breadcrumb_title s_("Wiki|Pages") - page_title s_("Wiki|Pages"), _("Wiki") - sort_title = wiki_sort_title(params[:sort]) +- add_page_specific_style 'page_bundles/wiki' .wiki-page-header.top-area.flex-column.flex-lg-row @@ -10,14 +11,14 @@ = s_("Wiki|Wiki Pages") .nav-controls.pb-md-3.pb-lg-0 - = link_to wiki_path(@wiki, action: :git_access), class: 'btn' do + = link_to wiki_path(@wiki, action: :git_access), class: 'btn gl-button' do = sprite_icon('download') = _("Clone repository") .dropdown.inline.wiki-sort-dropdown .btn-group{ role: 'group' } .btn-group{ role: 'group' } - %button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } + %button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn gl-button btn-default' } = sort_title = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort diff --git a/app/views/shared/wikis/show.html.haml b/app/views/shared/wikis/show.html.haml index a7c734f5af4..6f1c1a3a801 100644 --- a/app/views/shared/wikis/show.html.haml +++ b/app/views/shared/wikis/show.html.haml @@ -1,10 +1,10 @@ - wiki_page_title @page +- add_page_specific_style 'page_bundles/wiki' .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row = wiki_sidebar_toggle_button .nav-text.flex-fill - %h2.wiki-page-title{ data: { qa_selector: 'wiki_page_title' } }= @page.human_title %span.wiki-last-edit-by - if @page.last_version = (_("Last edited by %{name}") % { name: "<strong>#{@page.last_version.author_name}</strong>" }).html_safe @@ -20,8 +20,13 @@ - history_link = link_to s_("WikiHistoricalPage|history"), wiki_page_path(@wiki, @page, action: :history) = (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe -.gl-mt-3.gl-mb-3 - .js-wiki-page-content.md{ data: { qa_selector: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json } } +.gl-mt-5.gl-mb-3 + .gl-display-flex.gl-justify-content-space-between + %h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page.human_title + %div + - if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding + = link_to sprite_icon('pencil', css_class: 'gl-icon'), wiki_page_path(@wiki, @page, action: :edit), title: 'Edit', role: "button", class: 'btn gl-button btn-icon btn-default js-wiki-edit', data: { qa_selector: 'edit_page_button', testid: 'wiki_edit_button' } + .js-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json } } = render_wiki_content(@page) = render 'shared/wikis/sidebar' |