diff --git a/src/app/components/app-paginator/app-paginator.directive.js b/src/app/components/app-paginator/app-paginator.directive.js
index d5681fa..17c8cbf 100644
--- a/src/app/components/app-paginator/app-paginator.directive.js
+++ b/src/app/components/app-paginator/app-paginator.directive.js
@@ -46,11 +46,11 @@
AppPaginatorController.prototype.attachListeners = function() {
var vm = this;
- vm.$scope.$watch('vm.perPage', function(newValue/*, oldValue*/) {
+ vm.$scope.$watch('vm.perPage', function() {
vm.calcArrayPages();
});
- vm.$scope.$watch('vm.total', function(newValue/*, oldValue*/) {
+ vm.$scope.$watch('vm.total', function() {
vm.calcArrayPages();
});
};
diff --git a/src/app/components/article-service/article.service.js b/src/app/components/article-service/article.service.js
index e3d1976..f113b46 100644
--- a/src/app/components/article-service/article.service.js
+++ b/src/app/components/article-service/article.service.js
@@ -269,6 +269,7 @@
'url', // parent.image.url
'image',
'title',
+ 'archived',
]
}, params);
diff --git a/src/app/components/dialoga-service/dialoga.service.js b/src/app/components/dialoga-service/dialoga.service.js
index bf90059..3f5802e 100644
--- a/src/app/components/dialoga-service/dialoga.service.js
+++ b/src/app/components/dialoga-service/dialoga.service.js
@@ -39,7 +39,7 @@
}else{
// load main content
ArticleService.getArticleById(API.articleId.home, {
- 'fields[]': ['id','abstract','body','categories','children','children_count','title','slug','image','url', 'amount_of_children', 'archived'],
+ 'fields[]': ['id','abstract','body','categories','children','children_count','title','slug','image','url', 'archived'],
'content_type':'ProposalsDiscussionPlugin::DiscussionTopic'
}, function (data){
CACHE.home = data;
diff --git a/src/app/components/proposal-box/proposal-box.directive.js b/src/app/components/proposal-box/proposal-box.directive.js
index 3e9d4dd..4f6ceda 100644
--- a/src/app/components/proposal-box/proposal-box.directive.js
+++ b/src/app/components/proposal-box/proposal-box.directive.js
@@ -33,6 +33,7 @@
var vm = this;
vm.showVote = vm.showVote || false;
+ vm.archived = vm.archived || false;
vm.focus = vm.focus || false;
vm.STATE = null;
vm.errorOnSkip = false;
@@ -169,6 +170,11 @@
ProposalBoxController.prototype.vote = function(value) {
var vm = this;
+ if(vm.archived === true){
+ vm.$log.info('Article archived. Abort.');
+ return;
+ }
+
vm._oldVoteValue = value;
if (vm.canVote()) {
if (vm.doVote) {
@@ -190,6 +196,11 @@
ProposalBoxController.prototype.skip = function() {
var vm = this;
+ if(vm.archived === true){
+ vm.$log.info('Article archived. Abort.');
+ return;
+ }
+
vm.errorOnSkip = false;
vm.STATE = vm.VOTE_STATUS.LOADING;
vm.doVote({
@@ -226,15 +237,16 @@
restrict: 'E',
templateUrl: 'app/components/proposal-box/proposal-box.html',
scope: {
- proposal: '=',
- topic: '=',
- category: '=',
- showVote: '=',
- focus: '@',
- doVote: '&'
// @ -> Text binding / one-way binding
// = -> Direct model binding / two-way binding
// & -> Behaviour binding / Method binding
+ archived: '=',
+ category: '=',
+ doVote: '&',
+ focus: '@',
+ proposal: '=',
+ showVote: '=',
+ topic: '=',
},
controller: ProposalBoxController,
controllerAs: 'vm',
diff --git a/src/app/components/proposal-box/proposal-box.html b/src/app/components/proposal-box/proposal-box.html
index f54000b..43ed7c1 100644
--- a/src/app/components/proposal-box/proposal-box.html
+++ b/src/app/components/proposal-box/proposal-box.html
@@ -145,9 +145,16 @@
{{vm.proposal.abstract}}
-
+
+
diff --git a/src/app/components/proposal-carousel/proposal-carousel.directive.js b/src/app/components/proposal-carousel/proposal-carousel.directive.js
index 8cdb508..2cbbe2c 100644
--- a/src/app/components/proposal-carousel/proposal-carousel.directive.js
+++ b/src/app/components/proposal-carousel/proposal-carousel.directive.js
@@ -31,6 +31,7 @@
}
vm.activeIndex = 0;
+ vm.archived = vm.archived || false;
vm.loading = false;
vm.proposalsLength = vm.proposals.length;
};
@@ -80,6 +81,7 @@
restrict: 'E',
templateUrl: 'app/components/proposal-carousel/proposal-carousel.html',
scope: {
+ archived: '=',
proposals: '='
},
controller: ProposalCarouselController,
diff --git a/src/app/components/proposal-carousel/proposal-carousel.html b/src/app/components/proposal-carousel/proposal-carousel.html
index 77713be..f6873a8 100644
--- a/src/app/components/proposal-carousel/proposal-carousel.html
+++ b/src/app/components/proposal-carousel/proposal-carousel.html
@@ -20,7 +20,7 @@
{{::proposal.abstract}}
-
+