1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-11 09:34:05 +00:00

Merge branch 'master' into sk-passport

# Conflicts:
#	app/coffee/Features/Authorization/AuthorizationMiddlewear.coffee
This commit is contained in:
Shane Kilkelly 2016-09-15 14:48:51 +01:00
commit 97a6ac0f00
11 changed files with 28 additions and 15 deletions
services/web

View file

@ -97,12 +97,16 @@ module.exports = AuthorizationMiddlewear =
return callback(null, user_id)
redirectToRestricted: (req, res, next) ->
res.redirect "/restricted"
res.redirect "/restricted?from=#{encodeURIComponent(req.url)}"
restricted : (req, res, next)->
if AuthenticationController.isUserLoggedIn(req)
res.render 'user/restricted',
title:'restricted'
else
logger.log "user not logged in and trying to access #{req.url}, being redirected to login"
res.redirect '/register'
from = req.query.from
logger.log {from: from}, "redirecting to login"
redirect_to = "/login"
if from?
redirect_to += "?redir=#{encodeURIComponent(from)}"
res.redirect redirect_to

View file

@ -26,7 +26,7 @@ templates.canceledSubscription =
compiledTemplate: _.template '''
<p>Hi <%= first_name %>,</p>
<p>I'm sorry to see you cancelled your ShareLaTeX premium account. Would you mind giving me some advice on what the site is lacking at the moment via <a href="https://sharelatex.typeform.com/to/F7OzIY">this survey</a>?</p>
<p>I'm sorry to see you cancelled your ShareLaTeX premium account. Would you mind giving me some advice on what the site is lacking at the moment via <a href="https://sharelatex.typeform.com/to/f5lBiZ">this survey</a>?</p>
<p>Thank you in advance.</p>

View file

@ -122,7 +122,9 @@ module.exports = (app, webRouter, apiRouter)->
res.locals.translate = (key, vars = {}) ->
vars.appName = Settings.appName
req.i18n.translate(key, vars)
res.locals.currentUrl = req.originalUrl
# Don't include the query string parameters, otherwise Google
# treats ?nocdn=true as the canonical version
res.locals.currentUrl = Url.parse(req.originalUrl).pathname
next()
webRouter.use (req, res, next)->

View file

@ -57,7 +57,7 @@ html(itemscope, itemtype='http://schema.org/Product')
var noCdnKey = "nocdn=true"
var cdnBlocked = typeof jQuery === 'undefined'
var noCdnAlreadyInUrl = window.location.href.indexOf(noCdnKey) != -1 //prevent loops
if (cdnBlocked && !noCdnAlreadyInUrl) {
if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf("Googlebot") == -1) {
window.location.search += '&'+noCdnKey;
}
script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false}))

View file

@ -197,6 +197,10 @@ script(type='text/ng-template', id='wordCountModalTemplate')
)
div(ng-if="!status.loading")
.container-fluid
.row(ng-show='data.messages.length > 0')
.col-xs-12
.alert.alert-danger
p(style="white-space: pre-wrap") {{data.messages}}
.row
.col-xs-4
.pull-right #{translate("total_words")} :

View file

@ -8,7 +8,7 @@
input.form-control.col-md-7.col-xs-12(
placeholder="#{translate('search_projects')}…",
autofocus='autofocus',
ng-model="searchText",
ng-model="searchText.value",
focus-on='search:clear',
ng-keyup="searchProjects()"
)
@ -16,7 +16,7 @@
i.fa.fa-times.form-control-feedback(
ng-click="clearSearchText()",
style="cursor: pointer;",
ng-show="searchText.length > 0"
ng-show="searchText.value.length > 0"
)
//- i.fa.fa-remove

View file

@ -155,6 +155,6 @@
| #{translate("or_unlock_features_bonus")}
a(href="/user/bonus") #{translate("sharing_sl")} .
script.
window.userHasNoSubscription = #{settings.enableSubscriptions && !hasSubscription}
window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)}

View file

@ -155,7 +155,7 @@ module.exports = settings =
collaborators: -1
dropbox: true
versioning: true
compileTimeout: 60
compileTimeout: 180
compileGroup: "standard"
references: true
templates: true

View file

@ -74,7 +74,8 @@ define [
$scope.pdf.renderingError = true
# abort compile if syntax checks fail
$scope.stop_on_validation_error = localStorage("stop_on_validation_error:#{$scope.project_id}") or ide.$scope?.user?.betaProgram
$scope.stop_on_validation_error = localStorage("stop_on_validation_error:#{$scope.project_id}")
$scope.stop_on_validation_error ?= true # turn on for all users by default
$scope.$watch "stop_on_validation_error", (new_value, old_value) ->
if new_value? and old_value != new_value
localStorage("stop_on_validation_error:#{$scope.project_id}", new_value)

View file

@ -19,7 +19,7 @@ define [
, 200
INFINITE_COLLABORATORS = -1
$scope.$watch "project.members.length", (noOfMembers) ->
$scope.$watch "(project.members.length + project.invites.length)", (noOfMembers) ->
allowedNoOfMembers = $scope.project.features.collaborators
$scope.canAddCollaborators = noOfMembers < allowedNoOfMembers or allowedNoOfMembers == INFINITE_COLLABORATORS

View file

@ -11,6 +11,8 @@ define [
$scope.filter = "all"
$scope.predicate = "lastUpdated"
$scope.reverse = true
$scope.searchText =
value : ""
if $scope.projects.length == 0
$timeout () ->
@ -69,7 +71,7 @@ define [
$scope.updateVisibleProjects()
$scope.clearSearchText = () ->
$scope.searchText = ""
$scope.searchText.value = ""
$scope.filter = "all"
$scope.$emit "search:clear"
$scope.updateVisibleProjects()
@ -96,8 +98,8 @@ define [
for project in $scope.projects
visible = true
# Only show if it matches any search text
if $scope.searchText? and $scope.searchText != ""
if !project.name.toLowerCase().match($scope.searchText.toLowerCase())
if $scope.searchText.value? and $scope.searchText.value != ""
if !project.name.toLowerCase().match($scope.searchText.value.toLowerCase())
visible = false
# Only show if it matches the selected tag
if $scope.filter == "tag" and selectedTag? and project.id not in selectedTag.project_ids