diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 6eb659dae1..a38e453f6f 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -106,13 +106,13 @@ .project-repo-buttons { margin-top: 12px; margin-bottom: 0px; + } - .btn { - @include btn-gray; + .btn { + @include btn-gray; - .count { - display: inline-block; - } + .count { + display: inline-block; } } } diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 8c0980369f..518b25fa95 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -13,6 +13,13 @@ = link_to project_path(forked_from_project) do = forked_from_project.namespace.try(:name) + - if @project.mirror? + - import_url = @project.safe_import_url + %p + Mirrored from #{link_to import_url, import_url}. + + = render "shared/mirror_status" + = render "shared/mirror_update_button", size: "sm" .project-repo-buttons diff --git a/app/views/shared/_mirror_status.html.haml b/app/views/shared/_mirror_status.html.haml new file mode 100644 index 0000000000..ab832883ab --- /dev/null +++ b/app/views/shared/_mirror_status.html.haml @@ -0,0 +1,14 @@ +- case @project.mirror_last_update_status +- when :success + Updated #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}. +- when :failed + - if @project.mirror_ever_updated_successfully? + Last successful update #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}. + + - if can?(current_user, :admin_project, @project) + = link_to namespace_project_mirror_path(@project.namespace, @project) do + = icon("exclamation-triangle") + Failed to update #{time_ago_with_tooltip(@project.mirror_last_update_at)}. + - else + = icon("exclamation-triangle") + Failed to update #{time_ago_with_tooltip(@project.mirror_last_update_at)}.