Item detail settings buttons styles interactions for roles

stable
Xavier Julián 2014-10-30 12:59:55 +01:00 committed by David Barragán Merino
parent ac3d49c8b1
commit 354e0899c9
3 changed files with 29 additions and 9 deletions

View File

@ -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()

View File

@ -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"

View File

@ -356,9 +356,25 @@
}
.button-gray {
background: $gray-light;
&:hover,
&.active {
&:hover {
background: $gray-light;
}
&.editable {
&:hover {
background: $grayer;
cursor: pointer;
}
}
&.active {
background: $green-taiga;
}
}
.item-block {
&.editable {
&:hover {
background: $red;
cursor: pointer;
}
}
}
.button-red {
@ -368,7 +384,9 @@
}
}
label {
&.editable {
cursor: pointer;
}
+input {
display: none;
}