From 974fe8fd399f350becd90de6452f48d06ffbbe14 Mon Sep 17 00:00:00 2001 From: Alf Eaton <75253002+aeaton-overleaf@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:09:43 +0000 Subject: [PATCH] Remove optional hyphens from pug templates (#3788) GitOrigin-RevId: 2d31719a6aaefb85bba323d65ed66bdb06ec8928 --- services/web/app/views/_metadata.pug | 52 +++++++++---------- services/web/app/views/_mixins/faq_search.pug | 2 +- services/web/app/views/layout.pug | 10 ++-- services/web/app/views/project/editor.pug | 2 +- .../app/views/project/editor/left-menu.pug | 2 +- .../web/app/views/project/list/front-chat.pug | 2 +- .../web/app/views/project/list/side-bar.pug | 4 +- services/web/app/views/referal/bonus.pug | 12 ++--- .../web/app/views/subscriptions/dashboard.pug | 22 ++++---- .../dashboard/_change_plans_mixins.pug | 10 ++-- .../dashboard/_group_memberships.pug | 6 +-- .../_personal_subscription_recurly.pug | 4 +- .../dashboard/_team_name_mixin.pug | 6 +-- .../dashboard/_v1_subscription_status.pug | 24 ++++----- .../subscriptions/successful_subscription.pug | 4 +- .../app/views/subscriptions/team/invite.pug | 2 +- .../translations/translation_message.pug | 2 +- 17 files changed, 83 insertions(+), 83 deletions(-) diff --git a/services/web/app/views/_metadata.pug b/services/web/app/views/_metadata.pug index a83b5f995e..14f84c85d1 100644 --- a/services/web/app/views/_metadata.pug +++ b/services/web/app/views/_metadata.pug @@ -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) diff --git a/services/web/app/views/_mixins/faq_search.pug b/services/web/app/views/_mixins/faq_search.pug index 755722e363..ca51cb29c2 100644 --- a/services/web/app/views/_mixins/faq_search.pug +++ b/services/web/app/views/_mixins/faq_search.pug @@ -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") diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index 6213377395..af0c74c9cb 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -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) diff --git a/services/web/app/views/project/editor.pug b/services/web/app/views/project/editor.pug index a3fb9d5738..1cde011e47 100644 --- a/services/web/app/views/project/editor.pug +++ b/services/web/app/views/project/editor.pug @@ -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)}'); diff --git a/services/web/app/views/project/editor/left-menu.pug b/services/web/app/views/project/editor/left-menu.pug index 6384809ee7..bb42f5ce9c 100644 --- a/services/web/app/views/project/editor/left-menu.pug +++ b/services/web/app/views/project/editor/left-menu.pug @@ -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( diff --git a/services/web/app/views/project/list/front-chat.pug b/services/web/app/views/project/list/front-chat.pug index 7e1c9a7123..bbc283df23 100644 --- a/services/web/app/views/project/list/front-chat.pug +++ b/services/web/app/views/project/list/front-chat.pug @@ -1,4 +1,4 @@ -- if (frontChatWidgetRoomId) +if (frontChatWidgetRoomId) script. window.FCSP = '#{frontChatWidgetRoomId}'; script(src="https://chat-assets.frontapp.com/v1/chat.bundle.js") diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index debdd8e190..f80f14c4a8 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -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") diff --git a/services/web/app/views/referal/bonus.pug b/services/web/app/views/referal/bonus.pug index fff1b7f1b1..84c13a6372 100644 --- a/services/web/app/views/referal/bonus.pug +++ b/services/web/app/views/referal/bonus.pug @@ -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") diff --git a/services/web/app/views/subscriptions/dashboard.pug b/services/web/app/views/subscriptions/dashboard.pug index 26de8b463b..9810cea5af 100644 --- a/services/web/app/views/subscriptions/dashboard.pug +++ b/services/web/app/views/subscriptions/dashboard.pug @@ -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 diff --git a/services/web/app/views/subscriptions/dashboard/_change_plans_mixins.pug b/services/web/app/views/subscriptions/dashboard/_change_plans_mixins.pug index 3af8872b17..7e03adef16 100644 --- a/services/web/app/views/subscriptions/dashboard/_change_plans_mixins.pug +++ b/services/web/app/views/subscriptions/dashboard/_change_plans_mixins.pug @@ -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 diff --git a/services/web/app/views/subscriptions/dashboard/_group_memberships.pug b/services/web/app/views/subscriptions/dashboard/_group_memberships.pug index 197a2ed68c..2c0e907e5e 100644 --- a/services/web/app/views/subscriptions/dashboard/_group_memberships.pug +++ b/services/web/app/views/subscriptions/dashboard/_group_memberships.pug @@ -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} diff --git a/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug b/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug index 90a598536c..3ac3e891ed 100644 --- a/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug +++ b/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug @@ -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'])} |   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 #{personalSubscription.recurly.trialEndsAtFormatted} p !{translate("next_payment_of_x_collectected_on_y", {paymentAmmount: personalSubscription.recurly.price, collectionDate: personalSubscription.recurly.nextPaymentDueAt}, ['strong', 'strong'])} include ./../_price_exceptions diff --git a/services/web/app/views/subscriptions/dashboard/_team_name_mixin.pug b/services/web/app/views/subscriptions/dashboard/_team_name_mixin.pug index a17966f93f..f840cecfcb 100644 --- a/services/web/app/views/subscriptions/dashboard/_team_name_mixin.pug +++ b/services/web/app/views/subscriptions/dashboard/_team_name_mixin.pug @@ -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 diff --git a/services/web/app/views/subscriptions/dashboard/_v1_subscription_status.pug b/services/web/app/views/subscriptions/dashboard/_v1_subscription_status.pug index 27b58dbe0e..54df7bda2f 100644 --- a/services/web/app/views/subscriptions/dashboard/_v1_subscription_status.pug +++ b/services/web/app/views/subscriptions/dashboard/_v1_subscription_status.pug @@ -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 | diff --git a/services/web/app/views/subscriptions/successful_subscription.pug b/services/web/app/views/subscriptions/successful_subscription.pug index 36a75fa64f..294efeb6dc 100644 --- a/services/web/app/views/subscriptions/successful_subscription.pug +++ b/services/web/app/views/subscriptions/successful_subscription.pug @@ -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})} diff --git a/services/web/app/views/subscriptions/team/invite.pug b/services/web/app/views/subscriptions/team/invite.pug index 3a8d1464ea..c7f49d9354 100644 --- a/services/web/app/views/subscriptions/team/invite.pug +++ b/services/web/app/views/subscriptions/team/invite.pug @@ -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 diff --git a/services/web/app/views/translations/translation_message.pug b/services/web/app/views/translations/translation_message.pug index b8f6c2274f..a5b57320cb 100644 --- a/services/web/app/views/translations/translation_message.pug +++ b/services/web/app/views/translations/translation_message.pug @@ -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'])}