Inlines some code to speed up large ticket history rendering.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3594 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2f0fbef858
commit
f4be4d101b
|
@ -16,13 +16,13 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
module JournalsHelper
|
module JournalsHelper
|
||||||
def render_notes(journal, options={})
|
def render_notes(issue, journal, options={})
|
||||||
content = ''
|
content = ''
|
||||||
editable = journal.editable_by?(User.current)
|
editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project)))
|
||||||
links = []
|
links = []
|
||||||
if !journal.notes.blank?
|
if !journal.notes.blank?
|
||||||
links << link_to_remote(image_tag('comment.png'),
|
links << link_to_remote(image_tag('comment.png'),
|
||||||
{ :url => {:controller => 'issues', :action => 'reply', :id => journal.journalized, :journal_id => journal} },
|
{ :url => {:controller => 'issues', :action => 'reply', :id => issue, :journal_id => journal} },
|
||||||
:title => l(:button_quote)) if options[:reply_links]
|
:title => l(:button_quote)) if options[:reply_links]
|
||||||
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
|
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
|
||||||
{ :controller => 'journals', :action => 'edit', :id => journal },
|
{ :controller => 'journals', :action => 'edit', :id => journal },
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<li><%= show_detail(detail) %></li>
|
<li><%= show_detail(detail) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<%= render_notes(journal, :reply_links => reply_links) unless journal.notes.blank? %>
|
<%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
|
||||||
</div>
|
</div>
|
||||||
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
|
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
<% if @journals.any? %>
|
<% if @journals.any? %>
|
||||||
<div id="history">
|
<div id="history">
|
||||||
<h3><%=l(:label_history)%></h3>
|
<h3><%=l(:label_history)%></h3>
|
||||||
<%= render :partial => 'history', :locals => { :journals => @journals } %>
|
<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue