Project

General

Profile

Feature #19501 » assign_to_author.diff

Jacek Grzybowski, 2015-03-27 11:54

View differences:

app/helpers/application_helper.rb
383 383
  end
384 384
  # Returns a string for users/groups option tags
385
  def principals_options_for_select(collection, selected=nil)
385
  def principals_options_for_select(collection, selected=nil, author=nil)
386 386
    s = ''
387 387
    if collection.include?(User.current)
388 388
      s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id)
389 389
    end
390
    if author.present? && collection.include?(author)
391
      s << content_tag('option', "<< #{l(:label_author)} >>", :value => author.id)
392
    end
390 393
    groups = ''
391 394
    collection.sort.each do |element|
392 395
      selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected
app/views/issues/_attributes.html.erb
15 15
<% end %>
16 16
<% if @issue.safe_attribute? 'assigned_to_id' %>
17
<p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %></p>
17
<p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to, @issue.author), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %></p>
18 18
<% end %>
19 19
<% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
config/locales/en.yml
777 777
  label_disabled: disabled
778 778
  label_show_completed_versions: Show completed versions
779 779
  label_me: me
780
  label_author: author
780 781
  label_board: Forum
781 782
  label_board_new: New forum
782 783
  label_board_plural: Forums
config/locales/pl.yml
488 488
  label_logout: Wylogowanie
489 489
  label_max_size: Maksymalny rozmiar
490 490
  label_me: ja
491
  label_author: autor
491 492
  label_member: Uczestnik
492 493
  label_member_new: Nowy uczestnik
493 494
  label_member_plural: Uczestnicy
(1-1/3)