Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sang D NGO
linagora.esn.most
Commits
9266f3e6
Commit
9266f3e6
authored
Apr 13, 2018
by
Sang D NGO
Browse files
show proposal list
parent
257f685c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
117 additions
and
12 deletions
+117
-12
backend/lib/proposal/denormalize.js
backend/lib/proposal/denormalize.js
+2
-1
frontend/app/app.less
frontend/app/app.less
+3
-4
frontend/app/common/most-proposal-api-client.service.js
frontend/app/common/most-proposal-api-client.service.js
+22
-4
frontend/app/proposal/list/item/most-proposal-list-item.component.js
...p/proposal/list/item/most-proposal-list-item.component.js
+11
-0
frontend/app/proposal/list/item/most-proposal-list-item.less
frontend/app/proposal/list/item/most-proposal-list-item.less
+15
-0
frontend/app/proposal/list/item/most-proposal-list-item.pug
frontend/app/proposal/list/item/most-proposal-list-item.pug
+19
-0
frontend/app/proposal/list/most-proposal-list.component.js
frontend/app/proposal/list/most-proposal-list.component.js
+3
-1
frontend/app/proposal/list/most-proposal-list.pug
frontend/app/proposal/list/most-proposal-list.pug
+8
-0
frontend/app/proposal/list/subheader/most-proposal-list-subheader.component.js
.../list/subheader/most-proposal-list-subheader.component.js
+12
-0
frontend/app/proposal/list/subheader/most-proposal-list-subheader.pug
.../proposal/list/subheader/most-proposal-list-subheader.pug
+6
-0
frontend/app/proposal/most-proposal.controller.js
frontend/app/proposal/most-proposal.controller.js
+12
-1
frontend/app/proposal/most-proposal.less
frontend/app/proposal/most-proposal.less
+1
-0
frontend/app/proposal/most-proposal.pug
frontend/app/proposal/most-proposal.pug
+3
-1
No files found.
backend/lib/proposal/denormalize.js
View file @
9266f3e6
...
...
@@ -7,7 +7,8 @@ function denormalize(proposal) {
type
:
proposal
.
type
,
formData
:
proposal
.
formData
,
status
:
proposal
.
status
,
timestamps
:
proposal
.
timestamps
,
createdAt
:
proposal
.
createdAt
,
updatedAt
:
proposal
.
updatedAt
,
reviewers
:
proposal
.
reviewers
};
}
frontend/app/app.less
View file @
9266f3e6
@import './sidebar/most-sidebar';
@import './proposal/most-proposal';
.most-root {
& > .col-md-3, & > .col-md-8 {
margin-top: 45px;
@media (min-width: @screen-md-min) {
.most-root {
padding-top: 45px;
}
}
frontend/app/common/most-proposal-api-client.service.js
View file @
9266f3e6
...
...
@@ -15,23 +15,41 @@
};
function
createProposal
(
data
)
{
return
mostRestangular
.
all
(
API_PATH
).
post
(
data
).
then
(
_stripAndReturnData
);
return
mostRestangular
.
all
(
API_PATH
).
post
(
_encodeFormData
(
data
)
).
then
(
_stripAndReturnData
)
.
then
(
_decodeFormData
)
;
}
function
getProposals
(
options
)
{
return
mostRestangular
.
all
(
API_PATH
).
getList
(
options
).
then
(
_stripAndReturnData
);
return
mostRestangular
.
all
(
API_PATH
).
getList
(
options
).
then
(
_stripAndReturnData
).
then
(
function
(
proposals
)
{
return
proposals
.
map
(
_decodeFormData
);
});
}
function
getProposal
(
id
)
{
return
mostRestangular
.
one
(
API_PATH
,
id
).
get
().
then
(
_stripAndReturnData
);
return
mostRestangular
.
one
(
API_PATH
,
id
).
get
().
then
(
_stripAndReturnData
)
.
then
(
_decodeFormData
)
;
}
function
updateProposal
(
id
,
updateFields
)
{
return
mostRestangular
.
one
(
API_PATH
,
id
).
customPOST
(
updateFields
);
return
mostRestangular
.
one
(
API_PATH
,
id
).
customPOST
(
_encodeFormData
(
updateFields
)).
then
(
_decodeFormData
);
}
function
_stripAndReturnData
(
resp
)
{
return
mostRestangular
.
stripRestangular
(
resp
.
data
);
}
function
_decodeFormData
(
proposal
)
{
if
(
proposal
.
formData
)
{
proposal
.
formJson
=
JSON
.
parse
(
proposal
.
formData
);
}
return
proposal
;
}
function
_encodeFormData
(
proposal
)
{
if
(
proposal
.
formJson
)
{
proposal
.
formData
=
JSON
.
stringify
(
proposal
.
formJson
);
}
return
proposal
;
}
}
})(
angular
);
frontend/app/proposal/list/item/most-proposal-list-item.component.js
0 → 100644
View file @
9266f3e6
(
function
(
angular
)
{
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
component
(
'
mostProposalListItem
'
,
{
templateUrl
:
'
/linagora.esn.most/app/proposal/list/item/most-proposal-list-item.html
'
,
bindings
:
{
proposal
:
'
<
'
}
});
})(
angular
);
frontend/app/proposal/list/item/most-proposal-list-item.less
0 → 100644
View file @
9266f3e6
most-proposal-list-item {
& > .row {
.flex-space-between;
display: flex !important;
& > * {
.flex-vertical-centered;
}
}
& > .lv-actions {
top: 20px !important;
}
}
frontend/app/proposal/list/item/most-proposal-list-item.pug
0 → 100644
View file @
9266f3e6
.row
.col-xs-6
h5.ellipsis(title="{{::$ctrl.proposal.formJson.title}}") {{::$ctrl.proposal.formJson.title}}
.col-xs-1
span.ellipsis(title="{{::$ctrl.proposal.type}}") {{::$ctrl.proposal.type}}
.col-xs-3
span(title=__('Cập nhật lúc %s', '{{::$ctrl.proposal.updatedAt}}'), am-time-ago="::$ctrl.proposal.updatedAt")
.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-red(ng-switch-when="REJECTED") Đã từ chối
.lv-actions.actions
a(href="", data-toggle="dropdown", aria-expanded="false")
i.mdi.mdi-dots-vertical
ul.dropdown-menu.dropdown-menu-right
li
a(href="", esn-modal-launcher="/group/app/delete/group-delete.html") #{__('Delete')}
frontend/app/proposal/list/most-proposal-list.component.js
View file @
9266f3e6
...
...
@@ -4,6 +4,8 @@
angular
.
module
(
'
linagora.esn.most
'
)
.
component
(
'
mostProposalList
'
,
{
templateUrl
:
'
/linagora.esn.most/app/proposal/list/most-proposal-list.html
'
,
controller
:
'
MostProposalListController
'
bindings
:
{
proposals
:
'
<
'
}
});
})(
angular
);
frontend/app/proposal/list/most-proposal-list.pug
View file @
9266f3e6
sub-header
most-proposal-list-subheader(data-title=__('Đề xuất'))
.card.fadeIn200ms
.listview.lv-bordered.lv-lg
.lv-body
most-proposal-list-item.lv-item.clickable(proposal='proposal', ng-repeat="proposal in $ctrl.proposals")
fab(icon="plus", ui-sref="most.proposal.create")
frontend/app/proposal/list/most-proposal-list
.controller
.js
→
frontend/app/proposal/list/
subheader/
most-proposal-list
-subheader.component
.js
View file @
9266f3e6
...
...
@@ -2,9 +2,11 @@
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
controller
(
'
MostProposalListController
'
,
MostProposalListController
);
function
MostProposalListController
()
{
}
.
component
(
'
mostProposalListSubheader
'
,
{
templateUrl
:
'
/linagora.esn.most/app/proposal/list/subheader/most-proposal-list-subheader.html
'
,
bindings
:
{
title
:
'
@
'
}
});
})(
angular
);
frontend/app/proposal/list/subheader/most-proposal-list-subheader.pug
0 → 100644
View file @
9266f3e6
extends /modules/subheader/responsive-subheader.pug
block left
button.btn.btn-icon.btn-link.button.hidden-md(contextual-sidebar)
i.mdi.mdi-menu
span.title.ellipsis {{::$ctrl.title}}
frontend/app/proposal/most-proposal.controller.js
View file @
9266f3e6
...
...
@@ -4,7 +4,18 @@
angular
.
module
(
'
linagora.esn.most
'
)
.
controller
(
'
MostProposalController
'
,
MostProposalController
);
function
MostProposalController
()
{
function
MostProposalController
(
mostProposalApiClient
)
{
var
self
=
this
;
self
.
$onInit
=
$onInit
;
function
$onInit
()
{
self
.
status
=
'
loading
'
;
mostProposalApiClient
.
getProposals
().
then
(
function
(
proposals
)
{
self
.
status
=
'
loaded
'
;
self
.
proposals
=
proposals
;
});
}
}
})(
angular
);
frontend/app/proposal/most-proposal.less
View file @
9266f3e6
@import './create/most-proposal-create';
@import './list/item/most-proposal-list-item';
frontend/app/proposal/most-proposal.pug
View file @
9266f3e6
.card
most-proposal-list
most-proposal-list(proposals="$ctrl.proposals")
.text-center(ng-if="$ctrl.status === 'loading'", openpaas-logo-spinner, spinner-start-active='1', spinner-size='0.5')
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment