Skip to content
Permalink
Browse files

Merge branch 'dc-master'

# Conflicts:
#	AUTHORS.md
#	LICENSE.md
#	app/views/common/_donate_widget_js.html.erb
#	app/views/common/new/_footer.html.erb
#	app/views/donate/index.html.erb
#	app/views/home/about.html.erb
#	app/views/home/p3p.html
#	app/views/home/p3p.xml
#	app/views/home/privacy.html.erb
#	app/views/home/terms/changelog.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
  • Loading branch information...
DavidLemayian committed Aug 27, 2017
2 parents da6d232 + bdc9c73 commit b5868b41bff57c1d02e4bb48d064c674392e7919
@@ -2,7 +2,7 @@

sourceAFRICA is based on the amazing [DocumentCloud](https://github.com/documentcloud/documentcloud) code. It is currently being mainted by the core Code for Africa tech team with contributions by the community.

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)
@@ -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'
@@ -14,7 +14,10 @@ You can view the entire license [here](http://choosealicense.com/licenses/gpl-3.
DocumentCloud MIT License
-------------------------

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
@@ -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/)
@@ -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

@@ -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
@@ -414,7 +414,7 @@ def published?
end

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

def commentable?(account)
@@ -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 %>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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" />
@@ -6,6 +6,8 @@

<div id="content">

<h2>About sourceAFRICA</h2>

<p>sourceAFRICA is Africa's premier repository for "actionable documents".</p>

<p>What do we mean by actionable documents? Documents that the public need to help make more informed decisions, or that help civic watchdogs such as the media or social justice NGOs substantiate their reportage, or documents that have been suppressed or censored elsewhere.</p>
@@ -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>Code for Africa
Nairobi Startup Garage
Piedmont Plaza, Ngong Road
Nairobi
Kenya
Nairobi Garage, 8th Floor
Pinetree Plaza, Kaburu Dr.
Nairobi, Kenya
</pre>
<p>You may contact us by e-mail at
<a href="mailto:hello@sourceafrica.net">
@@ -12,18 +12,17 @@
<!-- Description of the entity making this policy statement. -->
<ENTITY>
<DATA-GROUP>
<DATA ref="#business.contact-info.telecom.telephone.number">TBD</DATA>
<DATA ref="#business.contact-info.online.email">support@codeforafrica.org</DATA>
<DATA ref="#business.contact-info.online.uri">http://www.codeforafrica.org/</DATA>
<DATA ref="#business.contact-info.postal.organization">Code for Africa</DATA>
<DATA ref="#business.contact-info.postal.street">Nairobi Startup Garage
Ngong Road
Piedmont Plaza</DATA>
<DATA ref="#business.contact-info.postal.city">Nairobi</DATA>
<DATA ref="#business.contact-info.postal.stateprov">Nairobi</DATA>
<DATA ref="#business.contact-info.postal.postalcode">00100</DATA>
<DATA ref="#business.contact-info.postal.country">Kenya</DATA>
<DATA ref="#business.name">Code for Africa</DATA>
<DATA ref="#business.contact-info.telecom.telephone.number">TBD</DATA>
<DATA ref="#business.contact-info.online.email">support@codeforafrica.org</DATA>
<DATA ref="#business.contact-info.online.uri">https://codeforafrica.org/</DATA>
<DATA ref="#business.contact-info.postal.organization">Code for Africa</DATA>
<DATA ref="#business.contact-info.postal.street">Nairobi Garage
Pinetree Plaza, Kaburu Dr.</DATA>
<DATA ref="#business.contact-info.postal.city">Nairobi</DATA>
<DATA ref="#business.contact-info.postal.stateprov">Nairobi</DATA>
<DATA ref="#business.contact-info.postal.postalcode">00100</DATA>
<DATA ref="#business.contact-info.postal.country">Kenya</DATA>
<DATA ref="#business.name">Code for Africa</DATA>
</DATA-GROUP>
</ENTITY>

@@ -3,7 +3,7 @@
<div class="content">
<div class="container-md">
<h1>Privacy Policy</h1>
<p><b><em>This is in draft. Please contact <a href="mailto:info@sourceafrica.net">info@sourceafrica.net</a> if you have any questions or concerns.</em></b></p>
<p><b><em>This is in draft. Please contact <a href="mailto:legal@codeforafrica.org">legal@codeforafrica.org</a> if you have any questions or concerns.</em></b></p>

<p>sourceAFRICA is offered as a service by <a href="https://investigativecenters.org" target="_blank">ANCIR (the African Network of Centers for Investigative Reporting)</a> with support from <a href="https://codeforafrica.org" target="_blank">Code for Africa</a>. This privacy policy extends our terms and conditions, which may be found at <a href="https://sourceafrica.net/terms">https://sourceafrica.net/terms</a>.</p>

0 comments on commit b5868b4

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