Item detail settings buttons styles interactions for roles
parent
ac3d49c8b1
commit
354e0899c9
|
@ -378,9 +378,15 @@ BlockButtonDirective = ($rootscope, $loading) ->
|
||||||
"""
|
"""
|
||||||
|
|
||||||
link = ($scope, $el, $attrs, $model) ->
|
link = ($scope, $el, $attrs, $model) ->
|
||||||
|
isEditable = ->
|
||||||
|
return $scope.project.my_permissions.indexOf("modify_us") != -1
|
||||||
|
|
||||||
$scope.$watch $attrs.ngModel, (item) ->
|
$scope.$watch $attrs.ngModel, (item) ->
|
||||||
return if not item
|
return if not item
|
||||||
|
|
||||||
|
if isEditable()
|
||||||
|
$el.find('.item-block').addClass('editable')
|
||||||
|
|
||||||
if item.is_blocked
|
if item.is_blocked
|
||||||
$el.find('.item-block').hide()
|
$el.find('.item-block').hide()
|
||||||
$el.find('.item-unblock').show()
|
$el.find('.item-unblock').show()
|
||||||
|
|
|
@ -539,7 +539,7 @@ UsTeamRequirementButtonDirective = ($rootscope, $tgrepo, $confirm, $loading) ->
|
||||||
return if not us
|
return if not us
|
||||||
|
|
||||||
if canEdit()
|
if canEdit()
|
||||||
$el.find('label').css("cursor", "pointer")
|
$el.find('label').addClass('editable')
|
||||||
|
|
||||||
if us.team_requirement
|
if us.team_requirement
|
||||||
$el.find('.team-requirement').addClass('active')
|
$el.find('.team-requirement').addClass('active')
|
||||||
|
@ -567,8 +567,6 @@ UsTeamRequirementButtonDirective = ($rootscope, $tgrepo, $confirm, $loading) ->
|
||||||
us.revert()
|
us.revert()
|
||||||
$model.$setViewValue(us)
|
$model.$setViewValue(us)
|
||||||
|
|
||||||
$el.find('label').css("cursor", "auto")
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
link: link
|
link: link
|
||||||
restrict: "EA"
|
restrict: "EA"
|
||||||
|
@ -596,7 +594,7 @@ UsClientRequirementButtonDirective = ($rootscope, $tgrepo, $confirm, $loading) -
|
||||||
return if not us
|
return if not us
|
||||||
|
|
||||||
if canEdit()
|
if canEdit()
|
||||||
$el.find('label').css("cursor", "pointer")
|
$el.find('label').addClass('editable')
|
||||||
|
|
||||||
if us?.client_requirement
|
if us?.client_requirement
|
||||||
$el.find('.client-requirement').addClass('active')
|
$el.find('.client-requirement').addClass('active')
|
||||||
|
@ -624,8 +622,6 @@ UsClientRequirementButtonDirective = ($rootscope, $tgrepo, $confirm, $loading) -
|
||||||
us.revert()
|
us.revert()
|
||||||
$model.$setViewValue(us)
|
$model.$setViewValue(us)
|
||||||
|
|
||||||
$el.find('label').css("cursor", "auto")
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
link: link
|
link: link
|
||||||
restrict: "EA"
|
restrict: "EA"
|
||||||
|
|
|
@ -356,9 +356,25 @@
|
||||||
}
|
}
|
||||||
.button-gray {
|
.button-gray {
|
||||||
background: $gray-light;
|
background: $gray-light;
|
||||||
&:hover,
|
&:hover {
|
||||||
|
background: $gray-light;
|
||||||
|
}
|
||||||
|
&.editable {
|
||||||
|
&:hover {
|
||||||
|
background: $grayer;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background: $grayer;
|
background: $green-taiga;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item-block {
|
||||||
|
&.editable {
|
||||||
|
&:hover {
|
||||||
|
background: $red;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.button-red {
|
.button-red {
|
||||||
|
@ -368,7 +384,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label {
|
label {
|
||||||
cursor: pointer;
|
&.editable {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
+input {
|
+input {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue