From 857dd7c4d29d85d94de724aed5c1b1cdf2e15d4d Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 8 Feb 2013 15:10:37 +0100 Subject: [PATCH] uses ajaxAppend for loading the issue#edit form This means that it is no longer necessary to render the edit form on every show request which will significantely increase the load speed of the page. We will have to see if it is ok for the user to have to wait for the form to load once he actually wishes to edit the issue. --- app/controllers/issues_controller.rb | 1 + app/views/issues/_action_menu.rhtml | 8 +++++-- app/views/issues/show.rhtml | 3 +-- public/javascripts/application.js | 34 ++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 0ee1a2949b..ffcba87249 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -178,6 +178,7 @@ class IssuesController < ApplicationController @journal = @issue.current_journal respond_to do |format| + format.js { render :partial => 'edit' } format.html { } format.xml { } end diff --git a/app/views/issues/_action_menu.rhtml b/app/views/issues/_action_menu.rhtml index 1993b29727..da209c2944 100644 --- a/app/views/issues/_action_menu.rhtml +++ b/app/views/issues/_action_menu.rhtml @@ -1,5 +1,9 @@ <% content_for :action_menu_main do %> - <%= li_unless_nil(link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit))) %> + <%= li_unless_nil(link_to_if_authorized(l(:button_update), { :controller => 'issues', + :action => 'edit', + :id => @issue }, + :class => 'edit icon icon-edit', + :accesskey => accesskey(:edit))) %> <%= li_unless_nil(watcher_link(@issue, User.current, { :class => 'watcher_link', @@ -11,4 +15,4 @@ <%= li_unless_nil(link_to_if_authorized l(:button_copy), {:controller => 'issue_moves', :action => 'new', :id => @issue, :copy_options => {:copy => 't'}}, :class => 'icon icon-copy') %> <%= li_unless_nil(link_to_if_authorized l(:button_move), {:controller => 'issue_moves', :action => 'new', :id => @issue}, :class => 'icon icon-move') %> <%= li_unless_nil(link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => (@issue.leaf? ? l(:text_are_you_sure) : l(:text_are_you_sure_with_children)), :method => :post, :class => 'icon icon-del') %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index dd9c19e382..e394239a42 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -113,8 +113,7 @@
<% if authorize_for('issues', 'edit') %> -