diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index ff57c37..42e1cc4 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -25,6 +25,12 @@ module AdminHelper [l(:project_status_archived), '9']], selected.to_s) end + # Returns date of last activity on project or creation date + def last_activity(project) + event = Redmine::Activity::Fetcher.new(User.current, :project => project).events(nil, nil, :limit => 1)[0] + event.nil? ? project.created_on : event[:updated_on].nil? ? event[:created_on] : event[:updated_on] + end + def plugin_data_for_updates(plugins) data = {"v" => Redmine::VERSION.to_s, "p" => {}} plugins.each do |plugin| diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index c57d3e5..f6dc943 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -22,6 +22,7 @@ <%=l(:label_project)%> <%=l(:field_is_public)%> <%=l(:field_created_on)%> + <%=l(:field_last_activity)%> @@ -30,6 +31,7 @@ <%= link_to_project_settings(project, {}, :title => project.short_description) %> <%= checked_image project.is_public? %> <%= format_date(project.created_on) %> + <%= format_date(last_activity(project)) %> <%= link_to(l(:button_archive), archive_project_path(project, :status => params[:status]), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %> <%= link_to(l(:button_unarchive), unarchive_project_path(project, :status => params[:status]), :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a38857..cba578f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -253,6 +253,7 @@ en: field_downloads: Downloads field_author: Author field_created_on: Created + field_last_activity: Last activity field_updated_on: Updated field_closed_on: Closed field_field_format: Format diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 3250bf8..57ef64d 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -222,6 +222,7 @@ pt-BR: field_downloads: Downloads field_author: Autor field_created_on: Criado em + field_last_activity: Ăšltima atividade field_updated_on: Alterado em field_field_format: Formato field_is_for_all: Para todos os projetos