diff --git a/public/js/index.js b/public/js/index.js index 1e795a504..8b3d7c3d7 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1663,8 +1663,11 @@ function selectRange($list, $select, $from) { } $(function () { - if ($('.user.signin').length > 0) return; - $('form').areYouSure(); + // Warn users that try to leave a page after entering data into a form. + // Except on sign-in pages, and for forms marked as 'ignore-dirty'. + if ($('.user.signin').length === 0) { + $('form:not(.ignore-dirty)').areYouSure(); + } // Parse SSH Key $("#ssh-key-content").on('change paste keyup',function(){ diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index 749e42af2..7d23e51c8 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -17,7 +17,7 @@ -
+
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index fd9f4f330..7c353ad30 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -185,7 +185,7 @@ {{end}}
{{.i18n.Tr "admin.config.mailer_user"}}
{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}

- + {{.CsrfTokenHtml}}
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl index 600348621..742ed5944 100644 --- a/templates/explore/code.tmpl +++ b/templates/explore/code.tmpl @@ -2,7 +2,7 @@
{{template "explore/navbar" .}}
- +
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl index 6f37bcb23..906dd06ca 100644 --- a/templates/explore/search.tmpl +++ b/templates/explore/search.tmpl @@ -15,7 +15,7 @@
- +
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl index dc1858e5c..3b0ee09b1 100644 --- a/templates/org/settings/delete.tmpl +++ b/templates/org/settings/delete.tmpl @@ -13,7 +13,7 @@

{{.i18n.Tr "org.settings.delete_prompt" | Str2html}}

- + {{.CsrfTokenHtml}}
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 4503976e0..8a8e2c369 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -5,7 +5,7 @@
{{if .PageIsCommits}} - + diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 91db56c98..9f705c967 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -10,7 +10,7 @@
{{if .RepoSearchEnabled}}