-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/winter edition #238
Changes from all commits
37d6b5c
58eae45
12a0f15
a6da20d
9b4041d
60e6b9c
d463abe
cc31bae
3e82f2d
5872ba0
7c150e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* AET | ||
* | ||
* Copyright (C) 2013 Cognifide Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
define(['angularAMD'], function (angularAMD) { | ||
'use strict'; | ||
// custom prefix for custom directive 'aet' see: http://bit.ly/29U2YFf | ||
angularAMD.directive('aetWinterEdition', WinterEdition); | ||
|
||
function WinterEdition() { | ||
return { | ||
restrict: 'AE', | ||
link: linkFunc | ||
}; | ||
|
||
function linkFunc($scope) { | ||
var WINTER_THEME = { | ||
name: 'winter', | ||
statusClasses: { | ||
passed: 'fa-tree', | ||
failed: 'fa-gift', | ||
warning: 'fa-bell', | ||
rebased: 'fa-snowflake', | ||
unrebased: 'fa-eraser' | ||
} | ||
}; | ||
var TODAY = new Date(); | ||
var CHRISTMAS_DATE = new Date(TODAY.getFullYear(), 11, 25); | ||
var DAY_MARGIN = 14; | ||
var isChristmas = isDateWithinMargin(TODAY, CHRISTMAS_DATE, DAY_MARGIN); | ||
|
||
if (isChristmas) { | ||
_.merge($scope.theme, WINTER_THEME); | ||
snowFall.snow(document.body, {flakeCount: 200, maxSpeed: 20}); | ||
} | ||
} | ||
|
||
function isDateWithinMargin(today, eventDate, dayMargin) { | ||
var eventStartDate = new Date(eventDate); | ||
var eventEndDate = new Date(eventDate); | ||
|
||
eventStartDate.setDate(eventStartDate.getDate()-dayMargin); | ||
eventEndDate.setDate(eventEndDate.getDate()+dayMargin); | ||
|
||
return today >= eventStartDate && today <= eventEndDate; | ||
} | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
<script defer src="assets/icons/fontawesome-all.js"></script> | ||
</head> | ||
|
||
<body aet-hide-popovers aet-keyboard-shortcuts aet-sidepanel ng-class="{ 'menu-expanded': sidebarExpanded }"> | ||
<body aet-hide-popovers aet-keyboard-shortcuts aet-sidepanel aet-winter-edition ng-class="{ 'menu-expanded': sidebarExpanded }"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this CSS class needed? why? Maybe it should be only added in December ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. discussed |
||
|
||
<div class="screen-cover js-loader-app" ng-if="metadataSaveInProgress"><h1>Saving data...</h1></div> | ||
<div class="screen-cover data-loading-error" ng-if="metadataLoadingStatus == 'FAILED'"><h1>Failed to | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those elements are required, so that when a case gets accepted/rejected the icon is redrawn - simply adding an element with {{theme.statusClasses[test.getStatus()]}} won't work, since the italic tags are replaced with svg tags by fontawesome.