summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2017-09-21 12:31:59 +0200
committerWinnie Hellmann <winnie@gitlab.com>2017-09-21 12:31:59 +0200
commitb321fa66b13432bb635374425073a16f3f550aae (patch)
treeab9f0ba7ee1e2264e41e8a7d2d17de614a425475
parentbc4c00238bd5e4c4f04608cf41c66633916e9ed3 (diff)
downloadgitlab-ce-winh-i18-branches-page.tar.gz
Fix code style issueswinh-i18-branches-page
-rw-r--r--app/views/projects/branches/_branch.html.haml29
-rw-r--r--app/views/projects/branches/_delete_protected_modal.html.haml14
-rw-r--r--app/views/projects/branches/index.html.haml14
3 files changed, 30 insertions, 27 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 33b457d815b..49101d1efa4 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -13,20 +13,23 @@
- if branch.name == @repository.root_ref
%span.label.label-primary default
- elsif @repository.merged_to_root_ref? branch.name
- %span.label.label-info.has-tooltip{ title: s_("Branches|Merged into %{default_branch}") % { default_branch: @repository.root_ref } }
- = s_("Branches|merged")
+ %span.label.label-info.has-tooltip{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } }
+ = s_('Branches|merged')
- if protected_branch?(@project, branch)
%span.label.label-success
- = s_("Branches|protected")
+ = s_('Branches|protected')
.controls.hidden-xs<
- if merge_project && create_mr_button?(@repository.root_ref, branch.name)
= link_to create_mr_path(@repository.root_ref, branch.name), class: 'btn btn-default' do
- = _("Merge request")
+ = _('Merge request')
- if branch.name != @repository.root_ref
- = link_to project_compare_index_path(@project, from: @repository.root_ref, to: branch.name), class: "btn btn-default #{'prepend-left-10' unless merge_project}", method: :post, title: s_("Branches|Compare") do
- = s_("Branches|Compare")
+ = link_to project_compare_index_path(@project, from: @repository.root_ref, to: branch.name),
+ class: "btn btn-default #{'prepend-left-10' unless merge_project}",
+ method: :post,
+ title: s_('Branches|Compare') do
+ = s_('Branches|Compare')
= render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name]
@@ -34,12 +37,12 @@
- if branch.name == @project.repository.root_ref
%button{ class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip disabled",
disabled: true,
- title: s_("Branches|The default branch cannot be deleted") }
+ title: s_('Branches|The default branch cannot be deleted') }
= icon("trash-o")
- elsif protected_branch?(@project, branch)
- if can?(current_user, :delete_protected_branch, @project)
%button{ class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip",
- title: s_("Branches|Delete protected branch"),
+ title: s_('Branches|Delete protected branch'),
data: { toggle: "modal",
target: "#modal-delete-branch",
delete_path: project_branch_path(@project, branch.name),
@@ -49,20 +52,20 @@
- else
%button{ class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip disabled",
disabled: true,
- title: s_("Branches|Only a project master or owner can delete a protected branch") }
+ title: s_('Branches|Only a project master or owner can delete a protected branch') }
= icon("trash-o")
- else
= link_to project_branch_path(@project, branch.name),
class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip",
- title: s_("Branches|Delete branch"),
+ title: s_('Branches|Delete branch'),
method: :delete,
data: { confirm: s_("Branches|Deleting the '%{branch_name}' branch cannot be undone. Are you sure?") % { branch_name: branch.name } },
remote: true,
- "aria-label" => s_("Branches|Delete branch") do
+ 'aria-label' => s_('Branches|Delete branch') do
= icon("trash-o")
- if branch.name != @repository.root_ref
- .divergence-graph{ title: s_("%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead") % { number_commits_behind: number_commits_behind,
+ .divergence-graph{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: number_commits_behind,
default_branch: @repository.root_ref,
number_commits_ahead: number_commits_ahead } }
.graph-side
@@ -78,4 +81,4 @@
= render 'projects/branches/commit', commit: commit, project: @project
- else
%p
- = s_("Branches|Cant find HEAD commit for this branch")
+ = s_('Branches|Cant find HEAD commit for this branch')
diff --git a/app/views/projects/branches/_delete_protected_modal.html.haml b/app/views/projects/branches/_delete_protected_modal.html.haml
index 7cd17706ff6..e0008e322a0 100644
--- a/app/views/projects/branches/_delete_protected_modal.html.haml
+++ b/app/views/projects/branches/_delete_protected_modal.html.haml
@@ -12,22 +12,22 @@
%p
- branch_name = capture do
%strong.js-branch-name.ref-name>[branch name]
- = s_("Branches|You’re about to permanently delete the protected branch %{branch_name}.").html_safe % { branch_name: branch_name }
+ = s_('Branches|You’re about to permanently delete the protected branch %{branch_name}.').html_safe % { branch_name: branch_name }
%p.js-not-merged
- default_branch = capture do
%span.ref-name= @repository.root_ref
- = s_("Branches|This branch hasn’t been merged into %{default_branch}.").html_safe % { default_branch: default_branch }
- = s_("Branches|To avoid data loss, consider merging this branch before deleting it.")
+ = s_('Branches|This branch hasn’t been merged into %{default_branch}.').html_safe % { default_branch: default_branch }
+ = s_('Branches|To avoid data loss, consider merging this branch before deleting it.')
%p
- delete_protected_branch = capture do
%strong
- = s_("Branches|Delete protected branch")
- = s_("Branches|Once you confirm and press %{delete_protected_branch}, it cannot be undone or recovered.").html_safe % { delete_protected_branch: delete_protected_branch }
+ = s_('Branches|Delete protected branch')
+ = s_('Branches|Once you confirm and press %{delete_protected_branch}, it cannot be undone or recovered.').html_safe % { delete_protected_branch: delete_protected_branch }
%p
- branch_name_confirmation = capture do
%kbd.js-branch-name [branch name]
%strong
- = s_("Branches|To confirm, type %{branch_name_confirmation}:").html_safe % { branch_name_confirmation: branch_name_confirmation }
+ = s_('Branches|To confirm, type %{branch_name_confirmation}:').html_safe % { branch_name_confirmation: branch_name_confirmation }
.form-group
= text_field_tag 'delete_branch_input', '', class: 'form-control js-delete-branch-input'
@@ -38,4 +38,4 @@
class: "btn btn-danger js-delete-branch",
title: s_('Branches|Delete branch'),
method: :delete,
- "aria-label" => s_('Branches|Delete branch')
+ 'aria-label' => s_('Branches|Delete branch')
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index 845d46fa990..ea6e7e9db6c 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -1,5 +1,5 @@
- @no_container = true
-- page_title _("Branches")
+- page_title _('Branches')
= render "projects/commits/head"
%div{ class: container_class }
@@ -7,7 +7,7 @@
- if can?(current_user, :admin_project, @project)
.nav-text
- project_settings_link = link_to s_('Branches|project settings'), project_protected_branches_path(@project)
- = s_("Branches|Protected branches can be managed in %{project_settings_link}").html_safe % { project_settings_link: project_settings_link }
+ = s_('Branches|Protected branches can be managed in %{project_settings_link}').html_safe % { project_settings_link: project_settings_link }
.nav-controls
= form_tag(filter_branches_path, method: :get) do
@@ -20,7 +20,7 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
%li.dropdown-header
- = s_("Branches|Sort by")
+ = s_('Branches|Sort by')
- branches_sort_options_hash.each do |value, title|
%li
= link_to title, filter_branches_path(sort: value), class: ("is-active" if @sort == value)
@@ -30,11 +30,11 @@
class: 'btn btn-inverted btn-remove has-tooltip',
title: s_("Branches|Delete all branches that are merged into '%{default_branch}'") % { default_branch: @project.repository.root_ref },
method: :delete,
- data: { confirm: s_("Branches|Deleting the merged branches cannot be undone. Are you sure?"),
+ data: { confirm: s_('Branches|Deleting the merged branches cannot be undone. Are you sure?'),
container: 'body' } do
- = s_("Branches|Delete merged branches")
+ = s_('Branches|Delete merged branches')
= link_to new_project_branch_path(@project), class: 'btn btn-create' do
- = s_("Branches|New branch")
+ = s_('Branches|New branch')
- if @branches.any?
%ul.content-list.all-branches
@@ -43,6 +43,6 @@
= paginate @branches, theme: 'gitlab'
- else
.nothing-here-block
- = s_("Branches|No branches to show")
+ = s_('Branches|No branches to show')
= render 'projects/branches/delete_protected_modal'