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
bdb6d975
Commit
bdb6d975
authored
Apr 13, 2018
by
Tuan Tuan LE
⛅
Browse files
POC create proposal
parent
1e4156aa
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
131 additions
and
1 deletion
+131
-1
frontend/app/app.less
frontend/app/app.less
+7
-0
frontend/app/app.router.js
frontend/app/app.router.js
+8
-0
frontend/app/proposal/create/most-proposal-create.component.js
...end/app/proposal/create/most-proposal-create.component.js
+9
-0
frontend/app/proposal/create/most-proposal-create.controller.js
...nd/app/proposal/create/most-proposal-create.controller.js
+54
-0
frontend/app/proposal/create/most-proposal-create.less
frontend/app/proposal/create/most-proposal-create.less
+10
-0
frontend/app/proposal/create/most-proposal-create.pug
frontend/app/proposal/create/most-proposal-create.pug
+26
-0
frontend/app/proposal/create/subheader/most-proposal-list-subheader.component.js
...reate/subheader/most-proposal-list-subheader.component.js
+9
-0
frontend/app/proposal/create/subheader/most-proposal-list-subheader.pug
...roposal/create/subheader/most-proposal-list-subheader.pug
+6
-0
frontend/app/proposal/list/most-proposal-list.pug
frontend/app/proposal/list/most-proposal-list.pug
+1
-1
frontend/app/proposal/most-proposal.less
frontend/app/proposal/most-proposal.less
+1
-0
No files found.
frontend/app/app.less
View file @
bdb6d975
@import './sidebar/most-sidebar';
@import './proposal/most-proposal';
.most-root {
& > .col-md-3, & > .col-md-8 {
margin-top: 45px;
}
}
frontend/app/app.router.js
View file @
bdb6d975
...
...
@@ -25,6 +25,14 @@
template
:
'
<most-proposal />
'
}
}
})
.
state
(
'
most.proposal.create
'
,
{
url
:
'
/proposal/create
'
,
views
:
{
'
root@most
'
:
{
template
:
'
<most-proposal-create />
'
}
}
});
});
})();
frontend/app/proposal/create/most-proposal-create.component.js
0 → 100644
View file @
bdb6d975
(
function
(
angular
)
{
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
component
(
'
mostProposalCreate
'
,
{
templateUrl
:
'
/linagora.esn.most/app/proposal/create/most-proposal-create.html
'
,
controller
:
'
MostProposalCreateController
'
});
})(
angular
);
frontend/app/proposal/create/most-proposal-create.controller.js
0 → 100644
View file @
bdb6d975
(
function
(
angular
)
{
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
controller
(
'
MostProposalCreateController
'
,
MostProposalCreateController
);
function
MostProposalCreateController
(
$state
,
asyncAction
,
mostProposalApiClient
)
{
var
self
=
this
;
var
AVAILABLE_PROPOSAL_TYPES
=
[{
value
:
'
A1
'
,
label
:
'
Mẫu A1-ĐXNV
'
},
{
value
:
'
A2
'
,
label
:
'
Mẫu A2-ĐXNV
'
},
{
value
:
'
A3
'
,
label
:
'
Mẫu A3-ĐXNV
'
}];
var
CREATING_NOTIFICATION_MESSAGE
=
{
progressing
:
'
Đang tạo đề xuất...
'
,
success
:
'
Đã tạo đề xuất
'
,
failure
:
'
Tạo đề xuất thất bại
'
};
self
.
$onInit
=
$onInit
;
self
.
onSubmitBtnClick
=
onSubmitBtnClick
;
function
$onInit
()
{
self
.
proposalTypes
=
AVAILABLE_PROPOSAL_TYPES
;
self
.
proposal
=
{
type
:
AVAILABLE_PROPOSAL_TYPES
[
0
].
value
,
formData
:
{}
};
}
function
onSubmitBtnClick
()
{
var
proposalToCreate
=
{
type
:
self
.
proposal
.
type
,
formData
:
JSON
.
stringify
(
self
.
proposal
.
formData
)
};
return
asyncAction
(
CREATING_NOTIFICATION_MESSAGE
,
function
()
{
return
mostProposalApiClient
.
createProposal
(
proposalToCreate
)
.
then
(
function
()
{
$state
.
go
(
'
most.proposal
'
);
});
});
}
}
})(
angular
);
frontend/app/proposal/create/most-proposal-create.less
0 → 100644
View file @
bdb6d975
most-proposal-create {
.card-body form {
padding: 20px;
.proposal-type {
margin-left: 20px;
width: 150px;
}
}
}
frontend/app/proposal/create/most-proposal-create.pug
0 → 100644
View file @
bdb6d975
sub-header
most-proposal-create-subheader
.card
.card-body
form(name="form")
.flex.flex-vertical-centered
h4 Chọn mẫu
.select.proposal-type
select.form-control(
ng-model="$ctrl.proposal.type",
name="proposalType",
ng-options="proposalType.value as proposalType.label for proposalType in $ctrl.proposalTypes",
required
)
hr
.row(ng-switch="$ctrl.proposal.type")
most-proposal-form-a1(ng-switch-when="A1", data="$ctrl.proposal.formData")
most-proposal-form-a2(ng-switch-when="A2", data="$ctrl.proposal.formData")
most-proposal-form-a3(ng-switch-when="A3", data="$ctrl.proposal.formData")
.row
button.btn.btn-primary(
ng-click="$ctrl.onSubmitBtnClick()",
ng-disabled="form.$invalid"
)
| #{__('Gửi')}
frontend/app/proposal/create/subheader/most-proposal-list-subheader.component.js
0 → 100644
View file @
bdb6d975
(
function
(
angular
)
{
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
component
(
'
mostProposalCreateSubheader
'
,
{
templateUrl
:
'
/linagora.esn.most/app/proposal/create/subheader/most-proposal-list-subheader.html
'
});
})(
angular
);
frontend/app/proposal/create/subheader/most-proposal-list-subheader.pug
0 → 100644
View file @
bdb6d975
extends /modules/subheader/responsive-subheader.pug
block left
most-subheader-burger-button.hidden-md
i.mdi.mdi-menu
span.title.ellipsis #{__('Tạo đề xuất')}
frontend/app/proposal/list/most-proposal-list.pug
View file @
bdb6d975
h1 Li
st
proposal
s page
fab(icon="plus", ui-sref="mo
st
.
proposal
.create")
frontend/app/proposal/most-proposal.less
View file @
bdb6d975
@import './create/most-proposal-create';
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