diff --git a/client/html/templates/meetups.jade b/client/html/templates/meetups.jade index 1d25f9673cd7687e4f618532187d963616accf8e_Y2xpZW50L2h0bWwvdGVtcGxhdGVzL21lZXR1cHMuamFkZQ==..a974ebf70835104364f26a622249d446fb2188f8_Y2xpZW50L2h0bWwvdGVtcGxhdGVzL21lZXR1cHMuamFkZQ== 100644 --- a/client/html/templates/meetups.jade +++ b/client/html/templates/meetups.jade @@ -20,12 +20,11 @@ Les prochains évènements seront annoncés bientôt. .fwblock.container - p.nav.prev(ng-if="chapterYear > firstChapterYear") - a(href="" ng-click="loadChapter(chapterYear - 1)") - | <-- Chapitre {{chapterYear - 1 | chapterYearToNb | njpFixedNb:2}} - p.nav.next(ng-if="chapterYear < lastChapterYear") - a(href="" ng-click="loadChapter(chapterYear + 1)") - | Chapitre {{chapterYear + 1 | chapterYearToNb | njpFixedNb:2}} --> + ul.pager + li.previous(ng-if="chapterYear > firstChapterYear") + a(href="" ng-click="loadChapter(chapterYear - 1)") « Chapitre {{chapterYear - 1 | chapterYearToNb | njpFixedNb:2}} + li.next(ng-if="chapterYear < lastChapterYear") + a(href="" ng-click="loadChapter(chapterYear + 1)") Chapitre {{chapterYear + 1 | chapterYearToNb | njpFixedNb:2}} » .load-more spinner(ng-if="!loaded", size="lg") @@ -33,7 +32,7 @@ .fwblock.old-events( ng-repeat="conference in conferences" ng-class="{even: $even, odd: $odd}" - ng-if="conference" + ng-if="conference && conference.length" ) .container p.previously(ng-if="display('next', $index)") Prochainement... @@ -52,9 +51,8 @@ spinner(ng-if="!loaded", size="lg") .fwblock.container - p.nav.prev(ng-if="chapterYear > firstChapterYear") - a(href="" ng-click="loadChapter(chapterYear - 1)") - | <-- Chapitre {{chapterYear - 1 | chapterYearToNb | njpFixedNb:2}} - p.nav.next(ng-if="chapterYear < lastChapterYear") - a(href="" ng-click="loadChapter(chapterYear + 1)") - | Chapitre {{chapterYear + 1 | chapterYearToNb | njpFixedNb:2}} --> + ul.pager + li.previous(ng-if="chapterYear > firstChapterYear") + a(href="" ng-click="loadChapter(chapterYear - 1)") « Chapitre {{chapterYear - 1 | chapterYearToNb | njpFixedNb:2}} + li.next(ng-if="chapterYear < lastChapterYear") + a(href="" ng-click="loadChapter(chapterYear + 1)") Chapitre {{chapterYear + 1 | chapterYearToNb | njpFixedNb:2}} » diff --git a/client/js/nodejsparis/controllers/meetups.js b/client/js/nodejsparis/controllers/meetups.js index 1d25f9673cd7687e4f618532187d963616accf8e_Y2xpZW50L2pzL25vZGVqc3BhcmlzL2NvbnRyb2xsZXJzL21lZXR1cHMuanM=..a974ebf70835104364f26a622249d446fb2188f8_Y2xpZW50L2pzL25vZGVqc3BhcmlzL2NvbnRyb2xsZXJzL21lZXR1cHMuanM= 100644 --- a/client/js/nodejsparis/controllers/meetups.js +++ b/client/js/nodejsparis/controllers/meetups.js @@ -54,7 +54,7 @@ $scope.calendar = []; - // If we between end of chapter & announce month + // If we are between end of chapter & announce month if (now.month() >= talkLastMonth && (now.month() !== talkLastMonth || getTalkDayOfMonth(now) >= now) && announceMonth > now.month()) @@ -74,7 +74,7 @@ if (tryToInsert.month() === announceMonth) tryToInsert = getTalkDayOfMonth(tryToInsert, 1); - while ($scope.calendar.length < 6) { + while ($scope.calendar.length < 5) { // If we are trying to add an event in the period where there is none, stop if (talkLastMonth < tryToInsert.month() && tryToInsert.month() < talkFirstMonth) @@ -104,6 +104,9 @@ $scope.conferences = []; $scope.loadChapter = function(chapterYear) { + if (chapterYear < $scope.firstChapterYear || chapterYear > $scope.lastChapterYear) + return; + $scope.loaded = false; // Retrieve the current chapter's talks @@ -138,7 +141,8 @@ var res = false; _.each($scope.conferences, function(conference) { if (conference.length && cmp(conference[0].talk_date)) { - res = conference[0].talk_date === $scope.conferences[index][0].talk_date; + res = $scope.conferences[index][0] && + conference[0].talk_date === $scope.conferences[index][0].talk_date; return false; } });