Project

General

Profile

Feature #23954 » last_activity-1.patch

Frederico Camara, 2017-01-02 14:11

View differences:

app/helpers/admin_helper.rb
25 25
                        [l(:project_status_archived), '9']], selected.to_s)
26 26
  end
27 27

  
28
  # Returns date of last activity on project or creation date
29
  def last_activity(project)
30
    event = Redmine::Activity::Fetcher.new(User.current, :project => project).events(nil, nil, :limit => 1)[0]
31
    event.nil? ? project.created_on : event[:updated_on].nil? ? event[:created_on] : event[:updated_on]
32
  end
33

  
28 34
  def plugin_data_for_updates(plugins)
29 35
    data = {"v" => Redmine::VERSION.to_s, "p" => {}}
30 36
    plugins.each do |plugin|
app/views/admin/projects.html.erb
22 22
  <th><%=l(:label_project)%></th>
23 23
  <th><%=l(:field_is_public)%></th>
24 24
  <th><%=l(:field_created_on)%></th>
25
  <th><%=l(:field_last_activity)%></th>
25 26
  <th></th>
26 27
  </tr></thead>
27 28
  <tbody>
......
30 31
  <td class="name"><span><%= link_to_project_settings(project, {}, :title => project.short_description) %></span></td>
31 32
  <td><%= checked_image project.is_public? %></td>
32 33
  <td><%= format_date(project.created_on) %></td>
34
  <td><%= format_date(last_activity(project)) %></td>
33 35
  <td class="buttons">
34 36
    <%= 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? %>
35 37
    <%= 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?) %>
config/locales/en.yml
253 253
  field_downloads: Downloads
254 254
  field_author: Author
255 255
  field_created_on: Created
256
  field_last_activity: Last activity
256 257
  field_updated_on: Updated
257 258
  field_closed_on: Closed
258 259
  field_field_format: Format
config/locales/pt-BR.yml
222 222
  field_downloads: Downloads
223 223
  field_author: Autor
224 224
  field_created_on: Criado em
225
  field_last_activity: Última atividade
225 226
  field_updated_on: Alterado em
226 227
  field_field_format: Formato
227 228
  field_is_for_all: Para todos os projetos
(3-3/9)