Skip to content

Commit 621b489

Browse files
author
Andreas Treubert
committed
fixed auto complete fields
1 parent af4cfec commit 621b489

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

app/views/issues/_form.html.erb

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<%= f.label_for_field :description, :required => @issue.required_attribute?('description') %>
3030
<%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
3131
<%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %>
32-
<%= f.text_area :description,
33-
:cols => 60,
34-
:rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
35-
:accesskey => accesskey(:edit),
36-
:class => 'wiki-edit',
32+
<%= f.text_area :description, :cols => 60, :accesskey => accesskey(:edit), :class => 'wiki-edit',
33+
:rows => [[10, @issue.description.to_s.length / 50].max, 20].min,
34+
:data => {
35+
:auto_complete => true,
36+
},
3737
:no_label => true %>
3838
<% end %>
3939
</p>
@@ -48,11 +48,37 @@
4848
<% end %>
4949

5050
<% heads_for_wiki_formatter %>
51+
<%= heads_for_auto_complete(@issue.project) %>
52+
53+
<% if User.current.allowed_to?(:add_issue_watchers, @issue.project)%>
54+
<%= update_data_sources_for_auto_complete({users: watchers_autocomplete_for_mention_path(project_id: @issue.project, q: '', object_type: 'issue',
55+
object_id: @issue.id)}) %>
56+
<% end %>
5157

5258
<%= javascript_tag do %>
5359
$(document).ready(function(){
5460
$("#issue_tracker_id, #issue_status_id").each(function(){
5561
$(this).val($(this).find("option[selected=selected]").val());
5662
});
63+
$(".assign-to-me-link").click(function(event){
64+
event.preventDefault();
65+
var element = $(event.target);
66+
$('#issue_assigned_to_id').val(element.data('id'));
67+
element.hide();
68+
});
69+
$('#issue_assigned_to_id').change(function(event){
70+
var assign_to_me_link = $(".assign-to-me-link");
71+
72+
if (assign_to_me_link.length > 0) {
73+
var user_id = $(event.target).val();
74+
var current_user_id = assign_to_me_link.data('id');
75+
76+
if (user_id == current_user_id) {
77+
assign_to_me_link.hide();
78+
} else {
79+
assign_to_me_link.show();
80+
}
81+
}
82+
});
5783
});
5884
<% end %>

init.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@
103103
name 'Mega Calendar plugin'
104104
author 'Andreas Treubert'
105105
description 'Better calendar for redmine'
106-
version '1.9.5'
106+
version '1.9.6'
107107
url 'https://github.com/berti92/mega_calendar'
108108
author_url 'https://github.com/berti92'
109-
requires_redmine :version_or_higher => '5.0.0'
109+
requires_redmine :version_or_higher => '5.1.1'
110110
menu(:top_menu, :calendar, { :controller => 'calendar', :action => 'index' }, :caption => :calendar, :if => Proc.new {(!Setting.plugin_mega_calendar['allowed_users'].blank? && Setting.plugin_mega_calendar['allowed_users'].include?(User.current.id.to_s) ? true : false)})
111111
menu(:top_menu, :holidays, { :controller => 'holidays', :action => 'index' }, :caption => :holidays, :if => Proc.new {(!Setting.plugin_mega_calendar['allowed_users'].blank? && Setting.plugin_mega_calendar['allowed_users'].include?(User.current.id.to_s) ? true : false)})
112112
settings :default => {'display_empty_dates' => 0, 'displayed_type' => 'users', 'displayed_users' => User.where(["users.login IS NOT NULL AND users.login <> ''"]).collect {|x| x.id.to_s}, 'default_holiday_color' => 'D59235', 'default_event_color' => '4F90FF', 'sub_path' => '/', 'week_start' => '1', 'allowed_users' => User.where(["users.login IS NOT NULL AND users.login <> ''"]).collect {|x| x.id.to_s}}, :partial => 'settings/mega_calendar_settings'

0 commit comments

Comments
 (0)