diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index cc0ec9483d..0b7608c260 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -3,17 +3,25 @@ %div = link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do %strong.str-truncated= branch.name -   - - 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="Merged into #{@repository.root_ref}") - merged - - if @project.protected_branch? branch.name - %span.label.label-success - %i.fa.fa-lock - protected + - 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="Merged into #{@repository.root_ref}") + merged + + - if @project.protected_branch? branch.name + %span.label.label-success + = icon('lock') + protected + + - if @project.mirror_ever_updated_successfully? && @repository.diverged_from_upstream?(branch.name) + - tooltip_message = "The branch could not be updated automatically because it has diverged from its upstream counterpart." + - tooltip_message << "
To discard the local changes and overwrite the branch with the upstream version, delete it here and choose 'Update Now' above." if can?(current_user, :push_code, @project) + %span.label.label-danger.has_tooltip{data: { html: "true", title: tooltip_message }} + = icon('exclamation-triangle') + diverged from upstream + .controls.hidden-xs - if create_mr_button?(@repository.root_ref, branch.name) = link_to create_mr_path(@repository.root_ref, branch.name), class: 'btn btn-grouped btn-xs' do diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index 03ade02a0c..0f282c73be 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -5,7 +5,7 @@ .pull-right - if can? current_user, :push_code, @project = link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do - %i.fa.fa-add-sign + = icon('plus') New branch   .dropdown.inline @@ -26,6 +26,9 @@ = sort_title_oldest_updated .oneline Protected branches can be managed in project settings + += render 'projects/commits/mirror_status' + - unless @branches.empty? %ul.content-list.all-branches - @branches.each do |branch| diff --git a/app/views/projects/commits/_mirror_status.html.haml b/app/views/projects/commits/_mirror_status.html.haml new file mode 100644 index 0000000000..6f249fcaed --- /dev/null +++ b/app/views/projects/commits/_mirror_status.html.haml @@ -0,0 +1,10 @@ +- if @project.mirror? + .gray-content-block.second-block + .pull-right + = render "shared/mirror_update_button" + + - import_url = @project.safe_import_url + .oneline + This project is mirrored from #{link_to import_url, import_url}. + + = render "shared/mirror_status" diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index 2dd99cc821..f9f68a9fcd 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -24,6 +24,8 @@ %ul.breadcrumb.repo-breadcrumb = commits_breadcrumbs += render 'projects/commits/mirror_status' + %div{id: dom_id(@project)} #commits-list= render "commits", project: @project .clear diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml index 85d76eae3b..75199e7f88 100644 --- a/app/views/projects/tags/index.html.haml +++ b/app/views/projects/tags/index.html.haml @@ -6,11 +6,13 @@ - if can? current_user, :push_code, @project .pull-right = link_to new_namespace_project_tag_path(@project.namespace, @project), class: 'btn btn-create new-tag-btn' do - %i.fa.fa-add-sign + = icon('plus') New tag .oneline Tags give the ability to mark specific points in history as being important += render 'projects/commits/mirror_status' + .tags - unless @tags.empty? %ul.content-list