code to count down date of end of campaign

This commit is contained in:
Kyle Drake 2015-06-28 21:49:24 -07:00
parent 1ae265d184
commit da4c51e1ef
4 changed files with 16 additions and 3 deletions

View file

@ -311,3 +311,6 @@ DEPENDENCIES
timecop
webmock
zipruby
BUNDLED WITH
1.10.2

View file

@ -1,3 +1,13 @@
def kickstarter_days_remaining
ending = Time.parse('Sat, Jul 25 2015 3:05 PM PDT')
today = Time.now
remaining = ending - today
return 0 if remaining < 0
((ending - today) / 86400).to_i
end
def dashboard_if_signed_in
redirect '/dashboard' if signed_in?
end

View file

@ -23,9 +23,9 @@
<div class="col col-66">
<div class="welcome kickstarter">
<h4><a href="https://www.kickstarter.com/projects/1262953102/neocities-30-an-interactive-html-css-course-for-ev">The Neocities Kickstarter: An HTML/CSS course for everyone</a></h4>
<p><strong>26 days left</strong> to get Neocities rewards and support our education goals! <a href="https://www.kickstarter.com/projects/1262953102/neocities-30-an-interactive-html-css-course-for-ev">Learn More&nbsp;>></a></p>
<p><strong><%= kickstarter_days_remaining %> days left</strong> to get Neocities rewards and support our education goals! <a href="https://www.kickstarter.com/projects/1262953102/neocities-30-an-interactive-html-css-course-for-ev">Learn More&nbsp;>></a></p>
</div>
<% if site.site_changed == false || site.changed_count == 0 %>
<div class="welcome">
<h4>Thanks for joining the Neocities community!</h4>

View file

@ -70,7 +70,7 @@
<a href="https://www.kickstarter.com/projects/1262953102/neocities-30-an-interactive-html-css-course-for-ev">
SUPPORT OUR
<img src="/img/kickstarterlogo.png" style="width: 280px; display:block; margin: 11px 0px;">
28 DAYS LEFT
<%= kickstarter_days_remaining %> DAYS LEFT
</a>
</div>
<p>We need your help to build an amazing HTML/CSS course into Neocities! <a href="https://www.kickstarter.com/projects/1262953102/neocities-30-an-interactive-html-css-course-for-ev">Learn More&nbsp;>></a></p>