Project

General

Profile

Feature #19501 » assign_to_author.diff

Jacek Grzybowski, 2015-03-27 11:54

View differences:

app/helpers/application_helper.rb
end
# Returns a string for users/groups option tags
def principals_options_for_select(collection, selected=nil)
def principals_options_for_select(collection, selected=nil, author=nil)
s = ''
if collection.include?(User.current)
s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id)
end
if author.present? && collection.include?(author)
s << content_tag('option', "<< #{l(:label_author)} >>", :value => author.id)
end
groups = ''
collection.sort.each do |element|
selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected
app/views/issues/_attributes.html.erb
<% end %>
<% if @issue.safe_attribute? 'assigned_to_id' %>
<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>
<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>
<% end %>
<% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
config/locales/en.yml
label_disabled: disabled
label_show_completed_versions: Show completed versions
label_me: me
label_author: author
label_board: Forum
label_board_new: New forum
label_board_plural: Forums
config/locales/pl.yml
label_logout: Wylogowanie
label_max_size: Maksymalny rozmiar
label_me: ja
label_author: autor
label_member: Uczestnik
label_member_new: Nowy uczestnik
label_member_plural: Uczestnicy
(1-1/3)