Skip to content

Commit

Permalink
Add Santa Claus cap to advent calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Altmann committed Nov 23, 2015
1 parent 47a5837 commit 90b308b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
Binary file modified app/assets/images/welcome/advent_calendar_01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/welcome/bow.png
Binary file not shown.
Binary file added app/assets/images/welcome/cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions app/assets/stylesheets/controller/welcome/_advent_calendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@

.advent-calendar-bow-div {
position: absolute;
left: -10px;
right: -10px;
top: -10px;
bottom: -10px;
background-image: image-url('welcome/bow.png');
left: 0;
right: -37px;
top: -37px;
bottom: 0;
z-index: 11;
background-image: image-url('welcome/cap.png');
background-position: right top;
background-repeat: no-repeat;
}
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/layout/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ html,body {
@include clear-links-with-hover;
}

body {
overflow-x: hidden;
}

/*
h-tags
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/welcome_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def featured_library_path library
def calendar_time?
# true
current_date = Date.today
if (current_date >= Date.parse('2015-11-27')) && (current_date <= Date.parse('2015-12-24'))
if (current_date >= Date.parse('2015-11-24')) && (current_date <= Date.parse('2015-12-24'))
true
else
false
Expand All @@ -27,12 +27,12 @@ def calendar_time?

def calendar_partial_name
# "welcome/advent_calendar/window_01"
if Date.today >= Date.parse('2015-12-01')
if Date.today < Date.parse('2015-12-01')
"welcome/advent_calendar/window_pre"
else
day = Date.today.day
day_str = day.to_s.rjust(2, '0')
"welcome/advent_calendar/window_#{day_str}"
else
"welcome/advent_calendar/window_pre"
end
end
end
4 changes: 2 additions & 2 deletions test/features/advent_calendar_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
end
end

scenario 'User visits on the 27th of November and finds the pre-calendar widget' do
travel_to Time.new(2015, 11, 27) do
scenario 'User visits on the 24th of November and finds the pre-calendar widget' do
travel_to Time.new(2015, 11, 24) do
visit root_path
within '.advent-calendar' do
assert page.has_selector?('.advent-calendar-pre')
Expand Down

0 comments on commit 90b308b

Please sign in to comment.