diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-22 13:29:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-22 13:29:26 +0000 |
commit | 6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46 (patch) | |
tree | af09ea2d29ce61690b656be91fbf82a3009ea1ed /app/views/issues | |
parent | 387836f8aa736eba4dfe0da879ad71bbc19dd224 (diff) | |
download | redmine-6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46.tar.gz redmine-6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46.zip |
JQuery in, Prototype/Scriptaculous out (#11445).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/issues')
-rw-r--r-- | app/views/issues/_attributes.html.erb | 8 | ||||
-rw-r--r-- | app/views/issues/_form.html.erb | 13 | ||||
-rw-r--r-- | app/views/issues/_list.html.erb | 2 | ||||
-rw-r--r-- | app/views/issues/_relations.html.erb | 1 | ||||
-rw-r--r-- | app/views/issues/_update_form.js.erb | 14 | ||||
-rw-r--r-- | app/views/issues/bulk_edit.html.erb | 9 | ||||
-rw-r--r-- | app/views/issues/bulk_edit.js.erb | 1 | ||||
-rw-r--r-- | app/views/issues/destroy.html.erb | 4 | ||||
-rw-r--r-- | app/views/issues/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/issues/new.html.erb | 2 |
10 files changed, 23 insertions, 33 deletions
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index ac2db0d65..a80fac9ce 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -3,9 +3,8 @@ <div class="splitcontent"> <div class="splitcontentleft"> <% if @issue.safe_attribute? 'status_id' %> -<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %></p> -<%= observe_field :issue_status_id, :url => project_issue_form_path(@project, :id => @issue), - :with => "Form.serialize('issue-form')" %> +<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true}, + :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p> <% else %> <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></p> @@ -44,8 +43,7 @@ <div class="splitcontentright"> <% if @issue.safe_attribute? 'parent_issue_id' %> <p id="parent_issue"><%= f.text_field :parent_issue_id, :size => 10, :required => @issue.required_attribute?('parent_issue_id') %></p> -<div id="parent_issue_candidates" class="autocomplete"></div> -<%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:id => @issue, :project_id => @issue.project) }')" %> +<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:id => @issue, :project_id => @issue.project)}')" %> <% end %> <% if @issue.safe_attribute? 'start_date' %> diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 4a13fa07a..712bb1188 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -8,15 +8,13 @@ <% end %> <% if @issue.safe_attribute? 'project_id' %> -<p><%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), :required => true %></p> -<%= observe_field :issue_project_id, :url => project_issue_form_path(@project, :id => @issue), - :with => "Form.serialize('issue-form')" %> +<p><%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true}, + :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p> <% end %> <% if @issue.safe_attribute? 'tracker_id' %> -<p><%= f.select :tracker_id, @issue.project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p> -<%= observe_field :issue_tracker_id, :url => project_issue_form_path(@project, :id => @issue), - :with => "Form.serialize('issue-form')" %> +<p><%= f.select :tracker_id, @issue.project.trackers.collect {|t| [t.name, t.id]}, {:required => true}, + :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p> <% end %> <% if @issue.safe_attribute? 'subject' %> @@ -26,8 +24,7 @@ <% if @issue.safe_attribute? 'description' %> <p> <%= f.label_for_field :description, :required => @issue.required_attribute?('description') %> - <%= link_to_function image_tag('edit.png'), - 'Element.hide(this); Effect.toggle("issue_description_and_toolbar", "appear", {duration:0.3})' unless @issue.new_record? %> + <%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> <%= f.text_area :description, :cols => 60, diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 62cf4e443..59f596452 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -3,7 +3,7 @@ <div class="autoscroll"> <table class="list issues"> <thead><tr> - <th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;', + <th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(this); return false;', :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> </th> <%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %> diff --git a/app/views/issues/_relations.html.erb b/app/views/issues/_relations.html.erb index 3d661ba00..cb7e0e15e 100644 --- a/app/views/issues/_relations.html.erb +++ b/app/views/issues/_relations.html.erb @@ -35,7 +35,6 @@ :as => :relation, :remote => true, :url => {:controller => 'issue_relations', :action => 'create', :issue_id => @issue}, :method => :post, - :complete => "Form.Element.focus('relation_issue_to_id');", :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')} } do |f| %> <%= render :partial => 'issue_relations/form', :locals => {:f => f}%> diff --git a/app/views/issues/_update_form.js.erb b/app/views/issues/_update_form.js.erb index 89429fc20..46fc9722e 100644 --- a/app/views/issues/_update_form.js.erb +++ b/app/views/issues/_update_form.js.erb @@ -1,9 +1,7 @@ -Element.update('all_attributes', '<%= escape_javascript(render :partial => 'form') %>'); +$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>'); -if ($('log_time')) { - <% if User.current.allowed_to?(:log_time, @issue.project) %> - Element.show('log_time'); - <% else %> - Element.hide('log_time'); - <% end %> -} +<% if User.current.allowed_to?(:log_time, @issue.project) %> + $('#log_time').show(); +<% else %> + $('#log_time').hide(); +<% end %> diff --git a/app/views/issues/bulk_edit.html.erb b/app/views/issues/bulk_edit.html.erb index 63bc1f7df..1312aa303 100644 --- a/app/views/issues/bulk_edit.html.erb +++ b/app/views/issues/bulk_edit.html.erb @@ -17,11 +17,9 @@ <% if @allowed_projects.present? %> <p> <label for="issue_project_id"><%= l(:field_project) %></label> - <%= select_tag('issue[project_id]', content_tag('option', l(:label_no_change_option), :value => '') + project_tree_options_for_select(@allowed_projects, :selected => @target_project)) %> + <%= select_tag('issue[project_id]', content_tag('option', l(:label_no_change_option), :value => '') + project_tree_options_for_select(@allowed_projects, :selected => @target_project), + :onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')") %> </p> -<%= observe_field :issue_project_id, :url => {:action => 'bulk_edit'}, - :update => 'content', - :with => "Form.serialize('bulk_edit_form')" %> <% end %> <p> <label for="issue_tracker_id"><%= l(:field_tracker) %></label> @@ -97,8 +95,7 @@ <label for='issue_parent_issue_id'><%= l(:field_parent_issue) %></label> <%= text_field_tag 'issue[parent_issue_id]', '', :size => 10 %> </p> -<div id="parent_issue_candidates" class="autocomplete"></div> -<%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:project_id => @project) }')" %> +<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project)}')" %> <% end %> <% if @safe_attributes.include?('start_date') %> diff --git a/app/views/issues/bulk_edit.js.erb b/app/views/issues/bulk_edit.js.erb new file mode 100644 index 000000000..98cdb8b82 --- /dev/null +++ b/app/views/issues/bulk_edit.js.erb @@ -0,0 +1 @@ +$('#content').html('<%= escape_javascript(render :template => 'issues/bulk_edit.html') %>'); diff --git a/app/views/issues/destroy.html.erb b/app/views/issues/destroy.html.erb index a8ca78826..02d842c3b 100644 --- a/app/views/issues/destroy.html.erb +++ b/app/views/issues/destroy.html.erb @@ -7,8 +7,8 @@ <p> <label><%= radio_button_tag 'todo', 'destroy', true %> <%= l(:text_destroy_time_entries) %></label><br /> <label><%= radio_button_tag 'todo', 'nullify', false %> <%= l(:text_assign_time_entries_to_project) %></label><br /> -<label><%= radio_button_tag 'todo', 'reassign', false, :onchange => 'if (this.checked) { $("reassign_to_id").focus(); }' %> <%= l(:text_reassign_time_entries) %></label> -<%= text_field_tag 'reassign_to_id', params[:reassign_to_id], :size => 6, :onfocus => '$("todo_reassign").checked=true;' %> +<label><%= radio_button_tag 'todo', 'reassign', false, :onchange => 'if (this.checked) { $("#reassign_to_id").focus(); }' %> <%= l(:text_reassign_time_entries) %></label> +<%= text_field_tag 'reassign_to_id', params[:reassign_to_id], :size => 6, :onfocus => '$("#todo_reassign").attr("checked", true);' %> </p> </div> <%= submit_tag l(:button_apply) %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 8e9b81fdc..d7679d65a 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -44,7 +44,7 @@ <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> <%= link_to_function l(:button_save), - "$('query_form').action='#{ @project ? new_project_query_path(@project) : new_query_path }'; submit_query_form('query_form')", + "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }'); submit_query_form('query_form')", :class => 'icon icon-save' %> <% end %> </p> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 1db43d726..8fdb9d854 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -39,7 +39,7 @@ <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %> - <%= javascript_tag "Form.Element.focus('issue_subject');" %> + <%= javascript_tag "$('#issue_subject').focus();" %> <% end %> <div id="preview" class="wiki"></div> |