Disable individual users TC control when TC is on for everyone; add styling for disabled toggles.

This commit is contained in:
Paulo Reis 2017-06-28 15:31:28 +01:00
parent 1fa7338baf
commit 0ac52e7f19
2 changed files with 16 additions and 4 deletions

View file

@ -57,28 +57,32 @@
review-panel-toggle(
ng-model="reviewPanel.trackChangesOnForEveryone"
on-toggle="toggleTrackChangesForEveryone(isOn);"
disabled="!project.features.trackChanges"
on-disabled-click="openTrackChangesUpgradeModal"
)
//- disabled="!project.features.trackChanges"
//- on-disabled-click="openTrackChangesUpgradeModal"
li.rp-tc-state-item
span.rp-tc-state-item-name.rp-tc-state-item-self(
ng-class="{ 'rp-tc-state-item-name-disabled' : reviewPanel.trackChangesOnForEveryone}"
style="color: hsl({{ users[user.id].hue }}, 70%, 40%);"
) {{ users[user.id].name }}
//- {{user.id}}
//- Missing on-toggle attribute because we also need to pass user_id to the toggleTrackChangesForUser
//- method, and it's not clear how.
review-panel-toggle(
ng-model="reviewPanel.trackChangesState[user.id]"
ng-model="reviewPanel.trackChangesOnForEveryone || reviewPanel.trackChangesState[user.id]"
on-toggle="toggleTrackChangesForUser(isOn, user.id);"
disabled="reviewPanel.trackChangesOnForEveryone"
)
li.rp-tc-state-item(ng-repeat="member in project.members")
span.rp-tc-state-item-name(
ng-class="{ 'rp-tc-state-item-name-disabled' : reviewPanel.trackChangesOnForEveryone}"
style="color: hsl({{ users[member._id].hue }}, 70%, 40%);"
) {{ users[member._id].name }}
//- {{member._id}}
review-panel-toggle(
ng-model="reviewPanel.trackChangesState[member._id]"
ng-model="reviewPanel.trackChangesOnForEveryone || reviewPanel.trackChangesState[member._id]"
on-toggle="toggleTrackChangesForUser(isOn, member._id);"
disabled="reviewPanel.trackChangesOnForEveryone"
)
//- span.review-panel-toolbar-label(ng-if="permissions.write")

View file

@ -182,6 +182,9 @@
.rp-tc-state-item-name-everyone {
color: @red;
}
.rp-tc-state-item-name-disabled {
opacity: .35;
}
.rp-entry-list {
display: none;
@ -802,6 +805,11 @@
background-color: #FFF;
}
}
&:disabled + .rp-toggle-btn {
cursor: default;
opacity: .35;
}
}
.ace-editor-wrapper {