mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 05:56:14 +01:00
3ea7437fa6
Fixes https://github.com/go-gitea/gitea/issues/30005. Regression from https://github.com/go-gitea/gitea/pull/29945. There was only once instance of `tw-content-center` before that PR, so I just ran below command and reverted that one instance. ```sh perl -p -i -e 's#tw-content-center#tw-items-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/* ``` (cherry picked from commit 04f9ad056882fc3f21b247b16f84437adf0f36d8) Conflicts: templates/repo/diff/conversation.tmpl templates/repo/header.tmpl templates/repo/issue/filter_list.tmpl templates/repo/issue/view_content/conversation.tmpl templates/repo/wiki/view.tmpl web_src/js/components/DashboardRepoList.vue re-ran the command after discarding the Gitea changes to ensure all Forgejo files are also covered
125 lines
5.2 KiB
Go HTML Template
125 lines
5.2 KiB
Go HTML Template
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-sequence-number="{{.SequenceNumber}}">
|
|
<div class="ui container">
|
|
{{$notificationUnreadCount := call .NotificationUnreadCount}}
|
|
<div class="tw-flex tw-items-center tw-justify-between gt-mb-4">
|
|
<div class="small-menu-items ui compact tiny menu">
|
|
<a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread">
|
|
{{ctx.Locale.Tr "notification.unread"}}
|
|
<div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}gt-hidden{{end}}">{{$notificationUnreadCount}}</div>
|
|
</a>
|
|
<a class="{{if eq .Status 2}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=read">
|
|
{{ctx.Locale.Tr "notification.read"}}
|
|
</a>
|
|
</div>
|
|
{{if and (eq .Status 1)}}
|
|
<form action="{{AppSubUrl}}/notifications/purge" method="post">
|
|
{{$.CsrfTokenHtml}}
|
|
<div class="{{if not $notificationUnreadCount}}gt-hidden{{end}}">
|
|
<button class="ui mini button primary gt-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
|
|
{{svg "octicon-checklist"}}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
<div class="gt-p-0">
|
|
<div id="notification_table">
|
|
{{if not .Notifications}}
|
|
<div class="tw-flex tw-items-center tw-flex-col gt-p-4">
|
|
{{svg "octicon-inbox" 56 "gt-mb-4"}}
|
|
{{if eq .Status 1}}
|
|
{{ctx.Locale.Tr "notification.no_unread"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "notification.no_read"}}
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
{{range $notification := .Notifications}}
|
|
<div class="notifications-item tw-flex tw-items-center tw-flex-wrap gt-gap-3 gt-p-3" id="notification_{{.ID}}" data-status="{{.Status}}">
|
|
<div class="notifications-icon gt-ml-3 gt-mr-2 tw-self-start gt-mt-2">
|
|
{{if .Issue}}
|
|
{{template "shared/issueicon" .Issue}}
|
|
{{else}}
|
|
{{svg "octicon-repo" 16 "text grey"}}
|
|
{{end}}
|
|
</div>
|
|
<a class="notifications-link tw-flex tw-flex-1 tw-flex-col silenced" href="{{.Link ctx}}">
|
|
<div class="notifications-top-row gt-font-13">
|
|
{{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
|
|
{{if eq .Status 3}}
|
|
{{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}}
|
|
{{end}}
|
|
</div>
|
|
<div class="notifications-bottom-row gt-font-16 gt-py-1">
|
|
<span class="issue-title">
|
|
{{if .Issue}}
|
|
{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}
|
|
{{else}}
|
|
{{.Repository.FullName}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
</a>
|
|
<div class="notifications-updated tw-items-center gt-mr-3">
|
|
{{if .Issue}}
|
|
{{TimeSinceUnix .Issue.UpdatedUnix ctx.Locale}}
|
|
{{else}}
|
|
{{TimeSinceUnix .UpdatedUnix ctx.Locale}}
|
|
{{end}}
|
|
</div>
|
|
<div class="notifications-buttons tw-items-center tw-justify-end gt-gap-2 gt-px-2">
|
|
{{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="btn interact-bg gt-p-3" title="{{ctx.Locale.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}}
|
|
{{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="btn interact-bg gt-p-3" title="{{ctx.Locale.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="btn interact-bg gt-p-3" title="{{ctx.Locale.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}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{template "base/paginate" .}}
|
|
</div>
|
|
</div>
|