Show upgrade prompts when the free history limit is hit.

This commit is contained in:
Paulo Reis 2018-08-17 16:04:31 +01:00
parent fc424aee9e
commit 96aa418b94
4 changed files with 52 additions and 41 deletions

View file

@ -1,45 +1,4 @@
div#history(ng-show="ui.view == 'history'")
span
.upgrade-prompt(ng-if="project.features.versioning === false && ui.view === 'history'")
.message(ng-if="project.owner._id == user.id")
p.text-center: strong #{translate("upgrade_to_get_feature", {feature:"full Project History"})}
p.text-center.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")}
ul.list-unstyled
li
i.fa.fa-check  
| #{translate("unlimited_projects")}
li
i.fa.fa-check  
| #{translate("collabs_per_proj", {collabcount:'Multiple'})}
li
i.fa.fa-check  
| #{translate("full_doc_history")}
li
i.fa.fa-check  
| #{translate("sync_to_dropbox")}
li
i.fa.fa-check  
| #{translate("sync_to_github")}
li
i.fa.fa-check  
|#{translate("compile_larger_projects")}
p.text-center(ng-controller="FreeTrialModalController")
a.btn.btn-success(
href
ng-class="buttonClass"
ng-click="startFreeTrial('history')"
) #{translate("start_free_trial")}
.message(ng-show="project.owner._id != user.id")
p #{translate("ask_proj_owner_to_upgrade_for_history")}
p
a.small(href, ng-click="toggleHistory()") #{translate("cancel")}
include ./history/entriesListV1
include ./history/entriesListV2

View file

@ -6,11 +6,13 @@ aside.change-list(
ng-if="!history.showOnlyLabels && !history.error"
entries="history.updates"
current-user="user"
current-user-is-owner="project.owner._id === user.id"
users="projectUsers"
load-entries="loadMore()"
load-disabled="history.loading || history.atEnd"
load-initialize="ui.view == 'history'"
is-loading="history.loading"
free-history-limit-hit="history.freeHistoryLimitHit"
on-entry-select="handleEntrySelect(selectedEntry)"
on-label-delete="handleLabelDelete(label)"
)
@ -134,6 +136,48 @@ script(type="text/ng-template", id="historyEntriesListTpl")
.loading(ng-show="$ctrl.isLoading")
i.fa.fa-spin.fa-refresh
|    #{translate("loading")}...
.history-entries-list-upgrade-prompt(
ng-if="$ctrl.freeHistoryLimitHit && $ctrl.currentUserIsOwner"
ng-controller="FreeTrialModalController"
)
p #{translate("currently_seeing_only_24_hrs_history")}
p: strong #{translate("upgrade_to_get_feature", {feature:"full Project History"})}
ul.list-unstyled
li
i.fa.fa-check  
| #{translate("unlimited_projects")}
li
i.fa.fa-check  
| #{translate("collabs_per_proj", {collabcount:'Multiple'})}
li
i.fa.fa-check  
| #{translate("full_doc_history")}
li
i.fa.fa-check  
| #{translate("sync_to_dropbox")}
li
i.fa.fa-check  
| #{translate("sync_to_github")}
li
i.fa.fa-check  
|#{translate("compile_larger_projects")}
p.text-center
a.btn.btn-success(
href
ng-class="buttonClass"
ng-click="startFreeTrial('history')"
) #{translate("start_free_trial")}
p.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")}
.history-entries-list-upgrade-prompt(
ng-if="$ctrl.freeHistoryLimitHit && !$ctrl.currentUserIsOwner"
)
p #{translate("currently_seeing_only_24_hrs_history")}
strong #{translate("ask_proj_owner_to_upgrade_for_full_history")}
script(type="text/ng-template", id="historyEntryTpl")
.history-entry(

View file

@ -30,6 +30,8 @@ define [
loadInitialize: "<"
isLoading: "<"
currentUser: "<"
freeHistoryLimitHit: "<"
currentUserIsOwner: "<"
onEntrySelect: "&"
onLabelDelete: "&"
controller: historyEntriesListController

View file

@ -174,6 +174,12 @@
}
}
.history-entries-list-upgrade-prompt {
background-color: #FFF;
margin-bottom: 2px;
padding: 5px 10px;
}
.history-labels-list {
.history-entries;
overflow-y: auto;