<%= link_to l(:button_edit), {:controller => "operations", :action => "edit", :id => @operation}, :class => 'icon icon-edit' if !@operation.blank? && @operation.editable_by?(User.current) %> <%= link_to l(:button_delete), {:controller => "operations", :action => "destroy", :id => @operation}, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' if !@operation.nil? && @operation.destroyable_by?(User.current) %>

<%= "#{l(:label_operation)} ##{@operation.id}" %>

<% if RedmineFinance.operations_approval? && !@operation.is_approved? %> <%= l(:label_finance_disapproved) %> <% end %> <%= "#{@operation.category_name}: #{@operation.amount_to_s}" %>

<%= authoring @operation.created_at, @operation.author %>. <% if @operation.created_at != @operation.updated_at %> <%= l(:label_updated_time, time_tag(@operation.updated_at)).html_safe %>. <% end %>

<%= issue_fields_rows do |rows| rows.left l(:label_account), "#{link_to @operation.account.name, account_path(@operation.account)} (#{@operation.account.amount_to_s})".html_safe rows.left l(:label_contact), link_to_contact(@operation.contact, :avatar => true) if @operation.contact rows.left l(:label_operation_category), operation_category_tree_tag(@operation) if @operation.category.present? rows.right l(:label_operation_date), format_time(@operation.operation_date) rows.right l(:field_assigned_to), "#{avatar(@operation.assigned_to, :size => '14')}#{@operation.assigned_to ? link_to_user(@operation.assigned_to) : "-"}".html_safe end %> <%= call_hook(:view_operations_show_details_bottom, :operation => @operation) %>
<% if @operation.description? || (@operation.respond_to?(:attachments) && @operation.attachments && @operation.attachments.any?) -%>
<% if @operation.description? %>

<%=l(:field_description)%>

<% attachments = nil %> <%= textilizable @operation, :description, :attachments => attachments %>
<% end %> <% end -%>

<%= l(:label_comment_plural) %>

<% @comments.each do |comment| %> <% next if comment.new_record? %>
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'operation_comments', :action => 'destroy', :id => @operation, :comment_id => comment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>

<%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %>

<%= textilizable(comment.comments) %> <% end if @comments.any? %>
<% if @operation.commentable? %>

<%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>

<%= form_tag({:controller => 'operation_comments', :action => 'create', :id => @operation}, :id => "add_comment_form", :style => "display:none;") do %>
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %> <%= wikitoolbar_for 'comment_comments' %>

<%= submit_tag l(:button_add) %>

<% end %> <% end %> <% content_for :sidebar do %> <% unless @operation.contact.blank? %>

<%= l(:label_contact) %>

<%= render :partial => 'contacts/contact_card', :object => @operation.contact %>
<% end %> <% end %> <% html_title "#{l(:label_operation)} ##{@operation.id}: #{@operation.category_name}" %> <% content_for :header_tags do %> <% end %>