diff --git a/.gitignore b/.gitignore index 7911b28..e4bf4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ node_modules dist .tmp .sass-cache +.publish app/bower_components +app/styles/main.css diff --git a/app/index.html b/app/index.html index 7a35c2b..95488f9 100644 --- a/app/index.html +++ b/app/index.html @@ -11,13 +11,10 @@ - + - - - @@ -35,9 +32,11 @@
-
+ +
-
+
+
@@ -66,13 +65,13 @@ - - - - - - - + + + + + + + @@ -83,7 +82,7 @@ - + @@ -93,6 +92,7 @@ + diff --git a/app/scripts/app.js b/app/scripts/app.js index 301ba2a..aa91a04 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -28,10 +28,10 @@ angular templateUrl: 'views/news.html', controller: 'NewsCtrl' }) - .when('/Rankings', { - templateUrl: 'views/rankings.html', - controller: 'RankingsCtrl' - }) + //.when('/Rankings', { + // templateUrl: 'views/rankings.html', + // controller: 'RankingsCtrl' + //}) .when('/Blog', { templateUrl: 'views/blog.html', controller: 'BlogCtrl' @@ -40,10 +40,10 @@ angular templateUrl: 'views/page.html', controller: 'PageCtrl' }) - .when('/Result', { - templateUrl: 'views/result.html', - controller: 'ResultCtrl' - }) + //.when('/Result', { + // templateUrl: 'views/result.html', + // controller: 'ResultCtrl' + //}) .when('/Skiclubs', { templateUrl: 'views/skiclubs.html', controller: 'SkiclubsCtrl' diff --git a/app/scripts/controllers/result.js b/app/scripts/controllers/result.js index 66330ab..cb0a3ec 100644 --- a/app/scripts/controllers/result.js +++ b/app/scripts/controllers/result.js @@ -19,6 +19,14 @@ angular.module('websiteApp') .html(result.table) .find('table') .addClass('table table-striped table-condensed'); + // Hack to hide 'FIS Code' column + if (angular.element('#table-content tr:first() th').length > 8) { + var fis = angular.element('#table-content th:contains("FIS Code")'); + var index = fis.parent().children().index(fis); + angular.element('#table-content tr').find('th:nth(' + index + ')').hide(); + angular.element('#table-content tr').find('td:nth(' + index + ')').hide(); + } + }); } ]); diff --git a/app/scripts/controllers/sponsors.js b/app/scripts/controllers/sponsors.js index 614ba1c..2a65edb 100644 --- a/app/scripts/controllers/sponsors.js +++ b/app/scripts/controllers/sponsors.js @@ -8,8 +8,10 @@ * Controller of the websiteApp */ angular.module('websiteApp') - .controller('SponsorsCtrl', function ($scope, Widget) { - Widget.get(2, function(widget) { - $scope.widgetContent = widget; - }); - }); + .controller('SponsorsCtrl', ['$scope', 'Widget', + function ($scope, Widget) { + Widget.get(2, function(widget) { + $scope.widgetContent = widget; + }); + } + ]); diff --git a/app/scripts/directives/tsAdPlaceholder.js b/app/scripts/directives/tsAdPlaceholder.js new file mode 100644 index 0000000..f4d6252 --- /dev/null +++ b/app/scripts/directives/tsAdPlaceholder.js @@ -0,0 +1,42 @@ +'use strict'; + +angular.module('websiteApp') + .directive('tsAdPlaceholder', ['$window', 'Pub', + function($window, Pub) { + return { + templateUrl: 'views/directives/core/placeholder.html', + restrict: 'EACM', + replace: true, + scope: { + width: '=?minWidth', + }, + link: function postLink(scope, element, attrs) { + + var checkWidth = function(width) { + var width = width; + return function() { + if (width >= window.innerWidth) { + element.css('display', 'none'); + } + else { + element.css('display', 'block'); + } + }; + }; + checkWidth = checkWidth(scope.width); + checkWidth(); + + var pubs = Pub.getPlaceholder( + attrs.placeholder, + attrs.category, + function (pubs) { + scope.ad = pubs[0]; + scope.cat = attrs.category; + } + ); + + angular.element($window).on('resize', checkWidth); + } + }; + } + ]); diff --git a/app/scripts/directives/tssideads.js b/app/scripts/directives/tssideads.js index a21978c..3a5d97f 100644 --- a/app/scripts/directives/tssideads.js +++ b/app/scripts/directives/tssideads.js @@ -1,41 +1,43 @@ 'use strict'; angular.module('websiteApp') - .directive('tsSideAds', function($window, Pub) { - return { - templateUrl: 'views/directives/core/sideads.html', - restrict: 'EACM', - scope: { - width: '=minWidth', - }, - link: function postLink(scope, element, attrs) { - function shuffle(o) { //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * - i), x = o[--i], o[i] = o[j], o[j] = x); - return o; - }; + .directive('tsSideAds', ['$window', 'Pub', + function($window, Pub) { + return { + templateUrl: 'views/directives/core/sideads.html', + restrict: 'EACM', + scope: { + width: '=minWidth', + }, + link: function postLink(scope, element, attrs) { + function shuffle(o) { //v1.0 + for (var j, x, i = o.length; i; j = Math.floor(Math.random() * + i), x = o[--i], o[i] = o[j], o[j] = x); + return o; + }; - var checkWidth = function(width) { - var width = width; - return function() { - if (width >= window.innerWidth) { - element.css('display', 'none'); - } - else { - element.css('display', 'block'); - } + var checkWidth = function(width) { + var width = width; + return function() { + if (width >= window.innerWidth) { + element.css('display', 'none'); + } + else { + element.css('display', 'block'); + } + }; }; - }; - checkWidth = checkWidth(scope.width); - checkWidth(); + checkWidth = checkWidth(scope.width); + checkWidth(); - Pub.getVerticalBanner(function(banners) { - scope.ad = shuffle(banners)[0]; - }); + Pub.getVerticalBanner(function(banners) { + scope.ad = shuffle(banners)[0]; + }); - angular.element($window) - .on('resize', checkWidth); - } - }; - }); + angular.element($window) + .on('resize', checkWidth); + } + }; + } + ]); diff --git a/app/scripts/services/pub.js b/app/scripts/services/pub.js index fc5f27b..90e3993 100644 --- a/app/scripts/services/pub.js +++ b/app/scripts/services/pub.js @@ -14,6 +14,15 @@ angular.module('websiteApp') return { + getPlaceholder: function(placeholder, cat, callback) { + $http.get(pubApi + '?placeholder=' + placeholder + '&category=' + cat, { + cache: true + }).then(function(res) { + var data = shuffleArray(res.data); + callback(data); + }, Server.errorHandler); + }, + getCat: function(cat, callback) { $http.get(pubApi + '?category=' + cat, { cache: true diff --git a/app/scripts/services/server.js b/app/scripts/services/server.js index 9882d55..3041825 100644 --- a/app/scripts/services/server.js +++ b/app/scripts/services/server.js @@ -1,32 +1,33 @@ 'use strict'; angular.module('websiteApp') - .service('Server', function Server($window, $location) { - // AngularJS will instantiate a singleton by calling "new" on this function + .service('Server', ['$window', '$location', + function Server($window, $location) { + // AngularJS will instantiate a singleton by calling "new" on this function - this.Url = 'http://tooski.webfactional.com/api/'; - // this.Url = 'http://127.0.0.1:8000/'; + this.Url = 'http://tooski.webfactional.com/api/'; - this.sendAnalytics = function() { - $window.ga('send', 'pageview', { - page: $location.path() - }); - }; + this.sendAnalytics = function() { + $window.ga('send', 'pageview', { + page: $location.path() + }); + }; - this.processResponse = function(response) { - return response.map(function(el) { - var result = el.fields; - result.id = el.pk; - result.date = new Date(result.date) - .getTime(); - return result; - }); - }; + this.processResponse = function(response) { + return response.map(function(el) { + var result = el.fields; + result.id = el.pk; + result.date = new Date(result.date) + .getTime(); + return result; + }); + }; - this.errorHandler = function(status, response) { - console.log( - 'There was a connection problem with the server. (' + - status + ')' - ); + this.errorHandler = function(status, response) { + console.log( + 'There was a connection problem with the server. (' + + status + ')' + ); + } } - }); + ]); diff --git a/app/styles/main.scss b/app/styles/main.scss index 8d16223..04ab4c1 100644 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -198,6 +198,18 @@ div.blue { padding-top:0px; } +.sponsors-hl { + background-color: #eee; + color: #000; + padding: 10px; + margin: 20px 0 30px 0; + text-align: justify; + + li { + margin: 20px 10px 20px 10px; + } +} + img { max-width:100%; } @@ -213,3 +225,35 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,su font-weight: bold; background-color: $lightgray; } + +/***** ADS ****/ +$ads_categories: ( + square: ( + width: 300px, + height: 250px, + ), + vertical: ( + width: 120px, + height: 600px, + ), + horizontal: ( + width: 468px, + height: 90px, + ), +); + +@each $category, $dimensions in $ads_categories { + .ad_block_#{$category} { + margin: 1px; + + .ad_image_#{$category} { + @each $property, $value in $dimensions { + #{$property}: #{$value}; + } + } + } +} + +.ad_block_horizontal { + margin: 20px auto; +} diff --git a/app/views/blog.html b/app/views/blog.html index d6fe18d..c67ee6c 100644 --- a/app/views/blog.html +++ b/app/views/blog.html @@ -1,3 +1,6 @@ + +
+
@@ -5,7 +8,7 @@ {{blogger.name}}
-
+

@@ -55,18 +58,12 @@

-
-
- Contactez-nous ! - -
-
-

Vous êtes skieur de compétition et souhaiteriez avoir votre propre blog sur www.tooski.ch ?

- - Contactez-nous -
-
- -
+ +
+
+
+
+
+ diff --git a/app/views/directives/core/navbar.html b/app/views/directives/core/navbar.html index 5693582..6a20bbd 100644 --- a/app/views/directives/core/navbar.html +++ b/app/views/directives/core/navbar.html @@ -32,12 +32,9 @@ Actu - - + + - - Résultats - Blogs @@ -47,9 +44,12 @@ Angulation - + Mentors & Sponsors + diff --git a/app/views/directives/core/placeholder.html b/app/views/directives/core/placeholder.html new file mode 100644 index 0000000..2a7b6f2 --- /dev/null +++ b/app/views/directives/core/placeholder.html @@ -0,0 +1,5 @@ + diff --git a/app/views/directives/core/widgetBar.html b/app/views/directives/core/widgetBar.html index 4f9986d..a4ab87b 100644 --- a/app/views/directives/core/widgetBar.html +++ b/app/views/directives/core/widgetBar.html @@ -1,8 +1,8 @@
-
+
diff --git a/app/views/index.html b/app/views/index.html index f41816e..440f094 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1,6 +1,9 @@
+ +
+
@@ -50,3 +53,10 @@
+ +
+
+
+
+
+ diff --git a/app/views/news.html b/app/views/news.html index a753eb2..11682f8 100644 --- a/app/views/news.html +++ b/app/views/news.html @@ -1,28 +1,18 @@ + +
+
-

+

{{news.title}}

-

- {{news.title}} -

-
-

- Auteur:  {{news.author}} -
- Date:  {{news.date | date:'dd/MM/yyyy'}} -

-

-

+

Par {{news.author}}, le {{news.date | date:'dd/MM/yyyy'}} à {{news.date | date:'HH:mm'}}

-
-
-
@@ -30,3 +20,10 @@

+ +
+
+
+
+
+ diff --git a/app/views/rankings.html b/app/views/rankings.html index dddefd9..b3bd460 100644 --- a/app/views/rankings.html +++ b/app/views/rankings.html @@ -1,3 +1,6 @@ + +
+
@@ -85,7 +88,7 @@
- Classements 2015/16 + Classements 2016/17
@@ -137,3 +140,10 @@
+ +
+
+
+
+
+ diff --git a/app/views/result.html b/app/views/result.html index bbd3583..587a31d 100644 --- a/app/views/result.html +++ b/app/views/result.html @@ -1,3 +1,6 @@ + +
+
@@ -28,4 +31,11 @@

.t { font-weight:bold; } -> + + +
+
+
+
+
+ diff --git a/app/views/shop.html b/app/views/shop.html index 0876251..1eab237 100644 --- a/app/views/shop.html +++ b/app/views/shop.html @@ -1,3 +1,6 @@ + +
+
@@ -91,5 +94,16 @@ Ancien numéro
+ + +
+
+

+ +
+
+
+
+ diff --git a/app/views/skiclubs.html b/app/views/skiclubs.html index dcfadb9..fbc5b67 100644 --- a/app/views/skiclubs.html +++ b/app/views/skiclubs.html @@ -1,3 +1,6 @@ + +
+
@@ -46,8 +49,17 @@

{{currentClub.title}}

Contactez-nous

-

+
+
+ +
+
+ +
+
+
+
-
+ diff --git a/app/views/sponsors.html b/app/views/sponsors.html index b3ea945..610e543 100644 --- a/app/views/sponsors.html +++ b/app/views/sponsors.html @@ -24,18 +24,19 @@

Soutenons la relève!

extrêmement importants car un jeune a besoin de sentir que beaucoup de gens sont derrière lui, même s’il ne les connaît pas. Et c’est justement sur ce point que votre aide nous est indispensable!

-

De manière très concrète, pour chaque soutien que nous réussirons à décrocher, - nous appliquerons la clé de répartition suivante:

-

-

    -
  • la moitié des fonds récoltés sera directement versée aux blogueurs - tooski; -
  • -
  • l’autre moitié servira à couvrir les frais techniques dépassant ceux - que tooski prend déjà à sa charge, nous permettant par conséquent - de gérer plus de blogs.
  • -
-

+
+

De manière très concrète, pour chaque soutien que nous réussissons à + décrocher, nous utilisons les fonds de la manière suivante:

+

+

    +
  • les cotisations des mentors sont intégralement reversées aux blogueurs tooski; +
  • +
  • quant aux fonds récoltés auprès des sponsors, la moitié est directement versée + aux blogueurs alors que l’autre moitié sert à couvrir les frais techniques dépassant + ceux que tooski prend déjà à sa charge, afin que nous puissions gérer plus de blogs.
  • +
+

+
Pour devenir mentor diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..11d9d5e --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,180 @@ +var gulp = require('gulp'); + +// Load plugins +var $ = require('gulp-load-plugins')(); + +// Config +var config = { +
 bowerDir: './app/bower_components'
, + buildPath: './dist', +
 cssPath: './dist/styles', + fontsPath: './app/fonts', +
 htmlPath: './app', + imagesPath: './app/images', +
 jsPath: './app/scripts', +
 sassPath: './app/styles', +} + +gulp.task('connectDev', function () { + $.connect.server({ + root: ['app', 'tmp'], + port: 8001, + livereload: true + }); +}); + +gulp.task('connectDist', function () { + $.connect.server({ + root: 'dist', + port: 8002, + livereload: true + }); +}); + +gulp.task('bower', function() {
 + return $.bower() +
 .pipe(gulp.dest(config.bowerDir))
; +}); + +gulp.task('bower-components', function() {
 + return gulp.src(config.htmlPath + '/bower_components/**/*') +
 .pipe(gulp.dest(config.buildPath + '/bower_components'))
; +}); + +gulp.task('fonts', function () { + return gulp.src(config.fontsPath + '/*.ttf') + .pipe(gulp.dest(config.buildPath + '/fonts')) + .pipe($.connect.reload()); +}); + +gulp.task('html', ["styles"], function () { + return gulp.src([ + config.htmlPath + '/**/*.html', + '!' + config.htmlPath + '/bower_components/**/*.html' + ]) + .pipe($.useref()) + .pipe($.if('*.js', $.uglify())) + .pipe($.if('*.css', $.cleanCss())) + .pipe(gulp.dest(config.buildPath)) + .pipe($.connect.reload()); +}); + +gulp.task('images', function () { + return gulp.src([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}']) + .pipe(gulp.dest(config.buildPath + '/images')) + .pipe($.connect.reload()); +}); + +gulp.task('misc', function () { + return gulp.src([ + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ]) + .pipe($.cache(gulp.dest(config.buildPath))) + .pipe($.connect.reload()); +}); + +gulp.task('styles', function () { + return gulp.src(config.sassPath + '/main.scss') + .pipe($.sass({ + style: 'expanded', + loadPath: [ + config.sassPath, + config.bowerDir + ] + })) + .pipe($.autoprefixer({ + browsers: ['last 2 versions'], + cascade: false + })) + .pipe($.cache(gulp.dest(config.sassPath))) + .pipe($.cleanCss()) + .pipe($.cache(gulp.dest(config.cssPath))) + .pipe($.connect.reload()); +}); + +// gulp.task('scripts', function () { +// return gulp.src(config.jsPath + '/**/*.js') +// .pipe($.concat('scripts.js')) +// .pipe($.rename({suffix: '.min'})) +// .pipe($.uglify()) +// .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) +// .pipe($.rev()) +// .pipe($.cache(gulp.dest(config.buildPath + '/scripts'))) +// .pipe($.rev.manifest(config.buildPath + '/rev-manifest.json', { +// base: config.buildPath, +// merge: true +// })) +// .pipe($.cache(gulp.dest(config.buildPath))) +// .pipe($.connect.reload()); +// }); + +gulp.task("revision", ["html"], function(){ + return gulp.src(["dist/**/*.css", "dist/**/*.js"]) + .pipe($.rev()) + .pipe(gulp.dest(config.buildPath)) + .pipe($.rev.manifest()) + .pipe(gulp.dest(config.buildPath)) +}) + +gulp.task("revreplace", ["revision"], function(){ + var manifest = gulp.src(config.buildPath + "/rev-manifest.json"); + + return gulp.src(config.buildPath + "/index.html") + .pipe($.revReplace({manifest: manifest})) + .pipe(gulp.dest(config.buildPath)); +}); + +gulp.task('watch', function () { + // Watch font files + gulp.watch([config.fontsPath + '/*'], ['fonts']); + + // Watch .html files + gulp.watch([ + config.jsPath + '/**/*.js', + config.htmlPath + '/**/*.html', + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ], ['html']); + + // Watch images + gulp.watch([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}'], ['images']); + + // Watch misc files + gulp.watch([ + config.htmlPath + '/favicon.ico', + config.htmlPath + '/robots.txt' + ], ['misc']); + + // Watch .scss files + gulp.watch([config.sassPath + '/**/*.scss'], ['styles']); + + // Watch .js files + // gulp.watch(config.jsPath + '/**/*.js', ['scripts']); +}); + +gulp.task('clean-cache', function () { + return $.cache.clearAll(); +}); + +gulp.task('clean', ['clean-cache'], function () { + return gulp.src(config.buildPath + '/*', {read: false}) + .pipe($.rimraf()); +}); + +// Build +gulp.task('build', ['clean'], function () { + gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'revreplace'); +}); + +// Deploy on gh-pages branch +gulp.task('deploy', function() { + return gulp.src(config.buildPath + '/**/*') + .pipe($.ghPages()); +}); + +// Dist serve +gulp.task('serve', ['connectDist']); + +// Default task +gulp.task('default', ['connectDev', 'build', 'watch']); diff --git a/package.json b/package.json index 10faf00..0ce210a 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,43 @@ { "name": "website", "version": "0.0.0", + "description": "website =======", + "main": "Gruntfile.js", + "directories": { + "test": "test" + }, "dependencies": {}, "devDependencies": { - "grunt": "~0.4.1", - "grunt-autoprefixer": "~0.4.0", - "grunt-bower-install": "~1.0.0", - "grunt-concurrent": "~0.5.0", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-compass": "~0.7.2", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-connect": "~0.5.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-cssmin": "~0.7.0", - "grunt-contrib-htmlmin": "~0.1.3", - "grunt-contrib-imagemin": "~0.3.0", - "grunt-contrib-jshint": "~0.7.1", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-watch": "~0.5.2", - "grunt-google-cdn": "~0.2.0", - "grunt-newer": "~0.6.1", - "grunt-ngmin": "~0.0.2", - "grunt-rev": "~0.1.0", - "grunt-svgmin": "~0.2.0", - "grunt-usemin": "~2.0.0", - "jshint-stylish": "~0.1.3", - "load-grunt-tasks": "~0.4.0", - "time-grunt": "~0.2.1" + "gulp": "^3.9.1", + "gulp-autoprefixer": "^3.1.0", + "gulp-bower": "0.0.13", + "gulp-cache": "^0.4.5", + "gulp-clean-css": "^2.0.11", + "gulp-concat": "^2.6.0", + "gulp-connect": "^4.1.0", + "gulp-copy": "0.0.2", + "gulp-gh-pages": "^0.5.4", + "gulp-if": "^2.0.1", + "gulp-image": "^2.0.1", + "gulp-imagemin": "^3.0.1", + "gulp-load-plugins": "^1.2.4", + "gulp-notify": "^2.2.0", + "gulp-rename": "^1.2.2", + "gulp-rev": "^7.1.0", + "gulp-rev-replace": "^0.4.3", + "gulp-rimraf": "^0.2.0", + "gulp-sass": "^2.3.2", + "gulp-uglify": "^1.5.4", + "gulp-useref": "^3.1.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://diadzine@bitbucket.org/ab_tooskich/website.git" }, - "engines": { - "node": ">=0.10.0" - } + "author": "", + "license": "ISC", + "homepage": "https://bitbucket.org/ab_tooskich/website#readme" }