diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-11-04 23:46:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 07:46:40 +0000 |
commit | 24b83ff63e7ffd3d412bc9b509102aa2c507ced1 (patch) | |
tree | 3f18ed68bb62f3a597d2417481c7525bf1ac8a41 /templates/repo | |
parent | 1887c75c35c1d16372b1dbe2b792e374b558ce1f (diff) | |
download | gitea-24b83ff63e7ffd3d412bc9b509102aa2c507ced1.tar.gz gitea-24b83ff63e7ffd3d412bc9b509102aa2c507ced1.zip |
Fix milestone deadline and date related problems (#32339)
Use zero instead of 9999-12-31 for deadline
Fix #32291
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/graph/commits.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/milestone_new.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 53 |
3 files changed, 23 insertions, 36 deletions
diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl index 17c6cad86b..f1d0e62330 100644 --- a/templates/repo/graph/commits.tmpl +++ b/templates/repo/graph/commits.tmpl @@ -56,7 +56,7 @@ {{end}} {{end}} </span> - <span class="author tw-flex tw-items-center tw-mr-2 tw-gap-[1px]"> + <span class="author tw-flex tw-items-center tw-mr-2 tw-gap-1"> {{$userName := $commit.Commit.Author.Name}} {{if $commit.User}} {{if and $commit.User.FullName DefaultShowFullName}} diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index 9f32df00e3..736a75d73a 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -30,9 +30,9 @@ <div class="field {{if .Err_Deadline}}error{{end}}"> <label> {{ctx.Locale.Tr "repo.milestones.due_date"}} - <a id="clear-date">{{ctx.Locale.Tr "repo.milestones.clear"}}</a> + <a id="milestone-clear-deadline">{{ctx.Locale.Tr "repo.milestones.clear"}}</a> </label> - <input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}"> + <input type="date" name="deadline" class="tw-w-auto" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}"> </div> <div class="field"> <label>{{ctx.Locale.Tr "repo.milestones.desc"}}</label> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 01fa433978..9c1acae0cf 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -358,44 +358,31 @@ <div class="divider"></div> <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span> - <div class="ui form" id="deadline-loader"> - <div class="ui negative message tw-hidden" id="deadline-err-invalid-date"> - {{svg "octicon-x" 16 "close icon"}} - {{ctx.Locale.Tr "repo.issues.due_date_invalid"}} - </div> - {{if ne .Issue.DeadlineUnix 0}} - <p> - <div class="tw-flex tw-justify-between tw-items-center"> - <div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}> - {{svg "octicon-calendar" 16 "tw-mr-2"}} - {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}} - </div> - <div> - {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} - <a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "tw-mr-1"}}</a> - <a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a> - {{end}} - </div> + <div class="ui form tw-mt-2"> + {{if .Issue.DeadlineUnix}} + <div class="tw-flex tw-justify-between tw-items-center tw-gap-2"> + <div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}> + {{svg "octicon-calendar"}} {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}} + </div> + <div class="flex-text-block"> + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} + <a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil"}}</a> + <a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a> + {{end}} </div> - </p> + </div> {{else}} - <p>{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}</p> + {{ctx.Locale.Tr "repo.issues.due_date_not_set"}} {{end}} {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} - <div {{if ne .Issue.DeadlineUnix 0}} class="tw-hidden"{{end}} id="deadlineForm"> - <form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form"> - {{$.CsrfTokenHtml}} - <input required placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.FormatDate}}"{{end}} type="date" name="deadlineDate" id="deadlineDate"> - <button class="ui icon button"> - {{if ne .Issue.DeadlineUnix 0}} - {{svg "octicon-pencil"}} - {{else}} - {{svg "octicon-plus"}} - {{end}} - </button> - </form> - </div> + <form class="ui fluid action input issue-due-form form-fetch-action tw-mt-2 {{if .Issue.DeadlineUnix}}tw-hidden{{end}}" + method="post" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" + > + {{$.CsrfTokenHtml}} + <input required type="date" name="deadline" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if .Issue.DeadlineUnix}}value="{{.Issue.DeadlineUnix.FormatDate}}"{{end}}> + <button class="ui icon button">{{Iif .Issue.DeadlineUnix (svg "octicon-pencil") (svg "octicon-plus")}}</button> + </form> {{end}} </div> |