Collapse panel with v1 info

This commit is contained in:
James Allen 2018-03-20 13:50:51 +00:00
parent 3551f1453b
commit a023512872
4 changed files with 41 additions and 16 deletions

View file

@ -66,17 +66,25 @@ block content
include ./list/side-bar
if hasFeature('v1-return-message')
.project-list-sidebar-v2-pane(ng-controller="OverleafV1NotificationController", style="")
span Welcome to the Overleaf v2 alpha! #[a(href="https://www.overleaf.com/help/342-overleaf-v2-faq") Find out more].
.project-list-sidebar-v2-pane(ng-controller="OverleafV1NotificationController")
div
button.btn-link.pull-right.project-list-sidebar-v2-pane-toggle(
ng-click="toggle()"
)
i.fa.fa-fw(ng-class="{ 'fa-chevron-up': !visible, 'fa-close': visible }")
| Welcome to the Overleaf v2 beta!
div(ng-show="visible") #[a(href="https://www.overleaf.com/help/342-overleaf-v2-faq") Find out more].
if userIsFromOLv1(user)
span To tag or rename your v1 projects, please go back to Overleaf v1.
a.project-list-sidebar-v1-link(
href=settings.overleaf.host + "/dash?prefer-v1-dash=1"
) Go back to v1
div(ng-show="visible")
| To tag or rename your v1 projects, please go back to Overleaf v1.
a.project-list-sidebar-v1-link(
href=settings.overleaf.host + "/dash?prefer-v1-dash=1"
) Go back to v1
if userIsFromSL(user)
a.project-list-sidebar-v1-link(
href=settings.accountMerge.sharelatexHost
) Go back to ShareLaTeX
div(ng-show="visible")
a.project-list-sidebar-v1-link(
href=settings.accountMerge.sharelatexHost
) Go back to ShareLaTeX
.project-list-main.col-md-10.col-xs-9
include ./list/notifications

View file

@ -1,6 +1,6 @@
if (user.awareOfV2 && !settings.overleaf)
.userNotifications
ul.list-unstyled.notifications-list(ng-controller="OverleafNotificationController", ng-show="visible")
ul.list-unstyled.notifications-list(ng-controller="OverleafV2NotificationController", ng-show="visible")
li.notification_entry
.row
.col-xs-12

View file

@ -37,9 +37,20 @@ define [
$scope.notification.inflight = false
$scope.notification.error = true
App.controller "OverleafNotificationController", ($scope, localStorage) ->
$scope.visible = !localStorage('overleaf_notification_hidden_at')
App.controller "OverleafV2NotificationController", ($scope, localStorage) ->
$scope.visible = !localStorage('overleaf_v2_notification_hidden_at')
$scope.dismiss = () ->
$scope.visible = false
localStorage('overleaf_notification_hidden_at', Date.now())
localStorage('overleaf_v2_notification_hidden_at', Date.now())
App.controller "OverleafV1NotificationController", ($scope, localStorage) ->
$scope.visible = !localStorage('overleaf_v1_notification_hidden_at')
$scope.toggle = () ->
console.log('toggle!', $scope.visible)
$scope.visible = !$scope.visible
if !$scope.visible
localStorage('overleaf_v1_notification_hidden_at', Date.now())
else
localStorage('overleaf_v1_notification_hidden_at', null)

View file

@ -16,10 +16,7 @@
flex-grow: 0;
flex-shrink: 0;
text-align: center;
display: flex;
background-color: @v2-dash-pane-bg;
flex-direction: column;
justify-content: center;
color: white;
font-size: 13px;
padding: @line-height-computed / 2;
@ -33,3 +30,12 @@
.project-list-sidebar-v2-pane a:hover {
text-decoration: none;
}
.project-list-sidebar-v2-pane-toggle {
color: white;
padding: 0;
line-height: 1;
&:hover, &:active {
color: white;
}
}