diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-02 18:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-02 18:09:08 +0300 |
commit | 840d5ecdbbf8da3e03a7f0b8b465a89d1519807c (patch) | |
tree | 4e197815c026a947057f7b5cbcb5e3cf106cc22f /app/helpers | |
parent | b0107e8756bf3287f8a6221252c800209a9c46f6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/commits_helper.rb | 10 | ||||
-rw-r--r-- | app/helpers/diff_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/nav_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/services_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/wiki_helper.rb | 24 |
5 files changed, 30 insertions, 11 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 2a0c2e73dd6..680a1a5a919 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -181,15 +181,11 @@ module CommitsHelper end def view_file_button(commit_sha, diff_new_path, project, replaced: false) + path = project_blob_path(project, tree_join(commit_sha, diff_new_path)) title = replaced ? _('View replaced file @ ') : _('View file @ ') - link_to( - project_blob_path(project, - tree_join(commit_sha, diff_new_path)), - class: 'btn view-file js-view-file' - ) do - raw(title) + content_tag(:span, Commit.truncate_sha(commit_sha), - class: 'commit-sha') + link_to(path, class: 'btn') do + raw(title) + content_tag(:span, truncate_sha(commit_sha), class: 'commit-sha') end end diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 4c3c4931387..65f204b3afd 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -135,8 +135,7 @@ module DiffHelper def diff_file_html_data(project, diff_file_path, diff_commit_id) { - blob_diff_path: project_blob_diff_path(project, - tree_join(diff_commit_id, diff_file_path)), + blob_diff_path: project_blob_diff_path(project, tree_join(diff_commit_id, diff_file_path)), view: diff_view } end diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 9ea0b9cb584..d849ed9d076 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -27,7 +27,7 @@ module NavHelper end elsif current_path?('jobs#show') %w[page-gutter build-sidebar right-sidebar-expanded] - elsif current_controller?('wikis') && current_action?('show', 'create', 'edit', 'update', 'history', 'git_access', 'destroy') + elsif current_controller?('wikis') && current_action?('show', 'create', 'edit', 'update', 'history', 'git_access', 'destroy', 'diff') %w[page-gutter wiki-sidebar right-sidebar-expanded] else [] diff --git a/app/helpers/services_helper.rb b/app/helpers/services_helper.rb index 13d26166e6e..8fb884919d4 100644 --- a/app/helpers/services_helper.rb +++ b/app/helpers/services_helper.rb @@ -96,7 +96,7 @@ module ServicesHelper end def integration_form_refactor? - Feature.enabled?(:integration_form_refactor, @project) + Feature.enabled?(:integration_form_refactor, @project, default_enabled: true) end def integration_form_data(integration) diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index 3c983606b73..c3ef4cbf841 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -3,6 +3,30 @@ module WikiHelper include API::Helpers::RelatedResourcesHelpers + def wiki_page_title(page, action = nil) + titles = [_('Wiki')] + + if page.persisted? + titles << page.human_title + breadcrumb_title(page.human_title) + wiki_breadcrumb_dropdown_links(page.slug) + end + + titles << action if action + page_title(*titles.reverse) + add_to_breadcrumbs(_('Wiki'), wiki_path(page.wiki)) + end + + def link_to_wiki_page(page, **options) + link_to page.human_title, wiki_page_path(page.wiki, page), **options + end + + def wiki_sidebar_toggle_button + content_tag :button, class: 'btn btn-default sidebar-toggle js-sidebar-wiki-toggle', role: 'button', type: 'button' do + sprite_icon('chevron-double-lg-left') + end + end + # Produces a pure text breadcrumb for a given page. # # page_slug - The slug of a WikiPage object. |