Skip to content

Commit

Permalink
Merge remote-tracking branch 'documentcloud/master' into dc-master
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLemayian committed Aug 27, 2017
2 parents a1060a8 + a795e43 commit bdc9c73
Show file tree
Hide file tree
Showing 35 changed files with 342 additions and 51 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.md
@@ -1,6 +1,6 @@
# AUTHORS

DocumentCloud was created in 2009 through generous funding from the Knight Foundation and is currently a service of [Investigative Reporters and Editors](http://www.ire.org). The following is a work-in-progress list of the people who've built, maintained and/or contributed to the platform and its components:
DocumentCloud was created in 2009 through generous funding from the Knight Foundation. The following is a work-in-progress list of the people who've built, maintained and/or contributed to the platform and its components:

* Adam Hooper, [@adamhooper](https://github.com/adamhooper)
* Alan McLean, [@amclean](https://github.com/amclean)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -6,6 +6,7 @@ end

if you_are_documentcloud?
# Must include branch explicitly for bundler's local config override
# ToDo: if in dev, look for local copy of china shop
gem 'bull_proof_china_shop',
git: 'git@github.com:documentcloud/bull_proof_china_shop',
branch: 'master'
Expand Down
4 changes: 3 additions & 1 deletion LICENSE
@@ -1,4 +1,6 @@
Copyright (c) 2011 DocumentCloud, Investigative Reporters & Editors
Copyright (c) 2009-2011 DocumentCloud
Copyright (c) 2011-2017 Investigative Reporters & Editors
Copyright (c) 2017- DocumentCloud

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
10 changes: 8 additions & 2 deletions app/controllers/admin_controller.rb
Expand Up @@ -236,7 +236,7 @@ def organizations
end

def organization
@organization = Organization.where(slug: params[:slug].downcase).first
@organization = Organization.where("lower(slug) = lower(?)", params[:slug]).first
return not_found unless @organization
@since = if params[:since]
if results = params[:since].match(/\A(?<val>\d+)(?<unit>months|days)\z/)
Expand All @@ -261,7 +261,13 @@ def organization
@private_count = @documents_by_access.fetch(DC::Access::PRIVATE, 0) + @documents_by_access.fetch(DC::Access::ORGANIZATION, 0)
@hit_count = @documents.sum(:hit_count)
@top_count = params.fetch(:top_count, 20)
@top_uploaders = Hash[@documents.group(:account_id).count.sort_by{|k,v| -v}.first(@top_count).map{ |arr| m=@memberships.where(account_id: arr.first).first; [m.blank? ? Account.find(arr.first) : m.account, arr.last]}]
top_data = @documents.group(:account_id).count.sort_by{|k,v| -v}.first(@top_count).map do |arr|
m = @memberships.where(account_id: arr.first).first
fake_account = Struct.new(:full_name, :email, :slug)
accountish = m.blank? ? fake_account.new("Deleted User", nil, nil) : m.account
[accountish, arr.last]
end
@top_uploaders = Hash[top_data]
render layout: 'new'
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/home_controller.rb
Expand Up @@ -10,7 +10,7 @@ class HomeController < ApplicationController

def index
@canonical_url = homepage_url
redirect_to search_url if logged_in? and env["PATH_INFO"].slice(0,5) != "/home"
redirect_to search_url if logged_in? and request.env["PATH_INFO"].slice(0,5) != "/home"
@document = Rails.cache.fetch( "homepage/featured_document" ) do
time = Rails.env.production? ? 2.weeks.ago : nil
Document.unrestricted.published.popular.random.since(time).first
Expand Down
2 changes: 1 addition & 1 deletion app/models/document.rb
Expand Up @@ -414,7 +414,7 @@ def published?
end

def published_url
remote_url || detected_remote_url
remote_url # || detected_remote_url
end

def commentable?(account)
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/organization.html.erb
Expand Up @@ -26,7 +26,7 @@
<% @top_uploaders.each do |account, count| %>
<tr>
<td><%= account.full_name %></td>
<td><%= mail_to account.email %></td>
<td><%= account.email.blank? ? "deleted" : mail_to(account.email) %></td>
<td><%= link_to count, "/search/Account:#{account.slug}", class: 'btn btn-sm btn-primary', target: '_blank' %></td>
</tr>
<% end %>
Expand Down
14 changes: 10 additions & 4 deletions app/views/admin/organizations.html.erb
Expand Up @@ -10,7 +10,7 @@
<table class="table table-striped table-sortable table-filterable">
<thead>
<tr>
<th data-sort="string-ins">Organizations – <span class="filterable-count"><%= @data.count %></span></th>
<th data-sort="string-ins">Organizations – <span class="filterable-count"><%= @organizations.count %></span></th>
<th data-sort="int">Documents</th>
<th data-sort="int">Pages</th>
<th data-sort="int">Views</th>
Expand All @@ -24,15 +24,21 @@
</tr>
</thead>
<tbody>
<% @data.each do |row| %>
<%# invert these two loops. %>
<% @organizations.each do |organization| %>
<tr>
<% organization = @organizations.find(row.first)%>
<% row = @data.find{ |arr| arr.first == organization.id } %>
<% row ||= [organization.id, 0, 0, 0, 0, nil] %>
<td><%= link_to organization.name, admin_organization_url(organization.slug, since:params[:since]), target:"_blank" %></td>
<td data-sort-value="<%= row[1] %>"><%= number_with_delimiter(row[1]) %></td>
<td data-sort-value="<%= row[2] %>"><%= number_with_delimiter(row[2]) %></td>
<td data-sort-value="<%= row[3] %>"><%= number_with_delimiter(row[3]) %></td>
<td data-sort-value="<%= row[4] %>"><%= number_to_human_size(row[4]) %></td>
<td data-sort-value="<%= row.last.to_i %>"><%= time_ago_in_words row.last %> ago</td>
<% if row.last.nil? %>
<td data-sort-value="<%= DateTime.parse("2008-01-01").to_i %>">never</td>
<% else %>
<td data-sort-value="<%= row.last.to_i %>"><%= time_ago_in_words row.last %> ago</td>
<% end %>
</tr>
<% end %>
</tbody>
Expand Down
4 changes: 4 additions & 0 deletions app/views/common/_announcement.html.erb
@@ -0,0 +1,4 @@
<div class="notification_bar">
<strong>An important message for our users:
<a class="notification_action" href="https://medium.com/@pilhofer/a-note-to-users-of-documentcloud-org-2641774661bb">Read the announcement.</a></strong>
</div>
2 changes: 1 addition & 1 deletion app/views/common/_donate_widget_js.html.erb
Expand Up @@ -2,7 +2,7 @@ var handler = StripeCheckout.configure({
key: '<%= DC::SECRETS['stripe']['publish'] %>',
locale: 'auto',
name: 'DocumentCloud',
description: 'c/o Investigative Reporters & Editors',
description: 'Donation to DocumentCloud.org',
image: '/images/common/dc_logomark_social_square.png',
billingAddress: true,
token: function(token) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/common/_maintenance.html.erb
@@ -1,4 +1,4 @@
<div class="notification_bar">
<strong>Notice!</strong> We're upgrading our database tonight at midnight EST (0500 UTC). Uploads and edits will be disabled during the upgrade.
<strong>Notice!</strong> DocumentCloud will be down for maintenance on <span class="date">Sunday 08/27 at 10pm EDT</span>.
<a class="notification_action" href="/status">See our status page for more</a>
</div>
2 changes: 2 additions & 0 deletions app/views/common/_meta_tags.html.erb
@@ -1,2 +1,4 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- this is to validate our google suite account -->
<meta name="google-site-verification" content="S3k7INfToagFrBxdwIVXZhqQEwMuavEEhGWr5luoYvQ" />
2 changes: 1 addition & 1 deletion app/views/common/new/_footer.html.erb
@@ -1,6 +1,6 @@
<footer id="page-footer" class="container">
<p><b>Find and share the story in your source documents.</b></p>
<p><%= link_to 'DocumentCloud', '/' %> is a service of <%= link_to 'Investigative Reporters & Editors', 'https://www.ire.org'%>. Additional funding provided by <%= link_to 'The Knight Foundation', 'http://www.knightfoundation.org/' %>.</p>
<p><%= link_to 'DocumentCloud', '/' %> is supported by <%= link_to 'the Klein College of Media and Communication', 'https://klein.temple.edu/'%> and <%= link_to 'The Knight Foundation', 'http://www.knightfoundation.org/' %>.</p>
<nav class="nav justify-content-center">
<%= link_to 'Contact us', "/contact", class: 'nav-link' %>
<%= link_to 'Terms of Service', "/terms", class: 'nav-link' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/donate/index.html.erb
Expand Up @@ -34,7 +34,7 @@
</div>
<p><%= f.submit 'Donate!', class: 'btn btn-block btn-success' %></p>
<div id="error_explanation"></div>
<p class="note">You’re making a tax-deductible donation on behalf of DocumentCloud to our parent non-profit <%= external_link_to 'Investigative Reporters & Editors', 'https://www.ire.org/' %>, a <nobr>501(c)(3)</nobr> organization.</p>
<p class="note">You’re making a tax-deductible donation to DocumentCloud.org</p>
<% end %>
<% if params[:prolix] %>
Expand Down
36 changes: 24 additions & 12 deletions app/views/home/about.html.erb
Expand Up @@ -6,23 +6,26 @@

<div id="content">

<p>DocumentCloud is a catalog of primary source documents and a tool for annotating, organizing and publishing them on the web. Documents are contributed by journalists, researchers and archivists. We're helping reporters get more out of documents and helping newsrooms make their online presence more engaging.</p>
<h2>About DocumentCloud</h2>

<p>DocumentCloud was founded in 2009 with a grant from the <a href="http://www.newschallenge.org/">Knight News Challenge</a>. After two years as an independent nonprofit organization, DocumentCloud <a href="https://blog.documentcloud.org/blog/2011/06/new-home-at-ire/">became a project of Investigative Reporters and Editors</a> in June 2011.
<p>DocumentCloud is a platform founded on the belief that if journalists were more open about their sourcing, the public would be more inclined to trust their reporting. The platform is a tool to help journalists share, analyze, annotate and, ultimately, publish source documents to the open web.</p>

<h2>DocumentCloud Staff</h2>
<p>DocumentCloud is a 501(c)3 nonprofit organization totally committed to trust and transparency. All of our code is open source and available on <a href="https://github.com/documentcloud">Github</a>.</p>

<p><a href="https://www.documentcloud.org/contact">Contact us</a> with questions about accounts or using DocumentCloud.</p>

<p>DocumentCloud's staff, who also are employees of Investigative Reporters and Editors, are responsible for the day-to-day development and operation of the platform. <a href="https://www.documentcloud.org/contact">Contact us</a> with questions about accounts or using DocumentCloud.</p>
<p>DocumentCloud was founded in 2009 with a grant from the <a href="http://www.newschallenge.org/">Knight News Challenge</a>. After two years as an independent nonprofit organization, DocumentCloud <a href="https://blog.documentcloud.org/blog/2011/06/new-home-at-ire/">became a project of Investigative Reporters and Editors</a> in June 2011.</p>

<p>In August 2017, DocumentCloud was <a href="https://technical.ly/philly/2017/07/27/knight-foundation-grant-documentcloud-temple-university-temple-university/">spun off from IRE</a> and again became an an independent nonprofit organization based in Philadelphia, PA, supported by <a href="https://klein.temple.edu/">Temple University’s Klein College of Media</a>.

<h2>DocumentCloud Staff</h2>

<p class="bio"><img class="headshot" src="/images/home/staff/ted.jpg" alt="Ted Han">
<strong>Ted Han</strong> has been leading DocumentCloud's technology efforts with a product focus since 2011. He studied computational linguistics and has worked in technology and startups for more than a decade. He was selected as a participant in the Knight Mozilla Journalism Challenge and has worked on <a class="external" target="_blank" href="http://www.datamapper.org">DataMapper</a>, Merb and a variety of data-based projects, including the <a class="external" target="_blank" href="http://www.crisiscommons.org">CrisisCommons</a> response to the Tohoku earthquake and tsunami.</p>

<p class="bio"><img class="headshot" src="/images/home/staff/justin.jpg" alt="Justin Reese">
<strong>Justin Reese</strong> joined DocumentCloud's development team in 2015 and focuses on the platform’s front-end components. Before that, Justin spent years translating complicated business requirements into simple, usable web apps for companies such as Essilor Labs and Bon-Ton; and his civic coding contributions include <a class="external" target="_blank" href="http://hacktyler.com">Hack Tyler</a>. Justin's artistry extends beyond software: he also makes <a class="external" target="_blank" href="https://vimeo.com/justinreese">short films</a> and tolerable Neapolitan-style pizza.</p>
<p class="bio"><img class="headshot" src="/images/home/staff/aron_pilhofer.jpg" alt="Aron Pilhofer"><strong>Aron Pilhofer</strong> is a co-founder and executive director of DocumentCloud. He is also the James B. Steele Chair in Journalism Innovation at Temple University. Prior to joining Temple, Pilhofer held senior editorial and business-side roles at The Guardian in London and was a senior editor at The New York Times.</p>

<p class="bio"><img class="headshot" src="/images/home/staff/lauren.jpg" alt="Lauren Grandestaff"><strong>Lauren Grandestaff</strong>, director of <a href="http://www.ire.org/resourcecenter/">IRE's Resource Center</a>, provides support to DocumentCloud users. She directs collection, indexing, and archiving of research materials that include tens of thousands of investigative stories and thousands of reporter tipsheets and coordinates <a href="http://www.ire.org/resourcecenter/contest/">IRE's annual awards</a>, which honor the best investigative journalism around the world.</p>

<h2>Advisory Group</h2>
<!-- ><h2>Advisory Group</h2>
<p>DocumentCloud's group of advisers includes journalism, business and technology professionals as well as several of the platform's founders.</p>
Expand All @@ -42,9 +45,11 @@
<p class="bio"><img class="headshot" src="/images/home/staff/chrys_wu.jpg" alt="Chrys Wu"><strong>Chrys Wu</strong> is developer advocate at The New York Times, where she leads internal and public-facing initiatives with <a href="http://developers.nytimes.com">The New York Times Developers</a>. She is also a founding organizer of <a href="http://hackshackers.com">Hacks/Hackers</a>, co-founder of the <a href="http://writespeakcode.com">Write/Speak/Code</a> engineering leadership conference, producer of the <a href="http://robotfilmfestival.com">Robot Film Festival</a>, and trustee emeritus of <a href="http://awesomenyc.org">Awesome Foundation NYC</a>. Chrys has also worked as a strategist, journalist, developer and consigliere to news media, tech startups, non-profits and foundations including The Los Angeles Times, NPR and its affiliates, DataKind, The Knight Foundation and The Gates Foundation. Talk with her on Twitter at @MacDiva.</p>
<h2>DocumentCloud Founders, Launch Staff</h2>
-->

<h2>DocumentCloud Founders and Alumni</h2>

<p>DocumentCloud is deeply appreciative of the vision and dedication of its founders and launch staff. In 2009, <strong>Aron Pilhofer</strong> (then of The New York Times), <strong>Scott Klein</strong> and <strong>Eric Umansky</strong> of ProPublica received a <a href="http://www.knightfoundation.org/grants/20083268/">Knight News Challenge grant</a> that provided the initial funding to hire staff and launch the platform.</p>
<p>DocumentCloud would not be here except for the vision and dedication of its founders and staff, past and present. In 2009, <strong>Pilhofer</strong>, <strong>Scott Klein</strong> and <strong>Eric Umansky</strong> of ProPublica received a <a href="http://www.knightfoundation.org/grants/20083268/">Knight News Challenge grant</a> that provided the initial funding to hire staff and launch the platform.</p>

<p><strong>Jeremy Ashkenas</strong> was the project's lead developer from 2009 to 2011, creating an impressive array of open source document processing and UX components including <a href="https://github.com/documentcloud/cloud-crowd">CloudCrowd</a>, <a href="https://github.com/documentcloud/docsplit">Docsplit</a> and the <a href="https://github.com/documentcloud/documentcloud">DocumentCloud</a> platform itself. Out of his work on the project came the widely used <a href="http://backbonejs.org/">Backbone.js</a> JavaScript framework and the <a href="http://underscorejs.org/">Underscore.js</a> JavaScript library. Jeremy continues to contribute ideas, advice and code.</p>

Expand All @@ -53,10 +58,17 @@ platform's priorities. Her dogged outreach brought hundreds of newsrooms on boar

<p><strong>Samuel Clay</strong> was a developer for DocumentCloud from 2010 to 2011 and contributed several key components to the platform, including <a href="https://github.com/documentcloud/visualsearch">visual faceted search</a> in the workspace.</p>

<h2>DocumentCloud Alumni</h2>
<p><strong>Anthony DeBarros</strong> was director of product development from 2015 to 2016.

<p><strong>Justin Reese</strong> joined the DocumentCloud team in 2015 and focused on front-end components.

<p><strong>Lauren Grandestaff</strong>, director of IRE's Resource Center, provided support to DocumentCloud users.

<!-- ><h2>DocumentCloud Alumni</h2>
<p class="bio"><img class="headshot" src="/images/home/staff/anthony.jpg" alt="Anthony DeBarros">
<strong>Anthony DeBarros</strong>, director of product development, joined DocumentCloud in 2015. Previously, he led an interactive applications team at Gannett Digital that built data-driven interactives for
<a class="external" target="_blank" href="http://www.usatoday.com/longform/news/nation/2014/03/11/fugitives-next-door/6262719/">investigations</a>, <a class="external" target="_blank" href="http://www.usatoday.com/pages/interactives/elections-results-2014/">elections</a> and publishing tools for the Gannett platform. He has been a database editor and investigative journalist with USA TODAY and was a 2012 IRE Service Award winner for making Census data easily available to journalists.</p>
-->

</div>
7 changes: 3 additions & 4 deletions app/views/home/p3p.html
Expand Up @@ -19,10 +19,9 @@ <h2>About Us</h2>
<p>We invite you to contact us if you have questions about this policy.
You may contact us by mail at the following address:
<pre>DocumentCloud
Investigative Reporters and Editors
141 Neff Annex
University of Missouri
Columbia, Missouri 65211
PO Box 29401
1602 Frankford Ave
Philadelphia, Pennsylvania 19125-9998
United States of America
</pre>
<p>You may contact us by e-mail at
Expand Down
11 changes: 5 additions & 6 deletions app/views/home/p3p.xml
Expand Up @@ -16,12 +16,11 @@
<DATA ref="#business.contact-info.online.email">support@documentcloud.org</DATA>
<DATA ref="#business.contact-info.online.uri">https://www.documentcloud.org/</DATA>
<DATA ref="#business.contact-info.postal.organization">DocumentCloud</DATA>
<DATA ref="#business.contact-info.postal.street">Investigative Reporters and Editors
141 Neff Annex
University of Missouri</DATA>
<DATA ref="#business.contact-info.postal.city">Columbia</DATA>
<DATA ref="#business.contact-info.postal.stateprov">Missouri</DATA>
<DATA ref="#business.contact-info.postal.postalcode">65211</DATA>
<DATA ref="#business.contact-info.postal.street">PO Box 29401
1602 Frankford Ave</DATA>
<DATA ref="#business.contact-info.postal.city">Philadelphia</DATA>
<DATA ref="#business.contact-info.postal.stateprov">Pennsylvania</DATA>
<DATA ref="#business.contact-info.postal.postalcode">19125-9998</DATA>
<DATA ref="#business.contact-info.postal.country">United States of America</DATA>
<DATA ref="#business.name">DocumentCloud</DATA>
</DATA-GROUP>
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/privacy.html.erb
Expand Up @@ -3,7 +3,7 @@
<div class="content">
<div class="container-md">
<h1>Privacy Policy</h1>
<p>DocumentCloud is provided by Investigative Reporters and Editors Inc., a nonprofit corporation. This privacy policy extends our terms and conditions, which may be found at <a href="https://www.documentcloud.org/terms">https://www.documentcloud.org/terms</a>.</p>
<p>This privacy policy extends DocumentCloud's terms and conditions, which may be found at <a href="https://www.documentcloud.org/terms">https://www.documentcloud.org/terms</a>.</p>
<ol>
<li><b>Information DocumentCloud collects about all users, including Document Contributors and non-contributing users:</b></li>
<ol>
Expand Down

0 comments on commit bdc9c73

Please sign in to comment.