From a066d04eba685e8d3a7c45eec989f05a0cbef1d1 Mon Sep 17 00:00:00 2001 From: JFronny Date: Tue, 18 Jul 2023 13:26:45 +0200 Subject: [PATCH] Update templates --- templates/repo/issue/list.tmpl | 50 +++++------ templates/repo/issue/view_content.tmpl | 117 +++++++++---------------- 2 files changed, 64 insertions(+), 103 deletions(-) diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 4ef24e1..4425994 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "repo/header" .}}
@@ -32,9 +32,7 @@
{{if $.CanWriteIssuesOrPulls}} -
- -
+ {{end}} {{template "repo/issue/openclose" .}}
@@ -102,9 +100,8 @@ {{.locale.Tr "repo.issues.new.open_projects"}}
{{range .OpenProjects}} - - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + + {{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}{{.Title}} {{end}} {{end}} @@ -115,8 +112,7 @@
{{range .ClosedProjects}} - {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}} - {{.Title}} + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} {{end}} {{end}} @@ -124,7 +120,11 @@
-
@@ -156,8 +151,8 @@
{{.locale.Tr "repo.issues.filter_assginee_no_select"}} {{range .Assignees}} - - {{avatar $.Context .}} {{.GetDisplayName}} + + {{avatar $.Context . 20}}{{template "repo/search_name" .}} {{end}} @@ -174,16 +169,17 @@ {{.locale.Tr "repo.issues.filter_type.all_issues"}} {{.locale.Tr "repo.issues.filter_type.assigned_to_you"}} {{.locale.Tr "repo.issues.filter_type.created_by_you"}} - {{.locale.Tr "repo.issues.filter_type.mentioning_you"}} {{if .PageIsPullList}} {{.locale.Tr "repo.issues.filter_type.review_requested"}} + {{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}} {{end}} + {{.locale.Tr "repo.issues.filter_type.mentioning_you"}} {{end}} - {{range .Assignees}}
- {{avatar $.Context .}} {{.GetDisplayName}} + {{avatar $.Context . 20}} {{.GetDisplayName}}
{{end}} @@ -316,7 +310,7 @@ - {{template "shared/issuelist" mergeinto . "listType" "repo"}} + {{template "shared/issuelist" dict "." . "listType" "repo"}} {{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 8e67075..f3e0c5f 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -12,20 +12,20 @@ - + {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
- +
- {{if .Issue.OriginalAuthor}} + {{if .Issue.OriginalAuthor}} - {{else}} + {{else}} {{avatar $.Context .Issue.Poster}} - {{end}} + {{end}}
@@ -64,8 +64,8 @@ {{end}} {{end}} {{if not $.Repository.IsArchived}} - {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}} - {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}} {{end}}
@@ -80,13 +80,13 @@
{{.Issue.Content}}
{{if .Issue.Attachments}} - {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}} + {{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}} {{end}}
{{$reactions := .Issue.Reactions.GroupByType}} {{if $reactions}}
- {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}}
{{end}}
@@ -97,6 +97,7 @@ {{if and .Issue.IsPull (not $.Repository.IsArchived)}} {{template "repo/issue/view_content/pull".}} {{end}} + {{if .IsSigned}} {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
@@ -112,13 +113,17 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}} {{if .Issue.IsClosed}} -
+
+ {{else}} -
- {{.locale.Tr "repo.issues.close_issue"}} -
+ {{$closeTranslationKey := "repo.issues.close"}} + {{if .Issue.IsPull}} + {{$closeTranslationKey = "repo.pulls.close"}} + {{end}} + {{end}} {{end}}
{{end}} - {{else}} - {{if .Repository.IsArchived}} -
- {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} - {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} - {{end}} -
- {{else}} - {{if .IsSigned}} - {{if .Repository.IsArchived}} -
- - {{avatar $.Context .SignedUser}} - -
-
- {{template "repo/issue/comment_tab" .}} - {{.CsrfTokenHtml}} - - -
-
+ {{else}} {{/* not .IsSigned */}} + {{if .Repository.IsArchived}} +
+ {{if .Issue.IsPull}} + {{.locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{.locale.Tr "repo.archive.issue.nocomment"}} + {{end}}
- {{end}} {{else}} {{if .Issue.IsPull}}
@@ -190,41 +161,37 @@ {{.locale.Tr "repo.issues.create_comment"}} {{end}} {{end}} - {{end}} - {{end}} - + {{end}}{{/* end if: .IsSigned */}} +
{{template "repo/issue/view_content/sidebar" .}}
-
+ {{template "repo/issue/view_content/reference_issue_dialog" .}}