Website/src/grants/index.erb

65 lines
2.6 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
title: Funding Sources
---
<h1>Research Funding</h1>
<p><strong>The ODIn lab relies on <u>your</u> support, and the support of countless others to fulfill our goal of making data more accessible.</strong>  We're extremely grateful to the American taxpayer and for the support we've received from <a href="http://oracle.com">Oracle</a> and <a href="http://www.google.com/">Google</a>.  In the interest of openness and data accessibility, we're publishing the scientific content of our accepted proposals -- the same content that the reviewers see.</p>
<div class="grants">
<% $db["cv/okennedy/grants"].
where { |grant| ["accepted", "completed"].include? grant["status"] }.
map { |grant| [grant["start"].split(/\//)[-1].to_i, grant] }.
my_reduce.
sort_by { |x| -x[0] }.
each do |year, grants| %>
<h2><%=year%></h2>
<ul class="grants">
<% grants.each do |grant| %>
<li>
<div class="title"><%= grant["title"] %></div>
<div class="section">$<%= grant["amount"].to_i.format_number %> from <%=grant["agency"]%>
<% if grant.has_key? "agency_id" %> (Award #<%= grant["agency_id"] %>)<% end %>
</div>
<div class="section"><b>PIs:</b>
<% pis = grant.fetch("copis", []).clone
collab_pis = grant.fetch("collaborative", [])
.map { |partner_inst| partner_inst.fetch("pis", []) }
.flatten
if grant["role"] == "PI"
pis.unshift("Oliver Kennedy")
else
pis.push("Oliver Kennedy")
end
if grant.fetch("lead", true)
pis = pis + collab_pis
else
pis = collab_pis + pis
end %>
<%= pis.map { |pi| LabMetadata::link_for pi }.join(", ") %></div>
<% if grant.has_key? "supports" %>
<div class="section"><b>Supports:</b>
<%= grant["supports"].map { |student| LabMetadata::link_for student }.join(", ")%></div>
<% end %>
<% if grant.has_key? "projects" %>
<div class="section"><b>Projects: </b>
<%= grant["projects"].map { |proj| LabMetadata.project_link(proj) }.join(", ") %></div>
<% end %>
<%
urls = grant.fetch("urls", []).map { |r, url| "<a href=\"#{url}\">#{r}</a>" }
p grant.fetch("agency", "")
if grant.fetch("agency", "").split(/:/)[0] == "NSF" then
grant_id = grant.fetch("agency_id", "").split(/-/)[-1]
if grant_id != ""
urls.push("<a href='https://www.nsf.gov/awardsearch/showAward?AWD_ID=#{grant_id}'>nsf abstract</a>")
end
end
if urls.size > 0 %>
<div class="section">
<%= urls.join(", ") %>
</div>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</div>