summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGerben <gerben@treora.com>2018-03-23 15:10:42 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2018-03-23 22:10:42 +0800
commit2dc6f15eca007105fb6c3972265e6da53696bdf1 (patch)
tree2775c7b19061663edf401d3af1adc87bb86c5453 /templates
parente64aa18dc97f2cf25bc642c7d987a4a3bed494ac (diff)
downloadgitea-2dc6f15eca007105fb6c3972265e6da53696bdf1.tar.gz
gitea-2dc6f15eca007105fb6c3972265e6da53696bdf1.zip
Don't warn users about *every* dirty form (#3707)
The choice regarding which forms should or should not trigger a warning is subjective. I tried to be consistent and not warn about forms that: - run an action, rather than edit data: search, send an email. - delete data: a warning about losing data would be confusing Note that forms on sign-in pages were already ignored (using a selector, rather than an explicit class on the form element). Fixes #3698.
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/base/search.tmpl2
-rw-r--r--templates/admin/config.tmpl2
-rw-r--r--templates/explore/code.tmpl2
-rw-r--r--templates/explore/search.tmpl2
-rw-r--r--templates/org/settings/delete.tmpl2
-rw-r--r--templates/repo/commits_table.tmpl2
-rw-r--r--templates/repo/home.tmpl2
-rw-r--r--templates/repo/issue/search.tmpl2
-rw-r--r--templates/repo/search.tmpl2
-rw-r--r--templates/user/auth/activate.tmpl2
-rw-r--r--templates/user/auth/forgot_passwd.tmpl2
-rw-r--r--templates/user/auth/reset_passwd.tmpl2
-rw-r--r--templates/user/settings/applications.tmpl2
-rw-r--r--templates/user/settings/delete.tmpl2
14 files changed, 14 insertions, 14 deletions
diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl
index 749e42af2d..7d23e51c89 100644
--- a/templates/admin/base/search.tmpl
+++ b/templates/admin/base/search.tmpl
@@ -17,7 +17,7 @@
</div>
</div>
</div>
-<form class="ui form" style="max-width: 90%">
+<form class="ui form ignore-dirty" style="max-width: 90%">
<div class="ui fluid action input">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index fd9f4f3303..7c353ad301 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -185,7 +185,7 @@
{{end}}
<dt>{{.i18n.Tr "admin.config.mailer_user"}}</dt>
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br>
- <form class="ui form" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
+ <form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
{{.CsrfTokenHtml}}
<div class="inline field ui left">
<div class="ui input">
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl
index 6003486213..742ed59442 100644
--- a/templates/explore/code.tmpl
+++ b/templates/explore/code.tmpl
@@ -2,7 +2,7 @@
<div class="explore users">
{{template "explore/navbar" .}}
<div class="ui container">
- <form class="ui form" style="max-width: 100%">
+ <form class="ui form ignore-dirty" style="max-width: 100%">
<div class="ui fluid action input">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
<input type="hidden" name="tab" value="{{$.TabName}}">
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl
index 6f37bcb236..906dd06caf 100644
--- a/templates/explore/search.tmpl
+++ b/templates/explore/search.tmpl
@@ -15,7 +15,7 @@
</div>
</div>
</div>
-<form class="ui form" style="max-width: 90%">
+<form class="ui form ignore-dirty" style="max-width: 90%">
<div class="ui fluid action input">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
<input type="hidden" name="tab" value="{{$.TabName}}">
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
index dc1858e5c4..3b0ee09b17 100644
--- a/templates/org/settings/delete.tmpl
+++ b/templates/org/settings/delete.tmpl
@@ -13,7 +13,7 @@
<div class="ui red message">
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}</p>
</div>
- <form class="ui form" id="delete-form" action="{{.Link}}" method="post">
+ <form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input class="fake" type="password">
<div class="inline required field {{if .Err_Password}}error{{end}}">
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 4503976e0e..8a8e2c369e 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -5,7 +5,7 @@
</div>
<div class="ten wide right aligned column">
{{if .PageIsCommits}}
- <form action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
+ <form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
<div class="ui tiny search input">
<input name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
</div>
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 91db56c98f..9f705c967c 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -10,7 +10,7 @@
</div>
{{if .RepoSearchEnabled}}
<div class="ui repo-search">
- <form class="ui form" action="{{.RepoLink}}/search" method="get">
+ <form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get">
<div class="field">
<div class="ui action input">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.search.search_repo"}}">
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl
index 5e0f9a562d..522bced3cf 100644
--- a/templates/repo/issue/search.tmpl
+++ b/templates/repo/issue/search.tmpl
@@ -1,4 +1,4 @@
-<form class="ui form">
+<form class="ui form ignore-dirty">
<div class="ui fluid action input">
<input type="hidden" name="type" value="{{$.ViewType}}"/>
<input type="hidden" name="state" value="{{$.State}}"/>
diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl
index 3ddc5de86c..c4413e7884 100644
--- a/templates/repo/search.tmpl
+++ b/templates/repo/search.tmpl
@@ -3,7 +3,7 @@
{{template "repo/header" .}}
<div class="ui container">
<div class="ui repo-search">
- <form class="ui form" method="get">
+ <form class="ui form ignore-dirty" method="get">
<div class="ui fluid action input">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.search.search_repo"}}">
<button class="ui button" type="submit">
diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl
index 9805067ae1..92b85a1373 100644
--- a/templates/user/auth/activate.tmpl
+++ b/templates/user/auth/activate.tmpl
@@ -2,7 +2,7 @@
<div class="user activate">
<div class="ui middle very relaxed page grid">
<div class="column">
- <form class="ui form" action="{{AppSubUrl}}/user/activate" method="post">
+ <form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/activate" method="post">
{{.CsrfTokenHtml}}
<h2 class="ui top attached header">
{{.i18n.Tr "auth.active_your_account"}}
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl
index 2aeee300f0..1e061763a5 100644
--- a/templates/user/auth/forgot_passwd.tmpl
+++ b/templates/user/auth/forgot_passwd.tmpl
@@ -2,7 +2,7 @@
<div class="user forgot password">
<div class="ui middle very relaxed page grid">
<div class="column">
- <form class="ui form" action="{{.Link}}" method="post">
+ <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h2 class="ui top attached header">
{{.i18n.Tr "auth.forgot_password_title"}}
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl
index 2408d39a7c..19a7c8eea8 100644
--- a/templates/user/auth/reset_passwd.tmpl
+++ b/templates/user/auth/reset_passwd.tmpl
@@ -2,7 +2,7 @@
<div class="user reset password">
<div class="ui middle very relaxed page grid">
<div class="column">
- <form class="ui form" action="{{.Link}}" method="post">
+ <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input name="code" type="hidden" value="{{.Code}}">
<h2 class="ui top attached header">
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl
index 93b2f992df..66a011ac9a 100644
--- a/templates/user/settings/applications.tmpl
+++ b/templates/user/settings/applications.tmpl
@@ -38,7 +38,7 @@
{{.i18n.Tr "settings.generate_new_token"}}
</h4>
<div class="ui attached segment">
- <form class="ui form" action="{{.Link}}" method="post">
+ <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<p>{{.i18n.Tr "settings.new_token_desc"}}</p>
<div class="field {{if .Err_Name}}error{{end}}">
diff --git a/templates/user/settings/delete.tmpl b/templates/user/settings/delete.tmpl
index 77ddda837b..76ac7233bd 100644
--- a/templates/user/settings/delete.tmpl
+++ b/templates/user/settings/delete.tmpl
@@ -10,7 +10,7 @@
<div class="ui red message">
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p>
</div>
- <form class="ui form" id="delete-form" action="{{.Link}}" method="post">
+ <form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input class="fake" type="password">
<div class="required field {{if .Err_Password}}error{{end}}">