Commit 1e2d8119 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '299925-fix-i18n-syntax-in-app-views-projects-cleanup-_show-html-haml' into 'master'

Fix i18n link syntax on Repository Cleanup page

See merge request gitlab-org/gitlab!52529
parents 3b6db32b 4a7e0bff
......@@ -267,10 +267,6 @@ module ProjectsHelper
"xcode://clone?repo=#{CGI.escape(default_url_to_repo(project))}"
end
def link_to_filter_repo
link_to 'git filter-repo', 'https://github.com/newren/git-filter-repo', target: '_blank', rel: 'noopener noreferrer'
end
def explore_projects_tab?
current_page?(explore_projects_path) ||
current_page?(trending_explore_projects_path) ||
......
......@@ -6,7 +6,10 @@
%button.btn.js-settings-toggle
= expanded ? _('Collapse') : _('Expand')
%p
= _("Clean up after running %{filter_repo} on the repository." % { filter_repo: link_to_filter_repo }).html_safe
- link_url = 'https://github.com/newren/git-filter-repo'
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: link_url }
- link_end = '</a>'.html_safe
= _("Clean up after running %{link_start}git filter-repo%{link_end} on the repository.").html_safe % { link_start: link_start, link_end: link_end }
= link_to sprite_icon('question-o'),
help_page_path('user/project/repository/reducing_the_repo_size_using_git.md'),
target: '_blank', rel: 'noopener noreferrer'
......
---
title: Make text on Repository Cleanup page translatable
merge_request: 52529
author:
type: fixed
......@@ -5827,6 +5827,9 @@ msgstr ""
msgid "ClassificationLabelUnavailable|is unavailable: %{reason}"
msgstr ""
msgid "Clean up after running %{link_start}git filter-repo%{link_end} on the repository."
msgstr ""
msgid "Clean up image tags"
msgstr ""
......
......@@ -657,31 +657,6 @@ RSpec.describe ProjectsHelper do
end
end
describe 'link_to_filter_repo' do
subject { helper.link_to_filter_repo }
it 'generates a hardcoded link to git filter-repo' do
result = helper.link_to_filter_repo
doc = Nokogiri::HTML.fragment(result)
expect(doc.children.size).to eq(1)
link = doc.children.first
aggregate_failures do
expect(result).to be_html_safe
expect(link.name).to eq('a')
expect(link[:target]).to eq('_blank')
expect(link[:rel]).to eq('noopener noreferrer')
expect(link[:href]).to eq('https://github.com/newren/git-filter-repo')
expect(link.inner_html).to eq('git filter-repo')
expect(result).to be_html_safe
end
end
end
describe '#explore_projects_tab?' do
subject { helper.explore_projects_tab? }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment