Commit 006ebcc9 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'jramsay-4012-i18n-compare' into 'master'

Add i18n helpers to branch comparison view

See merge request gitlab-org/gitlab-ce!16031
parents 9a2186d3 7c721e7b
...@@ -5,22 +5,24 @@ ...@@ -5,22 +5,24 @@
= link_to icon('exchange'), { from: params[:to], to: params[:from] }, class: 'commits-compare-switch has-tooltip btn btn-white', title: 'Swap revisions' = link_to icon('exchange'), { from: params[:to], to: params[:from] }, class: 'commits-compare-switch has-tooltip btn btn-white', title: 'Swap revisions'
.form-group.dropdown.compare-form-group.to.js-compare-to-dropdown .form-group.dropdown.compare-form-group.to.js-compare-to-dropdown
.input-group.inline-input-group .input-group.inline-input-group
%span.input-group-addon Source %span.input-group-addon
= s_("CompareBranches|Source")
= hidden_field_tag :to, params[:to] = hidden_field_tag :to, params[:to]
= button_tag type: 'button', title: params[:to], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_project_path(@project), toggle: "dropdown", target: ".js-compare-to-dropdown", selected: params[:to], field_name: :to } do = button_tag type: 'button', title: params[:to], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_project_path(@project), toggle: "dropdown", target: ".js-compare-to-dropdown", selected: params[:to], field_name: :to } do
.dropdown-toggle-text.str-truncated= params[:to] || 'Select branch/tag' .dropdown-toggle-text.str-truncated= params[:to] || _("Select branch/tag")
= render 'shared/ref_dropdown' = render 'shared/ref_dropdown'
.compare-ellipsis.inline ... .compare-ellipsis.inline ...
.form-group.dropdown.compare-form-group.from.js-compare-from-dropdown .form-group.dropdown.compare-form-group.from.js-compare-from-dropdown
.input-group.inline-input-group .input-group.inline-input-group
%span.input-group-addon Target %span.input-group-addon
= s_("CompareBranches|Target")
= hidden_field_tag :from, params[:from] = hidden_field_tag :from, params[:from]
= button_tag type: 'button', title: params[:from], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_project_path(@project), toggle: "dropdown", target: ".js-compare-from-dropdown", selected: params[:from], field_name: :from } do = button_tag type: 'button', title: params[:from], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_project_path(@project), toggle: "dropdown", target: ".js-compare-from-dropdown", selected: params[:from], field_name: :from } do
.dropdown-toggle-text.str-truncated= params[:from] || 'Select branch/tag' .dropdown-toggle-text.str-truncated= params[:from] || _("Select branch/tag")
= render 'shared/ref_dropdown' = render 'shared/ref_dropdown'
   
= button_tag "Compare", class: "btn btn-create commits-compare-btn" = button_tag s_("CompareBranches|Compare"), class: "btn btn-create commits-compare-btn"
- if @merge_request.present? - if @merge_request.present?
= link_to "View open merge request", project_merge_request_path(@project, @merge_request), class: 'prepend-left-10 btn' = link_to _("View open merge request"), project_merge_request_path(@project, @merge_request), class: 'prepend-left-10 btn'
- elsif create_mr_button? - elsif create_mr_button?
= link_to "Create merge request", create_mr_path, class: 'prepend-left-10 btn' = link_to _("Create merge request"), create_mr_path, class: 'prepend-left-10 btn'
...@@ -3,22 +3,16 @@ ...@@ -3,22 +3,16 @@
- page_title "Compare" - page_title "Compare"
%div{ class: container_class } %div{ class: container_class }
%h3.page-title
= _("Compare Git revisions")
.sub-header-block .sub-header-block
Compare Git revisions. - example_master = capture do
%br
Choose a branch/tag (e.g.
= succeed ')' do
%code.ref-name master %code.ref-name master
or enter a commit SHA (e.g. - example_sha = capture do
= succeed ')' do
%code.ref-name 4eedf23 %code.ref-name 4eedf23
to see what's changed or to create a merge request. = (_("Choose a branch/tag (e.g. %{master}) or enter a commit (e.g. %{sha}) to see what's changed or to create a merge request.") % { master: example_master, sha: example_sha }).html_safe
%br %br
Changes are shown as if the = (_("Changes are shown as if the <b>source</b> revision was being merged into the <b>target</b> revision.")).html_safe
%b source
revision was being merged into the
%b target
revision.
.prepend-top-20 .prepend-top-20
= render "form" = render "form"
- @no_container = true - @no_container = true
- add_to_breadcrumbs "Compare Revisions", project_compare_index_path(@project) - add_to_breadcrumbs _("Compare Revisions"), project_compare_index_path(@project)
- page_title "#{params[:from]}...#{params[:to]}" - page_title "#{params[:from]}...#{params[:to]}"
%div{ class: container_class } %div{ class: container_class }
...@@ -13,12 +13,13 @@ ...@@ -13,12 +13,13 @@
.light-well .light-well
.center .center
%h4 %h4
There isn't anything to compare. = s_("CompareBranches|There isn't anything to compare.")
%p.slead %p.slead
- if params[:to] == params[:from] - if params[:to] == params[:from]
- source_branch = capture do
%span.ref-name= params[:from] %span.ref-name= params[:from]
and - target_branch = capture do
%span.ref-name= params[:to] %span.ref-name= params[:to]
are the same. = (s_("CompareBranches|%{source_branch} and %{target_branch} are the same.") % { source_branch: source_branch, target_branch: target_branch }).html_safe
- else - else
You'll need to use different branch names to get a valid comparison. = _("You'll need to use different branch names to get a valid comparison.")
---
title: Add i18n helpers to branch comparison view
merge_request: 16031
author: James Ramsay
type: added
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