From d848098f60f78e6b4a72ae7f769fd66399a8ba82 Mon Sep 17 00:00:00 2001
From: silverwind <me@silverwind.io>
Date: Sun, 11 Apr 2021 05:46:37 +0200
Subject: [PATCH] Enforce tab indentation in templates (#15289)

* Enforce tab indendation in templates

This adds editorconfig-checker [1] to lint the template files so they
conform the editorconfig files. I fixed all current identation issues
using the fix mode of eclint [2] and some manual corrections.

We can extend this linting to other files later, for now I'd like this
PR to focus on HTML template files only.

[1] https://github.com/editorconfig-checker/editorconfig-checker
[2] https://github.com/jedmao/eclint

* fix indendation

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
---
 .editorconfig                                 |   6 +
 Makefile                                      |   1 +
 package-lock.json                             |  70 +++++
 package.json                                  |   1 +
 templates/admin/auth/edit.tmpl                |  10 +-
 templates/admin/auth/new.tmpl                 |   4 +-
 templates/admin/auth/source/ldap.tmpl         |   4 +-
 templates/admin/auth/source/oauth.tmpl        |   6 +-
 templates/admin/base/search.tmpl              |   4 +-
 templates/admin/repo/list.tmpl                |   2 +-
 templates/admin/repo/unadopted.tmpl           | 180 ++++++------
 templates/base/alert_details.tmpl             |   8 +-
 templates/base/head.tmpl                      |   2 +-
 templates/explore/code.tmpl                   |   1 -
 templates/explore/organizations.tmpl          |  34 +--
 templates/explore/repo_search.tmpl            |  44 +--
 templates/explore/search.tmpl                 |   4 +-
 templates/explore/users.tmpl                  |  24 +-
 templates/mail/issue/assigned.tmpl            |  10 +-
 templates/mail/issue/default.tmpl             |   2 +-
 templates/mail/notify/collaborator.tmpl       |  10 +-
 templates/mail/release.tmpl                   |   2 +-
 templates/org/home.tmpl                       |   6 +-
 templates/org/settings/labels.tmpl            |   2 +-
 templates/org/team/navbar.tmpl                |   4 +-
 templates/post-install.tmpl                   |   2 +-
 templates/repo/activity.tmpl                  |   2 +-
 templates/repo/blame.tmpl                     |   4 +-
 templates/repo/branch/list.tmpl               |  10 +-
 templates/repo/commit_page.tmpl               |  18 +-
 templates/repo/commits_table.tmpl             |   2 +-
 templates/repo/diff/compare.tmpl              |   6 +-
 templates/repo/diff/csv_diff.tmpl             |   2 +-
 templates/repo/diff/image_diff.tmpl           |   2 +-
 templates/repo/diff/new_review.tmpl           |  12 +-
 templates/repo/editor/edit.tmpl               |   6 +-
 templates/repo/header.tmpl                    |   2 +-
 .../repo/issue/branch_selector_field.tmpl     |   4 +-
 templates/repo/issue/comment_tab.tmpl         |   2 +-
 .../repo/issue/labels/edit_delete_label.tmpl  |   1 -
 .../issue/labels/label_load_template.tmpl     |   3 +-
 templates/repo/issue/milestone_issues.tmpl    |  32 +--
 templates/repo/issue/milestones.tmpl          |   2 +-
 templates/repo/issue/view_content.tmpl        |   6 +-
 .../repo/issue/view_content/attachments.tmpl  |  76 ++---
 .../repo/issue/view_content/comments.tmpl     |  20 +-
 templates/repo/issue/view_title.tmpl          |  56 ++--
 templates/repo/migrate/github.tmpl            |   2 +-
 templates/repo/migrate/gitlab.tmpl            |   2 +-
 templates/repo/migrate/gogs.tmpl              |   2 +-
 templates/repo/pulls/status.tmpl              |  58 ++--
 templates/repo/release/list.tmpl              |   2 +-
 templates/repo/settings/branches.tmpl         |  62 ++---
 templates/repo/settings/deploy_keys.tmpl      |   6 +-
 templates/repo/settings/webhook/matrix.tmpl   |  38 +--
 templates/repo/settings/webhook/telegram.tmpl |   8 +-
 templates/repo/view_file.tmpl                 |  10 +-
 templates/repo/wiki/revision.tmpl             |   2 +-
 templates/shared/issuelist.tmpl               |   4 +-
 templates/user/auth/signup_openid_navbar.tmpl |   1 -
 templates/user/auth/twofa.tmpl                |   2 +-
 templates/user/dashboard/issues.tmpl          |   2 +-
 templates/user/dashboard/milestones.tmpl      |  90 +++---
 .../user/notification/notification_div.tmpl   | 260 +++++++++---------
 templates/user/settings/keys_gpg.tmpl         |   2 +-
 templates/user/settings/repos.tmpl            |   2 +-
 templates/user/settings/security_u2f.tmpl     |  21 +-
 67 files changed, 678 insertions(+), 609 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 54738e8838..b7ff926c34 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -12,6 +12,12 @@ insert_final_newline = true
 [*.{go,tmpl,html}]
 indent_style = tab
 
+[templates/custom/*.tmpl]
+insert_final_newline = false
+
+[templates/swagger/v1_json.tmpl]
+indent_style = space
+
 [Makefile]
 indent_style = tab
 
diff --git a/Makefile b/Makefile
index e8738c9289..dcfaf89a8a 100644
--- a/Makefile
+++ b/Makefile
@@ -325,6 +325,7 @@ lint: lint-frontend lint-backend
 lint-frontend: node_modules
 	npx eslint --color --max-warnings=0 web_src/js build templates *.config.js
 	npx stylelint --color --max-warnings=0 web_src/less
+	npx editorconfig-checker templates
 
 .PHONY: lint-backend
 lint-backend: golangci-lint revive vet
diff --git a/package-lock.json b/package-lock.json
index 2c1dd4f6b4..3777c6b72d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1570,6 +1570,32 @@
       "resolved": "https://registry.npmjs.org/add-asset-webpack-plugin/-/add-asset-webpack-plugin-2.0.1.tgz",
       "integrity": "sha512-Hx9EKnirCUfdh684y1yhx8QOFolpkIG2VRHHgNm8wFy1Cf7P3RGwS678hoN7Y1XvZRPpVXWa+6QnfL/2i0CMCA=="
     },
+    "agent-base": {
+      "version": "6.0.2",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+      "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
+      "dev": true,
+      "requires": {
+        "debug": "4"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "4.3.1",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+          "dev": true,
+          "requires": {
+            "ms": "2.1.2"
+          }
+        },
+        "ms": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+          "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+          "dev": true
+        }
+      }
+    },
     "aggregate-error": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
@@ -3388,6 +3414,17 @@
         "safer-buffer": "^2.1.0"
       }
     },
+    "editorconfig-checker": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/editorconfig-checker/-/editorconfig-checker-4.0.2.tgz",
+      "integrity": "sha512-tUI7ABIzMB1kfwTUQmX+gaZGCMNuUgGuRHJ+Xu4Tk9T8lV8Vy5w/EaQsSZ7NKrOgLxbekptw6MUgrzHTvhceLw==",
+      "dev": true,
+      "requires": {
+        "https-proxy-agent": "^5.0.0",
+        "node-fetch": "^2.6.0",
+        "tar": "^6.0.0"
+      }
+    },
     "electron-to-chromium": {
       "version": "1.3.707",
       "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
@@ -4936,6 +4973,33 @@
         "sshpk": "^1.7.0"
       }
     },
+    "https-proxy-agent": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
+      "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
+      "dev": true,
+      "requires": {
+        "agent-base": "6",
+        "debug": "4"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "4.3.1",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+          "dev": true,
+          "requires": {
+            "ms": "2.1.2"
+          }
+        },
+        "ms": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+          "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+          "dev": true
+        }
+      }
+    },
     "human-signals": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
@@ -8107,6 +8171,12 @@
         "lower-case": "^1.1.1"
       }
     },
+    "node-fetch": {
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
+      "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
+      "dev": true
+    },
     "node-int64": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
diff --git a/package.json b/package.json
index 20a64856f8..430e98c079 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,7 @@
   },
   "devDependencies": {
     "eslint": "7.23.0",
+    "editorconfig-checker": "4.0.2",
     "eslint-plugin-html": "6.1.2",
     "eslint-plugin-import": "2.22.1",
     "eslint-plugin-unicorn": "29.0.0",
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index da1ea42a74..e14c3be761 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -96,8 +96,8 @@
 						<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="e.g. mail" required>
 					</div>
 					<div class="field">
-					    <label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label>
-					    <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="e.g. SshPublicKey">
+						<label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label>
+						<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="e.g. SshPublicKey">
 					</div>
 					<div class="inline field">
 						<div class="ui checkbox">
@@ -215,9 +215,9 @@
 						<input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required>
 					</div>
 					<div class="optional field">
-            <label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label>
-            <input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}">
-          </div>
+						<label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label>
+						<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}">
+					</div>
 					<div class="open_id_connect_auto_discovery_url required field">
 						<label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
 						<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}">
diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl
index c252f7d3f2..36a5d2c632 100644
--- a/templates/admin/auth/new.tmpl
+++ b/templates/admin/auth/new.tmpl
@@ -119,8 +119,8 @@
 				<span>{{.i18n.Tr "admin.auths.tip.nextcloud"}}</span>
 				<li>Yandex</li>
 				<span>{{.i18n.Tr "admin.auths.tip.yandex"}}</span>
-        <li>Mastodon</li>
-        <span>{{.i18n.Tr "admin.auths.tip.mastodon"}}</span>
+				<li>Mastodon</li>
+				<span>{{.i18n.Tr "admin.auths.tip.mastodon"}}</span>
 			</div>
 		</div>
 	</div>
diff --git a/templates/admin/auth/source/ldap.tmpl b/templates/admin/auth/source/ldap.tmpl
index dbadd31f14..584538f53b 100644
--- a/templates/admin/auth/source/ldap.tmpl
+++ b/templates/admin/auth/source/ldap.tmpl
@@ -68,8 +68,8 @@
 		<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="e.g. mail">
 	</div>
 	<div class="field">
-	    <label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label>
-	    <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="e.g. SshPublicKey">
+		<label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label>
+		<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="e.g. SshPublicKey">
 	</div>
 	<div class="inline field">
 		<div class="ui checkbox">
diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl
index 1489ab8394..787e29873d 100644
--- a/templates/admin/auth/source/oauth.tmpl
+++ b/templates/admin/auth/source/oauth.tmpl
@@ -21,9 +21,9 @@
 		<input id="oauth2_secret" name="oauth2_secret" value="{{.oauth2_secret}}">
 	</div>
 	<div class="optional field">
-  	<label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label>
-  	<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{.oauth2_icon_url}}">
-  </div>
+		<label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label>
+		<input id="oauth2_icon_url" name="oauth2_icon_url" value="{{.oauth2_icon_url}}">
+	</div>
 	<div class="open_id_connect_auto_discovery_url required field">
 		<label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
 		<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}">
diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl
index 8a7af53da5..e4e7e2d462 100644
--- a/templates/admin/base/search.tmpl
+++ b/templates/admin/base/search.tmpl
@@ -17,7 +17,7 @@
 </div>
 <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>
+		<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
+		<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
 	</div>
 </form>
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl
index aff30ab510..dbd1ad6921 100644
--- a/templates/admin/repo/list.tmpl
+++ b/templates/admin/repo/list.tmpl
@@ -7,7 +7,7 @@
 			{{.i18n.Tr "admin.repos.repo_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}})
 			<div class="ui right">
 				<a class="ui blue tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{.i18n.Tr "admin.repos.unadopted"}}</a>
-            </div>
+			</div>
 		</h4>
 		<div class="ui attached segment">
 			{{template "admin/repo/search" .}}
diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl
index 481d77dfd2..b1f172720a 100644
--- a/templates/admin/repo/unadopted.tmpl
+++ b/templates/admin/repo/unadopted.tmpl
@@ -5,98 +5,98 @@
 		{{template "base/alert" .}}
 		<h4 class="ui top attached header">
 			{{.i18n.Tr "admin.repos.unadopted"}}
-            <div class="ui right">
-                <a class="ui blue tiny button" href="{{AppSubUrl}}/admin/repos">{{.i18n.Tr "admin.repos.repo_manage_panel"}}</a>
-            </div>
+			<div class="ui right">
+				<a class="ui blue tiny button" href="{{AppSubUrl}}/admin/repos">{{.i18n.Tr "admin.repos.repo_manage_panel"}}</a>
+			</div>
 		</h4>
-        <div class="ui attached segment">
-            <form class="ui form ignore-dirty">
-                <div class="ui fluid action input">
-                <input name="search" value="true" type="hidden">
-                <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.adopt_search"}}" autofocus>
-                <button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
-                </div>
-            </form>
+		<div class="ui attached segment">
+			<form class="ui form ignore-dirty">
+				<div class="ui fluid action input">
+				<input name="search" value="true" type="hidden">
+				<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.adopt_search"}}" autofocus>
+				<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
+				</div>
+			</form>
 		</div>
-        {{if .search}}
-            <div class="ui attached segment settings">
-                {{if .Dirs}}
-                    <div class="ui middle aligned divided list">
-                        {{range $dirI, $dir := .Dirs}}
-                            <div class="item">
-                                <div class="content">
-                                    <span class="icon">{{svg "octicon-file-directory"}}</span>
-                                    <span class="name">{{$dir}}</span>
-                                    <div class="right floated content">
-                                        <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.i18n.Tr "repo.adopt_preexisting_label"}}</span></button>
-                                        <div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}">
-                                            {{svg "octicon-x" 16 "close inside"}}
-                                            <div class="header">
-                                                <span class="label">{{$.i18n.Tr "repo.adopt_preexisting"}}</span>
-                                            </div>
-                                            <div class="content">
-                                                <p>{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}</p>
-                                            </div>
-                                            <form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
-                                                {{$.CsrfTokenHtml}}
-                                                <input type="hidden" name="id" value="{{$dir}}">
-                                                <input type="hidden" name="action" value="adopt">
-																								<input type="hidden" name="q" value="{{$.Keyword}}">
-																								<input type="hidden" name="page" value="{{$.CurrentPage}}">
-                                                <div class="actions">
-                                                    <div class="ui red basic inverted cancel button">
-                                                        {{svg "octicon-trash" 16 "mr-2"}}
-                                                        {{$.i18n.Tr "modal.no"}}
-                                                    </div>
-                                                    <button class="ui green basic inverted ok button">
-                                                        {{svg "octicon-check" 16 "mr-2"}}
-                                                        {{$.i18n.Tr "modal.yes"}}
-                                                    </button>
-                                                </div>
-                                            </form>
-                                        </div>
-                                        <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.i18n.Tr "repo.delete_preexisting_label"}}</span></button>
-                                        <div class="ui basic modal" id="delete-unadopted-modal-{{$dirI}}">
-                                            {{svg "octicon-x" 16 "close inside"}}
-                                            <div class="header">
-                                                <span class="label">{{$.i18n.Tr "repo.delete_preexisting"}}</span>
-                                            </div>
-                                            <div class="content">
-                                                <p>{{$.i18n.Tr "repo.delete_preexisting_content" $dir}}</p>
-                                            </div>
-                                            <form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
-                                                {{$.CsrfTokenHtml}}
-                                                <input type="hidden" name="id" value="{{$dir}}">
-                                                <input type="hidden" name="action" value="delete">
-																								<input type="hidden" name="q" value="{{$.Keyword}}">
-																								<input type="hidden" name="page" value="{{$.CurrentPage}}">
-                                                <div class="actions">
-                                                    <div class="ui red basic inverted cancel button">
-                                                        {{svg "octicon-trash" 16 "mr-2"}}
-                                                        {{$.i18n.Tr "modal.no"}}
-                                                    </div>
-                                                    <button class="ui green basic inverted ok button">
-                                                        {{svg "octicon-check" 16 "mr-2"}}
-                                                        {{$.i18n.Tr "modal.yes"}}
-                                                    </button>
-                                                </div>
-                                            </form>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        {{end}}
-                    </div>
-                    {{template "base/paginate" .}}
-                {{else}}
-                    <div class="item">
-                        {{.i18n.Tr "admin.repos.unadopted.no_more"}}
-                    </div>
-                    {{template "base/paginate" .}}
-                {{end}}
-            </div>
-        {{end}}
-    </div>
+		{{if .search}}
+			<div class="ui attached segment settings">
+				{{if .Dirs}}
+					<div class="ui middle aligned divided list">
+						{{range $dirI, $dir := .Dirs}}
+							<div class="item">
+								<div class="content">
+									<span class="icon">{{svg "octicon-file-directory"}}</span>
+									<span class="name">{{$dir}}</span>
+									<div class="right floated content">
+										<button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.i18n.Tr "repo.adopt_preexisting_label"}}</span></button>
+										<div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}">
+											{{svg "octicon-x" 16 "close inside"}}
+											<div class="header">
+												<span class="label">{{$.i18n.Tr "repo.adopt_preexisting"}}</span>
+											</div>
+											<div class="content">
+												<p>{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}</p>
+											</div>
+											<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
+												{{$.CsrfTokenHtml}}
+												<input type="hidden" name="id" value="{{$dir}}">
+												<input type="hidden" name="action" value="adopt">
+												<input type="hidden" name="q" value="{{$.Keyword}}">
+												<input type="hidden" name="page" value="{{$.CurrentPage}}">
+												<div class="actions">
+													<div class="ui red basic inverted cancel button">
+														{{svg "octicon-trash" 16 "mr-2"}}
+														{{$.i18n.Tr "modal.no"}}
+													</div>
+													<button class="ui green basic inverted ok button">
+														{{svg "octicon-check" 16 "mr-2"}}
+														{{$.i18n.Tr "modal.yes"}}
+													</button>
+												</div>
+											</form>
+										</div>
+										<button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.i18n.Tr "repo.delete_preexisting_label"}}</span></button>
+										<div class="ui basic modal" id="delete-unadopted-modal-{{$dirI}}">
+											{{svg "octicon-x" 16 "close inside"}}
+											<div class="header">
+												<span class="label">{{$.i18n.Tr "repo.delete_preexisting"}}</span>
+											</div>
+											<div class="content">
+												<p>{{$.i18n.Tr "repo.delete_preexisting_content" $dir}}</p>
+											</div>
+											<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
+												{{$.CsrfTokenHtml}}
+												<input type="hidden" name="id" value="{{$dir}}">
+												<input type="hidden" name="action" value="delete">
+												<input type="hidden" name="q" value="{{$.Keyword}}">
+												<input type="hidden" name="page" value="{{$.CurrentPage}}">
+												<div class="actions">
+													<div class="ui red basic inverted cancel button">
+														{{svg "octicon-trash" 16 "mr-2"}}
+														{{$.i18n.Tr "modal.no"}}
+													</div>
+													<button class="ui green basic inverted ok button">
+														{{svg "octicon-check" 16 "mr-2"}}
+														{{$.i18n.Tr "modal.yes"}}
+													</button>
+												</div>
+											</form>
+										</div>
+									</div>
+								</div>
+							</div>
+						{{end}}
+					</div>
+					{{template "base/paginate" .}}
+				{{else}}
+					<div class="item">
+						{{.i18n.Tr "admin.repos.unadopted.no_more"}}
+					</div>
+					{{template "base/paginate" .}}
+				{{end}}
+			</div>
+		{{end}}
+	</div>
 </div>
 
 {{template "base/footer" .}}
diff --git a/templates/base/alert_details.tmpl b/templates/base/alert_details.tmpl
index 38a2721bf8..1d7ec15dc0 100644
--- a/templates/base/alert_details.tmpl
+++ b/templates/base/alert_details.tmpl
@@ -1,7 +1,7 @@
 {{.Message}}
 <details>
-    <summary>{{.Summary}}</summary>
-    <code>
-        {{.Details | Str2html}}
-    </code>
+	<summary>{{.Summary}}</summary>
+	<code>
+		{{.Details | Str2html}}
+	</code>
 </details>
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 74bca72399..d8d24c61ea 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -55,7 +55,7 @@
 				name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.RelAvatarLink}}'}],
 				{{ end }}
 				{{ range .MentionableTeams }}
-					['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}', 
+					['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}',
 					name: '{{$.MentionableTeamsOrg}}/{{.Name}}', avatar: '{{$.MentionableTeamsOrgAvatar}}'}],
 				{{ end }}
 			]).values()),
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl
index 222bbb8aae..6332413a17 100644
--- a/templates/explore/code.tmpl
+++ b/templates/explore/code.tmpl
@@ -18,7 +18,6 @@
 			</div>
 		</form>
 		<div class="ui divider"></div>
-
 		<div class="ui user list">
 			{{if .SearchResults}}
 				<h3>
diff --git a/templates/explore/organizations.tmpl b/templates/explore/organizations.tmpl
index b039c1ad2a..b2fee6c19a 100644
--- a/templates/explore/organizations.tmpl
+++ b/templates/explore/organizations.tmpl
@@ -8,24 +8,24 @@
 			{{range .Users}}
 				<div class="item">
 					{{avatar .}}
-				  <div class="content">
-					<span class="header">
-						<a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}
-						{{if .Visibility.IsPrivate}}
-							<span class="ui basic label">{{$.i18n.Tr "repo.desc.private"}}</span>
-						{{end}}
-					</span>
-					<div class="description">
-						{{if .Location}}
-							{{svg "octicon-location"}} {{.Location}}
-						{{end}}
-						{{if and .Website}}
-							{{svg "octicon-link"}}
-							<a href="{{.Website}}" rel="nofollow">{{.Website}}</a>
-						{{end}}
-						{{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+					<div class="content">
+						<span class="header">
+							<a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}
+							{{if .Visibility.IsPrivate}}
+								<span class="ui basic label">{{$.i18n.Tr "repo.desc.private"}}</span>
+							{{end}}
+						</span>
+						<div class="description">
+							{{if .Location}}
+								{{svg "octicon-location"}} {{.Location}}
+							{{end}}
+							{{if and .Website}}
+								{{svg "octicon-link"}}
+								<a href="{{.Website}}" rel="nofollow">{{.Website}}</a>
+							{{end}}
+							{{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+						</div>
 					</div>
-				  </div>
 				</div>
 			{{else}}
 				<div>{{$.i18n.Tr "explore.org_no_results"}}</div>
diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl
index 53c5156dc9..5e7bed8b31 100644
--- a/templates/explore/repo_search.tmpl
+++ b/templates/explore/repo_search.tmpl
@@ -1,30 +1,30 @@
 <div class="ui right floated secondary filter menu">
-    <!-- Sort -->
-    <div class="ui right dropdown type jump item">
+	<!-- Sort -->
+	<div class="ui right dropdown type jump item">
 		<span class="text">
 			{{.i18n.Tr "repo.issues.filter_sort"}}
-                {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		</span>
-        <div class="menu">
-            <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
-            <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
-            <a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
-            <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
-            <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-            <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
-            <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a>
-            <a class="{{if eq .SortType "feweststars"}}active{{end}} item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.feweststars"}}</a>
-            <a class="{{if eq .SortType "mostforks"}}active{{end}} item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.mostforks"}}</a>
-            <a class="{{if eq .SortType "fewestforks"}}active{{end}} item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.fewestforks"}}</a>
-        </div>
-    </div>
+		<div class="menu">
+			<a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
+			<a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+			<a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
+			<a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+			<a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a>
+			<a class="{{if eq .SortType "feweststars"}}active{{end}} item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.feweststars"}}</a>
+			<a class="{{if eq .SortType "mostforks"}}active{{end}} item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.mostforks"}}</a>
+			<a class="{{if eq .SortType "fewestforks"}}active{{end}} item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.fewestforks"}}</a>
+		</div>
+	</div>
 </div>
 <form class="ui form ignore-dirty" style="max-width: 90%">
-    <input type="hidden" name="tab" value="{{$.TabName}}">
-    <input type="hidden" name="sort" value="{{$.SortType}}">
-    <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>
-    </div>
+	<input type="hidden" name="tab" value="{{$.TabName}}">
+	<input type="hidden" name="sort" value="{{$.SortType}}">
+	<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>
+	</div>
 </form>
 <div class="ui divider"></div>
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl
index d9d2f3b9a3..245cc9f345 100644
--- a/templates/explore/search.tmpl
+++ b/templates/explore/search.tmpl
@@ -18,8 +18,8 @@
 <form class="ui form ignore-dirty" style="max-width: 90%">
 	<input type="hidden" name="tab" value="{{$.TabName}}">
 	<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>
+		<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
+		<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
 	</div>
 </form>
 <div class="ui divider"></div>
diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl
index cdb8e9d375..dff4e8c8be 100644
--- a/templates/explore/users.tmpl
+++ b/templates/explore/users.tmpl
@@ -8,19 +8,19 @@
 			{{range .Users}}
 				<div class="item">
 					{{avatar .}}
-				  <div class="content">
-					<span class="header"><a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}</span>
-					<div class="description">
-						{{if .Location}}
-							{{svg "octicon-location"}} {{.Location}}
-						{{end}}
-						{{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}}
-							{{svg "octicon-mail"}}
-							<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
-						{{end}}
-						{{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+					<div class="content">
+						<span class="header"><a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}</span>
+						<div class="description">
+							{{if .Location}}
+								{{svg "octicon-location"}} {{.Location}}
+							{{end}}
+							{{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}}
+								{{svg "octicon-mail"}}
+								<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
+							{{end}}
+							{{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
+						</div>
 					</div>
-				  </div>
 				</div>
 			{{else}}
 				<div>{{$.i18n.Tr "explore.user_no_results"}}</div>
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl
index d302a16f26..5b0d2526f1 100644
--- a/templates/mail/issue/assigned.tmpl
+++ b/templates/mail/issue/assigned.tmpl
@@ -11,11 +11,11 @@
 <body>
 	<p>@{{.Doer.Name}} assigned you to the {{if .IsPull}}pull request{{else}}issue{{end}} <a href="{{.Link}}">#{{.Issue.Index}}</a> in repository {{.Repo}}.</p>
 	<div class="footer">
-	    <p>
-	        ---
-	        <br>
-	        <a href="{{.Link}}">View it on {{AppName}}</a>.
-	    </p>
+		<p>
+			---
+			<br>
+			<a href="{{.Link}}">View it on {{AppName}}</a>.
+		</p>
 	</div>
 </body>
 </html>
diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl
index b7d576bef4..4b492dad8a 100644
--- a/templates/mail/issue/default.tmpl
+++ b/templates/mail/issue/default.tmpl
@@ -19,7 +19,7 @@
 	{{if .IsMention}}<p><b>@{{.Doer.Name}}</b> mentioned you:</p>{{end}}
 	{{if eq .ActionName "push"}}
 		<p>
-			<b>{{.Doer.Name}}</b>  
+			<b>{{.Doer.Name}}</b>
 			{{if .Comment.IsForcePush}}
 				{{ $oldCommitLink:= printf "%s%s/%s/commit/%s" AppUrl  .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.OldCommit}}
 				{{ $newCommitLink:= printf "%s%s/%s/commit/%s" AppUrl  .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.NewCommit}}
diff --git a/templates/mail/notify/collaborator.tmpl b/templates/mail/notify/collaborator.tmpl
index 947b404399..19a2431023 100644
--- a/templates/mail/notify/collaborator.tmpl
+++ b/templates/mail/notify/collaborator.tmpl
@@ -11,11 +11,11 @@
 <body>
 	<p>You have been added as a collaborator of repository: <code>{{.RepoName}}</code></p>
 	<div class="footer">
-	    <p>
-	        ---
-	        <br>
-	        <a href="{{.Link}}">View it on {{AppName}}</a>.
-	    </p>
+		<p>
+			---
+			<br>
+			<a href="{{.Link}}">View it on {{AppName}}</a>.
+		</p>
 	</div>
 </body>
 </html>
diff --git a/templates/mail/release.tmpl b/templates/mail/release.tmpl
index 04b8c3bf51..7829bce243 100644
--- a/templates/mail/release.tmpl
+++ b/templates/mail/release.tmpl
@@ -26,7 +26,7 @@
 	</p>
 	<br><br>
 	<p>
-		--- 
+		---
 		<br>
 		Downloads:
 		<ul>
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 25cd68291c..9b77ae6b3f 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -26,9 +26,9 @@
 			<div class="ui eleven wide column">
 				{{if .CanCreateOrgRepo}}
 					<div class="text right">
-            {{if not .DisabledMirrors}}
-						  <a class="ui green button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.i18n.Tr "new_migrate"}}</a>
-            {{end}}
+						{{if not .DisabledMirrors}}
+							<a class="ui green button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.i18n.Tr "new_migrate"}}</a>
+						{{end}}
 						<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.i18n.Tr "new_repo"}}</a>
 					</div>
 					<div class="ui divider"></div>
diff --git a/templates/org/settings/labels.tmpl b/templates/org/settings/labels.tmpl
index 61302c731a..482d1b17d0 100644
--- a/templates/org/settings/labels.tmpl
+++ b/templates/org/settings/labels.tmpl
@@ -20,7 +20,7 @@
 					{{template "base/alert" .}}
 					{{template "repo/issue/labels/label_list" .}}
 				</div>
-			</div>	
+			</div>
 		</div>
 	</div>
 </div>
diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl
index 18d638796c..b5732ed71b 100644
--- a/templates/org/team/navbar.tmpl
+++ b/templates/org/team/navbar.tmpl
@@ -1,4 +1,4 @@
 <div class="ui top attached tabular menu">
-  <a class="item{{if .PageIsOrgTeamMembers}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName}}">{{svg "octicon-person"}} <strong>{{.Team.NumMembers}}</strong>&nbsp; {{$.i18n.Tr "org.lower_members"}}</a>
-  <a class="item{{if .PageIsOrgTeamRepos}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/repositories">{{svg "octicon-repo"}} <strong>{{.Team.NumRepos}}</strong>&nbsp; {{$.i18n.Tr "org.lower_repositories"}}</a>
+	<a class="item{{if .PageIsOrgTeamMembers}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName}}">{{svg "octicon-person"}} <strong>{{.Team.NumMembers}}</strong>&nbsp; {{$.i18n.Tr "org.lower_members"}}</a>
+	<a class="item{{if .PageIsOrgTeamRepos}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/repositories">{{svg "octicon-repo"}} <strong>{{.Team.NumRepos}}</strong>&nbsp; {{$.i18n.Tr "org.lower_repositories"}}</a>
 </div>
diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl
index 62abf5ef88..4637e5a185 100644
--- a/templates/post-install.tmpl
+++ b/templates/post-install.tmpl
@@ -1,6 +1,6 @@
 {{template "base/head" .}}
 <div class="page-content install">
-    <div class="ui container">
+	<div class="ui container">
 		<div class="ui grid">
 			<div class="sixteen wide column content">
 				<div class="home">
diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl
index bcf64a3fa1..08e2a31115 100644
--- a/templates/repo/activity.tmpl
+++ b/templates/repo/activity.tmpl
@@ -93,7 +93,7 @@
 			{{if gt .Activity.Code.CommitCountInAllBranches 0}}
 				<div class="ui attached segment horizontal segments">
 					<div class="ui attached segment text">
-					    {{.i18n.Tr "repo.activity.git_stats_exclude_merges" }}
+						{{.i18n.Tr "repo.activity.git_stats_exclude_merges" }}
 						<strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n") .Activity.Code.AuthorCount }}</strong>
 						{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n") }}
 						<strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n") .Activity.Code.CommitCount }}</strong>
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl
index 5dd93d3d46..638683b25e 100644
--- a/templates/repo/blame.tmpl
+++ b/templates/repo/blame.tmpl
@@ -19,7 +19,7 @@
 			</div>
 		</div>
 	</h4>
-    <div class="ui attached table unstackable segment">
+	<div class="ui attached table unstackable segment">
 		<div class="file-view code-view">
 			<table>
 				<tbody>
@@ -31,5 +31,5 @@
 				</tbody>
 			</table>
 		</div>
-    </div>
+	</div>
 </div>
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index de4f0fb57e..caddcf69e4 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -25,11 +25,11 @@
 						</td>
 						<td class="right aligned overflow-visible">
 							<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right">
-							  {{svg "octicon-download"}}
-							  <div class="menu">
-							    <a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.zip">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
-							    <a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.tar.gz">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
-							  </div>
+								{{svg "octicon-download"}}
+								<div class="menu">
+									<a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.zip">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
+									<a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.tar.gz">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
+								</div>
 							</div>
 						</td>
 					</tr>
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 6260d2e965..01cbd5182d 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -113,13 +113,13 @@
 					<span class="ui text">{{.i18n.Tr .Verification.Reason}}</span>
 					<span class="pull-right"><span class="ui text">{{.i18n.Tr "repo.commits.gpg_key_id"}}:</span> <i class="warning icon"></i>{{.Verification.SigningKey.KeyID}}</span>
 				{{else}}
-				  <i class="unlock icon"></i>
-				  {{.i18n.Tr .Verification.Reason}}
-				  {{if .Verification.SigningKey}}
-				  	{{if ne .Verification.SigningKey.KeyID ""}}
-						<span class="pull-right"><span class="ui text">{{.i18n.Tr "repo.commits.gpg_key_id"}}:</span> <i class="warning icon"></i>{{.Verification.SigningKey.KeyID}}</span>
-				  	{{end}}
-				  {{end}}
+					<i class="unlock icon"></i>
+					{{.i18n.Tr .Verification.Reason}}
+					{{if .Verification.SigningKey}}
+						{{if ne .Verification.SigningKey.KeyID ""}}
+							<span class="pull-right"><span class="ui text">{{.i18n.Tr "repo.commits.gpg_key_id"}}:</span> <i class="warning icon"></i>{{.Verification.SigningKey.KeyID}}</span>
+						{{end}}
+					{{end}}
 				{{end}}
 			</div>
 		{{end}}
@@ -130,9 +130,9 @@
 				{{if .NoteAuthor}}
 					<a href="{{.NoteAuthor.HomeLink}}">
 						{{if .NoteAuthor.FullName}}
-						  <strong>{{.NoteAuthor.FullName}}</strong>
+							<strong>{{.NoteAuthor.FullName}}</strong>
 						{{else}}
-						  <strong>{{.NoteCommit.Author.Name}}</strong>
+							<strong>{{.NoteCommit.Author.Name}}</strong>
 						{{end}}
 					</a>
 				{{else}}
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 623df6f63e..3ef2339843 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -28,7 +28,7 @@
 </h4>
 
 {{if and .Commits (gt .CommitCount 0)}}
-    {{template "repo/commits_list" .}}
+	{{template "repo/commits_list" .}}
 {{end}}
 
 {{template "base/paginate" .}}
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index fdf65aaad3..124b4e5d1c 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -117,9 +117,9 @@
 		{{end}}
 	{{else if and .PageIsComparePull (gt .CommitCount 0)}}
 		{{if .HasPullRequest}}
-        	<div class="ui segment">
-        		{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}
-        	</div>
+			<div class="ui segment">
+				{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}
+			</div>
 		{{else}}
 			{{if and $.IsSigned (not .Repository.IsArchived)}}
 				<div class="ui info message show-form-container">
diff --git a/templates/repo/diff/csv_diff.tmpl b/templates/repo/diff/csv_diff.tmpl
index c4af70461f..b86e9d2a72 100644
--- a/templates/repo/diff/csv_diff.tmpl
+++ b/templates/repo/diff/csv_diff.tmpl
@@ -43,4 +43,4 @@
 			</table>
 		{{end}}
 	</td>
-</tr>
\ No newline at end of file
+</tr>
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl
index 01f7e3f8e8..91092c412f 100644
--- a/templates/repo/diff/image_diff.tmpl
+++ b/templates/repo/diff/image_diff.tmpl
@@ -106,4 +106,4 @@
 		</div>
 	</td>
 </tr>
-{{end}}
\ No newline at end of file
+{{end}}
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 6304369416..9e65d6d420 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -13,16 +13,12 @@
 					<a class="muted close px-3">{{svg "octicon-x" 16}}</a>
 				</div>
 				<div class="ui field">
-					<textarea name="content" tabindex="0" rows="2"
-							  placeholder="{{$.i18n.Tr "repo.diff.review.placeholder"}}"></textarea>
+					<textarea name="content" tabindex="0" rows="2" placeholder="{{$.i18n.Tr "repo.diff.review.placeholder"}}"></textarea>
 				</div>
 				<div class="ui divider"></div>
-				<button type="submit" name="type" value="approve" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }}
-						class="ui submit green tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.approve"}}</button>
-				<button type="submit" name="type" value="comment"
-					        class="ui submit tiny basic button btn-submit">{{$.i18n.Tr "repo.diff.review.comment"}}</button>
-				<button type="submit" name="type" value="reject" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }}
-						class="ui submit red tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.reject"}}</button>
+				<button type="submit" name="type" value="approve" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit green tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.approve"}}</button>
+				<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.i18n.Tr "repo.diff.review.comment"}}</button>
+				<button type="submit" name="type" value="reject" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit red tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.reject"}}</button>
 			</form>
 		</div>
 	</div>
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl
index 695574cd99..3efde70f50 100644
--- a/templates/repo/editor/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -59,7 +59,7 @@
 	<div class="ui small basic modal" id="edit-empty-content-modal">
 		<div class="ui icon header">
 			<i class="file icon"></i>
-            {{.i18n.Tr "repo.editor.commit_empty_file_header"}}
+			{{.i18n.Tr "repo.editor.commit_empty_file_header"}}
 		</div>
 		<div class="center content">
 			<p>{{.i18n.Tr "repo.editor.commit_empty_file_text"}}</p>
@@ -67,11 +67,11 @@
 		<div class="actions">
 			<div class="ui red basic cancel inverted button">
 				<i class="remove icon"></i>
-                {{.i18n.Tr "repo.editor.cancel"}}
+				{{.i18n.Tr "repo.editor.cancel"}}
 			</div>
 			<div class="ui green basic ok inverted button">
 				<i class="save icon"></i>
-                {{.i18n.Tr "repo.editor.commit_changes"}}
+				{{.i18n.Tr "repo.editor.commit_changes"}}
 			</div>
 		</div>
 	</div>
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 71963d698c..188fc87b6a 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -32,7 +32,7 @@
 							{{end}}
 						{{end}}
 						{{if .IsArchived}}
-						  <span class="ui basic label">{{$.i18n.Tr "repo.desc.archived"}}</span>
+							<span class="ui basic label">{{$.i18n.Tr "repo.desc.archived"}}</span>
 						{{end}}
 					</div>
 				</div>
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl
index 7ca18508d9..e115b4a3f4 100644
--- a/templates/repo/issue/branch_selector_field.tmpl
+++ b/templates/repo/issue/branch_selector_field.tmpl
@@ -34,7 +34,7 @@
 		<div id="branch-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}}">
 			{{if .Issue.Ref}}
 				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{$.i18n.Tr "repo.clear_ref"}}</a></strong></div>
-			{{end}}	
+			{{end}}
 			{{range .Branches}}
 				<div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector">{{.}}</div>
 			{{end}}
@@ -42,7 +42,7 @@
 		<div id="tag-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}}" style="display: none">
 			{{if .Issue.Ref}}
 				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{.i18n.Tr "repo.clear_ref"}}</a></strong></div>
-			{{end}}	
+			{{end}}
 			{{range .Tags}}
 				<div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div>
 			{{end}}
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl
index 28a9b24edc..ab874bdd13 100644
--- a/templates/repo/issue/comment_tab.tmpl
+++ b/templates/repo/issue/comment_tab.tmpl
@@ -4,7 +4,7 @@
 </div>
 <div class="field">
 	<div class="ui bottom active tab" data-tab="write">
-	 	<textarea id="content" class="edit_area js-quick-submit" name="content" tabindex="4" data-id="issue-{{.RepoName}}" data-url="{{.Repository.APIURL}}/markdown" data-context="{{.Repo.RepoLink}}">
+		<textarea id="content" class="edit_area js-quick-submit" name="content" tabindex="4" data-id="issue-{{.RepoName}}" data-url="{{.Repository.APIURL}}/markdown" data-context="{{.Repo.RepoLink}}">
 			{{- if .BodyQuery}}{{.BodyQuery}}{{else if .IssueTemplate}}{{.IssueTemplate}}{{else if .PullRequestTemplate}}{{.PullRequestTemplate}}{{else}}{{.content}}{{end -}}
 		</textarea>
 	</div>
diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl
index 8e1f914d5f..19f422cdfe 100644
--- a/templates/repo/issue/labels/edit_delete_label.tmpl
+++ b/templates/repo/issue/labels/edit_delete_label.tmpl
@@ -55,4 +55,3 @@
 		</div>
 	</div>
 </div>
-
diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl
index 76ee77658a..037069c29b 100644
--- a/templates/repo/issue/labels/label_load_template.tmpl
+++ b/templates/repo/issue/labels/label_load_template.tmpl
@@ -3,8 +3,7 @@
 		<div class="ui attached left aligned segment">
 			<!-- <h4 class="ui header">
 				{{.i18n.Tr "repo.issues.label_templates.title"}}
-				<a target="_blank" rel="noopener noreferrer"
-				   href="https://discuss.gogs.io/t/how-to-use-predefined-label-templates/599">
+				<a target="_blank" rel="noopener noreferrer" href="https://discuss.gogs.io/t/how-to-use-predefined-label-templates/599">
 					<span class="octicon octicon-question"></span>
 				</a>
 			</h4> -->
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
index f977074fea..8c2f36f04b 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -14,29 +14,29 @@
 			{{if not .Repository.IsArchived}}
 				<div class="column right aligned">
 					{{if or .CanWriteIssues .CanWritePulls}}
-					<a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
+						<a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
 					{{end}}
 					<a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
 				</div>
 			{{end}}
 		</div>
-        <div class="ui one column stackable grid">
-            <div class="column">
-                {{ $closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.Lang }}
-                {{if .IsClosed}}
+		<div class="ui one column stackable grid">
+			<div class="column">
+				{{ $closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.Lang }}
+				{{if .IsClosed}}
 					{{svg "octicon-clock"}} {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}}
-                {{else}}
+				{{else}}
 					{{svg "octicon-calendar"}}
-                    {{if .Milestone.DeadlineString}}
-                        <span {{if .IsOverdue}}class="overdue"{{end}}>{{.Milestone.DeadlineString}}</span>
-                    {{else}}
-                        {{$.i18n.Tr "repo.milestones.no_due_date"}}
-                    {{end}}
-                {{end}}
-                &nbsp;
-                <b>{{.i18n.Tr "repo.milestones.completeness" .Milestone.Completeness}}</b>
-            </div>
-        </div>
+					{{if .Milestone.DeadlineString}}
+						<span {{if .IsOverdue}}class="overdue"{{end}}>{{.Milestone.DeadlineString}}</span>
+					{{else}}
+						{{$.i18n.Tr "repo.milestones.no_due_date"}}
+					{{end}}
+				{{end}}
+				&nbsp;
+				<b>{{.i18n.Tr "repo.milestones.completeness" .Milestone.Completeness}}</b>
+			</div>
+		</div>
 		<div class="ui divider"></div>
 		<div id="issue-filters" class="ui stackable grid">
 			<div class="six wide column">
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index c572e0c3f3..c7d3522abc 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -14,7 +14,7 @@
 		{{template "base/alert" .}}
 
 		<div class="ui three column stackable grid">
-		  <div class="column">
+			<div class="column">
 				<div class="ui compact tiny menu">
 					<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}">
 						{{svg "octicon-milestone" 16 "mr-3"}}
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 233893be0b..0482604b70 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -66,9 +66,9 @@
 						</div>
 						<div id="comment-{{.Issue.ID}}" class="raw-content hide">{{.Issue.Content}}</div>
 						<div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}" data-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/attachments" data-view-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/view-attachments"></div>
-    					{{if .Issue.Attachments}}
-    						{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}}
-    					{{end}}
+						{{if .Issue.Attachments}}
+							{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}}
+						{{end}}
 					</div>
 					{{$reactions := .Issue.Reactions.GroupByType}}
 					{{if $reactions}}
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl
index 16d77847d0..343d1d8358 100644
--- a/templates/repo/issue/view_content/attachments.tmpl
+++ b/templates/repo/issue/view_content/attachments.tmpl
@@ -1,42 +1,42 @@
 <div class="dropzone-attachments">
-    {{if .Attachments}}
-        <div class="ui clearing divider"></div>
-    {{end}}
-    <div class="ui middle aligned padded grid">
-        {{$hasThumbnails := false}}
-        {{- range .Attachments -}}
-            <div class="twelve wide column" style="padding: 6px;">
-                <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
-                    {{if FilenameIsImage .Name}}
-                        {{if not (containGeneric $.Content .UUID)}}
-                            {{$hasThumbnails = true}}
-                        {{end}}
-                        <span class="ui image">{{svg "octicon-file"}}</span>
-                    {{else}}
-                        <span class="ui image">{{svg "octicon-desktop-download"}}</span>
-                    {{end}}
-                    <span><strong>{{.Name}}</strong></span>
-                </a>
-            </div>
-            <div class="four wide column" style="padding: 0px;">
-                <span class="ui text grey right">{{.Size | FileSize}}</span>
-            </div>
-        {{end -}}
-    </div>
+	{{if .Attachments}}
+		<div class="ui clearing divider"></div>
+	{{end}}
+	<div class="ui middle aligned padded grid">
+		{{$hasThumbnails := false}}
+		{{- range .Attachments -}}
+			<div class="twelve wide column" style="padding: 6px;">
+				<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
+					{{if FilenameIsImage .Name}}
+						{{if not (containGeneric $.Content .UUID)}}
+							{{$hasThumbnails = true}}
+						{{end}}
+						<span class="ui image">{{svg "octicon-file"}}</span>
+					{{else}}
+						<span class="ui image">{{svg "octicon-desktop-download"}}</span>
+					{{end}}
+					<span><strong>{{.Name}}</strong></span>
+				</a>
+			</div>
+			<div class="four wide column" style="padding: 0px;">
+				<span class="ui text grey right">{{.Size | FileSize}}</span>
+			</div>
+		{{end -}}
+	</div>
 
-    {{if $hasThumbnails}}
-        <div class="ui clearing divider"></div>
-        <div class="ui small images thumbnails">
-            {{- range .Attachments -}}
-                {{if FilenameIsImage .Name}}
-                    {{if not (containGeneric $.Content .UUID)}}
-                    <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
-                        <img class="ui image" src="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
-                    </a>
-                    {{end}}
-                {{end}}
-            {{end -}}
-        </div>
-    {{end}}
+	{{if $hasThumbnails}}
+		<div class="ui clearing divider"></div>
+		<div class="ui small images thumbnails">
+			{{- range .Attachments -}}
+				{{if FilenameIsImage .Name}}
+					{{if not (containGeneric $.Content .UUID)}}
+					<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
+						<img class="ui image" src="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
+					</a>
+					{{end}}
+				{{end}}
+			{{end -}}
+		</div>
+	{{end}}
 
 </div>
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index c86689400e..81f0d0434a 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -3,13 +3,13 @@
 	{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
 
 	<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
-	 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
-	 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
-	 18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
-	 22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
-	 26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST, 28 = MERGE_PULL_REQUEST,
-	 29 = PULL_PUSH_EVENT, 30 = PROJECT_CHANGED, 31 = PROJECT_BOARD_CHANGED
-	 32 = DISMISSED_REVIEW -->
+	5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
+	13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
+	18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
+	22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
+	26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST, 28 = MERGE_PULL_REQUEST,
+	29 = PULL_PUSH_EVENT, 30 = PROJECT_CHANGED, 31 = PROJECT_BOARD_CHANGED
+	32 = DISMISSED_REVIEW -->
 	{{if eq .Type 0}}
 		<div class="timeline-item comment" id="{{.HashTag}}">
 		{{if .OriginalAuthor }}
@@ -73,9 +73,9 @@
 					</div>
 					<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
 					<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
-    				{{if .Attachments}}
-    					{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}}
-    				{{end}}
+					{{if .Attachments}}
+						{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}}
+					{{end}}
 				</div>
 				{{$reactions := .Reactions.GroupByType}}
 				{{if $reactions}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index f6cbb9206c..b6bf965a15 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -57,34 +57,34 @@
 				</span>
 			{{end}}
 			<span id="pull-desc-edit" style="display: none">
-								<div class="ui floating filter dropdown">
-									<div class="ui basic small button">
-										<span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
-									</div>
-								</div>
-								{{svg "octicon-arrow-right"}}
-								 <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
-									<div class="ui basic small button">
-										<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
-										{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-									</div>
-									<div class="menu">
-										<div class="ui icon search input">
-											<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
-											<input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}...">
-										</div>
-										<div class="scrolling menu" id="branch-select">
-											{{range .Branches}}
-												{{ $sameBase := ne $.BaseName $.HeadUserName }}
-												{{ $differentBranch := ne . $.HeadBranch }}
-												{{ if or $sameBase $differentBranch }}
-													<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
-												{{ end }}
-											{{end}}
-										</div>
-									</div>
-								</div>
-					 </span>
+				<div class="ui floating filter dropdown">
+					<div class="ui basic small button">
+						<span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
+					</div>
+				</div>
+				{{svg "octicon-arrow-right"}}
+				<div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
+					<div class="ui basic small button">
+						<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
+						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
+					</div>
+					<div class="menu">
+						<div class="ui icon search input">
+							<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
+							<input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}...">
+						</div>
+						<div class="scrolling menu" id="branch-select">
+							{{range .Branches}}
+								{{ $sameBase := ne $.BaseName $.HeadUserName }}
+								{{ $differentBranch := ne . $.HeadBranch }}
+								{{ if or $sameBase $differentBranch }}
+									<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
+								{{ end }}
+							{{end}}
+						</div>
+					</div>
+				</div>
+			</span>
 		{{end}}
 	{{else}}
 		{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl
index b7c5bd5b0d..156f8896fc 100644
--- a/templates/repo/migrate/github.tmpl
+++ b/templates/repo/migrate/github.tmpl
@@ -6,7 +6,7 @@
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
 					{{.i18n.Tr "repo.migrate.migrate" .service.Title}}
-                    <input id="service_type" type="hidden" name="service" value="{{.service}}">
+					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl
index 26eebd18bb..e1424c250f 100644
--- a/templates/repo/migrate/gitlab.tmpl
+++ b/templates/repo/migrate/gitlab.tmpl
@@ -6,7 +6,7 @@
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
 					{{.i18n.Tr "repo.migrate.migrate" .service.Title}}
-                    <input id="service_type" type="hidden" name="service" value="{{.service}}">
+					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl
index dc83ac5bb8..b1900e83d1 100644
--- a/templates/repo/migrate/gogs.tmpl
+++ b/templates/repo/migrate/gogs.tmpl
@@ -62,7 +62,7 @@
 								<label>{{.i18n.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
-					  -->
+						-->
 					</div>
 
 					<div class="ui divider"></div>
diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl
index e48f5f3fe3..f029d5cb6c 100644
--- a/templates/repo/pulls/status.tmpl
+++ b/templates/repo/pulls/status.tmpl
@@ -1,32 +1,32 @@
 {{if $.LatestCommitStatus}}
-    {{if not $.Issue.PullRequest.HasMerged}}
-        <div class="ui top attached header">
-            {{if eq .LatestCommitStatus.State "pending"}}
-                {{$.i18n.Tr "repo.pulls.status_checking"}}
-            {{else if eq .LatestCommitStatus.State "success"}}
-                {{$.i18n.Tr "repo.pulls.status_checks_success"}}
-            {{else if eq .LatestCommitStatus.State "warning"}}
-                {{$.i18n.Tr "repo.pulls.status_checks_warning"}}
-            {{else if eq .LatestCommitStatus.State "failure"}}
-                {{$.i18n.Tr "repo.pulls.status_checks_failure"}}
-            {{else if eq .LatestCommitStatus.State "error"}}
-                {{$.i18n.Tr "repo.pulls.status_checks_error"}}
-            {{else}}
-                {{$.i18n.Tr "repo.pulls.status_checking"}}
-            {{end}}
-    	    </div>
-    {{end}}
+	{{if not $.Issue.PullRequest.HasMerged}}
+		<div class="ui top attached header">
+			{{if eq .LatestCommitStatus.State "pending"}}
+				{{$.i18n.Tr "repo.pulls.status_checking"}}
+			{{else if eq .LatestCommitStatus.State "success"}}
+				{{$.i18n.Tr "repo.pulls.status_checks_success"}}
+			{{else if eq .LatestCommitStatus.State "warning"}}
+				{{$.i18n.Tr "repo.pulls.status_checks_warning"}}
+			{{else if eq .LatestCommitStatus.State "failure"}}
+				{{$.i18n.Tr "repo.pulls.status_checks_failure"}}
+			{{else if eq .LatestCommitStatus.State "error"}}
+				{{$.i18n.Tr "repo.pulls.status_checks_error"}}
+			{{else}}
+				{{$.i18n.Tr "repo.pulls.status_checking"}}
+			{{end}}
+			</div>
+	{{end}}
 
-    {{range $.LatestCommitStatuses}}
-        <div class="ui attached segment">
-            <span>{{template "repo/commit_status" .}}</span>
-            <span class="ui">{{.Context}} <span class="text grey">{{.Description}}</span></span>
-            <div class="ui right">
-                {{if $.is_context_required}}
-                    {{if (call $.is_context_required .Context)}}<div class="ui label">{{$.i18n.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
-                {{end}}
-                <span class="ui">{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.i18n.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
-            </div>
-        </div>
-    {{end}}
+	{{range $.LatestCommitStatuses}}
+		<div class="ui attached segment">
+			<span>{{template "repo/commit_status" .}}</span>
+			<span class="ui">{{.Context}} <span class="text grey">{{.Description}}</span></span>
+			<div class="ui right">
+				{{if $.is_context_required}}
+					{{if (call $.is_context_required .Context)}}<div class="ui label">{{$.i18n.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
+				{{end}}
+				<span class="ui">{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.i18n.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
+			</div>
+		</div>
+	{{end}}
 {{end}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 72a69a756a..ce4de3ddfa 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -127,7 +127,7 @@
 									{{$.i18n.Tr "repo.released_this"}}
 								</span>
 								{{if .CreatedUnix}}
-									<span class="time">{{TimeSinceUnix .CreatedUnix $.Lang}}</span> | 
+									<span class="time">{{TimeSinceUnix .CreatedUnix $.Lang}}</span> |
 								{{end}}
 								<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{.Target}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" .Target}}</span>
 							</p>
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index 81e80215c5..fbe9a7463e 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -9,37 +9,37 @@
 				{{.i18n.Tr "repo.settings.archive.branchsettings_unavailable"}}
 			</div>
 		{{else}}
-            <h4 class="ui top attached header">
-                {{.i18n.Tr "repo.default_branch"}}
-            </h4>
-            <div class="ui attached segment">
-                <p>
-                    {{.i18n.Tr "repo.settings.default_branch_desc"}}
-                </p>
-                <form class="ui form" action="{{.Link}}" method="post">
-                    {{.CsrfTokenHtml}}
-                    <input type="hidden" name="action" value="default_branch">
-                    {{if not .Repository.IsEmpty}}
-                    <div class="required inline field">
-                        <div class="ui dropdown selection" tabindex="0">
-                            <select name="branch">
-                                <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
-                                {{range .Branches}}
-                                    <option value="{{.}}">{{.}}</option>
-                                {{end}}
-                            </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-                            <div class="default text">{{.Repository.DefaultBranch}}</div>
-                            <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
-                                {{range .Branches}}
-                                    <div class="item" data-value="{{.}}">{{.}}</div>
-                                {{end}}
-                            </div>
-                        </div>
-                        <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
-                    </div>
-                    {{end}}
-                </form>
-            </div>
+			<h4 class="ui top attached header">
+				{{.i18n.Tr "repo.default_branch"}}
+			</h4>
+			<div class="ui attached segment">
+				<p>
+					{{.i18n.Tr "repo.settings.default_branch_desc"}}
+				</p>
+				<form class="ui form" action="{{.Link}}" method="post">
+					{{.CsrfTokenHtml}}
+					<input type="hidden" name="action" value="default_branch">
+					{{if not .Repository.IsEmpty}}
+					<div class="required inline field">
+						<div class="ui dropdown selection" tabindex="0">
+							<select name="branch">
+								<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
+								{{range .Branches}}
+									<option value="{{.}}">{{.}}</option>
+								{{end}}
+							</select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
+							<div class="default text">{{.Repository.DefaultBranch}}</div>
+							<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
+								{{range .Branches}}
+									<div class="item" data-value="{{.}}">{{.}}</div>
+								{{end}}
+							</div>
+						</div>
+						<button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
+					</div>
+					{{end}}
+				</form>
+			</div>
 
 			<h4 class="ui top attached header">
 				{{.i18n.Tr "repo.settings.protected_branch"}}
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl
index 8e052ac303..7dfc27c64f 100644
--- a/templates/repo/settings/deploy_keys.tmpl
+++ b/templates/repo/settings/deploy_keys.tmpl
@@ -19,12 +19,12 @@
 				<div class="ui key list">
 					{{range .Deploykeys}}
 						<div class="item">
-						    <div class="right floated content">
+							<div class="right floated content">
 								<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
 									{{$.i18n.Tr "settings.delete_key"}}
 								</button>
-						    </div>
-						    <div class="left floated content">
+							</div>
+							<div class="left floated content">
 								<i class="{{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}>{{svg "octicon-key" 32}}</i>
 							</div>
 							<div class="content">
diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl
index fa23bb73e8..a99f8e09b5 100644
--- a/templates/repo/settings/webhook/matrix.tmpl
+++ b/templates/repo/settings/webhook/matrix.tmpl
@@ -7,25 +7,25 @@
 			<input id="homeserver_url" name="homeserver_url" type="url" value="{{.MatrixHook.HomeserverURL}}" autofocus required>
 		</div>
 		<div class="required field {{if .Err_Room}}error{{end}}">
-        	<label for="room_id">{{.i18n.Tr "repo.settings.matrix.room_id"}}</label>
-          	<input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required>
-        </div>
-    	<div class="required field {{if .Err_AccessToken}}error{{end}}">
-    		<label for="access_token">{{.i18n.Tr "repo.settings.matrix.access_token"}}</label>
-    		<input id="access_token" name="access_token" type="text" value="{{.MatrixHook.AccessToken}}" required>
-    	</div>
-    	<div class="field">
-    		<label>{{.i18n.Tr "repo.settings.matrix.message_type"}}</label>
-     		<div class="ui selection dropdown">
-	     		<input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}">
-    	 		<div class="default text"></div>
-     				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-     				<div class="menu">
-     					<div class="item" data-value="1">m.notice</div>
-     					<div class="item" data-value="2">m.text</div>
-     				</div>
-     			</div>
-     	</div>
+			<label for="room_id">{{.i18n.Tr "repo.settings.matrix.room_id"}}</label>
+			<input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required>
+		</div>
+		<div class="required field {{if .Err_AccessToken}}error{{end}}">
+			<label for="access_token">{{.i18n.Tr "repo.settings.matrix.access_token"}}</label>
+			<input id="access_token" name="access_token" type="text" value="{{.MatrixHook.AccessToken}}" required>
+		</div>
+		<div class="field">
+			<label>{{.i18n.Tr "repo.settings.matrix.message_type"}}</label>
+				<div class="ui selection dropdown">
+				<input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}">
+				<div class="default text"></div>
+				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
+				<div class="menu">
+					<div class="item" data-value="1">m.notice</div>
+					<div class="item" data-value="2">m.text</div>
+				</div>
+			</div>
+		</div>
 		{{template "repo/settings/webhook/settings" .}}
 	</form>
 {{end}}
diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl
index 598ac44822..d062e7aac4 100644
--- a/templates/repo/settings/webhook/telegram.tmpl
+++ b/templates/repo/settings/webhook/telegram.tmpl
@@ -6,10 +6,10 @@
 			<label for="bot_token">{{.i18n.Tr "repo.settings.bot_token"}}</label>
 			<input id="bot_token" name="bot_token" type="text" value="{{.TelegramHook.BotToken}}" autofocus required>
 		</div>
-    <div class="required field {{if .Err_ChatID}}error{{end}}">
-      <label for="chat_id">{{.i18n.Tr "repo.settings.chat_id"}}</label>
-      <input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required>
-    </div>
+		<div class="required field {{if .Err_ChatID}}error{{end}}">
+			<label for="chat_id">{{.i18n.Tr "repo.settings.chat_id"}}</label>
+			<input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required>
+		</div>
 		{{template "repo/settings/webhook/settings" .}}
 	</form>
 {{end}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 76c0ac76fe..889cb5a691 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -128,10 +128,10 @@
 
 <script>
 function submitDeleteForm() {
-    var message = prompt("{{.i18n.Tr "repo.delete_confirm_message"}}\n\n{{.i18n.Tr "repo.delete_commit_summary"}}", "Delete '{{.TreeName}}'");
-    if (message != null) {
-        $("#delete-message").val(message);
-        $("#delete-file-form").submit()
-    }
+	var message = prompt("{{.i18n.Tr "repo.delete_confirm_message"}}\n\n{{.i18n.Tr "repo.delete_commit_summary"}}", "Delete '{{.TreeName}}'");
+	if (message != null) {
+		$("#delete-message").val(message);
+		$("#delete-file-form").submit()
+	}
 }
 </script>
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl
index 9838b2c11c..d74c99152a 100644
--- a/templates/repo/wiki/revision.tmpl
+++ b/templates/repo/wiki/revision.tmpl
@@ -29,7 +29,7 @@
 			</h4>
 
 			{{if and .Commits (gt .CommitCount 0)}}
-                {{template "repo/commits_list" .}}
+				{{template "repo/commits_list" .}}
 			{{end}}
 
 			{{template "base/paginate" .}}
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 1b4f21b400..d6cd60cbd2 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -48,8 +48,8 @@
 				<div class="desc issue-item-bottom-row df ac fw my-1">
 					<a class="index ml-0 mr-2" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
 						{{if eq $.listType "dashboard"}}
-          		{{.Repo.FullName}}#{{.Index}}
-          	{{else}}
+							{{.Repo.FullName}}#{{.Index}}
+						{{else}}
 							#{{.Index}}
 						{{end}}
 					</a>
diff --git a/templates/user/auth/signup_openid_navbar.tmpl b/templates/user/auth/signup_openid_navbar.tmpl
index 9ba727548c..9928bb6198 100644
--- a/templates/user/auth/signup_openid_navbar.tmpl
+++ b/templates/user/auth/signup_openid_navbar.tmpl
@@ -10,4 +10,3 @@
 		{{end}}
 	</div>
 </div>
-
diff --git a/templates/user/auth/twofa.tmpl b/templates/user/auth/twofa.tmpl
index b8b4892426..68b474c866 100644
--- a/templates/user/auth/twofa.tmpl
+++ b/templates/user/auth/twofa.tmpl
@@ -17,7 +17,7 @@
 					<div class="inline field">
 						<label></label>
 						<button class="ui green button">{{.i18n.Tr "auth.verify"}}</button>
-                        <a href="{{AppSubUrl}}/user/two_factor/scratch">{{.i18n.Tr "auth.use_scratch_code" | Str2html}}</a>
+						<a href="{{AppSubUrl}}/user/two_factor/scratch">{{.i18n.Tr "auth.use_scratch_code" | Str2html}}</a>
 					</div>
 				</div>
 			</form>
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index dfd0e5d8ec..d2a51fd44a 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -26,7 +26,7 @@
 							{{.i18n.Tr "repo.issues.filter_type.review_requested"}}
 							<strong class="ui right">{{CountFmt .IssueStats.ReviewRequestedCount}}</strong>
 						</a>
-					{{end}}          
+					{{end}}
 					<div class="ui divider"></div>
 					<a class="{{if not $.RepoIDs}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}">
 						<span class="text truncate">All</span>
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
index 5c3aa55062..c7416e7cd7 100644
--- a/templates/user/dashboard/milestones.tmpl
+++ b/templates/user/dashboard/milestones.tmpl
@@ -76,56 +76,56 @@
 							</div>
 						</div>
 					</div>
-        </div>
-                <div class="milestone list">
-                    {{range .Milestones}}
-                        <li class="item">
-                            <div class="ui label">{{.Repo.FullName}}</div>
+				</div>
+				<div class="milestone list">
+					{{range .Milestones}}
+						<li class="item">
+							<div class="ui label">{{.Repo.FullName}}</div>
 							{{svg "octicon-milestone"}} <a href="{{.Repo.Link }}/milestone/{{.ID}}">{{.Name}}</a>
-                            <div class="ui right green progress" data-percent="{{.Completeness}}">
-                                <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
-                                    <div class="progress"></div>
-                                </div>
-                            </div>
-                            <div class="meta">
-                                {{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.Lang }}
-                                {{if .IsClosed}}
+							<div class="ui right green progress" data-percent="{{.Completeness}}">
+								<div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
+									<div class="progress"></div>
+								</div>
+							</div>
+							<div class="meta">
+								{{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.Lang }}
+								{{if .IsClosed}}
 									{{svg "octicon-clock"}} {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}}
-                                {{else}}
+								{{else}}
 									{{svg "octicon-calendar"}}
-                                    {{if .DeadlineString}}
-                                        <span {{if .IsOverdue}}class="overdue"{{end}}>{{.DeadlineString}}</span>
-                                    {{else}}
-                                        {{$.i18n.Tr "repo.milestones.no_due_date"}}
-                                    {{end}}
-                                {{end}}
-                                <span class="issue-stats">
-                                    {{svg "octicon-issue-opened"}} {{$.i18n.Tr "repo.milestones.open_tab" .NumOpenIssues}}
+									{{if .DeadlineString}}
+										<span {{if .IsOverdue}}class="overdue"{{end}}>{{.DeadlineString}}</span>
+									{{else}}
+										{{$.i18n.Tr "repo.milestones.no_due_date"}}
+									{{end}}
+								{{end}}
+								<span class="issue-stats">
+									{{svg "octicon-issue-opened"}} {{$.i18n.Tr "repo.milestones.open_tab" .NumOpenIssues}}
 									{{svg "octicon-issue-closed"}} {{$.i18n.Tr "repo.milestones.close_tab" .NumClosedIssues}}
-                                    {{if .TotalTrackedTime}}{{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}{{end}}
-                                </span>
-                            </div>
-                            {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
-                                <div class="ui right operate">
-                                    <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-pencil"}} {{$.i18n.Tr "repo.issues.label_edit"}}</a>
-                                    {{if .IsClosed}}
-                                        <a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-check"}} {{$.i18n.Tr "repo.milestones.open"}}</a>
-                                    {{else}}
-                                        <a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-x"}} {{$.i18n.Tr "repo.milestones.close"}}</a>
-                                    {{end}}
-                                    <a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.i18n.Tr "repo.issues.label_delete"}}</a>
-                                </div>
-                            {{end}}
-                            {{if .Content}}
-                                <div class="content">
-                                    {{.RenderedContent|Str2html}}
-                                </div>
-                            {{end}}
-                        </li>
-                    {{end}}
+									{{if .TotalTrackedTime}}{{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}{{end}}
+								</span>
+							</div>
+							{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
+								<div class="ui right operate">
+									<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-pencil"}} {{$.i18n.Tr "repo.issues.label_edit"}}</a>
+									{{if .IsClosed}}
+										<a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-check"}} {{$.i18n.Tr "repo.milestones.open"}}</a>
+									{{else}}
+										<a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-x"}} {{$.i18n.Tr "repo.milestones.close"}}</a>
+									{{end}}
+									<a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.i18n.Tr "repo.issues.label_delete"}}</a>
+								</div>
+							{{end}}
+							{{if .Content}}
+								<div class="content">
+									{{.RenderedContent|Str2html}}
+								</div>
+							{{end}}
+						</li>
+					{{end}}
 
-                    {{template "base/paginate" .}}
-                </div>
+					{{template "base/paginate" .}}
+				</div>
 
 			</div>
 		</div>
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 2158dcb000..e7327d34bb 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -1,134 +1,134 @@
 <div class="page-content user notification" id="notification_div" data-params="{{.Page.GetParams}}">
 	<div class="ui container">
 		<h1 class="ui dividing header">{{.i18n.Tr "notification.notifications"}}</h1>
-        <div class="ui top attached tabular menu">
-            {{ $notificationUnreadCount := call .NotificationUnreadCount}}
-            <a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active{{end}} item">
-                {{.i18n.Tr "notification.unread"}}
-                <div class="ui label {{if not $notificationUnreadCount}}hidden{{end}}">{{$notificationUnreadCount}}</div>
-            </a>
-            <a href="{{AppSubUrl}}/notifications?q=read" class="{{if eq .Status 2}}active{{end}} item">
-                {{.i18n.Tr "notification.read"}}
-            </a>
-            {{if and (eq .Status 1)}}
-                <form action="{{AppSubUrl}}/notifications/purge" method="POST" style="margin-left: auto;">
-                    {{$.CsrfTokenHtml}}
-                    <div class="{{if not $notificationUnreadCount}}hide{{end}}">
-                        <button class="ui mini button primary" title='{{$.i18n.Tr "notification.mark_all_as_read"}}'>
-                            {{svg "octicon-checklist"}}
-                        </button>
-                    </div>
-                </form>
-            {{end}}
-        </div>
-        <div class="ui bottom attached active tab segment">
-            {{if eq (len .Notifications) 0}}
-                {{if eq .Status 1}}
-                    {{.i18n.Tr "notification.no_unread"}}
-                {{else}}
-                    {{.i18n.Tr "notification.no_read"}}
-                {{end}}
-            {{else}}
-                <table class="ui unstackable striped very compact small selectable table" id="notification_table">
-                    <tbody>
-                        {{range $notification := .Notifications}}
-                            {{$issue := .Issue}}
-                            {{$repo := .Repository}}
-                            {{$repoOwner := $repo.MustOwner}}
-                            <tr id="notification_{{.ID}}">
-                                <td class="collapsing" data-href="{{.HTMLURL}}">
-                                    {{if eq .Status 3}}
-                                        <span class="blue">{{svg "octicon-pin"}}</span>
-                                    {{else if not $issue}}
-                                        <span class="gray">{{svg "octicon-repo"}}</span>
-                                    {{else if $issue.IsPull}}
-                                        {{if $issue.IsClosed}}
-                                            {{if $issue.GetPullRequest.HasMerged}}
-                                                <span class="purple">{{svg "octicon-git-merge"}}</span>
-                                            {{else}}
-                                                <span class="red">{{svg "octicon-git-pull-request"}}</span>
-                                            {{end}}
-                                        {{else}}
-                                            <span class="green">{{svg "octicon-git-pull-request"}}</span>
-                                        {{end}}
-                                    {{else}}
-                                        {{if $issue.IsClosed}}
-                                            <span class="red">{{svg "octicon-issue-closed"}}</span>
-                                        {{else}}
-                                            <span class="green">{{svg "octicon-issue-opened"}}</span>
-                                        {{end}}
-                                    {{end}}
-                                </td>
-                                <td class="eleven wide" data-href="{{.HTMLURL}}">
-                                    <a class="item" href="{{.HTMLURL}}">
-                                        {{if $issue}}
-                                            #{{$issue.Index}} - {{$issue.Title}}
-                                        {{else}}
-                                            {{$repo.FullName}}
-                                        {{end}}
-                                    </a>
-                                </td>
-                                <td data-href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}">
-                                    <a class="item" href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}">
-                                        {{$repoOwner.Name}}/{{$repo.Name}}
-                                    </a>
-                                </td>
-                                <td class="collapsing">
-                                    {{if ne .Status 3}}
-                                        <form action="{{AppSubUrl}}/notifications/status" method="POST">
-                                            {{$.CsrfTokenHtml}}
-                                            <input type="hidden" name="notification_id" value="{{.ID}}" />
-                                            <input type="hidden" name="status" value="pinned" />
-                                            <button class="ui mini button" title='{{$.i18n.Tr "notification.pin"}}'
-                                                data-url="{{AppSubUrl}}/notifications/status"
-                                                data-status="pinned"
-                                                data-page="{{$.Page.Paginater.Current}}"
-                                                data-notification-id="{{.ID}}"
-                                                data-q="{{$.Keyword}}">
-                                                {{svg "octicon-pin"}}
-                                            </button>
-                                        </form>
-                                    {{end}}
-                                </td>
-                                <td class="collapsing">
-                                    {{if or (eq .Status 1) (eq .Status 3)}}
-                                        <form action="{{AppSubUrl}}/notifications/status" method="POST">
-                                            {{$.CsrfTokenHtml}}
-                                            <input type="hidden" name="notification_id" value="{{.ID}}" />
-                                            <input type="hidden" name="status" value="read" />
-                                            <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" />
-                                            <button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_read"}}'
-                                                data-url="{{AppSubUrl}}/notifications/status"
-                                                data-status="read"
-                                                data-page="{{$.Page.Paginater.Current}}"
-                                                data-notification-id="{{.ID}}"
-                                                data-q="{{$.Keyword}}">
-                                                {{svg "octicon-check"}}
-                                            </button>
-                                        </form>
-                                    {{else if eq .Status 2}}
-                                        <form action="{{AppSubUrl}}/notifications/status" method="POST">
-                                            {{$.CsrfTokenHtml}}
-                                            <input type="hidden" name="notification_id" value="{{.ID}}" />
-                                            <input type="hidden" name="status" value="unread" />
-                                            <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" />
-                                            <button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_unread"}}'
-                                                data-url="{{AppSubUrl}}/notifications/status"
-                                                data-status="unread"
-                                                data-page="{{$.Page.Paginater.Current}}"
-                                                data-notification-id="{{.ID}}"
-                                                data-q="{{$.Keyword}}">
-                                                {{svg "octicon-bell"}}
-                                            </button>
-                                        </form>
-                                    {{end}}
-                                </td>
-                            </tr>
-                        {{end}}
-                    </tbody>
-                </table>
-            {{end}}
-        </div>
-        {{template "base/paginate" .}}
-    </div>
+		<div class="ui top attached tabular menu">
+			{{ $notificationUnreadCount := call .NotificationUnreadCount}}
+			<a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active{{end}} item">
+				{{.i18n.Tr "notification.unread"}}
+				<div class="ui label {{if not $notificationUnreadCount}}hidden{{end}}">{{$notificationUnreadCount}}</div>
+			</a>
+			<a href="{{AppSubUrl}}/notifications?q=read" class="{{if eq .Status 2}}active{{end}} item">
+				{{.i18n.Tr "notification.read"}}
+			</a>
+			{{if and (eq .Status 1)}}
+				<form action="{{AppSubUrl}}/notifications/purge" method="POST" style="margin-left: auto;">
+					{{$.CsrfTokenHtml}}
+					<div class="{{if not $notificationUnreadCount}}hide{{end}}">
+						<button class="ui mini button primary" title='{{$.i18n.Tr "notification.mark_all_as_read"}}'>
+							{{svg "octicon-checklist"}}
+						</button>
+					</div>
+				</form>
+			{{end}}
+		</div>
+		<div class="ui bottom attached active tab segment">
+			{{if eq (len .Notifications) 0}}
+				{{if eq .Status 1}}
+					{{.i18n.Tr "notification.no_unread"}}
+				{{else}}
+					{{.i18n.Tr "notification.no_read"}}
+				{{end}}
+			{{else}}
+				<table class="ui unstackable striped very compact small selectable table" id="notification_table">
+					<tbody>
+						{{range $notification := .Notifications}}
+							{{$issue := .Issue}}
+							{{$repo := .Repository}}
+							{{$repoOwner := $repo.MustOwner}}
+							<tr id="notification_{{.ID}}">
+								<td class="collapsing" data-href="{{.HTMLURL}}">
+									{{if eq .Status 3}}
+										<span class="blue">{{svg "octicon-pin"}}</span>
+									{{else if not $issue}}
+										<span class="gray">{{svg "octicon-repo"}}</span>
+									{{else if $issue.IsPull}}
+										{{if $issue.IsClosed}}
+											{{if $issue.GetPullRequest.HasMerged}}
+												<span class="purple">{{svg "octicon-git-merge"}}</span>
+											{{else}}
+												<span class="red">{{svg "octicon-git-pull-request"}}</span>
+											{{end}}
+										{{else}}
+											<span class="green">{{svg "octicon-git-pull-request"}}</span>
+										{{end}}
+									{{else}}
+										{{if $issue.IsClosed}}
+											<span class="red">{{svg "octicon-issue-closed"}}</span>
+										{{else}}
+											<span class="green">{{svg "octicon-issue-opened"}}</span>
+										{{end}}
+									{{end}}
+								</td>
+								<td class="eleven wide" data-href="{{.HTMLURL}}">
+									<a class="item" href="{{.HTMLURL}}">
+										{{if $issue}}
+											#{{$issue.Index}} - {{$issue.Title}}
+										{{else}}
+											{{$repo.FullName}}
+										{{end}}
+									</a>
+								</td>
+								<td data-href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}">
+									<a class="item" href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}">
+										{{$repoOwner.Name}}/{{$repo.Name}}
+									</a>
+								</td>
+								<td class="collapsing">
+									{{if ne .Status 3}}
+										<form action="{{AppSubUrl}}/notifications/status" method="POST">
+											{{$.CsrfTokenHtml}}
+											<input type="hidden" name="notification_id" value="{{.ID}}" />
+											<input type="hidden" name="status" value="pinned" />
+											<button class="ui mini button" title='{{$.i18n.Tr "notification.pin"}}'
+												data-url="{{AppSubUrl}}/notifications/status"
+												data-status="pinned"
+												data-page="{{$.Page.Paginater.Current}}"
+												data-notification-id="{{.ID}}"
+												data-q="{{$.Keyword}}">
+												{{svg "octicon-pin"}}
+											</button>
+										</form>
+									{{end}}
+								</td>
+								<td class="collapsing">
+									{{if or (eq .Status 1) (eq .Status 3)}}
+										<form action="{{AppSubUrl}}/notifications/status" method="POST">
+											{{$.CsrfTokenHtml}}
+											<input type="hidden" name="notification_id" value="{{.ID}}" />
+											<input type="hidden" name="status" value="read" />
+											<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" />
+											<button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_read"}}'
+												data-url="{{AppSubUrl}}/notifications/status"
+												data-status="read"
+												data-page="{{$.Page.Paginater.Current}}"
+												data-notification-id="{{.ID}}"
+												data-q="{{$.Keyword}}">
+												{{svg "octicon-check"}}
+											</button>
+										</form>
+									{{else if eq .Status 2}}
+										<form action="{{AppSubUrl}}/notifications/status" method="POST">
+											{{$.CsrfTokenHtml}}
+											<input type="hidden" name="notification_id" value="{{.ID}}" />
+											<input type="hidden" name="status" value="unread" />
+											<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" />
+											<button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_unread"}}'
+												data-url="{{AppSubUrl}}/notifications/status"
+												data-status="unread"
+												data-page="{{$.Page.Paginater.Current}}"
+												data-notification-id="{{.ID}}"
+												data-q="{{$.Keyword}}">
+												{{svg "octicon-bell"}}
+											</button>
+										</form>
+									{{end}}
+								</td>
+							</tr>
+						{{end}}
+					</tbody>
+				</table>
+			{{end}}
+		</div>
+		{{template "base/paginate" .}}
+	</div>
 </div>
diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl
index 69dbcced8c..4e04d831d2 100644
--- a/templates/user/settings/keys_gpg.tmpl
+++ b/templates/user/settings/keys_gpg.tmpl
@@ -39,7 +39,7 @@
 <p>{{.i18n.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}</p>
 <div {{if not .HasGPGError}}class="hide"{{end}} id="add-gpg-key-panel">
 	<h4 class="ui top attached header">
-		 {{.i18n.Tr "settings.add_new_gpg_key"}}
+		{{.i18n.Tr "settings.add_new_gpg_key"}}
 	</h4>
 	<div class="ui attached segment">
 		<form class="ui form" action="{{.Link}}" method="post">
diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl
index 453dce7278..b82f131b20 100644
--- a/templates/user/settings/repos.tmpl
+++ b/templates/user/settings/repos.tmpl
@@ -35,7 +35,7 @@
 									{{else}}
 										<span class="icon">{{svg "octicon-file-directory"}}</span>
 										<span class="name">{{$.Owner.Name}}/{{$dir}}</span>
-        		                        <div class="right floated content">
+										<div class="right floated content">
 											{{if $.allowAdopt}}
 												<button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.i18n.Tr "repo.adopt_preexisting_label"}}</span></button>
 												<div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}">
diff --git a/templates/user/settings/security_u2f.tmpl b/templates/user/settings/security_u2f.tmpl
index 6b8215f8d0..dcc56d8729 100644
--- a/templates/user/settings/security_u2f.tmpl
+++ b/templates/user/settings/security_u2f.tmpl
@@ -6,16 +6,16 @@
 	{{if .TwofaEnrolled}}
 		<div class="ui key list">
 			{{range .U2FRegistrations}}
-			    <div class="item">
-			    	<div class="right floated content">
-			    		<button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
-			    		{{$.i18n.Tr "settings.delete_key"}}
-			    		</button>
-			    	</div>
-			    	<div class="content">
-			    		<strong>{{.Name}}</strong>
-			    	</div>
-			    </div>
+				<div class="item">
+					<div class="right floated content">
+						<button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
+						{{$.i18n.Tr "settings.delete_key"}}
+						</button>
+					</div>
+					<div class="content">
+						<strong>{{.Name}}</strong>
+					</div>
+				</div>
 			{{end}}
 		</div>
 		<div class="ui form">
@@ -53,4 +53,3 @@
 	</div>
 	{{template "base/delete_modal_actions" .}}
 </div>
-