% 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) %>
<% end %> <% if @contact.is_public? || authorize_for(:notes, :show) %>