-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
292 additions
and
19 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
@each $var, $val in $colors | ||
.border-#{$var} | ||
border-color: $val | ||
border-color: $val !important |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
li | ||
li.mb5 | ||
' Grants available for | ||
strong | ||
= message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
li | ||
li.mb5 | ||
' Awards grants for | ||
strong | ||
= message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class PublicFundsController < ApplicationController | ||
before_action :ensure_logged_out | ||
|
||
def index | ||
@funds = Fund.includes(:funder).order(:name).page(params[:page]) | ||
end | ||
|
||
def show | ||
return redirect_to public_funds_path unless public_fund?(params[:slug]) | ||
@fund = Fund.find_by(slug: params[:slug]) | ||
return redirect_to public_funds_path unless @fund | ||
@restrictions = @fund.restrictions.pluck(:category, :details) | ||
end | ||
|
||
private | ||
|
||
def ensure_logged_out | ||
redirect_to root_path if logged_in? | ||
end | ||
|
||
def public_fund?(slug) | ||
Fund.order(:name).limit(3).pluck(:slug).include?(slug) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
= content_for :title, 'Funds preview' | ||
|
||
%header | ||
= cell :v2_navbar, @current_user | ||
= cell :breadcrumb, 'Funds' => public_funds_path | ||
|
||
%main.maxw1080.mx-auto.px20.flex.flex-wrap | ||
%aside.perc25.md.px20.mb40 | ||
.bg-mint.white.px10.py15.rounded-top | ||
%h3 Check your eligibility and suitability for funds in seconds. | ||
%a.button-wide.button-bottom.white.bg-olive.caps.shadow{ href: root_path } Sign up | ||
|
||
%section.perc75.md.mb80.px20 | ||
%h1.light.mb30 Funds | ||
|
||
- @funds.each_with_index do |fund, i| | ||
%article.mb40 | ||
|
||
- if i < 3 && params[:page].to_i < 2 | ||
.mb5 | ||
= link_to fund.name, public_fund_path(fund), class: 'blue fs22 lh30' | ||
.mb5.fs15.lh20.mid-gray | ||
= fund.funder.name | ||
|
||
- else | ||
.muted | ||
.mb5.blue.fs22.lh30.redacted= scramble_name fund.name | ||
.mb5.fs15.lh20.mid-gray.redacted= scramble_name fund.funder.name | ||
|
||
.mb5.fs15.lh20 | ||
%p | ||
= raw fund.description_html.truncate_words(24) | ||
|
||
- if i == 2 && params[:page].to_i < 2 | ||
.flex.mb40 | ||
%a.fs14.white.bg-darken-blue.circle.shadow.inline-block.py5.pr14.pl5.truncate{ href: root_path } | ||
.fs12.bg-green.caps.bold.circle.inline-block.py3.px5 Preview | ||
Sign in or create a free account to see more | ||
|
||
.center | ||
= paginate @funds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
= content_for :title, "Preview #{@fund.name}" | ||
|
||
%header | ||
= cell :v2_navbar, @current_user | ||
= cell :breadcrumb, 'Funds' => public_funds_path, @fund.name => public_fund_path | ||
|
||
%main | ||
.maxw1080.mx-auto.px20.flex.flex-wrap | ||
%aside.perc25.md.px20.mb40 | ||
.bg-mint.white.px10.py15.rounded-top | ||
%h3 Check your eligibility and suitability for funds in seconds. | ||
%a.button-wide.button-bottom.white.bg-olive.caps.truncate.shadow{ href: root_path } Sign up | ||
|
||
%section.perc75.md.px20.mb40 | ||
|
||
%section | ||
%h1.light= @fund.name | ||
.fs15.lh20.mid-gray= @fund.funder.name | ||
|
||
%hr.my40 | ||
|
||
%section | ||
.mb20 | ||
%h2.light Summary | ||
|
||
.mb20 | ||
= raw @fund.description_html | ||
|
||
- if @fund.period_end.present? && @fund.period_end > 3.years.ago | ||
%small.slate | ||
Powered by open data | ||
· | ||
= link_to 'Sources', fund_sources_path(@fund), target: '_blank', class: 'blue' | ||
.slate.fs15.my10 | ||
= period(@fund) | ||
|
||
- unless @fund.open_call? | ||
%div.cta Please note this fund does not accept unsolicited applications. Please read the fund guidance for more information. | ||
|
||
%ul.list.pl30 | ||
= cell(:fund_insight, @fund).call(:amount) | ||
= cell(:fund_insight, @fund).call(:duration) | ||
|
||
- if @fund.open_data && @fund.grant_count | ||
%li.mb5 | ||
Awarded | ||
%span.bold= number_with_delimiter(@fund.grant_count) | ||
= "grant".pluralize(@fund.grant_count) + '.' | ||
|
||
- if @fund.open_data? && @fund.award_month_distribution? | ||
%li.mb5< | ||
Awarded the most funding in | ||
= succeed '.' do | ||
%strong= top_award_months(@fund) | ||
|
||
- if @fund.open_data? && @fund.country_distribution? | ||
%li.mb5< | ||
Awarded most funding in the | ||
= succeed '.' do | ||
%strong= top_countries(@fund) | ||
|
||
= cell(:fund_insight, @fund).call(:grant_examples) | ||
|
||
%hr.my40 | ||
|
||
%section.muted | ||
.mb20 | ||
%h2.light Eligibility | ||
|
||
%p.mb40 | ||
The following questions have been set by | ||
= succeed '.' do | ||
= @fund.funder.name | ||
|
||
%p.bold.mb20 Are you seeking funding for? | ||
|
||
%h5.mb20 Your organisation | ||
|
||
- @restrictions.select { |i| i[0] == 'Organisation' }.each do |r| | ||
.mb20.flex.items-center.fs15.lh20 | ||
.blue.nowrap.mr30 Yes No | ||
= r[1].capitalize | ||
|
||
%h5.mb20 Your proposal | ||
|
||
- @restrictions.select { |i| i[0] == 'Proposal' }.each do |r| | ||
.mb20.flex.items-center.fs15.lh20 | ||
.blue.nowrap.mr30 Yes No | ||
= r[1].capitalize | ||
|
||
.bg-silver.rounded.shadow.fs14.p10.mb20 | ||
.bold.caps.mb10 Good to know | ||
Eligibility checks for location, the amount you are seeking and other factors will been done automatically. | ||
|
||
.button.white.bg-blue.caps.shadow Check eligibility | ||
|
||
%hr.my40 | ||
|
||
%section.muted | ||
.mb40 | ||
%h2.light Apply | ||
|
||
.button.white.bg-blue.caps.shadow.mb40 Application form | ||
|
||
%h5.mb20 Status | ||
|
||
.button.blue.border-blue.caps.mb10 Submitted | ||
.button.green.border-green.caps.mb10 Successful | ||
.button.red.border-red.caps.mb10 Declined | ||
|
||
= render partial: 'layouts/sign_up_cta' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.