diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /app/views/shared/wikis | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/views/shared/wikis')
-rw-r--r-- | app/views/shared/wikis/_form.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/wikis/_pages_wiki_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/wikis/_sidebar.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/wikis/_sidebar_wiki_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/wikis/diff.html.haml | 32 | ||||
-rw-r--r-- | app/views/shared/wikis/edit.html.haml | 10 | ||||
-rw-r--r-- | app/views/shared/wikis/history.html.haml | 57 | ||||
-rw-r--r-- | app/views/shared/wikis/pages.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/wikis/show.html.haml | 15 |
9 files changed, 77 insertions, 57 deletions
diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index 8ea06d4d6c3..92b9207aaa4 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -1,4 +1,4 @@ -- form_classes = %w[wiki-form common-note-form prepend-top-default js-quick-submit] +- form_classes = %w[wiki-form common-note-form gl-mt-3 js-quick-submit] - if @page.persisted? - form_action = wiki_page_path(@wiki, @page) @@ -20,7 +20,7 @@ .col-sm-12= f.label :title, class: 'control-label-full-width' .col-sm-12 = 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.prepend-top-5 + %span.d-inline-block.mw-100.gl-mt-2 = icon('lightbulb-o') - if @page.persisted? = s_("WikiEditPageTip|Tip: You can move this page by adding the path to the beginning of the title.") diff --git a/app/views/shared/wikis/_pages_wiki_page.html.haml b/app/views/shared/wikis/_pages_wiki_page.html.haml index 534884eb848..b56ae2bf9b1 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) + = link_to wiki_page.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 8cfb95cdcf5..cddf19fbc8e 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -1,12 +1,12 @@ %aside.right-sidebar.right-sidebar-expanded.wiki-sidebar.js-wiki-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix" } } .sidebar-container - .block.wiki-sidebar-header.append-bottom-default.w-100 + .block.wiki-sidebar-header.gl-mb-3.w-100 %a.gutter-toggle.float-right.d-block.d-sm-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" } - = icon('angle-double-right') + = sprite_icon('chevron-double-lg-right', size: 16, 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 - = icon('cloud-download', class: 'append-right-5') + = sprite_icon('download', size: 16, css_class: 'gl-mr-2') %span= _("Clone repository") .blocks-container @@ -18,5 +18,5 @@ = render @sidebar_wiki_entries, context: 'sidebar' .block.w-100 - if @sidebar_limited - = link_to wiki_path(@wiki, action: :pages), class: 'btn btn-block' do + = link_to wiki_path(@wiki, action: :pages), class: 'btn btn-block', data: { qa_selector: 'view_all_pages_button' } do = s_("Wiki|View All Pages") diff --git a/app/views/shared/wikis/_sidebar_wiki_page.html.haml b/app/views/shared/wikis/_sidebar_wiki_page.html.haml index 2573471f9f9..4259633280a 100644 --- a/app/views/shared/wikis/_sidebar_wiki_page.html.haml +++ b/app/views/shared/wikis/_sidebar_wiki_page.html.haml @@ -1,3 +1,3 @@ %li{ class: active_when(params[:id] == wiki_page.slug) } - = link_to wiki_page_path(@wiki, wiki_page) do + = link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.slug } do = wiki_page.human_title diff --git a/app/views/shared/wikis/diff.html.haml b/app/views/shared/wikis/diff.html.haml new file mode 100644 index 00000000000..6fce3f5894e --- /dev/null +++ b/app/views/shared/wikis/diff.html.haml @@ -0,0 +1,32 @@ +- wiki_page_title @page, _('Changes') +- commit = @diffs.diffable + +.wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row + = wiki_sidebar_toggle_button + + .nav-text + %h2.wiki-page-title + = link_to_wiki_page @page + %span.light + · + = _('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 + = s_('Wiki|Page history') + +.page-content-header + .header-main-content + %strong= markdown_field(commit, :title) + %span.d-none.d-sm-inline= _('authored') + #{time_ago_with_tooltip(commit.authored_date)} + %span= s_('ByAuthor|by') + = author_avatar(commit, size: 24, has_tooltip: false) + %strong + = commit_author_link(commit, avatar: true, size: 24) + - if commit.description.present? + %pre.commit-description< + = preserve(markdown_field(commit, :description)) + += render 'projects/diffs/diffs', diffs: @diffs += render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/edit.html.haml b/app/views/shared/wikis/edit.html.haml index 5bda8d85627..64a4816def6 100644 --- a/app/views/shared/wikis/edit.html.haml +++ b/app/views/shared/wikis/edit.html.haml @@ -1,18 +1,14 @@ -- @content_class = "limit-container-width" unless fluid_layout -- add_to_breadcrumbs _("Wiki"), wiki_page_path(@wiki, @page) -- breadcrumb_title @page.persisted? ? _("Edit") : _("New") -- page_title @page.persisted? ? _("Edit") : _("New"), @page.human_title, _("Wiki") +- wiki_page_title @page, @page.persisted? ? _('Edit') : _('New') = wiki_page_errors(@error) .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row - %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } - = icon('angle-double-left') + = wiki_sidebar_toggle_button .nav-text %h2.wiki-page-title - if @page.persisted? - = link_to @page.human_title, wiki_page_path(@wiki, @page) + = link_to_wiki_page @page %span.light · = s_("Wiki|Edit Page") diff --git a/app/views/shared/wikis/history.html.haml b/app/views/shared/wikis/history.html.haml index ec07082bd02..f9d21c8fb57 100644 --- a/app/views/shared/wikis/history.html.haml +++ b/app/views/shared/wikis/history.html.haml @@ -1,41 +1,38 @@ -- page_title _("History"), @page.human_title, _("Wiki") +- wiki_page_title @page, _('History') .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row - %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } - = icon('angle-double-left') + = wiki_sidebar_toggle_button .nav-text %h2.wiki-page-title - = link_to @page.human_title, wiki_page_path(@wiki, @page) + = link_to_wiki_page @page %span.light · - = _("History") + = _('History') -.table-holder - %table.table - %thead - %tr - %th= s_("Wiki|Page version") - %th= _("Author") - %th= _("Commit Message") - %th= _("Last updated") - %th= _("Format") - %tbody - - @page_versions.each_with_index do |version, index| - - commit = version +.prepend-top-default.gl-mb-3 + .table-holder + %table.table.wiki-history + %thead %tr - %td - = link_to wiki_page_path(@wiki, @page, version_id: index == 0 ? nil : commit.id) do - = truncate_sha(commit.id) - %td - = commit.author_name - %td - = commit.message - %td - #{time_ago_with_tooltip(version.authored_date)} - %td - %strong - = version.format -= paginate @page_versions, theme: 'gitlab' + %th= s_('Wiki|Page version') + %th= _('Author') + %th= _('Changes') + %th= _('Last updated') + %tbody + - @page_versions.each do |commit| + %tr + %td + = link_to wiki_page_path(@wiki, @page, version_id: commit.id) do + = truncate_sha(commit.id) + %td + = commit.author_name + %td + %span.str-truncated-60 + = link_to wiki_page_path(@wiki, @page, action: :diff, version_id: commit.id), { title: commit.message } do + = commit.message + %td + = time_ago_with_tooltip(commit.authored_date) + = paginate @page_versions, theme: 'gitlab' = render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/pages.html.haml b/app/views/shared/wikis/pages.html.haml index 987c696cdfe..35a62ec2bb4 100644 --- a/app/views/shared/wikis/pages.html.haml +++ b/app/views/shared/wikis/pages.html.haml @@ -11,7 +11,7 @@ .nav-controls.pb-md-3.pb-lg-0 = link_to wiki_path(@wiki, action: :git_access), class: 'btn' do - = icon('cloud-download') + = sprite_icon('download') = _("Clone repository") .dropdown.inline.wiki-sort-dropdown @@ -19,7 +19,7 @@ .btn-group{ role: 'group' } %button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } = sort_title - = icon('chevron-down') + = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %li = sortable_item(s_("Wiki|Title"), wiki_path(@wiki, action: :pages, sort: Wiki::TITLE_ORDER), sort_title) diff --git a/app/views/shared/wikis/show.html.haml b/app/views/shared/wikis/show.html.haml index a4f3996e5de..a7c734f5af4 100644 --- a/app/views/shared/wikis/show.html.haml +++ b/app/views/shared/wikis/show.html.haml @@ -1,19 +1,14 @@ -- @content_class = "limit-container-width" unless fluid_layout -- breadcrumb_title @page.human_title -- wiki_breadcrumb_dropdown_links(@page.slug) -- page_title @page.human_title, _("Wiki") -- add_to_breadcrumbs _("Wiki"), wiki_path(@wiki) +- wiki_page_title @page .wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row - %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } - = icon('angle-double-left') + = 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 - #{time_ago_with_tooltip(@page.last_version.authored_date)} + = time_ago_with_tooltip(@page.last_version.authored_date) .nav-controls.pb-md-3.pb-lg-0 = render 'shared/wikis/main_links' @@ -25,8 +20,8 @@ - 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 -.prepend-top-default.append-bottom-default - .md{ data: { qa_selector: 'wiki_page_content' } } +.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 } } = render_wiki_content(@page) = render 'shared/wikis/sidebar' |