<% extend Redmine::Pagination source_id_cond = @contact.is_company ? Contact.visible.where(:company => @contact.first_name).map(&:id) << @contact.id : @contact.id @note = Note.new(:created_on => Time.now) scope = Note.where({:source_id => source_id_cond, :source_type => 'Contact'}).includes(:attachments).order("#{Note.table_name}.created_on DESC") @notes_pages = Redmine::Pagination::Paginator.new(scope.count, 20, params['page']) @notes = scope.limit(20).offset(@notes_pages.offset) %> <% if authorize_for(:notes, :create) %>
<%= render :partial => 'notes/add', :locals => {:note_source => @contact} %>
<% end %> <% if @contact.is_public? || authorize_for(:notes, :show) %>
<%= render :partial => 'notes/note_item', :collection => @notes, :locals => {:show_info => @contact.is_company, :note_source => @contact} %> <%= pagination_links_full @notes_pages %>
<% other_formats_links do |f| %> <% filtered_params = params.respond_to?(:to_unsafe_hash) ? params.to_unsafe_hash : params %> <%= f.link_to 'Atom', :url => filtered_params.merge(:key => User.current.atom_key) %> <% end %> <% end %>