From e2fdce10ef379f48cda070cf23cb7035890febb4 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 8 Dec 2018 20:22:41 +0100 Subject: [PATCH] frontend: click on card to go to the related theme/defi --- frontend/static/js/challenge.js | 13 +++++++++++-- frontend/static/views/home.html | 2 +- frontend/static/views/tag.html | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/static/js/challenge.js b/frontend/static/js/challenge.js index 7a670ddb..ffd1777b 100644 --- a/frontend/static/js/challenge.js +++ b/frontend/static/js/challenge.js @@ -558,7 +558,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"]) $location.url("/"); }); }) - .controller("TagController", function($scope, $rootScope, $routeParams) { + .controller("TagController", function($scope, $rootScope, $routeParams, $location) { $rootScope.current_theme = 0; $rootScope.current_exercice = 0; $rootScope.current_tag = $routeParams.tag; @@ -577,6 +577,11 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"]) }) }) }) + + $scope.goDefi = function() { + $location.url("/" + this.ex.theme.urlid + "/" + this.ex.exercice.urlid); + } + }) .controller("RankController", function($scope, $rootScope) { $rootScope.current_theme = 0; @@ -604,12 +609,16 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"]) $rootScope.title = "Vidéos de résolution"; $rootScope.authors = ""; }) - .controller("HomeController", function($scope, $rootScope) { + .controller("HomeController", function($scope, $rootScope, $location) { $rootScope.current_theme = 0; $rootScope.current_exercice = 0; $rootScope.current_tag = undefined; $rootScope.title = "Bienvenue au challenge forensic de l'ÉPITA !"; $rootScope.authors = ""; + + $scope.goTheme = function() { + $location.url("/" + this.theme.urlid); + } }); function sready() { diff --git a/frontend/static/views/home.html b/frontend/static/views/home.html index 91b2672d..3254861c 100644 --- a/frontend/static/views/home.html +++ b/frontend/static/views/home.html @@ -15,7 +15,7 @@
-
+
diff --git a/frontend/static/views/tag.html b/frontend/static/views/tag.html index 6eefeacc..1b8f4730 100644 --- a/frontend/static/views/tag.html +++ b/frontend/static/views/tag.html @@ -1,5 +1,5 @@
-
+