diff --git a/src/app/components/article-service/article.service.js b/src/app/components/article-service/article.service.js index 5379938..243c308 100644 --- a/src/app/components/article-service/article.service.js +++ b/src/app/components/article-service/article.service.js @@ -121,7 +121,7 @@ var url = service.apiArticles + topicId + '/children'; var paramsExtended = angular.extend({ - 'fields[]': ['id', 'title', 'abstract', 'children', 'children_count'], + 'fields[]': ['id', 'title', 'abstract', 'children', 'children_count', 'ranking_position', 'hits', 'votes_for', 'votes_against'], 'limit':'20', 'page':'1', 'content_type':'ProposalsDiscussionPlugin::Proposal' diff --git a/src/app/components/category-list/category-list.directive.js b/src/app/components/category-list/category-list.directive.js index 7f35a43..3634ad8 100644 --- a/src/app/components/category-list/category-list.directive.js +++ b/src/app/components/category-list/category-list.directive.js @@ -9,7 +9,7 @@ function categoryList() { /** @ngInject */ - function CategoryListController($rootScope, $location, $log) { + function CategoryListController($rootScope, $element, $log) { $log.debug('CategoryListController'); // alias @@ -17,7 +17,7 @@ // dependencies vm.$rootScope = $rootScope; - vm.$location = $location; + vm.$element = $element; vm.$log = $log; // initialization @@ -25,7 +25,11 @@ } CategoryListController.prototype.init = function() { - // var vm = this; + var vm = this; + + if(!vm.isCollapsed){ + vm.isCollapsed = false; + } }; CategoryListController.prototype.selectCategory = function(category, $event) { @@ -45,6 +49,17 @@ vm.$rootScope.$broadcast('change-selectedCategory', vm.selectedCategory); }; + + CategoryListController.prototype.toogleList = function() { + var vm = this; + + if(!vm._listGroup){ + vm._listGroup = vm.$element.find('.list-group'); + } + + vm._listGroup.slideToggle(); + }; + var directive = { restrict: 'E', templateUrl: 'app/components/category-list/category-list.html', @@ -53,7 +68,7 @@ selectedCategory: '@' }, controller: CategoryListController, - controllerAs: 'categoryListCtrl', + controllerAs: 'vm', bindToController: true }; diff --git a/src/app/components/category-list/category-list.html b/src/app/components/category-list/category-list.html index 0355722..ee31c7c 100644 --- a/src/app/components/category-list/category-list.html +++ b/src/app/components/category-list/category-list.html @@ -1,16 +1,21 @@
diff --git a/src/app/components/category-list/category-list.scss b/src/app/components/category-list/category-list.scss index b64a21c..9cd5dee 100644 --- a/src/app/components/category-list/category-list.scss +++ b/src/app/components/category-list/category-list.scss @@ -1,5 +1,5 @@ .category-list { - .category-list--title { + &--title { color: #ffffff; font-size: 16px; margin: 0; @@ -8,10 +8,7 @@ border-top-left-radius: 5px; border-top-right-radius: 5px; overflow: hidden; - } - - - .category-list--group { + cursor: pointer; } .category-list--item { @@ -23,6 +20,8 @@ overflow: hidden; } + + .category-list--label { margin-left: 70px; margin-right: 30px; @@ -93,19 +92,25 @@ transform: scale(1.4); } + .list-group { + + -webkit-transition: -webkit-transform .3s ease-in-out; + -moz-transition: -moz-transform .3s ease-in-out; + -o-transition: -o-transform .3s ease-in-out; + transition: transform .3s ease-in-out; + + opacity: 1; + + &.ng-hide { + opacity: 0; + // height: 0; + // line-height: 0; + } + } + .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { background-color: #f5f5f5; } - - // @each $category, $color in $categories { - // &.#{$category} { - // .list-group-item.active, - // .list-group-item.active:hover, - // .list-group-item.active:focus { - // background-color: $color; - // } - // } - // } } diff --git a/src/app/components/event-list/event-list.scss b/src/app/components/event-list/event-list.scss index 6ef5c75..ba9f384 100644 --- a/src/app/components/event-list/event-list.scss +++ b/src/app/components/event-list/event-list.scss @@ -55,7 +55,12 @@ text-align: center; line-height: 20px; cursor: pointer; - transition: .3s linear all; + + -webkit-transition: -webkit-transform 0.3s linear all; + -moz-transition: -moz-transform 0.3s linear all; + -o-transition: -o-transform 0.3s linear all; + transition: transform 0.3s linear all; + overflow: hidden; z-index: 100; diff --git a/src/app/components/proposal-carousel/proposal-carousel.scss b/src/app/components/proposal-carousel/proposal-carousel.scss index 6c9f0a1..619d064 100644 --- a/src/app/components/proposal-carousel/proposal-carousel.scss +++ b/src/app/components/proposal-carousel/proposal-carousel.scss @@ -2,6 +2,7 @@ background-color: #f1f1f1; border-radius: 5px; overflow: hidden; + margin-bottom: 30px; &-top { position: relative; @@ -57,21 +58,20 @@ font-weight: bold; line-height: 116px; z-index: 1; - } } &-bottom { position: relative; color: #fff; - padding: 10px; + padding: 15px 30px; font-weight: bold; cursor: pointer; z-index: 10; &-icon { position: absolute; - top: 10px; + top: 15px; right: 15px; .glyphicon { diff --git a/src/app/components/proposal-related/proposal-related.directive.js b/src/app/components/proposal-related/proposal-related.directive.js index 9ab6712..3c42e1d 100644 --- a/src/app/components/proposal-related/proposal-related.directive.js +++ b/src/app/components/proposal-related/proposal-related.directive.js @@ -9,14 +9,10 @@ function proposalRelated() { /** @ngInject */ - function ProposalRelatedController(ArticleService, $scope, $element, $timeout, $log) { + function ProposalRelatedController($log) { $log.debug('ProposalRelatedController'); var vm = this; - vm.ArticleService = ArticleService; - vm.$scope = $scope; - vm.$element = $element; - vm.$timeout = $timeout; vm.$log = $log; vm.init(); @@ -24,69 +20,16 @@ ProposalRelatedController.prototype.init = function () { // initial values - var vm = this; - - vm.activeIndex = 1; - vm.loading = false; - - if(angular.isDefined(vm.limit) && angular.isString(vm.limit)){ - vm.limit = parseInt(vm.limit); - }else{ - vm.limit = 3; - } - - vm.loadData(); - }; - - ProposalRelatedController.prototype.loadData = function () { - // async values - var vm = this; - - vm.loading = true; - - // simulate delay - vm.$timeout(function(){ - vm.loading = false; - - // Fake Data - // vm.proposals = vm.ArticleService.getProposals(); - vm.proposals = [{ - id: 4159, - abstract: 'Ut odio unde porro in. Aut fuga magni adipisci. Recusandae ipsum distinctio omnis ut illum.', - effective_support: 0.1572052401746725, - hits: 4159, - votes_against: 3779, - votes_for: 1780 - },{ - id: 935, - abstract: 'Magni sunt ut molestiae. A porro et quod saepe placeat amet nihil. Aut ut id voluptatem doloribus quia.', - effective_support: 0.1572052401746725, - hits: 8602, - votes_against: 7005, - votes_for: 8728 - },{ - id: 1008, - abstract: 'Cum quas assumenda nihil delectus eos. Minus fugit velit voluptatem nisi nam esse ut id.', - effective_support: 0.1572052401746725, - hits: 9181, - votes_against: 612, - votes_for: 1786 - }]; - - if(vm.display === 'list'){ - // wait until DOM be created - vm.$timeout(function(){ - // attachPopover.call(vm); - }, 20); - } - }, 2000); + // var vm = this; }; var directive = { restrict: 'E', templateUrl: 'app/components/proposal-related/proposal-related.html', scope: { - article: '=' + proposal: '=', + topic: '=', + category: '=' }, controller: ProposalRelatedController, controllerAs: 'vm', diff --git a/src/app/components/proposal-related/proposal-related.html b/src/app/components/proposal-related/proposal-related.html index 9a21e10..9324000 100644 --- a/src/app/components/proposal-related/proposal-related.html +++ b/src/app/components/proposal-related/proposal-related.html @@ -1,10 +1,12 @@