Skip to content

Commit

Permalink
Completed PR requested changes, minor changes in routes and layout. D…
Browse files Browse the repository at this point in the history
…uplicates extracted to _sukromne_osoby.erb partial
  • Loading branch information
michal-rohacek committed Jun 30, 2019
1 parent e58f6fc commit 9373c0b
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 22 deletions.
9 changes: 8 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ def h(text)
erb :privacy_policy
end

get '/podporovatelia' do
@page.title = 'Podporovatelia'
@year = '2019'
erb :supporters
end

get '/podporovatelia/?:year?' do
@year = params['year'] if ['2016', '2017', '2018', '2019'].include?(params['year'])
@year = params['year'] if ['2016', '2017', '2018'].include?(params['year'])
redirect('/podporovatelia') unless @year
@page.title = 'Podporovatelia'
erb :supporters
end
Expand Down
9 changes: 5 additions & 4 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,15 @@ $(document).ready(function () {
});

$('#sukromne-osoby').each(function(i, e) {
//get year value from URL
var year_from = window.location.pathname.split("/").pop();
var year_to = parseInt(year_from) + 1;
//get year value from HTML data attribute
var year_from = $('#supporters-year').data('year');

//if the year value from URL is anything else than 4 digits, no API call needed
//if the year value is not valid (regex tests 4 digits), no API call needed
if(!/^([0-9]{4})$/.test(year_from))
return;

var year_to = parseInt(year_from) + 1;

var api_link = 'https://api.darujme.sk/v1/feeds/6bdda09c-356b-4328-9953-103eb78aa44d/donors?per_page=500&before=' + year_to + '-01-01&since=' + year_from + '-01-01';
var elm = $(e);
$.getJSON(api_link, function (data) {
Expand Down
24 changes: 15 additions & 9 deletions views/supporters.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@
</ul>
</div>
<div class="content-box col-md-9 content-supporters">
<h1 class="content-heading text-center">Podporovatelia</h1>
<h1 class="content-heading text-center">Podporovatelia v roku <%= @year %></h1>
<ul>
<li><a href="/podporovatelia/2018">Podporovatelia v roku 2018</a></li>
<li><a href="/podporovatelia/2017">Podporovatelia v roku 2017</a></li>
<li><a href="/podporovatelia/2016">Podporovatelia v roku 2016</a></li>
</ul>
<div id="supporters-year" data-year="<%= @year %>"></div>

<hr/>
<!-- <div class="col-sm-3"><a href="/podporovatelia/2019">Podporovatelia v roku 2019</a></div>-->
<!-- <div class="col-sm-3"><a href="/podporovatelia/2018">Podporovatelia v roku 2018</a></div>-->
<!-- <div class="col-sm-3"><a href="/podporovatelia/2017">Podporovatelia v roku 2017</a></div>-->
<!-- <div class="col-sm-3"><a href="/podporovatelia/2016">Podporovatelia v roku 2016</a></div>-->
<div class="content-wrap logos">
<p>Slovensko.Digital je komunita. Ďakujeme všetkým, ktorí sa rozhodli nás podporiť.</p>
<div class="row">
<div class="col-sm-3"><a href="/podporovatelia/2019">Podporovatelia v roku 2019</a></div>
<div class="col-sm-3"><a href="/podporovatelia/2018">Podporovatelia v roku 2018</a></div>
<div class="col-sm-3"><a href="/podporovatelia/2017">Podporovatelia v roku 2017</a></div>
<div class="col-sm-3"><a href="/podporovatelia/2016">Podporovatelia v roku 2016</a></div>
</div>
<div class="row">
<div class="col-sm-4"><a href="http://websupport.sk"><img class="img-responsive" src="/img/logo/websupport.png" alt="WebSupport"></a></div>
<div class="col-sm-4"><a href="http://qualityunit.com"><img class="img-responsive" src="/img/logo/quality-unit.png" alt="Quality Unit"></a></div>
Expand Down Expand Up @@ -67,8 +73,8 @@
</div>
<hr>

<%= erb :"supporters_years/_#{@year}" if @year %>

<%= erb :"supporters/_#{@year}"%>
<%= erb :'supporters/_sukromne_osoby' %>
</div>
</div>
</div>
Expand Down
108 changes: 108 additions & 0 deletions views/supporters/_2016.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<h2 id="dary">Prijaté dary</h2>
<h3 id="firmy-a-granty">Firmy a granty</h3>
<table class="table table-supporters">
<tbody>
<tr>
<td>Fond pre transparentné Slovensko v Nadácii Pontis</td>
<td class="text-right">30.000 &euro;</td>
</tr>
<tr>
<td>Websupport, s.r.o.</td>
<td class="text-right">20.000 &euro;</td>
</tr>
<tr>
<td>Quality Unit, s.r.o.</td>
<td class="text-right">20.000 &euro;</td>
</tr>
<tr>
<td>Pixel Federation, s.r.o.</td>
<td class="text-right">25.000 &euro;</td>
</tr>
<tr>
<td>EEA, s.r.o.</td>
<td class="text-right">20.000 &euro;</td>
</tr>
<tr>
<td>Nadácia ESET</td>
<td class="text-right">10.000 &euro;</td>
</tr>
<tr>
<td>Martinus.sk, s.r.o.</td>
<td class="text-right">10.000 &euro;</td>
</tr>
<tr>
<td>Keen Software House, a. s.</td>
<td class="text-right">10.000 &euro;</td>
</tr>
<tr>
<td>O2 Slovakia, s.r.o.</td>
<td class="text-right">10.000 &euro;</td>
</tr>
<tr>
<td>US Embassy grant</td>
<td class="text-right">$10.000 = ~9900 &euro;</td>
</tr>
<tr>
<td>VIAMO, a.s.</td>
<td class="text-right">5.000 &euro;</td>
</tr>
<tr>
<td>sli.do, s. r. o.</td>
<td class="text-right">2.000 &euro;</td>
</tr>
<tr>
<td>Comiit ApS</td>
<td class="text-right">1.000 &euro;</td>
</tr>
<tr>
<td>BMB Leitner, k.s.</td>
<td class="text-right">účtovníctvo</td>
</tr>
<tr>
<td>Studio Echt, s.r.o.</td>
<td class="text-right">dizajn a marketingové služby</td>
</tr>
<tr>
<td>Seesame, s.r.o.</td>
<td class="text-right">podpora pre PR a komunikáciu</td>
</tr>
<tr>
<td>Brichta &amp; Partners</td>
<td class="text-right">právne služby v hodnote 20.000 &euro;</td>
</tr>
<tr>
<td>Phirational, s.r.o.</td>
<td class="text-right">kancelárske priestory</td>
</tr>
<tr>
<td>Trnka Investments, spol. s r.o.</td>
<td class="text-right">kancelárske priestory a priestor na recepciu</td>
</tr>
<tr>
<td>Bright, s.r.o.</td>
<td class="text-right">tlač propagačných materiálov</td>
</tr>
<tr>
<td>Pizza SEO, s.r.o.</td>
<td class="text-right">správa online kampaní</td>
</tr>
<tr>
<td>superfaktura.sk, s.r.o.</td>
<td class="text-right">fakturačný softvér</td>
</tr>
<tr>
<td>NEWTON Media, spol. s r.o.</td>
<td class="text-right">mediálny monitoring</td>
</tr>
<tr>
<td>i-Secure, s. r. o.</td>
<td class="text-right">ochrana osobných údajov</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Spolu</td>
<td class="text-right">170.900 &euro;</td>
</tr>
</tfoot>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,3 @@
</tr>
</tfoot>
</table>

<h3 id="sukromne-osoby">Súkromné osoby</h3>
<p>V prípade anonymných alebo pseudonymných darcov overujeme ich identitu dodatočne.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,3 @@
</tr>
</tfoot>
</table>

<h3 id="sukromne-osoby">Súkromné osoby</h3>
<p>V prípade anonymných alebo pseudonymných darcov overujeme ich identitu dodatočne.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,3 @@
</tfoot>
</table>

<h3 id="sukromne-osoby">Súkromné osoby</h3>
<p>V prípade anonymných alebo pseudonymných darcov overujeme ich identitu dodatočne.</p>
2 changes: 2 additions & 0 deletions views/supporters/_sukromne_osoby.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h3 id="sukromne-osoby">Súkromné osoby</h3>
<p>V prípade anonymných alebo pseudonymných darcov overujeme ich identitu dodatočne.</p>

0 comments on commit 9373c0b

Please sign in to comment.