Remove optional hyphens from pug templates (#3788)

GitOrigin-RevId: 2d31719a6aaefb85bba323d65ed66bdb06ec8928
This commit is contained in:
Alf Eaton 2021-03-24 10:09:43 +00:00 committed by Copybot
parent 54e6053cf9
commit 974fe8fd39
17 changed files with 83 additions and 83 deletions

View file

@ -1,101 +1,101 @@
//- Title
-if (metadata && metadata.title)
if (metadata && metadata.title)
title= metadata.title + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
meta(name="twitter:title", content=metadata.title)
meta(name="og:title", content=metadata.title)
-else if (typeof(title) == "undefined")
else if (typeof(title) == "undefined")
title= settings.appName + ', '+ translate("online_latex_editor")
meta(name="twitter:title", content=settings.appName + ', '+ translate("online_latex_editor"))
meta(name="og:title", content=settings.appName + ', '+ translate("online_latex_editor"))
-else
else
title= translate(title) + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
//- to do - not translate?
meta(name="twitter:title", content=translate(title))
meta(name="og:title", content=translate(title))
//- Description
-if (metadata && metadata.description)
if (metadata && metadata.description)
meta(name="description" , content=metadata.description)
meta(itemprop="description" , content=metadata.description)
//-twitter and og descriptions handeled in their sections below
-else
else
meta(name="description", content=translate("site_description"))
meta(itemprop="description", content=translate("site_description"))
//- Image
-if (metadata && metadata.image && metadata.image.fields)
if (metadata && metadata.image && metadata.image.fields)
//- from the CMS
meta(itemprop="image", content=metadata.image.fields.file.url)
meta(name="image", content=metadata.image.fields.file.url)
-else if (metadata && metadata.image_src)
else if (metadata && metadata.image_src)
//- pages with custom metadata images, metadata.image_src is the full image URL
meta(itemprop="image", content=metadata.image_src)
meta(name="image", content=metadata.image_src)
-else if (settings.overleaf)
else if (settings.overleaf)
//- the default image for Overleaf
meta(itemprop="image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
meta(name="image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
-else
else
//- the default image for ShareLaTeX
meta(itemprop="image", content='/touch-icon-192x192.png')
meta(name="image", content='/touch-icon-192x192.png')
//- Keywords
-if (metadata && metadata.keywords)
if (metadata && metadata.keywords)
meta(name="keywords" content=metadata.keywords)
//- Misc
meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
-if (metadata && metadata.robotsNoindexNofollow)
if (metadata && metadata.robotsNoindexNofollow)
meta(name="robots" content="noindex, nofollow")
//- Twitter
meta(name="twitter:card", content=metadata && metadata.twitterCardType ? metadata.twitterCardType : 'summary')
-if (settings.social && settings.social.twitter && settings.social.twitter.handle)
if (settings.social && settings.social.twitter && settings.social.twitter.handle)
meta(name="twitter:site", content="@" + settings.social.twitter.handle)
-if (metadata && metadata.twitterDescription)
if (metadata && metadata.twitterDescription)
meta(name="twitter:description", content=metadata.twitterDescription)
- else
else
meta(name="twitter:description", content=translate("site_description"))
-if (metadata && metadata.twitterImage && metadata.twitterImage.fields)
if (metadata && metadata.twitterImage && metadata.twitterImage.fields)
//- from the CMS
meta(name="twitter:image", content=metadata.twitterImage.fields.file.url)
meta(name="twitter:image:alt", content=metadata.twitterImage.fields.title)
-else if (settings.overleaf)
else if (settings.overleaf)
//- the default image for Overleaf
meta(name="twitter:image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
-else
else
//- the default image for ShareLaTeX
meta(name="twitter:image", content='/touch-icon-192x192.png')
//- Open Graph
//- to do - add og:url
-if (settings.social && settings.social.facebook && settings.social.facebook.appId)
if (settings.social && settings.social.facebook && settings.social.facebook.appId)
meta(property="fb:app_id", content=settings.social.facebook.appId)
-if (metadata && metadata.openGraphDescription)
if (metadata && metadata.openGraphDescription)
meta(property="og:description", content=metadata.openGraphDescription)
-else
else
meta(property="og:description", content=translate("site_description"))
-if (metadata && metadata.openGraphImage && metadata.openGraphImage.fields)
if (metadata && metadata.openGraphImage && metadata.openGraphImage.fields)
//- from the CMS
meta(property="og:image", content=metadata.openGraphImage.fields.file.url)
-else if (settings.overleaf)
else if (settings.overleaf)
//- the default image for Overleaf
meta(property="og:image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
-else
else
//- the default image for ShareLaTeX
meta(property="og:image", content='/touch-icon-192x192.png')
-if (metadata && metadata.openGraphType)
if (metadata && metadata.openGraphType)
meta(property="og:type", metadata.openGraphType)
-else
else
meta(property="og:type", content="website")
- if (metadata && metadata.openGraphVideo)
if (metadata && metadata.openGraphVideo)
//- from the CMS
meta(property="og:video", content=metadata.openGraphVideo)

View file

@ -1,5 +1,5 @@
mixin faq_search(headerText, headerClass)
- if(typeof(settings.algolia) != "undefined" && typeof(settings.algolia.indexes) != "undefined" && typeof(settings.algolia.indexes.wiki) != "undefined")
if (typeof(settings.algolia) != "undefined" && typeof(settings.algolia.indexes) != "undefined" && typeof(settings.algolia.indexes.wiki) != "undefined")
if headerText
div(class=headerClass, ng-non-bindable) #{headerText}
.wiki(ng-controller="SearchWikiController")

View file

@ -14,7 +14,7 @@ html(
window.similarproducts = true
style [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {display: none !important; display: none; }
-if (typeof(gaExperiments) != "undefined")
if (typeof(gaExperiments) != "undefined")
|!{gaExperiments}
//- Stylesheet
@ -31,7 +31,7 @@ html(
//- Scripts
//- Google Analytics
- if (typeof(gaToken) != "undefined")
if (typeof(gaToken) != "undefined")
script(type='text/javascript').
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -65,7 +65,7 @@ html(
{'#{gaOptimizeId}':true});
}
- else
else
script(type='text/javascript').
window.ga = function() { console.log("would send to GA", arguments) };
@ -111,12 +111,12 @@ html(
script(src="https://www.google.com/recaptcha/api.js?render="+settings.recaptcha.siteKeyV3)
- if(typeof(suppressNavbar) == "undefined")
if (typeof(suppressNavbar) == "undefined")
include layout/navbar
block content
- if(typeof(suppressFooter) == "undefined")
if (typeof(suppressFooter) == "undefined")
include layout/footer
!= moduleIncludes("contactModal", locals)

View file

@ -191,7 +191,7 @@ block content
window.showReactFileTree = "!{showReactFileTree}" === 'true'
window.showReactAddFilesModal = "!{showReactAddFilesModal}" === 'true'
- if (settings.overleaf != null)
if (settings.overleaf != null)
script(type='text/javascript').
window.overallThemes = JSON.parse('!{StringHelper.stringifyJsonForScript(overallThemes)}');

View file

@ -154,7 +154,7 @@ aside#left-menu.full-size(
each editorTheme in editorThemes
option(value=editorTheme) #{editorTheme.replace(/_/g, ' ')}
- if (settings.overleaf != null && !isIEEE(brandVariation))
if (settings.overleaf != null && !isIEEE(brandVariation))
.form-controls
label(for="overallTheme") #{translate("overall_theme")}
select(

View file

@ -1,4 +1,4 @@
- if (frontChatWidgetRoomId)
if (frontChatWidgetRoomId)
script.
window.FCSP = '#{frontChatWidgetRoomId}';
script(src="https://chat-assets.frontapp.com/v1/chat.bundle.js")

View file

@ -134,8 +134,8 @@
i.fa.fa-arrow-up.fa-2x(aria-hidden="true")
div
strong #{translate("create_your_first_project")}
- if (showUserDetailsArea)
if (showUserDetailsArea)
span(ng-controller="LeftHandMenuPromoController", ng-cloak)
.row-spaced#userProfileInformation(ng-if="hasProjects")

View file

@ -64,16 +64,16 @@ block content
.row.ab-bonus
.col-md-10.col-md-offset-1.bonus-banner(style="position: relative; height: 30px; margin-top: 20px;")
- for (var i = 0; i <= 10; i++) {
- if (refered_user_count == i)
if (refered_user_count == i)
.number(style="left: "+i+"0%").active #{i}
- else
else
.number(style="left: "+i+"0%") #{i}
- }
.row.ab-bonus
.col-md-10.col-md-offset-1.bonus-banner
.progress
- if (refered_user_count == 0)
if (refered_user_count == 0)
div(style="text-align: center; padding: 4px;") #{translate("spread_the_word_and_fill_bar")}
.progress-bar.progress-bar-info(style="width: "+refered_user_count+"0%")
@ -87,11 +87,11 @@ block content
.row.ab-bonus
.col-md-10.col-md-offset-1.bonus-banner.bonus-status
- if (refered_user_count == 0)
if (refered_user_count == 0)
p.thanks !{translate("you_not_introed_anyone_to_sl")}
- else if (refered_user_count == 1)
else if (refered_user_count == 1)
p.thanks !{translate("you_introed_small_number", {numberOfPeople: refered_user_count}, ['strong'])}
- else
else
p.thanks !{translate("you_introed_high_number", {numberOfPeople: refered_user_count}, ['strong'])}
script(type="text/ng-template", id="BonusLinkToUsModal")

View file

@ -10,7 +10,7 @@ block content
.container
.row
.col-md-8.col-md-offset-2
-if (fromPlansPage)
if (fromPlansPage)
.alert.alert-warning
p You already have a subscription
.card
@ -18,36 +18,36 @@ block content
h1 #{translate("your_subscription")}
-var hasDisplayedSubscription = false
-if (personalSubscription)
if (personalSubscription)
-hasDisplayedSubscription = true
include ./dashboard/_personal_subscription
-if (managedGroupSubscriptions && managedGroupSubscriptions.length > 0)
if (managedGroupSubscriptions && managedGroupSubscriptions.length > 0)
include ./dashboard/_managed_groups
-if (managedInstitutions && managedInstitutions.length > 0)
if (managedInstitutions && managedInstitutions.length > 0)
include ./dashboard/_managed_institutions
-if (managedPublishers && managedPublishers.length > 0)
if (managedPublishers && managedPublishers.length > 0)
include ./dashboard/_managed_publishers
-if (memberGroupSubscriptions && memberGroupSubscriptions.length > 0)
if (memberGroupSubscriptions && memberGroupSubscriptions.length > 0)
-hasDisplayedSubscription = true
include ./dashboard/_group_memberships
-if (confirmedMemberAffiliations && confirmedMemberAffiliations.length > 0)
if (confirmedMemberAffiliations && confirmedMemberAffiliations.length > 0)
include ./dashboard/_institution_memberships
-if (v1SubscriptionStatus)
if (v1SubscriptionStatus)
include ./dashboard/_v1_subscription_status
-if (!hasDisplayedSubscription)
-if (hasSubscription)
if (!hasDisplayedSubscription)
if (hasSubscription)
-hasDisplayedSubscription = true
p(ng-non-bindable) You're on an #{settings.appName} Paid plan. Contact
a(href="mailto:support@overleaf.com") support@overleaf.com
| to find out more.
-else
else
p(ng-non-bindable) You're on the #{settings.appName} Free plan.
|
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now

View file

@ -1,17 +1,17 @@
mixin printPlan(plan)
-if (!plan.hideFromUsers)
if (!plan.hideFromUsers)
tr(ng-controller="ChangePlanFormController", ng-init="plan="+JSON.stringify(plan))
td
strong(ng-non-bindable) #{plan.name}
td
-if (plan.annual)
if (plan.annual)
| {{price}} / #{translate("year")}
-else
else
| {{price}} / #{translate("month")}
td
-if (typeof(personalSubscription.planCode) != "undefined" && plan.planCode == personalSubscription.planCode.split("_")[0])
if (typeof(personalSubscription.planCode) != "undefined" && plan.planCode == personalSubscription.planCode.split("_")[0])
button.btn.disabled #{translate("your_plan")}
-else
else
form
input(type="hidden", ng-model="plan_code", name="plan_code", value=plan.planCode)
input(type="submit", ng-click="changePlan()", value=translate("change_to_this_plan")).btn.btn-success

View file

@ -1,12 +1,12 @@
div(ng-controller="GroupMembershipController")
each groupSubscription in memberGroupSubscriptions
- if (user._id+'' != groupSubscription.admin_id._id+'')
div
if (user._id+'' != groupSubscription.admin_id._id+'')
div
p
| You are a member of
|
+teamName(groupSubscription)
- if (groupSubscription.teamNotice && groupSubscription.teamNotice != '')
if (groupSubscription.teamNotice && groupSubscription.teamNotice != '')
p
//- Team notice is sanitized in SubscriptionViewModelBuilder
em(ng-non-bindable) !{groupSubscription.teamNotice}

View file

@ -8,12 +8,12 @@ div(ng-controller="RecurlySubscriptionController")
case personalSubscription.recurly.state
when "active"
p !{translate("currently_subscribed_to_plan", {planName: personalSubscription.plan.name}, ['strong'])}
-if (personalSubscription.recurly.additionalLicenses > 0)
if (personalSubscription.recurly.additionalLicenses > 0)
|
| !{translate("additional_licenses", {additionalLicenses: personalSubscription.recurly.additionalLicenses, totalLicenses: personalSubscription.recurly.totalLicenses}, ['strong', 'strong'])}
| &nbsp;
a(href, ng-click="switchToChangePlanView()", ng-if="showChangePlanButton") !{translate("change_plan")}.
-if (personalSubscription.recurly.trialEndsAtFormatted && personalSubscription.recurly.trial_ends_at > Date.now())
if (personalSubscription.recurly.trialEndsAtFormatted && personalSubscription.recurly.trial_ends_at > Date.now())
p You're on a free trial which ends on <strong ng-non-bindable>#{personalSubscription.recurly.trialEndsAtFormatted}</strong>
p !{translate("next_payment_of_x_collectected_on_y", {paymentAmmount: personalSubscription.recurly.price, collectionDate: personalSubscription.recurly.nextPaymentDueAt}, ['strong', 'strong'])}
include ./../_price_exceptions

View file

@ -1,9 +1,9 @@
mixin teamName(subscription)
- if (subscription.teamName && subscription.teamName != '')
if (subscription.teamName && subscription.teamName != '')
strong(ng-non-bindable)= subscription.teamName
- else if (subscription.admin_id._id == user._id)
else if (subscription.admin_id._id == user._id)
| a group account
- else
else
| the group account owned by
|
strong= subscription.admin_id.email

View file

@ -1,8 +1,8 @@
- if (v1SubscriptionStatus['team'] && v1SubscriptionStatus['team']['default_plan_name'] != 'free')
if (v1SubscriptionStatus['team'] && v1SubscriptionStatus['team']['default_plan_name'] != 'free')
- hasDisplayedSubscription = true
p
| You have a legacy group licence from Overleaf v1.
- if (v1SubscriptionStatus['team']['will_end_at'])
if (v1SubscriptionStatus['team']['will_end_at'])
p
| Your current group licence ends on
|
@ -10,16 +10,16 @@
|
| and will
|
- if (v1SubscriptionStatus['team']['will_renew'])
if (v1SubscriptionStatus['team']['will_renew'])
| be automatically renewed.
- else
else
| not be automatically renewed.
- if (v1SubscriptionStatus['can_cancel_team'])
if (v1SubscriptionStatus['can_cancel_team'])
p
form(method="POST", action="/user/subscription/v1/cancel")
input(type="hidden", name="_csrf", value=csrfToken)
button().btn.btn-danger Stop automatic renewal
- else
else
p
| Please
|
@ -28,9 +28,9 @@
| to make changes to your plan
hr
- if (v1SubscriptionStatus['product'])
if (v1SubscriptionStatus['product'])
- hasDisplayedSubscription = true
p
p
| You have a legacy Overleaf v1
|
strong= v1SubscriptionStatus['product']['display_name']
@ -43,16 +43,16 @@
|
| and will
|
- if (v1SubscriptionStatus['product']['will_renew'])
if (v1SubscriptionStatus['product']['will_renew'])
| be automatically renewed.
- else
else
| not be automatically renewed.
- if (v1SubscriptionStatus['can_cancel'])
if (v1SubscriptionStatus['can_cancel'])
p
form(method="POST", action="/user/subscription/v1/cancel")
input(type="hidden", name="_csrf", value=csrfToken)
button().btn.btn-danger Stop automatic renewal
- else
else
p
| Please
|

View file

@ -10,13 +10,13 @@ block content
h2 #{translate("thanks_for_subscribing")}
.alert.alert-success
- if (personalSubscription.recurly.trial_ends_at)
if (personalSubscription.recurly.trial_ends_at)
p !{translate("next_payment_of_x_collectected_on_y", {paymentAmmount: personalSubscription.recurly.price, collectionDate: personalSubscription.recurly.nextPaymentDueAt}, ['strong', 'strong'])}
include ./_price_exceptions
p #{translate("to_modify_your_subscription_go_to")}
a(href="/user/subscription") #{translate("manage_subscription")}.
p
- if (personalSubscription.groupPlan == true)
if (personalSubscription.groupPlan == true)
a.btn.btn-success.btn-large(href=`/manage/groups/${personalSubscription._id}/members`) #{translate("add_your_first_group_member_now")}
p.letter-from-founders
p #{translate("thanks_for_subscribing_you_help_sl", {planName:personalSubscription.plan.name})}

View file

@ -11,7 +11,7 @@ block content
.container
.row
.col-md-8.col-md-offset-2
-if (expired)
if (expired)
.alert.alert-warning #{translate("email_link_expired")}
.row.row-spaced

View file

@ -1,4 +1,4 @@
- if(typeof(suggestedLanguageSubdomainConfig) != "undefined")
if (typeof(suggestedLanguageSubdomainConfig) != "undefined")
span(ng-controller="TranslationsPopupController", ng-cloak)
.translations-message(ng-hide="hidei18nNotification")
a(href=suggestedLanguageSubdomainConfig.url+currentUrl) !{translate("click_here_to_view_sl_in_lng", {lngName: translate(suggestedLanguageSubdomainConfig.lngCode)}, ['strong'])}