aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2021-04-11 05:46:37 +0200
committerGitHub <noreply@github.com>2021-04-10 23:46:37 -0400
commitd848098f60f78e6b4a72ae7f769fd66399a8ba82 (patch)
treeee6e769196f546c8a0c7d85c82eecccd0bf67e1e /templates/user
parent0c77e0791c079ea8c01e03f636f22a0ff7e9d22b (diff)
downloadgitea-d848098f60f78e6b4a72ae7f769fd66399a8ba82.tar.gz
gitea-d848098f60f78e6b4a72ae7f769fd66399a8ba82.zip
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>
Diffstat (limited to 'templates/user')
-rw-r--r--templates/user/auth/signup_openid_navbar.tmpl1
-rw-r--r--templates/user/auth/twofa.tmpl2
-rw-r--r--templates/user/dashboard/issues.tmpl2
-rw-r--r--templates/user/dashboard/milestones.tmpl90
-rw-r--r--templates/user/notification/notification_div.tmpl260
-rw-r--r--templates/user/settings/keys_gpg.tmpl2
-rw-r--r--templates/user/settings/repos.tmpl2
-rw-r--r--templates/user/settings/security_u2f.tmpl21
8 files changed, 189 insertions, 191 deletions
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>
-