Add mirror status to project homepage.

This commit is contained in:
Douwe Maan
2015-11-11 16:41:00 +01:00
parent 9098fc54db
commit e09a5de348
3 changed files with 26 additions and 5 deletions
+5 -5
View File
@@ -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;
}
}
}
+7
View File
@@ -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
+14
View File
@@ -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)}.