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