瀏覽代碼

Merge pull request #1914 from overleaf/jel-no-pw-message

Check for password on delete modal

GitOrigin-RevId: a2ec40b9c73e92490a9dfd0377b10f9d1831f56f
Timothée Alby 7 年之前
父節點
當前提交
e029616ed4
共有 1 個文件被更改,包括 38 次插入 和 32 次删除
  1. 38 32
      services/web/app/views/user/settings.pug

+ 38 - 32
services/web/app/views/user/settings.pug

@@ -232,41 +232,47 @@ block content
 							| If you want to remove your projects from Overleaf v1, you must do this before you
 							| delete your account by going to your My Projects page in Overleaf v1, moving your
 							| projects to the Trash, and then from there either ‘leaving’ or ‘purging’ them, as appropriate.
-			form(novalidate, name="deleteAccountForm")
-				label #{translate('email')}
-				input.form-control(
-					type="text",
-					autocomplete="off",
-					placeholder="",
-					ng-model="state.deleteText",
-					focus-on="open",
-					ng-keyup="checkValidation()"
-				)
 
-				label #{translate('password')}
-				input.form-control(
-					type="password",
-					autocomplete="off",
-					placeholder="",
-					ng-model="state.password",
-					ng-keyup="checkValidation()"
-				)
+			if settings.overleaf && !hasPassword
+				p
+					b
+						| #[a(href="/user/password/reset", target='_blank') #{translate("delete_acct_no_existing_pw")}].
+			else
+				form(novalidate, name="deleteAccountForm")
+					label #{translate('email')}
+					input.form-control(
+						type="text",
+						autocomplete="off",
+						placeholder="",
+						ng-model="state.deleteText",
+						focus-on="open",
+						ng-keyup="checkValidation()"
+					)
 
-				div.confirmation-checkbox-wrapper
-					input(
-						type="checkbox"
-						ng-model="state.confirmV1Purge"
-						ng-change="checkValidation()"
-					).pull-left
-					label(style="display: inline")  I have left, purged or imported my projects on Overleaf v1 (if any)  
+					label #{translate('password')}
+					input.form-control(
+						type="password",
+						autocomplete="off",
+						placeholder="",
+						ng-model="state.password",
+						ng-keyup="checkValidation()"
+					)
 
-				div.confirmation-checkbox-wrapper
-					input(
-						type="checkbox"
-						ng-model="state.confirmSharelatexDelete"
-						ng-change="checkValidation()"
-					).pull-left
-					label(style="display: inline")  I understand this will delete all projects in my Overleaf v2 account (and ShareLaTeX account, if any) with email address #[em {{ userDefaultEmail }}]
+					div.confirmation-checkbox-wrapper
+						input(
+							type="checkbox"
+							ng-model="state.confirmV1Purge"
+							ng-change="checkValidation()"
+						).pull-left
+						label(style="display: inline")  I have left, purged or imported my projects on Overleaf v1 (if any)  
+
+					div.confirmation-checkbox-wrapper
+						input(
+							type="checkbox"
+							ng-model="state.confirmSharelatexDelete"
+							ng-change="checkValidation()"
+						).pull-left
+						label(style="display: inline")  I understand this will delete all projects in my Overleaf v2 account (and ShareLaTeX account, if any) with email address #[em {{ userDefaultEmail }}]
 
 			div(ng-if="state.error")
 				div.alert.alert-danger(ng-switch="state.error.code")