From 9a073cdaf06c1f7145a8f73cdb3fb64c2e6970ff Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 16:58:19 +0000 Subject: [PATCH 01/14] Add link to V1 dash --- services/web/app/views/project/list.pug | 4 +++ .../public/stylesheets/app/project-list.less | 30 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index deecc46911..48d2cf205a 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -63,6 +63,10 @@ block content aside.project-list-sidebar.col-md-2.col-xs-3 include ./list/side-bar + .project-list-sidebar-v1-link.col-md-2.col-xs-3 + span Want to go back to the V1 dashboard? + a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 + .project-list-main.col-md-10.col-xs-9 include ./list/notifications include ./list/project-list diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index 1ca170ff89..55dcd30643 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -1,4 +1,5 @@ @announcements-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); +@v1-dash-link-height: 110px; @keyframes pulse { 0% { @@ -55,7 +56,7 @@ } .project-list-sidebar when (@is-overleaf) { - height: 100%; + height: calc(~"100% -" @v1-dash-link-height); overflow-x: hidden; overflow-y: auto; -ms-overflow-style: -ms-autohiding-scrollbar; @@ -110,6 +111,33 @@ } } +.project-list-sidebar-v1-link { + position: absolute; + bottom: 0; + height: @v1-dash-link-height; + background-color: @sidebar-hover-bg; // TODO: Fix var names + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + color: white; +} + + .project-list-sidebar-v1-link a { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 4px; + padding-top: 0; + padding-bottom: 0; + background-color: @sidebar-bg; // TODO: Fix var names + color: #fff; + } + + .project-list-sidebar-v1-link a:hover { + background-color: @sidebar-active-bg; // TODO: Fix var names + } + .userNotifications { ul { margin-bottom:0px; From 7f622e2e6b49220666a9423bbf75af512a09cd86 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 17:14:53 +0000 Subject: [PATCH 02/14] Conditionally show V1 dash link --- .../app/coffee/Features/Project/ProjectController.coffee | 1 + services/web/app/views/project/list.pug | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 9d9b7d9a13..38b2eb66c3 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -182,6 +182,7 @@ module.exports = ProjectController = hasSubscription: results.hasSubscription[0] isShowingV1Projects: results.v1Projects? noV1Connection: results.v1Projects?.noConnection + showV1DashLink: true # TODO: false if SL } if Settings?.algolia?.app_id? and Settings?.algolia?.read_only_api_key? diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 48d2cf205a..6702527612 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -63,9 +63,10 @@ block content aside.project-list-sidebar.col-md-2.col-xs-3 include ./list/side-bar - .project-list-sidebar-v1-link.col-md-2.col-xs-3 - span Want to go back to the V1 dashboard? - a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 + if showV1DashLink + .project-list-sidebar-v1-link.col-md-2.col-xs-3 + span Want to go back to the V1 dashboard? + a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 .project-list-main.col-md-10.col-xs-9 include ./list/notifications From d6e50ac940f33c7d140d21bd19c00420292df476 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 17:16:37 +0000 Subject: [PATCH 03/14] Extract var to allowed to be overridden --- services/web/public/stylesheets/app/project-list.less | 1 - services/web/public/stylesheets/core/_common-variables.less | 1 + services/web/public/stylesheets/core/ol-variables.less | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index 55dcd30643..a3ad20dd94 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -1,5 +1,4 @@ @announcements-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); -@v1-dash-link-height: 110px; @keyframes pulse { 0% { diff --git a/services/web/public/stylesheets/core/_common-variables.less b/services/web/public/stylesheets/core/_common-variables.less index 0b5d3bf744..4defe7bc9f 100644 --- a/services/web/public/stylesheets/core/_common-variables.less +++ b/services/web/public/stylesheets/core/_common-variables.less @@ -852,6 +852,7 @@ @sidebar-active-bg : @link-color; @sidebar-hover-bg : transparent; @sidebar-hover-text-decoration : underline; +@v1-dash-link-height : 0; @folders-menu-margin : 0; @folders-menu-line-height : 1.2; diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 43646ec542..b72143c29b 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -110,6 +110,7 @@ @sidebar-active-bg : @ol-blue-gray-6; @sidebar-hover-bg : @ol-blue-gray-4; @sidebar-hover-text-decoration : none; +@v1-dash-link-height : 110px; @folders-menu-margin : 0 -(@grid-gutter-width / 2); @folders-menu-line-height : @structured-list-line-height; From e7f83c73ae58f83acb5d3258fc9bb5ea4a5ed859 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 17:53:47 +0000 Subject: [PATCH 04/14] Extract v1 dash link styles to file so can define OL only vars --- .../stylesheets/_ol_style_includes.less | 1 + .../public/stylesheets/app/project-list.less | 27 ------------------- .../stylesheets/app/sidebar-v1-dash-link.less | 26 ++++++++++++++++++ .../public/stylesheets/core/ol-variables.less | 3 +++ services/web/public/stylesheets/ol-style.less | 3 ++- 5 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 services/web/public/stylesheets/_ol_style_includes.less create mode 100644 services/web/public/stylesheets/app/sidebar-v1-dash-link.less diff --git a/services/web/public/stylesheets/_ol_style_includes.less b/services/web/public/stylesheets/_ol_style_includes.less new file mode 100644 index 0000000000..c8505c2e56 --- /dev/null +++ b/services/web/public/stylesheets/_ol_style_includes.less @@ -0,0 +1 @@ +@import "app/sidebar-v1-dash-link.less"; diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index a3ad20dd94..9fe3dc2238 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -110,33 +110,6 @@ } } -.project-list-sidebar-v1-link { - position: absolute; - bottom: 0; - height: @v1-dash-link-height; - background-color: @sidebar-hover-bg; // TODO: Fix var names - text-align: center; - display: flex; - flex-direction: column; - justify-content: center; - color: white; -} - - .project-list-sidebar-v1-link a { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 4px; - padding-top: 0; - padding-bottom: 0; - background-color: @sidebar-bg; // TODO: Fix var names - color: #fff; - } - - .project-list-sidebar-v1-link a:hover { - background-color: @sidebar-active-bg; // TODO: Fix var names - } - .userNotifications { ul { margin-bottom:0px; diff --git a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less new file mode 100644 index 0000000000..008d47662e --- /dev/null +++ b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less @@ -0,0 +1,26 @@ +.project-list-sidebar-v1-link { + position: absolute; + bottom: 0; + height: @v1-dash-link-height; + background-color: @v1-dash-link-bg; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + color: white; +} + + .project-list-sidebar-v1-link a { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 4px; + padding-top: 0; + padding-bottom: 0; + background-color: @v1-dash-link-btn-bg; + color: #fff; + } + + .project-list-sidebar-v1-link a:hover { + background-color: @v1-dash-link-btn-hover-bg; + } \ No newline at end of file diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index b72143c29b..49e4196ebf 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -111,6 +111,9 @@ @sidebar-hover-bg : @ol-blue-gray-4; @sidebar-hover-text-decoration : none; @v1-dash-link-height : 110px; +@v1-dash-link-bg : @ol-blue-gray-4; +@v1-dash-link-btn-bg : @ol-blue-gray-5; +@v1-dash-link-btn-hover-bg : @ol-blue-gray-6; @folders-menu-margin : 0 -(@grid-gutter-width / 2); @folders-menu-line-height : @structured-list-line-height; diff --git a/services/web/public/stylesheets/ol-style.less b/services/web/public/stylesheets/ol-style.less index 1e48b7284d..2a9a140611 100644 --- a/services/web/public/stylesheets/ol-style.less +++ b/services/web/public/stylesheets/ol-style.less @@ -1,4 +1,5 @@ // Core variables and mixins @import "core/ol-variables.less"; @import "app/ol-style-guide.less"; -@import "_style_includes.less"; \ No newline at end of file +@import "_style_includes.less"; +@import "_ol_style_includes.less"; \ No newline at end of file From bf23a096442978e383235a8ae1ffce67b1cfe5a1 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 1 Dec 2017 17:58:35 +0000 Subject: [PATCH 05/14] Move setting sidebar height to OL only file so var can be moved to specific scope --- services/web/public/stylesheets/app/project-list.less | 1 - .../web/public/stylesheets/app/sidebar-v1-dash-link.less | 6 ++++++ services/web/public/stylesheets/core/_common-variables.less | 1 - services/web/public/stylesheets/core/ol-variables.less | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index 9fe3dc2238..687cd545fc 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -55,7 +55,6 @@ } .project-list-sidebar when (@is-overleaf) { - height: calc(~"100% -" @v1-dash-link-height); overflow-x: hidden; overflow-y: auto; -ms-overflow-style: -ms-autohiding-scrollbar; diff --git a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less index 008d47662e..b297920e5b 100644 --- a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less +++ b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less @@ -1,3 +1,9 @@ +@v1-dash-link-height: 110px; + +.project-list-sidebar { + height: calc(~"100% -" @v1-dash-link-height); +} + .project-list-sidebar-v1-link { position: absolute; bottom: 0; diff --git a/services/web/public/stylesheets/core/_common-variables.less b/services/web/public/stylesheets/core/_common-variables.less index 4defe7bc9f..0b5d3bf744 100644 --- a/services/web/public/stylesheets/core/_common-variables.less +++ b/services/web/public/stylesheets/core/_common-variables.less @@ -852,7 +852,6 @@ @sidebar-active-bg : @link-color; @sidebar-hover-bg : transparent; @sidebar-hover-text-decoration : underline; -@v1-dash-link-height : 0; @folders-menu-margin : 0; @folders-menu-line-height : 1.2; diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 49e4196ebf..61c74d0230 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -110,7 +110,6 @@ @sidebar-active-bg : @ol-blue-gray-6; @sidebar-hover-bg : @ol-blue-gray-4; @sidebar-hover-text-decoration : none; -@v1-dash-link-height : 110px; @v1-dash-link-bg : @ol-blue-gray-4; @v1-dash-link-btn-bg : @ol-blue-gray-5; @v1-dash-link-btn-hover-bg : @ol-blue-gray-6; From f5950099110275318d5458f8ddde4c9f62b67111 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 11:23:09 +0000 Subject: [PATCH 06/14] Switch to existing v1 dash flag --- .../web/app/coffee/Features/Project/ProjectController.coffee | 1 - services/web/app/views/project/list.pug | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 38b2eb66c3..9d9b7d9a13 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -182,7 +182,6 @@ module.exports = ProjectController = hasSubscription: results.hasSubscription[0] isShowingV1Projects: results.v1Projects? noV1Connection: results.v1Projects?.noConnection - showV1DashLink: true # TODO: false if SL } if Settings?.algolia?.app_id? and Settings?.algolia?.read_only_api_key? diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 6702527612..c1c708de1f 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -63,7 +63,7 @@ block content aside.project-list-sidebar.col-md-2.col-xs-3 include ./list/side-bar - if showV1DashLink + if isShowingV1Projects .project-list-sidebar-v1-link.col-md-2.col-xs-3 span Want to go back to the V1 dashboard? a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 From a25464d9256654e549ef22415d7cce4174a2a439 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 11:34:00 +0000 Subject: [PATCH 07/14] Add check for OL host --- services/web/app/views/project/list.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index c1c708de1f..26c2082968 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -63,7 +63,7 @@ block content aside.project-list-sidebar.col-md-2.col-xs-3 include ./list/side-bar - if isShowingV1Projects + if isShowingV1Projects && settings.overleaf && settings.overleaf.host .project-list-sidebar-v1-link.col-md-2.col-xs-3 span Want to go back to the V1 dashboard? a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 From 1fd518ec5819b50ff8189872bea9bcfa75388535 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 12:22:27 +0000 Subject: [PATCH 08/14] Add query param to mark as explicitly using V1 dash --- services/web/app/views/project/list.pug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 26c2082968..ab8d42751c 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -66,7 +66,8 @@ block content if isShowingV1Projects && settings.overleaf && settings.overleaf.host .project-list-sidebar-v1-link.col-md-2.col-xs-3 span Want to go back to the V1 dashboard? - a.btn.btn-default(href=settings.overleaf.host + "/dash") Go back to V1 + a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") + | Go back to V1 .project-list-main.col-md-10.col-xs-9 include ./list/notifications From ab78cea48ddb6653c84fd6ac02d3f81b686bcbb7 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 12:24:21 +0000 Subject: [PATCH 09/14] Move to sidebar template --- services/web/app/views/project/list.pug | 9 +- .../web/app/views/project/list/side-bar.pug | 275 +++++++++--------- 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index ab8d42751c..bcfd7954cb 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -60,14 +60,7 @@ block content .row.project-list-row(ng-cloak) .project-list-container(ng-if="projects.length > 0") - aside.project-list-sidebar.col-md-2.col-xs-3 - include ./list/side-bar - - if isShowingV1Projects && settings.overleaf && settings.overleaf.host - .project-list-sidebar-v1-link.col-md-2.col-xs-3 - span Want to go back to the V1 dashboard? - a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") - | Go back to V1 + include ./list/side-bar .project-list-main.col-md-10.col-xs-9 include ./list/notifications diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index c1ffb6e30c..f01223293b 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -1,144 +1,151 @@ -.dropdown(dropdown) - a.btn.btn-primary.sidebar-new-proj-btn.dropdown-toggle( - href="#", - data-toggle="dropdown", - dropdown-toggle - ) - | #{translate("new_project")} +if isShowingV1Projects && settings.overleaf && settings.overleaf.host + .project-list-sidebar-v1-link.col-md-2.col-xs-3 + span Want to go back to the V1 dashboard? + a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") + | Go back to V1 - ul.dropdown-menu(role="menu") - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openCreateProjectModal()" - ) #{translate("blank_project")} - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openCreateProjectModal('example')" - ) #{translate("example_project")} - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openUploadProjectModal()" - ) #{translate("upload_project")} - != moduleIncludes("newProjectMenu", locals) - if (templates) - li.divider - li.dropdown-header #{translate("templates")} - each item in templates - li - a.menu-indent(href=item.url, sixpack-convert="first_sign_up") #{translate(item.name)} - -.row-spaced(ng-if="projects.length > 0", ng-cloak) - ul.list-unstyled.folders-menu( - ng-controller="TagListController" - ) - li(ng-class="{active: (filter == 'all')}", ng-click="filterProjects('all')") - a(href) #{translate("all_projects")} - li(ng-class="{active: (filter == 'owned')}", ng-click="filterProjects('owned')") - a(href) #{translate("your_projects")} - li(ng-class="{active: (filter == 'shared')}", ng-click="filterProjects('shared')") - a(href) #{translate("shared_with_you")} - li(ng-class="{active: (filter == 'archived')}", ng-click="filterProjects('archived')") - a(href) #{translate("deleted_projects")} - if isShowingV1Projects - li(ng-class="{active: (filter == 'v1')}", ng-click="filterProjects('v1')") - a(href) #{translate("v1_projects")} - li.separator - h2 #{translate("folders")} - li.tag( - ng-repeat="tag in tags | orderBy:'name'", - ng-class="{active: tag.selected}", - ng-cloak, - ng-click="selectTag(tag)" +aside.project-list-sidebar.col-md-2.col-xs-3 + .dropdown(dropdown) + a.btn.btn-primary.sidebar-new-proj-btn.dropdown-toggle( + href="#", + data-toggle="dropdown", + dropdown-toggle ) - a.tag-name(href) - i.icon.fa.fa-fw( - ng-class="{\ - 'fa-folder-open-o': tag.selected,\ - 'fa-folder-o': !tag.selected\ - }" - ) - span.name {{tag.name}} - span.subdued ({{tag.project_ids.length}}) - span.v1-badge( - ng-if="tag.isV1", - ng-cloak, - aria-label=translate("v1_badge") - tooltip-template="'v1TagTooltipTemplate'" - tooltip-append-to-body="true" + | #{translate("new_project")} + + ul.dropdown-menu(role="menu") + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openCreateProjectModal()" + ) #{translate("blank_project")} + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openCreateProjectModal('example')" + ) #{translate("example_project")} + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openUploadProjectModal()" + ) #{translate("upload_project")} + != moduleIncludes("newProjectMenu", locals) + if (templates) + li.divider + li.dropdown-header #{translate("templates")} + each item in templates + li + a.menu-indent(href=item.url, sixpack-convert="first_sign_up") #{translate(item.name)} + + .row-spaced(ng-if="projects.length > 0", ng-cloak) + ul.list-unstyled.folders-menu( + ng-controller="TagListController" + ) + li(ng-class="{active: (filter == 'all')}", ng-click="filterProjects('all')") + a(href) #{translate("all_projects")} + li(ng-class="{active: (filter == 'owned')}", ng-click="filterProjects('owned')") + a(href) #{translate("your_projects")} + li(ng-class="{active: (filter == 'shared')}", ng-click="filterProjects('shared')") + a(href) #{translate("shared_with_you")} + li(ng-class="{active: (filter == 'archived')}", ng-click="filterProjects('archived')") + a(href) #{translate("deleted_projects")} + if isShowingV1Projects + li(ng-class="{active: (filter == 'v1')}", ng-click="filterProjects('v1')") + a(href) #{translate("v1_projects")} + li.separator + h2 #{translate("folders")} + li.tag( + ng-repeat="tag in tags | orderBy:'name'", + ng-class="{active: tag.selected}", + ng-cloak, + ng-click="selectTag(tag)" + ) + a.tag-name(href) + i.icon.fa.fa-fw( + ng-class="{\ + 'fa-folder-open-o': tag.selected,\ + 'fa-folder-o': !tag.selected\ + }" ) - span.dropdown.tag-menu(dropdown) - a.dropdown-toggle( - href="#", - data-toggle="dropdown", - dropdown-toggle, - stop-propagation="click" - ) - span.caret - ul.dropdown-menu.dropdown-menu-right( - role="menu" - ) - li - a(href, ng-click="renameTag(tag)", stop-propagation="click") - | #{translate("rename")} - li - a(href, ng-click="deleteTag(tag)", stop-propagation="click") - | #{translate("delete")} - li.tag.untagged( - ng-if="tags.length", - ng-cloak, - ng-click="selectUntagged()" - ng-class="{active: filter === 'untagged'}", - ) - a.tag-name(href) - | #{translate("uncategorized")} - span.subdued ({{ nUntagged }}) - li(ng-cloak) - a.tag(href, ng-click="openNewTagModal()") - i.fa.fa-fw.fa-plus - span.name #{translate("new_folder")} + span.name {{tag.name}} + span.subdued ({{tag.project_ids.length}}) + span.v1-badge( + ng-if="tag.isV1", + ng-cloak, + aria-label=translate("v1_badge") + tooltip-template="'v1TagTooltipTemplate'" + tooltip-append-to-body="true" + ) + span.dropdown.tag-menu(dropdown) + a.dropdown-toggle( + href="#", + data-toggle="dropdown", + dropdown-toggle, + stop-propagation="click" + ) + span.caret + ul.dropdown-menu.dropdown-menu-right( + role="menu" + ) + li + a(href, ng-click="renameTag(tag)", stop-propagation="click") + | #{translate("rename")} + li + a(href, ng-click="deleteTag(tag)", stop-propagation="click") + | #{translate("delete")} + li.tag.untagged( + ng-if="tags.length", + ng-cloak, + ng-click="selectUntagged()" + ng-class="{active: filter === 'untagged'}", + ) + a.tag-name(href) + | #{translate("uncategorized")} + span.subdued ({{ nUntagged }}) + li(ng-cloak) + a.tag(href, ng-click="openNewTagModal()") + i.fa.fa-fw.fa-plus + span.name #{translate("new_folder")} -.row-spaced(ng-if="projects.length == 0", ng-cloak) - .first-project - div - i.fa.fa-arrow-up.fa-2x - div - strong #{translate("create_your_first_project")} - -- if (showUserDetailsArea) - span(ng-controller="LeftHandMenuPromoController", ng-cloak) + .row-spaced(ng-if="projects.length == 0", ng-cloak) + .first-project + div + i.fa.fa-arrow-up.fa-2x + div + strong #{translate("create_your_first_project")} - .row-spaced#userProfileInformation(ng-if="hasProjects") - div(ng-controller="UserProfileController") - hr(ng-show="percentComplete < 100") - .text-centered.user-profile(ng-show="percentComplete < 100") - .progress - .progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}") + - if (showUserDetailsArea) + span(ng-controller="LeftHandMenuPromoController", ng-cloak) - p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})} - - button#completeUserProfileInformation.btn.btn-info( - ng-hide="formVisable", - ng-click="openUserProfileModal()" - ) #{translate("complete")} + .row-spaced#userProfileInformation(ng-if="hasProjects") + div(ng-controller="UserProfileController") + hr(ng-show="percentComplete < 100") + .text-centered.user-profile(ng-show="percentComplete < 100") + .progress + .progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}") + + p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})} + + button#completeUserProfileInformation.btn.btn-info( + ng-hide="formVisable", + ng-click="openUserProfileModal()" + ) #{translate("complete")} - .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered - hr - p.small #{translate("on_free_sl")} - p - a(href="/user/subscription/plans", sixpack-convert="left-menu-upgraed-rotation").btn.btn-primary #{translate("upgrade")} - p.small.text-centered - | #{translate("or_unlock_features_bonus")} - a(href="/user/bonus") #{translate("sharing_sl")} . - - -script. - window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)} + .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered + hr + p.small #{translate("on_free_sl")} + p + a(href="/user/subscription/plans", sixpack-convert="left-menu-upgraed-rotation").btn.btn-primary #{translate("upgrade")} + p.small.text-centered + | #{translate("or_unlock_features_bonus")} + a(href="/user/bonus") #{translate("sharing_sl")} . + + + script. + window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)} From 77dc7adf1f1af25840da3b27977da10648d080a1 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 14:53:18 +0000 Subject: [PATCH 10/14] Revert "Move to sidebar template" This reverts commit 15dc1a35184aade8912d129ea75248ffc8b1b4bd. --- services/web/app/views/project/list.pug | 9 +- .../web/app/views/project/list/side-bar.pug | 275 +++++++++--------- 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index bcfd7954cb..ab8d42751c 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -60,7 +60,14 @@ block content .row.project-list-row(ng-cloak) .project-list-container(ng-if="projects.length > 0") - include ./list/side-bar + aside.project-list-sidebar.col-md-2.col-xs-3 + include ./list/side-bar + + if isShowingV1Projects && settings.overleaf && settings.overleaf.host + .project-list-sidebar-v1-link.col-md-2.col-xs-3 + span Want to go back to the V1 dashboard? + a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") + | Go back to V1 .project-list-main.col-md-10.col-xs-9 include ./list/notifications diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index f01223293b..c1ffb6e30c 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -1,151 +1,144 @@ -if isShowingV1Projects && settings.overleaf && settings.overleaf.host - .project-list-sidebar-v1-link.col-md-2.col-xs-3 - span Want to go back to the V1 dashboard? - a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") - | Go back to V1 +.dropdown(dropdown) + a.btn.btn-primary.sidebar-new-proj-btn.dropdown-toggle( + href="#", + data-toggle="dropdown", + dropdown-toggle + ) + | #{translate("new_project")} -aside.project-list-sidebar.col-md-2.col-xs-3 - .dropdown(dropdown) - a.btn.btn-primary.sidebar-new-proj-btn.dropdown-toggle( - href="#", - data-toggle="dropdown", - dropdown-toggle + ul.dropdown-menu(role="menu") + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openCreateProjectModal()" + ) #{translate("blank_project")} + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openCreateProjectModal('example')" + ) #{translate("example_project")} + li + a( + href, + sixpack-convert="first_sign_up", + ng-click="openUploadProjectModal()" + ) #{translate("upload_project")} + != moduleIncludes("newProjectMenu", locals) + if (templates) + li.divider + li.dropdown-header #{translate("templates")} + each item in templates + li + a.menu-indent(href=item.url, sixpack-convert="first_sign_up") #{translate(item.name)} + +.row-spaced(ng-if="projects.length > 0", ng-cloak) + ul.list-unstyled.folders-menu( + ng-controller="TagListController" + ) + li(ng-class="{active: (filter == 'all')}", ng-click="filterProjects('all')") + a(href) #{translate("all_projects")} + li(ng-class="{active: (filter == 'owned')}", ng-click="filterProjects('owned')") + a(href) #{translate("your_projects")} + li(ng-class="{active: (filter == 'shared')}", ng-click="filterProjects('shared')") + a(href) #{translate("shared_with_you")} + li(ng-class="{active: (filter == 'archived')}", ng-click="filterProjects('archived')") + a(href) #{translate("deleted_projects")} + if isShowingV1Projects + li(ng-class="{active: (filter == 'v1')}", ng-click="filterProjects('v1')") + a(href) #{translate("v1_projects")} + li.separator + h2 #{translate("folders")} + li.tag( + ng-repeat="tag in tags | orderBy:'name'", + ng-class="{active: tag.selected}", + ng-cloak, + ng-click="selectTag(tag)" ) - | #{translate("new_project")} - - ul.dropdown-menu(role="menu") - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openCreateProjectModal()" - ) #{translate("blank_project")} - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openCreateProjectModal('example')" - ) #{translate("example_project")} - li - a( - href, - sixpack-convert="first_sign_up", - ng-click="openUploadProjectModal()" - ) #{translate("upload_project")} - != moduleIncludes("newProjectMenu", locals) - if (templates) - li.divider - li.dropdown-header #{translate("templates")} - each item in templates + a.tag-name(href) + i.icon.fa.fa-fw( + ng-class="{\ + 'fa-folder-open-o': tag.selected,\ + 'fa-folder-o': !tag.selected\ + }" + ) + span.name {{tag.name}} + span.subdued ({{tag.project_ids.length}}) + span.v1-badge( + ng-if="tag.isV1", + ng-cloak, + aria-label=translate("v1_badge") + tooltip-template="'v1TagTooltipTemplate'" + tooltip-append-to-body="true" + ) + span.dropdown.tag-menu(dropdown) + a.dropdown-toggle( + href="#", + data-toggle="dropdown", + dropdown-toggle, + stop-propagation="click" + ) + span.caret + ul.dropdown-menu.dropdown-menu-right( + role="menu" + ) li - a.menu-indent(href=item.url, sixpack-convert="first_sign_up") #{translate(item.name)} + a(href, ng-click="renameTag(tag)", stop-propagation="click") + | #{translate("rename")} + li + a(href, ng-click="deleteTag(tag)", stop-propagation="click") + | #{translate("delete")} + li.tag.untagged( + ng-if="tags.length", + ng-cloak, + ng-click="selectUntagged()" + ng-class="{active: filter === 'untagged'}", + ) + a.tag-name(href) + | #{translate("uncategorized")} + span.subdued ({{ nUntagged }}) + li(ng-cloak) + a.tag(href, ng-click="openNewTagModal()") + i.fa.fa-fw.fa-plus + span.name #{translate("new_folder")} - .row-spaced(ng-if="projects.length > 0", ng-cloak) - ul.list-unstyled.folders-menu( - ng-controller="TagListController" - ) - li(ng-class="{active: (filter == 'all')}", ng-click="filterProjects('all')") - a(href) #{translate("all_projects")} - li(ng-class="{active: (filter == 'owned')}", ng-click="filterProjects('owned')") - a(href) #{translate("your_projects")} - li(ng-class="{active: (filter == 'shared')}", ng-click="filterProjects('shared')") - a(href) #{translate("shared_with_you")} - li(ng-class="{active: (filter == 'archived')}", ng-click="filterProjects('archived')") - a(href) #{translate("deleted_projects")} - if isShowingV1Projects - li(ng-class="{active: (filter == 'v1')}", ng-click="filterProjects('v1')") - a(href) #{translate("v1_projects")} - li.separator - h2 #{translate("folders")} - li.tag( - ng-repeat="tag in tags | orderBy:'name'", - ng-class="{active: tag.selected}", - ng-cloak, - ng-click="selectTag(tag)" - ) - a.tag-name(href) - i.icon.fa.fa-fw( - ng-class="{\ - 'fa-folder-open-o': tag.selected,\ - 'fa-folder-o': !tag.selected\ - }" - ) - span.name {{tag.name}} - span.subdued ({{tag.project_ids.length}}) - span.v1-badge( - ng-if="tag.isV1", - ng-cloak, - aria-label=translate("v1_badge") - tooltip-template="'v1TagTooltipTemplate'" - tooltip-append-to-body="true" - ) - span.dropdown.tag-menu(dropdown) - a.dropdown-toggle( - href="#", - data-toggle="dropdown", - dropdown-toggle, - stop-propagation="click" - ) - span.caret - ul.dropdown-menu.dropdown-menu-right( - role="menu" - ) - li - a(href, ng-click="renameTag(tag)", stop-propagation="click") - | #{translate("rename")} - li - a(href, ng-click="deleteTag(tag)", stop-propagation="click") - | #{translate("delete")} - li.tag.untagged( - ng-if="tags.length", - ng-cloak, - ng-click="selectUntagged()" - ng-class="{active: filter === 'untagged'}", - ) - a.tag-name(href) - | #{translate("uncategorized")} - span.subdued ({{ nUntagged }}) - li(ng-cloak) - a.tag(href, ng-click="openNewTagModal()") - i.fa.fa-fw.fa-plus - span.name #{translate("new_folder")} +.row-spaced(ng-if="projects.length == 0", ng-cloak) + .first-project + div + i.fa.fa-arrow-up.fa-2x + div + strong #{translate("create_your_first_project")} + +- if (showUserDetailsArea) + span(ng-controller="LeftHandMenuPromoController", ng-cloak) - .row-spaced(ng-if="projects.length == 0", ng-cloak) - .first-project - div - i.fa.fa-arrow-up.fa-2x - div - strong #{translate("create_your_first_project")} + .row-spaced#userProfileInformation(ng-if="hasProjects") + div(ng-controller="UserProfileController") + hr(ng-show="percentComplete < 100") + .text-centered.user-profile(ng-show="percentComplete < 100") + .progress + .progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}") - - if (showUserDetailsArea) - span(ng-controller="LeftHandMenuPromoController", ng-cloak) - - .row-spaced#userProfileInformation(ng-if="hasProjects") - div(ng-controller="UserProfileController") - hr(ng-show="percentComplete < 100") - .text-centered.user-profile(ng-show="percentComplete < 100") - .progress - .progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}") - - p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})} - - button#completeUserProfileInformation.btn.btn-info( - ng-hide="formVisable", - ng-click="openUserProfileModal()" - ) #{translate("complete")} + p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})} + + button#completeUserProfileInformation.btn.btn-info( + ng-hide="formVisable", + ng-click="openUserProfileModal()" + ) #{translate("complete")} - .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered - hr - p.small #{translate("on_free_sl")} - p - a(href="/user/subscription/plans", sixpack-convert="left-menu-upgraed-rotation").btn.btn-primary #{translate("upgrade")} - p.small.text-centered - | #{translate("or_unlock_features_bonus")} - a(href="/user/bonus") #{translate("sharing_sl")} . - - - script. - window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)} + .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered + hr + p.small #{translate("on_free_sl")} + p + a(href="/user/subscription/plans", sixpack-convert="left-menu-upgraed-rotation").btn.btn-primary #{translate("upgrade")} + p.small.text-centered + | #{translate("or_unlock_features_bonus")} + a(href="/user/bonus") #{translate("sharing_sl")} . + + +script. + window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)} From c84c00d56d8c5334998118866cbfd83a519caf15 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 15:19:03 +0000 Subject: [PATCH 11/14] Change query param for nicer api on OL side --- services/web/app/views/project/list.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index ab8d42751c..7ee28763a8 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -66,7 +66,7 @@ block content if isShowingV1Projects && settings.overleaf && settings.overleaf.host .project-list-sidebar-v1-link.col-md-2.col-xs-3 span Want to go back to the V1 dashboard? - a.btn.btn-default(href=settings.overleaf.host + "/dash?remember-dash=1") + a.btn.btn-default(href=settings.overleaf.host + "/dash?prefer-v1-dash=1") | Go back to V1 .project-list-main.col-md-10.col-xs-9 From 6a185a838dee8b46948c9d4dee0b4bbb2c4ffe6b Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 4 Dec 2017 17:20:49 +0000 Subject: [PATCH 12/14] Increase height & margin --- services/web/public/stylesheets/app/sidebar-v1-dash-link.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less index b297920e5b..072042226e 100644 --- a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less +++ b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less @@ -1,4 +1,4 @@ -@v1-dash-link-height: 110px; +@v1-dash-link-height: 130px; .project-list-sidebar { height: calc(~"100% -" @v1-dash-link-height); @@ -20,7 +20,7 @@ display: block; margin-left: auto; margin-right: auto; - margin-top: 4px; + margin-top: 12.5px; padding-top: 0; padding-bottom: 0; background-color: @v1-dash-link-btn-bg; From 6198491e5f38eece274d927a02ca1fafd4fd46ff Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 8 Dec 2017 11:31:44 +0000 Subject: [PATCH 13/14] Add unsupported file type error --- services/web/app/coffee/Features/Errors/Errors.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/web/app/coffee/Features/Errors/Errors.coffee b/services/web/app/coffee/Features/Errors/Errors.coffee index 2e46dd692d..ce236d5968 100644 --- a/services/web/app/coffee/Features/Errors/Errors.coffee +++ b/services/web/app/coffee/Features/Errors/Errors.coffee @@ -26,8 +26,16 @@ InvalidNameError = (message) -> return error InvalidNameError.prototype.__proto__ = Error.prototype +UnsupportedFileType = (message) -> + error = new Error(message) + error.name = "UnsupportedFileType" + error.__proto__ = UnsupportedFileType.prototype + return error +UnsupportedFileType.prototype.__proto___ = Error.prototype + module.exports = Errors = NotFoundError: NotFoundError ServiceNotConfiguredError: ServiceNotConfiguredError TooManyRequestsError: TooManyRequestsError InvalidNameError: InvalidNameError + UnsupportedFileType: UnsupportedFileType From 5c62ac4f8aed26112aafbbbb8ee5ac9816dbb4a3 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 12 Dec 2017 12:50:20 +0000 Subject: [PATCH 14/14] Change error type for consistency --- services/web/app/coffee/Features/Errors/Errors.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/web/app/coffee/Features/Errors/Errors.coffee b/services/web/app/coffee/Features/Errors/Errors.coffee index ce236d5968..d88b243418 100644 --- a/services/web/app/coffee/Features/Errors/Errors.coffee +++ b/services/web/app/coffee/Features/Errors/Errors.coffee @@ -26,16 +26,16 @@ InvalidNameError = (message) -> return error InvalidNameError.prototype.__proto__ = Error.prototype -UnsupportedFileType = (message) -> +UnsupportedFileTypeError = (message) -> error = new Error(message) - error.name = "UnsupportedFileType" - error.__proto__ = UnsupportedFileType.prototype + error.name = "UnsupportedFileTypeError" + error.__proto__ = UnsupportedFileTypeError.prototype return error -UnsupportedFileType.prototype.__proto___ = Error.prototype +UnsupportedFileTypeError.prototype.__proto___ = Error.prototype module.exports = Errors = NotFoundError: NotFoundError ServiceNotConfiguredError: ServiceNotConfiguredError TooManyRequestsError: TooManyRequestsError InvalidNameError: InvalidNameError - UnsupportedFileType: UnsupportedFileType + UnsupportedFileTypeError: UnsupportedFileTypeError