diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-06-27 16:15:06 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-06-27 16:15:06 +0800 |
commit | 849f9995d97c85d88b36a40ee563f7dd51fdc3f1 (patch) | |
tree | 3523089d253b001f7e3b029266399e497407441b /app/views/projects/branches/_branch.html.haml | |
parent | ef6b3e0271d226462bed5f899f3964cf5652978c (diff) | |
parent | 87f7597a4fb7852fc81f830158cdfd5fdec8fac4 (diff) | |
download | gitlab-ce-849f9995d97c85d88b36a40ee563f7dd51fdc3f1.tar.gz |
Merge remote-tracking branch 'upstream/master' into 14995-custom_wiki_sidebar
* upstream/master: (4180 commits)
Enable frozen string literals for app/workers/*.rb
Resolve "Search dropdown hides & shows when typing"
Revert merge request widget button max height
Update CHANGELOG.md for 11.0.2
Update external link icon in header user dropdown
Added Diff Viewer to new VUE based MR page
Fixed eslint failure in IDE spec helpers
Use refs instead of querySelector.
Show file in tree on WebIDE open
Resolve "Remove unused bootstrap component CSS"
Resolve "Explain what Groups are in the New Group page"
[QA] Make sure we wait for the deploy key list to load
Update _scopes_form.html.haml to remove duplicate information
Use the branch instead of the tag to install
port the EE changes
Add index on deployable_type/id for deployments
Add a helper to rename a column using a background migration
Fix performance bottleneck when rendering large wiki pages
Port Namespace#root_ancestor to CE
Remove duplicate spec
...
Diffstat (limited to 'app/views/projects/branches/_branch.html.haml')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index 883dfb3e6c8..88f9b7dfc9f 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -4,22 +4,21 @@ - diverging_commit_counts = @repository.diverging_commit_counts(branch) - number_commits_behind = diverging_commit_counts[:behind] - number_commits_ahead = diverging_commit_counts[:ahead] -- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) +- merge_project = merge_request_source_project_for_project(@project) %li{ class: "branch-item js-branch-#{branch.name}" } .branch-info .branch-title - = link_to project_tree_path(@project, branch.name), class: 'item-title str-truncated-100 ref-name' do - = sprite_icon('fork', size: 12) + = sprite_icon('fork', size: 12) + = link_to project_tree_path(@project, branch.name), class: 'item-title str-truncated-100 ref-name prepend-left-8' do = branch.name - - if branch.name == @repository.root_ref - %span.label.label-primary default + %span.badge.badge-primary.prepend-left-5 default - elsif merged - %span.label.label-info.has-tooltip{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } } + %span.badge.badge-info.has-tooltip.prepend-left-5{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } } = s_('Branches|merged') - if protected_branch?(@project, branch) - %span.label.label-success + %span.badge.badge-success.prepend-left-5 = s_('Branches|protected') .block-truncated @@ -29,7 +28,7 @@ = s_('Branches|Cant find HEAD commit for this branch') - 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: diverging_count_label(number_commits_behind), + .divergence-graph.d-none.d-md-block{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind), default_branch: @repository.root_ref, number_commits_ahead: diverging_count_label(number_commits_ahead) } } .graph-side @@ -40,7 +39,7 @@ .bar.bar-ahead{ style: "width: #{number_commits_ahead * bar_graph_width_factor}%" } %span.count.count-ahead= diverging_count_label(number_commits_ahead) - .controls.hidden-xs< + .controls.d-none.d-md-block< - 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') @@ -61,7 +60,7 @@ 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) + - if can?(current_user, :push_to_delete_protected_branch, @project) %button{ class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip", title: s_('Branches|Delete protected branch'), data: { toggle: "modal", @@ -73,7 +72,7 @@ - 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 maintainer or owner can delete a protected branch') } = icon("trash-o") - else = link_to project_branch_path(@project, branch.name), |