Add a per-user TC notice dialog.

This commit is contained in:
Paulo Reis 2017-07-06 16:38:04 +01:00
parent 3f359c8dfd
commit 1937da1bb3
2 changed files with 51 additions and 25 deletions

View file

@ -51,12 +51,13 @@
ng-if="editor.wantTrackChanges === true" ng-if="editor.wantTrackChanges === true"
) )
i.fa.fa-circle i.fa.fa-circle
span(ng-click="toggleFullTCStateCollapse();", ng-if="editor.wantTrackChanges === false") !{translate("track_changes_is_off")} span(ng-click="toggleFullTCStateCollapse();")
span(ng-click="toggleFullTCStateCollapse();", ng-if="editor.wantTrackChanges === true") !{translate("track_changes_is_on")} span(ng-if="editor.wantTrackChanges === false") !{translate("track_changes_is_off")}
span.rp-tc-state-collapse( span(ng-if="editor.wantTrackChanges === true") !{translate("track_changes_is_on")}
ng-class="{ 'rp-tc-state-collapse-on': reviewPanel.fullTCStateCollapsed }" span.rp-tc-state-collapse(
) ng-class="{ 'rp-tc-state-collapse-on': reviewPanel.fullTCStateCollapsed }"
i.fa.fa-angle-down )
i.fa.fa-angle-down
ul.rp-tc-state( ul.rp-tc-state(
review-panel-collapse-height="reviewPanel.fullTCStateCollapsed" review-panel-collapse-height="reviewPanel.fullTCStateCollapsed"
) )
@ -67,20 +68,6 @@
on-toggle="toggleTrackChangesForEveryone(isOn);" on-toggle="toggleTrackChangesForEveryone(isOn);"
disabled="!project.features.trackChanges || !permissions.write" disabled="!project.features.trackChanges || !permissions.write"
) )
//- li.rp-tc-state-item(
//- ng-init="formattedOwner = formatUser(project.owner);"
//- )
//- pre {{ project.owner | json }}
//- pre {{ formattedOwner | json }}
//- span.rp-tc-state-item-name.rp-tc-state-item-owner(
//- ng-class="{ 'rp-tc-state-item-name-disabled' : reviewPanel.trackChangesOnForEveryone}"
//- style="color: hsl({{ formattedOwner.hue }}, 70%, 40%);"
//- ) {{ formattedOwner.name }}
//- review-panel-toggle(
//- ng-model="reviewPanel.trackChangesState[formattedOwner.id].value"
//- on-toggle="toggleTrackChangesForUser(isOn, formattedOwner.id);"
//- disabled="reviewPanel.trackChangesOnForEveryone || !project.features.trackChanges || !permissions.write"
//- )
li.rp-tc-state-item( li.rp-tc-state-item(
ng-repeat="member in reviewPanel.formattedProjectMembers" ng-repeat="member in reviewPanel.formattedProjectMembers"
) )
@ -526,7 +513,7 @@ script(type="text/ng-template", id="trackChangesUpgradeModalTemplate")
.modal-body .modal-body
.teaser-video-container .teaser-video-container
video.teaser-video(autoplay, loop) video.teaser-video(autoplay, loop)
source(src="/img/teasers/track-changes/teaser-track-changes.mp4", type="video/mp4") source(ng-src="{{ '/img/teasers/track-changes/teaser-track-changes.mp4' }}", type="video/mp4")
img(src="/img/teasers/track-changes/teaser-track-changes.gif") img(src="/img/teasers/track-changes/teaser-track-changes.gif")
h4.teaser-title #{translate("see_changes_in_your_documents_live")} h4.teaser-title #{translate("see_changes_in_your_documents_live")}
@ -564,6 +551,37 @@ script(type="text/ng-template", id="trackChangesUpgradeModalTemplate")
) )
span #{translate("close")} span #{translate("close")}
script(type="text/ng-template", id="perUserTCNoticeModalTemplate")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="$close()"
) ×
h3 Per-user Track Changes
.modal-body
.teaser-video-container
video.teaser-video(autoplay, loop)
source(ng-src="{{ '/img/teasers/track-changes/per-user-track-changes.mp4' }}", type="video/mp4")
img(src="/img/teasers/track-changes/per-user-track-changes.gif")
h4.teaser-title Now you can use Track Changes on a per-user basis
.row
.col-md-8.col-md-offset-2
ul.list-unstyled
li
i.fa.fa-check  
| Turn Track Changes on for individuals users
li
i.fa.fa-check  
| Or keep it on for everyone, like before
.modal-footer()
button.btn.btn-default(
ng-click="$close()"
)
span #{translate("close")}
script(type="text/ng-template", id="bulkActionsModalTemplate") script(type="text/ng-template", id="bulkActionsModalTemplate")
.modal-header .modal-header
button.close( button.close(

View file

@ -15,8 +15,6 @@ define [
SYNCED : "synced" SYNCED : "synced"
PENDING : "pending" PENDING : "pending"
window.reviewPanel = # DEBUG LINE
$scope.reviewPanel = $scope.reviewPanel =
trackChangesState: {} trackChangesState: {}
trackChangesOnForEveryone: false trackChangesOnForEveryone: false
@ -42,6 +40,7 @@ define [
# A count of user-facing selected changes. An aggregated change (insertion + deletion) will count # A count of user-facing selected changes. An aggregated change (insertion + deletion) will count
# as only one. # as only one.
nVisibleSelectedChanges: 0 nVisibleSelectedChanges: 0
showPerUserTCNotice: window.showPerUserTCNotice
window.addEventListener "beforeunload", () -> window.addEventListener "beforeunload", () ->
collapsedStates = {} collapsedStates = {}
@ -586,7 +585,9 @@ define [
$scope.toggleFullTCStateCollapse = () -> $scope.toggleFullTCStateCollapse = () ->
if $scope.project.features.trackChanges if $scope.project.features.trackChanges
reviewPanel.fullTCStateCollapsed = !reviewPanel.fullTCStateCollapsed if true or $scope.reviewPanel.showPerUserTCNotice
$scope.openPerUserTCNoticeModal()
$scope.reviewPanel.fullTCStateCollapsed = !$scope.reviewPanel.fullTCStateCollapsed
else else
$scope.openTrackChangesUpgradeModal() $scope.openTrackChangesUpgradeModal()
@ -636,7 +637,6 @@ define [
_setEveryoneTCState onForEveryone, true _setEveryoneTCState onForEveryone, true
applyClientTrackChangesStateToServer() applyClientTrackChangesStateToServer()
window.toggleTrackChangesForUser = # DEBUG LINE
$scope.toggleTrackChangesForUser = (onForUser, userId) -> $scope.toggleTrackChangesForUser = (onForUser, userId) ->
_setUserTCState userId, onForUser, true _setUserTCState userId, onForUser, true
applyClientTrackChangesStateToServer() applyClientTrackChangesStateToServer()
@ -753,3 +753,11 @@ define [
controller: "TrackChangesUpgradeModalController" controller: "TrackChangesUpgradeModalController"
scope: $scope.$new() scope: $scope.$new()
} }
$scope.openPerUserTCNoticeModal = () ->
$scope.reviewPanel.showPerUserTCNotice = false
$modal.open({
templateUrl: "perUserTCNoticeModalTemplate"
}).result.finally () ->
event_tracking.sendMB "shown-per-user-tc-notice"