From 55144cca39bde2c5b6bcf50d3f72cf71cf9b21d3 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Fri, 26 Jan 2018 12:01:05 +0100 Subject: [PATCH] frontend/public: minor fixes --- frontend/static/js/public.js | 5 ++++- frontend/static/public.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/public.js b/frontend/static/js/public.js index 4bef654e..121658e3 100644 --- a/frontend/static/js/public.js +++ b/frontend/static/js/public.js @@ -155,7 +155,10 @@ angular.module("FICApp") $scope.themes = themes; $scope.max_gain = 0; angular.forEach(themes, function(theme, key) { - this[key].exercice_count = Object.keys(theme.exercices).length; + if (theme.exercices) + this[key].exercice_count = Object.keys(theme.exercices).length; + else + this[key].exercice_count = 0; this[key].gain = 0; angular.forEach(theme.exercices, function(ex, k) { this.gain += ex.gain; diff --git a/frontend/static/public.html b/frontend/static/public.html index 24c38884..8e165af2 100644 --- a/frontend/static/public.html +++ b/frontend/static/public.html @@ -120,7 +120,7 @@ - Niveau {{ lvl }} + Challenge {{ lvl }} {{ exercice.solved }}