diff --git a/app/helpers/activities_helper.rb b/app/helpers/activities_helper.rb index 49074b561..8f3e92362 100644 --- a/app/helpers/activities_helper.rb +++ b/app/helpers/activities_helper.rb @@ -30,4 +30,11 @@ module ActivitiesHelper end sorted_events end + + def activity_authors_options_for_select(project, selected) + options = [] + options += [["<< #{l(:label_me)} >>", User.current.id]] if User.current.logged? + options += Query.new(project: project).users.select{|user| user.active?}.map{|user| [user.name, user.id]} + options_for_select(options, selected) + end end diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb index f71266004..e7f179ebe 100644 --- a/app/views/activities/index.html.erb +++ b/app/views/activities/index.html.erb @@ -36,6 +36,10 @@ <%= t(:label_days_to_html, :days => @days, :date => date_field_tag('from', '', :value => (@date_to - 1), :size => 10)) %> <%= calendar_for('from') %>

+

+ <%= l(:label_user) %> + <%= select_tag('user_id', activity_authors_options_for_select(@project, params[:user_id]), include_blank: true) %> +