Skip to content
Permalink
Browse files

Merge branch 'dc-master' πŸ˜ͺ

# Conflicts:
#	app/models/featured_report.rb
#	app/views/accounts/enable.html.erb
#	app/views/accounts/reset.html.erb
#	app/views/admin/test_embedded_note.html.erb
#	app/views/admin/test_embedded_search.html.erb
#	app/views/admin/test_embedded_viewer.html.erb
#	app/views/annotations/show.html.erb
#	app/views/embed/enhance.js.erb
#	app/views/help/eng/api.markdown
#	app/views/help/eng/publishing.markdown
#	app/views/help/spa/api.markdown
#	app/views/help/spa/publishing.markdown
#	app/views/home/api_terms/_v1.0.html.erb
#	app/views/home/api_terms/show.html.erb
#	app/views/home/faq.html.erb
#	app/views/home/privacy.html.erb
#	app/views/home/terms/_v2.0.html.erb
#	app/views/home/terms/show.html.erb
#	app/views/jst/workspace/workspace/page_embed_code.jst
#	app/views/pages/_embed_code.html.erb
#	app/views/pages/show.html.erb
#	config/cloud_crowd/production/config.yml
#	config/document_cloud.yml
#	config/routes.rb
#	config/server/files/secrets/secrets.yml
#	public/400.html
#	public/403.html
#	public/404.html
#	public/409.html
#	public/500.html
#	public/501.html
#	public/502.html
#	public/503.html
#	public/embed/page/page_embed.js
#	public/note_embed/note_embed.js
#	public/status.html
#	public/viewer/viewer.js
#	test/controllers/oembed_controller_test.rb
  • Loading branch information...
DavidLemayian committed Dec 2, 2016
2 parents 64fd68f + 5b50339 commit ce292371df41f68aee355fcc0b184b7ba7782cd8
Showing with 3,275 additions and 4,806 deletions.
  1. +2 βˆ’0 .gitignore
  2. +12 βˆ’5 Gemfile
  3. +13 βˆ’1 Gemfile.lock
  4. +69 βˆ’39 app/controllers/accounts_controller.rb
  5. +28 βˆ’28 app/controllers/admin_controller.rb
  6. +13 βˆ’11 app/controllers/annotations_controller.rb
  7. +29 βˆ’17 app/controllers/api_controller.rb
  8. +12 βˆ’7 app/controllers/application_controller.rb
  9. +3 βˆ’2 app/controllers/authentication_controller.rb
  10. +14 βˆ’17 app/controllers/documents_controller.rb
  11. +2 βˆ’0 app/controllers/download_controller.rb
  12. +6 βˆ’7 app/controllers/embed_controller.rb
  13. +4 βˆ’4 app/controllers/home_controller.rb
  14. +33 βˆ’35 app/controllers/import_controller.rb
  15. +0 βˆ’6 app/controllers/organizations_controller.rb
  16. +18 βˆ’5 app/controllers/pages_controller.rb
  17. +8 βˆ’9 app/controllers/reviewers_controller.rb
  18. +0 βˆ’1 app/controllers/search_controller.rb
  19. +0 βˆ’1 app/controllers/sections_controller.rb
  20. +12 βˆ’2 app/helpers/application_helper.rb
  21. +43 βˆ’20 app/models/annotation.rb
  22. +43 βˆ’18 app/models/document.rb
  23. +1 βˆ’1 app/models/featured_report.rb
  24. +12 βˆ’1 app/models/page.rb
  25. +5 βˆ’0 app/models/processing_job.rb
  26. +16 βˆ’2 app/models/project.rb
  27. +17 βˆ’1 app/models/upload_mailbox.rb
  28. +14 βˆ’40 app/views/accounts/enable.html.erb
  29. +52 βˆ’0 app/views/accounts/mailboxes.html.erb
  30. +14 βˆ’38 app/views/accounts/reset.html.erb
  31. +16 βˆ’49 app/views/admin/test_embedded_note.html.erb
  32. +25 βˆ’73 app/views/admin/test_embedded_search.html.erb
  33. +21 βˆ’63 app/views/admin/test_embedded_viewer.html.erb
  34. +2 βˆ’2 app/views/annotations/{_embed_code.html.erb β†’ _direct_embed_code.html.erb}
  35. +21 βˆ’0 app/views/annotations/_iframe_embed_code.html.erb
  36. +51 βˆ’31 app/views/annotations/embed_loader.js.erb
  37. +0 βˆ’50 app/views/annotations/oembed_loader.js.erb
  38. +23 βˆ’13 app/views/annotations/show.html.erb
  39. +2 βˆ’2 app/views/annotations/show_embedded.html.erb
  40. +15 βˆ’43 app/views/authentication/login.html.erb
  41. +1 βˆ’1 app/views/common/_globals.js.erb
  42. +20 βˆ’0 app/views/common/_sharing_meta_tags.html.erb
  43. +10 βˆ’0 app/views/common/new/_flash_messages.html.erb
  44. +9 βˆ’0 app/views/common/new/_footer.html.erb
  45. +21 βˆ’0 app/views/common/new/_header.html.erb
  46. +5 βˆ’0 app/views/common/new/_nav_authenticated.html.erb
  47. +5 βˆ’0 app/views/common/new/_nav_unauthenticated.html.erb
  48. +2 βˆ’2 app/views/documents/{_embed_code.html.erb β†’ _direct_embed_code.html.erb}
  49. +10 βˆ’0 app/views/documents/_iframe_embed_code.html.erb
  50. +51 βˆ’32 app/views/documents/embed_loader.js.erb
  51. +0 βˆ’50 app/views/documents/oembed_loader.js.erb
  52. +4 βˆ’4 app/views/documents/preview.html.erb
  53. +29 βˆ’10 app/views/documents/show.html.erb
  54. +15 βˆ’28 app/views/embed/enhance.js.erb
  55. +3 βˆ’3 app/views/help/eng/api.markdown
  56. +3 βˆ’3 app/views/help/spa/api.markdown
  57. +21 βˆ’0 app/views/home/api_terms/_changelog_entry.html.erb
  58. +1 βˆ’1 app/views/home/api_terms/_v1.0.html.erb
  59. +9 βˆ’23 app/views/home/api_terms/show.html.erb
  60. +15 βˆ’653 app/views/home/faq.html.erb
  61. +70 βˆ’80 app/views/home/privacy.html.erb
  62. +20 βˆ’18 app/views/home/terms/_changelog_entry.html.erb
  63. +147 βˆ’99 app/views/home/terms/_v2.0.html.erb
  64. +10 βˆ’24 app/views/home/terms/show.html.erb
  65. +1 βˆ’1 app/views/jst/workspace/document/embed_code.jst
  66. +4 βˆ’1 app/views/jst/workspace/organizer/project_dialog.jst
  67. +1 βˆ’1 app/views/jst/workspace/search/embed_code.jst
  68. +1 βˆ’1 app/views/jst/workspace/workspace/document_embed_dialog.jst
  69. +1 βˆ’1 app/views/jst/workspace/workspace/note_embed_code.jst
  70. +1 βˆ’2 app/views/jst/workspace/workspace/page_embed_code.jst
  71. +0 βˆ’22 app/views/layouts/empty.html.erb
  72. +43 βˆ’0 app/views/layouts/new.html.erb
  73. +3 βˆ’0 app/views/pages/_direct_embed_code.html.erb
  74. +17 βˆ’0 app/views/pages/_iframe_embed_code.html.erb
  75. +27 βˆ’15 app/views/pages/show.html.erb
  76. +4 βˆ’5 app/views/pages/show_embedded.html.erb
  77. +51 βˆ’31 app/views/search/embed_loader.js.erb
  78. +1 βˆ’1 app/views/search/preview.html.erb
  79. +2 βˆ’4 app/views/static/contributors.yml
  80. +23 βˆ’0 config/cloud_crowd/maintenance/config.ru
  81. +73 βˆ’0 config/cloud_crowd/maintenance/config.yml
  82. +16 βˆ’0 config/cloud_crowd/maintenance/database.yml
  83. +0 βˆ’1 config/cloud_crowd/production/config.yml
  84. +14 βˆ’8 config/document_cloud.yml
  85. +16 βˆ’12 config/routes.rb
  86. +78 βˆ’35 config/server/files/secrets/secrets.yml
  87. +312 βˆ’581 db/development_structure.sql
  88. +10 βˆ’2 db/schema.rb
  89. +1 βˆ’1 lib/dc/embed.rb
  90. +19 βˆ’8 lib/dc/embed/base.rb
  91. +53 βˆ’24 lib/dc/embed/document.rb
  92. +53 βˆ’18 lib/dc/embed/note.rb
  93. +51 βˆ’23 lib/dc/embed/page.rb
  94. +1 βˆ’1 lib/dc/sanitized.rb
  95. +1 βˆ’1 lib/dc/search/controller.rb
  96. +11 βˆ’1 lib/dc/urls.rb
  97. +0 βˆ’22 lib/tasks/app.rake
  98. +2 βˆ’0 lib/tasks/crowd.rake
  99. +3 βˆ’8 lib/tasks/deploy.rake
  100. +22 βˆ’20 public/400.html
  101. +27 βˆ’21 public/403.html
  102. +22 βˆ’20 public/404.html
  103. +22 βˆ’20 public/409.html
  104. +22 βˆ’20 public/500.html
  105. +22 βˆ’20 public/501.html
  106. +22 βˆ’20 public/502.html
  107. +22 βˆ’19 public/503.html
  108. +316 βˆ’862 public/embed/page/page_embed.js
  109. BIN public/favicon.ico
  110. +5 βˆ’4 public/javascripts/app/searcher.js
  111. +10 βˆ’3 public/javascripts/embed/search_embed.js
  112. +215 βˆ’752 public/note_embed/note_embed.js
  113. +289 βˆ’278 public/search_embed/search_embed.js
  114. +0 βˆ’63 public/status.html
  115. +0 βˆ’65 public/stylesheets/v2/info_site.css
  116. +1 βˆ’1 public/viewer/viewer-datauri.css
  117. +1 βˆ’1 public/viewer/viewer.css
  118. +9 βˆ’7 public/viewer/viewer.js
  119. +28 βˆ’28 test/controllers/accounts_controller_test.rb
  120. +7 βˆ’0 test/controllers/annotations_controller_test.rb
  121. +1 βˆ’1 test/controllers/documents_controller_test.rb
  122. +25 βˆ’15 test/controllers/import_controller_test.rb
  123. +37 βˆ’13 test/controllers/oembed_controller_test.rb
  124. +3 βˆ’2 test/controllers/search_controller_test.rb
  125. +4 βˆ’5 test/controllers/workspace_controller_test.rb
  126. +17 βˆ’1 test/fixtures/annotations.yml
  127. +27 βˆ’0 test/fixtures/documents.yml
  128. +30 βˆ’14 test/lib/embed_test.rb
  129. +4 βˆ’4 test/lib/statistics_test.rb
  130. +3 βˆ’3 test/models/annotation_test.rb
  131. +8 βˆ’10 test/models/document_test.rb
  132. +1 βˆ’1 test/models/organization_test.rb
  133. +7 βˆ’7 test/models/project_test.rb
@@ -33,3 +33,5 @@ Vagrantfile

public/javascripts/rates.json
node_modules

public/status.html
17 Gemfile
@@ -5,17 +5,21 @@ def you_are_documentcloud?
end

if you_are_documentcloud?
gem "bull_proof_china_shop", :git => "git@github.com:documentcloud/bull_proof_china_shop", :branch => "master" # Must include branch explicitly for bundler's local config override
# Must include branch explicitly for bundler's local config override
gem 'bull_proof_china_shop',
git: 'git@github.com:documentcloud/bull_proof_china_shop',
branch: 'master'
end

gem 'iconv'
gem 'rails', '~>4.2.0'
gem 'curb', '~>0.8.4'
gem 'open_calais', :github => 'documentcloud/open_calais', :branch => 'fuzziness' # Supports Open Calais v2
gem 'open_calais', github: 'documentcloud/open_calais',
branch: 'fuzziness' # Supports Open Calais v2
gem 'rest-client', '~> 1.8.0'
gem 'bcrypt', '~> 3.1.1', :require => 'bcrypt'
gem 'bcrypt', '~> 3.1.1', require: 'bcrypt'
gem 'rubyzip', '~> 1.1.0'
gem 'aws-sdk', '~> 1.30', :require => 'aws'
gem 'aws-sdk', '~> 1.30', require: 'aws'
gem 'pg'

gem 'closure-compiler'
@@ -31,10 +35,12 @@ gem 'sanitize', '~> 2.0.6'
gem 'rdiscount', '~> 2.1.6'
gem 'rake'
gem 'actionpack-page_caching'
gem 'jammit', :github => "documentcloud/jammit", :branch => "master"
gem 'jammit', github: 'documentcloud/jammit', branch: 'master'
gem 'nokogiri', '~> 1.6.0'
gem 'net-ssh-shell'
gem 'country_select', '~> 2.2.0'
gem 'bootstrap_form', github: 'documentcloud/rails-bootstrap-forms',
branch: 'bootstrap-v4'

gem 'active_model_serializers', '~>0.9.0'
gem 'passenger'
@@ -46,6 +52,7 @@ group :development, :test do
#gem 'sunspot_matchers'
gem 'spring'
gem 'pry'
gem 'pry-remote'
gem 'byebug' # Debugger
gem 'factory_girl_rails' # Mocking out objects
gem 'ruby-debug-passenger'
@@ -21,6 +21,13 @@ GIT
multi_json
multi_xml

GIT
remote: git://github.com/documentcloud/rails-bootstrap-forms.git
revision: 3e1d9727b452595433cac0618a6660b4b1318e89
branch: bootstrap-v4
specs:
bootstrap_form (2.4.0)

GIT
remote: git@github.com:documentcloud/bull_proof_china_shop
revision: 0460788877a7a0b6c8ba3eea9eace96f2083e4ad
@@ -265,6 +272,9 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-remote (0.1.8)
pry (~> 0.9)
slop (~> 3.0)
rack (1.6.4)
rack-protection (1.5.3)
rack
@@ -373,6 +383,7 @@ DEPENDENCIES
active_model_serializers (~> 0.9.0)
aws-sdk (~> 1.30)
bcrypt (~> 3.1.1)
bootstrap_form!
bull_proof_china_shop!
byebug
closure-compiler
@@ -403,6 +414,7 @@ DEPENDENCIES
pg
progress_bar
pry
pry-remote
rails (~> 4.2.0)
rake
rdiscount (~> 2.1.6)
@@ -418,4 +430,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
1.12.5
1.13.6
@@ -1,41 +1,47 @@
# The AccountsController is responsible for account management -- adding users
# activating accounts, updating email addresses and the like.
class AccountsController < ApplicationController
layout 'workspace'
layout 'new'

before_action :secure_only, :only => [:enable, :reset]
before_action :login_required, :except => [:enable, :reset, :logged_in]
before_action :bouncer, :only => [:enable, :reset] if exclusive_access?
before_action :secure_only, only: [:enable, :reset]
before_action :login_required, except: [:enable, :reset, :logged_in]
before_action :bouncer, only: [:enable, :reset] if exclusive_access?

READONLY_ACTIONS = [
:index, :logged_in, :resend_welcome
]
before_action :read_only_error, :except => READONLY_ACTIONS if read_only?
before_action :read_only_error, except: READONLY_ACTIONS if read_only?

# Enabling an account continues the second half of the signup process,
# allowing the journalist to set their password, and logging them in.
def enable
render and return if request.get?

@failure = 'Please accept the Terms of Service.' and return render unless params[:acceptance]
key = SecurityKey.find_by_key(params[:key])
@failure = 'The account is invalid, or has already been activated.' and return render unless key
account = key.securable
account.password = params[:password]
account.save
account.authenticate(session, cookies)
key.destroy
redirect_to '/'
if key
if request.post?
if params[:acceptance] == 'yes'
account = key.securable
account.update(password: params[:password])
account.authenticate(session, cookies)
key.destroy
redirect_to homepage_url and return
else
flash.now[:error] = 'Please accept the Terms of Service.'
end
end
else
redirect_to login_url, flash: {error: 'That account is invalid or has already been activated.'} and return
end
end

# Show the "Reset Password" screen for an account holder.
def reset
render and return if request.get?
@display_notice = true
account = Account.lookup(params[:email].strip)
@failure = true and return render unless account
account.send_reset_request
@success = true
if request.post? && params[:email].present?
if account = Account.lookup(params[:email].strip)
account.send_reset_request
end
# Show this flash whether or not the email address exists in our system.
flash.now[:notice] = "Please check the email address you provided for further instructions."
end
end

# Requesting /accounts returns the list of accounts in your logged-in organization.
@@ -48,9 +54,9 @@ def index
@current_organization = current_account.organization
@organizations = Organization.all_slugs
@has_documents = Document.owned_by(current_account).exists?
return render :template => 'workspace/index'
return render template: 'workspace/index', layout: 'workspace'
end
redirect_to home_path
redirect_to public_search_url(query: params[:query])
end
format.json do
json current_organization.accounts.active
@@ -61,7 +67,7 @@ def index
# Does the current request come from a logged-in account?
def logged_in
return bad_request unless request.format.json? or request.format.js?
@response = {:logged_in => logged_in?}
@response = { logged_in: logged_in? }
render_cross_origin_json
end

@@ -77,34 +83,35 @@ def create

# Find or create the appropriate account
account_attributes = pick(params, :first_name, :last_name, :email, :language, :document_language).merge({
:language => current_organization.language,
:document_language=>current_organization.document_language
language: current_organization.language,
document_language: current_organization.document_language
})
account = Account.lookup(account_attributes[:email]) || Account.create(account_attributes)
return json(account) unless account.valid?

# Find role for account in organization if it exists.
membership_attributes = pick(params, :role, :concealed)
return bad_request(:error => 'Role is required') unless Account::ROLES.include? membership_attributes[:role]
membership = current_organization.role_of(account)
return bad_request(error: 'Role is required') unless Account::ROLES.include? membership_attributes[:role]

membership = current_organization.role_of(account)
# Create a membership if account has no existing role
if membership.nil?
membership_attributes[:default] = true unless account.memberships.exists?
membership = current_organization.memberships.create(membership_attributes.merge(:account_id => account.id))
membership = current_organization.memberships.create(membership_attributes.merge(account_id: account.id))
elsif membership.role == Account::REVIEWER # or if account is a reviewer in this organization
account.upgrade_reviewer_to_real(current_organization, membership_attributes[:role])
elsif membership.role == Account::DISABLED
return bad_request(:error => 'That email address belongs to an inactive account.')
return bad_request(error: 'That email address belongs to an inactive account.')
else
return conflict(:error => 'That email address is already part of this organization.')
return conflict(error: 'That email address is already part of this organization.')
end

if account.pending?
account.send_login_instructions(current_organization, current_account)
else
LifecycleMailer.membership_notification(account, current_organization, current_account).deliver_now
end
json account.canonical( :membership=>membership )
json account.canonical(membership: membership)
end

# Journalists are authorized to update any account in the organization.
@@ -113,41 +120,64 @@ def update
account = current_organization.accounts.find(params[:id])
return forbidden unless account && current_account.allowed_to_edit_account?(account, current_organization)
return json(account) unless account.update_attributes pick(params, :first_name, :last_name, :email,:language, :document_language)

role = pick(params, :role)
#account.update_attributes(role) if !role.empty? && current_account.admin?
membership = current_organization.role_of(account)
membership.update_attributes(role) if !role.empty? && current_account.admin?
password = pick(params, :password)[:password]
if (current_account.id == account.id) && password
account.password = password
account.save
account.update(password: password)
end
json account.canonical( :membership=>membership )
json account.canonical(membership: membership)
end

# Resend a welcome email for a pending account.
def resend_welcome
return forbidden unless current_account.admin?

account = current_organization.accounts.find(params[:id])
LifecycleMailer.login_instructions( account, current_organization, current_account ).deliver_now
LifecycleMailer.login_instructions(account, current_organization, current_account).deliver_now
json nil
end

def mailboxes
# code goes here.
# TODO: Filter by status, once that exists
@mailboxes = UploadMailbox.where(membership_id: current_account.memberships.pluck(:id))
set_minimal_nav text: 'Back to the workspace',
xs_text: 'Workspace',
link: '/search/'
end

def create_mailbox
@mailbox = UploadMailbox.create(membership: current_account.memberships.default.first, sender: params[:email])
if @mailbox.valid?
flash[:success] = 'You’ve created a new upload mailbox!'
else
flash[:error] = 'Sorry, something went wrong creating that mailbox.'
end
redirect_to :mailboxes
end

def destroy_mailbox
def revoke_mailbox
@mailbox = UploadMailbox.find(params[:id])
return forbidden unless @mailbox.membership.account == current_account

# TODO: Replace destroy with status update
if @mailbox.destroy
flash[:success] = 'You’ve successfully revoked that mailbox.'
else
flash[:error] = 'Sorry, something went wrong revoking that mailbox.'
end
redirect_to :mailboxes
end

# Removing an account only changes their role so that they cannot
# login. Ther documents, projects, and name remain.
def destroy
return forbidden unless current_account.admin?
current_organization.memberships.where( account_id: params[:id] ).update_all( role: Account::DISABLED )

current_organization.memberships.where(account_id: params[:id]).update_all(role: Account::DISABLED)
json nil
end

@@ -20,35 +20,35 @@ def index
respond_to do |format|
format.json do
@response = {
:stats => {
:documents_by_access => DC::Statistics.documents_by_access,
:embedded_documents => DC::Statistics.embedded_document_count,
:average_page_count => DC::Statistics.average_page_count,
:daily_documents => keys_to_timestamps(DC::Statistics.daily_documents(1.month.ago)),
:daily_pages => keys_to_timestamps(DC::Statistics.daily_pages(1.month.ago)),
:weekly_documents => keys_to_timestamps(DC::Statistics.weekly_documents),
:weekly_pages => keys_to_timestamps(DC::Statistics.weekly_pages),
:daily_hits_on_documents => keys_to_timestamps(DC::Statistics.daily_hits_on_documents(1.month.ago)),
:weekly_hits_on_documents => keys_to_timestamps(DC::Statistics.weekly_hits_on_documents),
:daily_hits_on_notes => keys_to_timestamps(DC::Statistics.daily_hits_on_notes(1.month.ago)),
:weekly_hits_on_notes => keys_to_timestamps(DC::Statistics.weekly_hits_on_notes),
:daily_hits_on_searches => keys_to_timestamps(DC::Statistics.daily_hits_on_searches(1.month.ago)),
:weekly_hits_on_searches => keys_to_timestamps(DC::Statistics.weekly_hits_on_searches),
:total_pages => DC::Statistics.total_pages,

:instances => DC::AWS.new.describe_instances,
:remote_url_hits_last_week => DC::Statistics.remote_url_hits_last_week,
:remote_url_hits_all_time => DC::Statistics.remote_url_hits_all_time,
:count_organizations_embedding => DC::Statistics.count_organizations_embedding,
:count_total_collaborators => DC::Statistics.count_total_collaborators,
:numbers => DC::Statistics.by_the_numbers,
stats: {
documents_by_access: DC::Statistics.documents_by_access,
embedded_documents: DC::Statistics.embedded_document_count,
average_page_count: DC::Statistics.average_page_count,
daily_documents: keys_to_timestamps(DC::Statistics.daily_documents(1.month.ago)),
daily_pages: keys_to_timestamps(DC::Statistics.daily_pages(1.month.ago)),
weekly_documents: keys_to_timestamps(DC::Statistics.weekly_documents),
weekly_pages: keys_to_timestamps(DC::Statistics.weekly_pages),
daily_hits_on_documents: keys_to_timestamps(DC::Statistics.daily_hits_on_documents(1.month.ago)),
weekly_hits_on_documents: keys_to_timestamps(DC::Statistics.weekly_hits_on_documents),
daily_hits_on_notes: keys_to_timestamps(DC::Statistics.daily_hits_on_notes(1.month.ago)),
weekly_hits_on_notes: keys_to_timestamps(DC::Statistics.weekly_hits_on_notes),
daily_hits_on_searches: keys_to_timestamps(DC::Statistics.daily_hits_on_searches(1.month.ago)),
weekly_hits_on_searches: keys_to_timestamps(DC::Statistics.weekly_hits_on_searches),
total_pages: DC::Statistics.total_pages,

instances: DC::AWS.new.describe_instances,
remote_url_hits_last_week: DC::Statistics.remote_url_hits_last_week,
remote_url_hits_all_time: DC::Statistics.remote_url_hits_all_time,
count_organizations_embedding: DC::Statistics.count_organizations_embedding,
count_total_collaborators: DC::Statistics.count_total_collaborators,
numbers: DC::Statistics.by_the_numbers,
},
:documents => Document.finished.chronological.limit(5).map {|d| d.admin_attributes },
:failed_documents => Document.failed.chronological.limit(3).map {|d| d.admin_attributes },
:top_documents => RemoteUrl.top_documents(7, 5),
:top_searches => RemoteUrl.top_searches(7, 5),
:top_notes => RemoteUrl.top_notes(7, 5),
:accounts => [],
documents: Document.finished.chronological.limit(5).map {|d| d.admin_attributes },
failed_documents: Document.failed.chronological.limit(3).map {|d| d.admin_attributes },
top_documents: RemoteUrl.top_documents(7, 5),
top_searches: RemoteUrl.top_searches(7, 5),
top_notes: RemoteUrl.top_notes(7, 5),
accounts: [],
}
if params[:accounts]
@response[:accounts] = Account.all

0 comments on commit ce29237

Please sign in to comment.
You can’t perform that action at this time.