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
702bdf6e
Commit
702bdf6e
authored
Apr 17, 2018
by
Sang D NGO
Browse files
only expert can give review
parent
77523c31
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
15 deletions
+47
-15
frontend/app/proposal/detail/experts/modal.pug
frontend/app/proposal/detail/experts/modal.pug
+1
-1
frontend/app/proposal/detail/most-proposal-detail.controller.js
...nd/app/proposal/detail/most-proposal-detail.controller.js
+4
-2
frontend/app/proposal/detail/most-proposal-detail.pug
frontend/app/proposal/detail/most-proposal-detail.pug
+1
-1
frontend/app/proposal/detail/subheader/most-proposal-detail-subheader.component.js
...ail/subheader/most-proposal-detail-subheader.component.js
+1
-1
frontend/app/proposal/detail/subheader/most-proposal-detail-subheader.pug
...posal/detail/subheader/most-proposal-detail-subheader.pug
+8
-8
frontend/app/proposal/most-proposal.controller.js
frontend/app/proposal/most-proposal.controller.js
+2
-2
frontend/app/services/most-role.service.js
frontend/app/services/most-role.service.js
+30
-0
No files found.
frontend/app/proposal/detail/experts/modal.pug
View file @
702bdf6e
...
...
@@ -5,7 +5,7 @@
.modal-header
button.close(type="button", data-dismiss="modal", aria-label="Close", ng-click="$hide()")
span(aria-hidden="true") ×
h4.modal-title #{__('
Thiết lập
chuyên gia')}
h4.modal-title #{__('
Hỏi
chuyên gia')}
.modal-body
p
| #{__('Chọn một nhóm chuyên gia:')}
...
...
frontend/app/proposal/detail/most-proposal-detail.controller.js
View file @
702bdf6e
...
...
@@ -9,7 +9,8 @@
$modal
,
$stateParams
,
session
,
mostProposalApiClient
mostProposalApiClient
,
mostRoleService
)
{
var
self
=
this
;
...
...
@@ -20,7 +21,8 @@
self
.
onReviewBtnClick
=
onReviewBtnClick
;
function
$onInit
()
{
self
.
showAction
=
session
.
userIsDomainAdministrator
();
self
.
userRole
=
mostRoleService
.
getRole
();
mostProposalApiClient
.
getProposal
(
$stateParams
.
proposalId
)
.
then
(
function
(
proposal
)
{
self
.
proposal
=
proposal
;
...
...
frontend/app/proposal/detail/most-proposal-detail.pug
View file @
702bdf6e
sub-header
most-proposal-detail-subheader(
data-title="$ctrl.proposal.formJson.title",
show-action="$ctrl.showAction
",
user-role="$ctrl.userRole
",
on-reject-btn-click="$ctrl.onRejectBtnClick()",
on-set-experts-btn-click="$ctrl.onSetExpertsBtnClick()",
on-accept-btn-click="$ctrl.onAcceptBtnClick()",
...
...
frontend/app/proposal/detail/subheader/most-proposal-detail-subheader.component.js
View file @
702bdf6e
...
...
@@ -7,7 +7,7 @@
templateUrl
:
'
/linagora.esn.most/app/proposal/detail/subheader/most-proposal-detail-subheader.html
'
,
bindings
:
{
title
:
'
<
'
,
showAction
:
'
<
'
,
userRole
:
'
<
'
,
onRejectBtnClick
:
'
&
'
,
onReviewBtnClick
:
'
&
'
,
onSetExpertsBtnClick
:
'
&
'
,
...
...
frontend/app/proposal/detail/subheader/most-proposal-detail-subheader.pug
View file @
702bdf6e
...
...
@@ -5,17 +5,17 @@ block left
span.title.ellipsis {{::$ctrl.title}}
block right
ul.actions.flex-space-around(ng-if="$ctrl.
showAction
")
ul.actions.flex-space-around(ng-if="$ctrl.
userRole !== 'user'
")
li.contact-dropdown.dropdown
a(href='', data-toggle='dropdown')
i.mdi.mdi-dots-vertical
ul.dropdown-menu.dropdown-menu-right
li
a(href='', ng-click='$ctrl.onRejectBtnClick()') Từ chối
li
a(href='', ng-click='$ctrl.onSetExpertsBtnClick()') Thiết lập chuyên gia
li
li(ng-if="$ctrl.userRole === 'moderator'")
a(href='', ng-click='$ctrl.onAcceptBtnClick()') Duyệt
li
a(href='', ng-click="$ctrl.onReviewBtnClick()") Nhận xét và đánh giá
li(ng-if="$ctrl.userRole === 'moderator'")
a(href='', ng-click='$ctrl.onRejectBtnClick()') Từ chối
li(ng-if="$ctrl.userRole === 'moderator'")
a(href='', ng-click='$ctrl.onSetExpertsBtnClick()') Hỏi chuyên gia
li(ng-if="$ctrl.userRole === 'expert'")
a(href='', ng-click="$ctrl.onReviewBtnClick()") Nhận xét
frontend/app/proposal/most-proposal.controller.js
View file @
702bdf6e
...
...
@@ -6,7 +6,7 @@
function
MostProposalController
(
$stateParams
,
session
,
mostRoleService
,
mostProposalApiClient
)
{
var
self
=
this
;
...
...
@@ -15,7 +15,7 @@
function
$onInit
()
{
self
.
status
=
'
loading
'
;
self
.
showCreateBtn
=
!
session
.
userIsDomainAdministrator
()
;
self
.
showCreateBtn
=
mostRoleService
.
getRole
()
===
'
user
'
;
mostProposalApiClient
.
getProposals
({
status
:
$stateParams
.
status
}).
then
(
function
(
proposals
)
{
self
.
status
=
'
loaded
'
;
...
...
frontend/app/services/most-role.service.js
0 → 100644
View file @
702bdf6e
(
function
(
angular
)
{
'
use strict
'
;
angular
.
module
(
'
linagora.esn.most
'
)
.
factory
(
'
mostRoleService
'
,
mostRoleService
);
function
mostRoleService
(
session
)
{
return
{
getRole
:
getRole
};
function
getRole
()
{
if
(
userIsExpert
())
{
return
'
expert
'
;
}
if
(
session
.
userIsDomainAdministrator
())
{
return
'
moderator
'
;
}
return
'
user
'
;
}
function
userIsExpert
()
{
return
session
.
user
.
preferredEmail
.
indexOf
(
'
chuyengia
'
)
===
0
;
}
}
})(
angular
);
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