mirror of https://github.com/go-gitea/gitea.git
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>pull/15399/head
parent
0c77e0791c
commit
d848098f60
@ -1,7 +1,7 @@
|
||||
{{.Message}}
|
||||
<details>
|
||||
<summary>{{.Summary}}</summary>
|
||||
<code>
|
||||
{{.Details | Str2html}}
|
||||
</code>
|
||||
<summary>{{.Summary}}</summary>
|
||||
<code>
|
||||
{{.Details | Str2html}}
|
||||
</code>
|
||||
</details>
|
||||
|
@ -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>
|
||||
|
@ -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> {{$.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> {{$.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> {{$.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> {{$.i18n.Tr "org.lower_repositories"}}</a>
|
||||
</div>
|
||||
|
@ -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>
|
||||
|
@ -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}}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue