Commit 9a367cee authored by Sang D NGO's avatar Sang D NGO

show proposal by status

parent a603a16b
......@@ -39,6 +39,7 @@ module.exports = function(dependencies, lib) {
var listOptions = {
creator: req.user.id,
type: req.query.type,
status: req.query.status,
limit: Number(req.query.limit),
offset: Number(req.query.offset)
};
......
......@@ -6,20 +6,16 @@
angular.module(MODULE_NAME)
.config(function($stateProvider) {
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.when('/most', '/most/proposal');
$stateProvider
.state('most', {
url: '/most',
templateUrl: MODULE_DIR_NAME + '/app/app.html',
deepStateRedirect: {
default: 'most.proposal',
fn: function() {
return true;
}
}
templateUrl: MODULE_DIR_NAME + '/app/app.html'
})
.state('most.proposal', {
url: '/proposal',
url: '/proposal?status',
views: {
'root@most': {
template: '<most-proposal />'
......
......@@ -8,8 +8,8 @@
.col-xs-2
div(ng-switch="$ctrl.proposal.status")
span.text-muted(ng-switch-when="PENDING") Đang chờ
span.c-orange(ng-switch-when="REVIEWING") Đang xem xét
span.c-green(ng-switch-when="ACCEPTED") Đã chấp nhận
span.c-orange(ng-switch-when="REVIEWING") Đang xử lý
span.c-green(ng-switch-when="ACCEPTED") Đã thông qua
span.c-red(ng-switch-when="REJECTED") Đã từ chối
.lv-actions.actions
a(href="", data-toggle="dropdown", aria-expanded="false")
......
......@@ -4,7 +4,10 @@
angular.module('linagora.esn.most')
.controller('MostProposalController', MostProposalController);
function MostProposalController(mostProposalApiClient) {
function MostProposalController(
$stateParams,
mostProposalApiClient
) {
var self = this;
self.$onInit = $onInit;
......@@ -12,7 +15,7 @@
function $onInit() {
self.status = 'loading';
mostProposalApiClient.getProposals().then(function(proposals) {
mostProposalApiClient.getProposals({ status: $stateParams.status }).then(function(proposals) {
self.status = 'loaded';
self.proposals = proposals;
});
......
......@@ -4,6 +4,18 @@
ul.nav.nav-pills.nav-stacked
.listview
.lv-body
a.lv-item.menu-item(href="", ui-sref="most.proposal", ui-sref-active="selected")
a.lv-item.menu-item(href="", ui-sref="most.proposal({ status: '' })", ui-sref-active="selected")
i.mdi.mdi-file
.menu-title #{__('Proposals')}
.menu-title #{__('Tất cả')}
a.lv-item.menu-item(href="", ui-sref="most.proposal({ status: 'PENDING' })", ui-sref-active="selected")
i.mdi.mdi-file
.menu-title #{__('Chờ xét duyệt')}
a.lv-item.menu-item(href="", ui-sref="most.proposal({ status: 'REVIEWING' })", ui-sref-active="selected")
i.mdi.mdi-file
.menu-title #{__('Đang xử lý')}
a.lv-item.menu-item(href="", ui-sref="most.proposal({ status: 'ACCEPTED' })", ui-sref-active="selected")
i.mdi.mdi-file
.menu-title #{__('Đã thông qua')}
a.lv-item.menu-item(href="", ui-sref="most.proposal({ status: 'REJECTED' })", ui-sref-active="selected")
i.mdi.mdi-file
.menu-title #{__('Đã từ chối')}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment