Merge branch '26509-show-update-time' into 'master'

Add updated time to project list

Closes #26509

See merge request !8514
This commit is contained in:
Annabel Dunstone Gray 2017-04-26 13:21:12 +00:00
commit 465a818061
5 changed files with 26 additions and 17 deletions

View file

@ -614,6 +614,7 @@ pre.light-well {
.controls {
margin-left: auto;
text-align: right;
}
.ci-status-link {

View file

@ -160,7 +160,7 @@ module ProjectsHelper
end
def project_list_cache_key(project)
key = [project.namespace.cache_key, project.cache_key, controller.controller_name, controller.action_name, current_application_settings.cache_key, 'v2.3']
key = [project.namespace.cache_key, project.cache_key, controller.controller_name, controller.action_name, current_application_settings.cache_key, 'v2.4']
key << pipeline_status_cache_key(project.pipeline_status) if project.pipeline_status.has_status?
key

View file

@ -7,6 +7,7 @@
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
- cache_key = project_list_cache_key(project)
- updated_tooltip = time_ago_with_tooltip(project.updated_at)
%li.project-row{ class: css_class }
= cache(cache_key) do
@ -37,18 +38,21 @@
= markdown_field(project, :description)
.controls
- if project.archived
%span.prepend-left-10.label.label-warning archived
- if project.pipeline_status.has_status?
%span.prepend-left-10
= render_project_pipeline_status(project.pipeline_status)
- if forks
%span.prepend-left-10
= icon('code-fork')
= number_with_delimiter(project.forks_count)
- if stars
%span.prepend-left-10
= icon('star')
= number_with_delimiter(project.star_count)
%span.prepend-left-10.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(project) }
= visibility_level_icon(project.visibility_level, fw: true)
.prepend-top-0
- if project.archived
%span.prepend-left-10.label.label-warning archived
- if project.pipeline_status.has_status?
%span.prepend-left-10
= render_project_pipeline_status(project.pipeline_status)
- if forks
%span.prepend-left-10
= icon('code-fork')
= number_with_delimiter(project.forks_count)
- if stars
%span.prepend-left-10
= icon('star')
= number_with_delimiter(project.star_count)
%span.prepend-left-10.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(project) }
= visibility_level_icon(project.visibility_level, fw: true)
.prepend-top-5
updated #{updated_tooltip}

View file

@ -0,0 +1,4 @@
---
title: Add update time to project lists.
merge_request: 8514
author: Jeff Stubler

View file

@ -93,7 +93,7 @@ describe ProjectsHelper do
end
it "includes a version" do
expect(helper.project_list_cache_key(project)).to include("v2.3")
expect(helper.project_list_cache_key(project).last).to start_with('v')
end
it "includes the pipeline status when there is a status" do