From f418e14e39a0d5c3159d6d09dd903187d545502c Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 14 Jun 2023 21:19:54 +0200 Subject: [PATCH 1/2] Various UI fixes --- templates/admin/notice.tmpl | 2 +- templates/projects/list.tmpl | 17 +++++--- templates/projects/view.tmpl | 2 +- templates/repo/issue/milestones.tmpl | 50 +++++++++++++++------- templates/repo/projects/list.tmpl | 17 +++++--- templates/repo/projects/view.tmpl | 2 +- templates/repo/view_list.tmpl | 2 +- templates/user/dashboard/milestones.tmpl | 51 +++++++++++++++-------- templates/user/settings/organization.tmpl | 6 +-- templates/user/settings/repos.tmpl | 4 +- web_src/css/base.css | 7 ++++ web_src/css/repo.css | 8 ---- 12 files changed, 106 insertions(+), 62 deletions(-) diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 3dbae04625751..5cd617a0b591b 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -3,7 +3,7 @@

{{.locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}})

- +
diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index e9e86e5d5d585..4cf601daf09b5 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -38,17 +38,22 @@
{{range .Projects}}
  • - {{svg .IconName}} {{.Title}} + {{svg .IconName 16 "gt-mr-3"}} + {{.Title}}
    {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{if .IsClosed}} {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{end}} - - {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} - {{svg "octicon-check" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} + +
    + {{svg "octicon-issue-opened" 14}} + {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} +
    {{if and $.CanWriteProjects (not $.Repository.IsArchived)}} diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index a7209e0c21743..0d56769d39207 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -45,7 +45,7 @@
  • {{if $.CanWriteProjects}}
    -
    - {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} - {{if .IsClosed}} - {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} - {{else}} - {{svg "octicon-calendar"}} - {{if .DeadlineString}} - {{DateTime "short" .DeadlineString}} + +
    + {{svg "octicon-issue-opened"}} + {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} +
    + {{if .TotalTrackedTime}} +
    + {{svg "octicon-clock" 14}} {{.TotalTrackedTime|Sec2Time}} +
    + {{end}} + {{if .UpdatedUnix}} +
    + {{svg "octicon-clock" 14}}{{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}} +
    + {{end}} + {{if .IsClosed}} +
    + {{svg "octicon-clock" 14}} + {{$.locale.Tr "repo.milestones.closed" (TimeSinceUnix .ClosedDateUnix $.locale) | Safe}} +
    {{else}} - {{$.locale.Tr "repo.milestones.no_due_date"}} +
    + {{svg "octicon-calendar" 14}} + {{if .DeadlineString}} + + {{DateTime "short" .DeadlineString}} + + {{else}} + {{$.locale.Tr "repo.milestones.no_due_date"}} + {{end}} +
    {{end}} - {{end}} - - {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} - {{svg "octicon-check" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} - {{if .TotalTrackedTime}}{{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}{{end}} - {{if .UpdatedUnix}}{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}}{{end}}
    {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl index a5f99cee66a04..bdfe311ab149b 100644 --- a/templates/repo/projects/list.tmpl +++ b/templates/repo/projects/list.tmpl @@ -38,17 +38,22 @@
    {{range .Projects}}
  • - {{svg .IconName}} {{.Title}} + {{svg .IconName 16 "gt-mr-3"}} + {{.Title}}
    {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{if .IsClosed}} {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{end}} - - {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} - {{svg "octicon-check" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} + +
    + {{svg "octicon-issue-opened" 14}} + {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} +
    {{if and $.CanWriteProjects (not $.Repository.IsArchived)}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index 068c42838a571..edee97e2174ad 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -49,7 +49,7 @@
  • {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
    {{if .HasParentPath}} - + {{end}} {{range $item := .Files}} diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl index 372d3c7b99f9a..060bab676cb73 100644 --- a/templates/user/dashboard/milestones.tmpl +++ b/templates/user/dashboard/milestones.tmpl @@ -85,24 +85,41 @@
    - {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} - {{if .IsClosed}} - {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} - {{else}} - {{svg "octicon-calendar"}} - {{if .DeadlineString}} - {{DateTime "short" .DeadlineString}} - {{else}} - {{$.locale.Tr "repo.milestones.no_due_date"}} - {{end}} - {{end}} - - {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} - {{svg "octicon-check" 16 "gt-mr-3"}} - {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} + +
    + {{svg "octicon-issue-opened"}} + {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} +
    {{if .TotalTrackedTime}} - {{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}} +
    + {{svg "octicon-clock" 14}} {{.TotalTrackedTime|Sec2Time}} +
    + {{end}} + {{if .UpdatedUnix}} +
    + {{svg "octicon-clock" 14}}{{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}} +
    + {{end}} + {{if .IsClosed}} +
    + {{svg "octicon-clock" 14}} + {{$.locale.Tr "repo.milestones.closed" (TimeSinceUnix .ClosedDateUnix $.locale) | Safe}} +
    + {{else}} +
    + {{svg "octicon-calendar" 14}} + {{if .DeadlineString}} + + {{DateTime "short" .DeadlineString}} + + {{else}} + {{$.locale.Tr "repo.milestones.no_due_date"}} + {{end}} +
    {{end}}
    diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl index 2e10588fd8f25..9b6d0f66c5eb8 100644 --- a/templates/user/settings/organization.tmpl +++ b/templates/user/settings/organization.tmpl @@ -23,9 +23,9 @@ - {{avatar $.Context . 28 "mini"}} -
    - {{.Name}} +
    + {{avatar $.Context . 28 "mini"}} + {{.Name}}
    {{end}} diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl index 64b08ca2c5407..d2164d199a08d 100644 --- a/templates/user/settings/repos.tmpl +++ b/templates/user/settings/repos.tmpl @@ -23,8 +23,8 @@ {{else}} {{svg "octicon-repo"}} {{end}} - {{$repo.OwnerName}}/{{$repo.Name}} - {{FileSize $repo.Size}} + {{$repo.OwnerName}}/{{$repo.Name}} + {{FileSize $repo.Size}} {{if $repo.IsFork}} {{$.locale.Tr "repo.forked_from"}} {{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}} diff --git a/web_src/css/base.css b/web_src/css/base.css index d2aa64e6ede60..a00ae2c14253a 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -869,6 +869,13 @@ a.label, border-color: var(--color-secondary); } +.ui.table > tfoot > tr > th, +.ui.table > tfoot > tr > td { + border-color: var(--color-secondary); + background: var(--color-box-body); + color: var(--color-text); +} + img.ui.avatar, .ui.avatar img, .ui.avatar svg { diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 674f8c9e67700..b8d54ef6c1aa3 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1190,10 +1190,6 @@ padding-top: 5px; } -.repository .milestone.list > .item .meta .issue-stats .svg { - padding-left: 5px; -} - .repository .milestone.list > .item .meta .overdue { color: var(--color-red); } @@ -1975,10 +1971,6 @@ line-height: 2em; } -.repository.settings.collaboration .collaborator.list > .item:not(:last-child) { - border-bottom: 1px solid var(--color-secondary); -} - .repository.settings.collaboration #repo-collab-form #search-user-box .results { left: 7px; } From b483ad8e40d4730f016c5e99970c56b1bb7e9ae8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 21 Jun 2023 22:32:06 +0200 Subject: [PATCH 2/2] tweak overdue, remove the extra class --- templates/repo/issue/milestone_issues.tmpl | 8 ++++++-- templates/repo/issue/milestones.tmpl | 5 +++-- templates/shared/issuelist.tmpl | 2 +- templates/user/dashboard/milestones.tmpl | 5 +++-- web_src/css/shared/issuelist.css | 4 ---- web_src/css/shared/milestone.css | 4 ---- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 3a103bd5e0c72..3cd84d5456f2c 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -33,10 +33,14 @@ {{if .IsClosed}} {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} - {{svg "octicon-calendar"}} + {{if .Milestone.DeadlineString}} - {{DateTime "short" .Milestone.DeadlineString}} + + {{svg "octicon-calendar"}} + {{DateTime "short" .Milestone.DeadlineString}} + {{else}} + {{svg "octicon-calendar"}} {{$.locale.Tr "repo.milestones.no_due_date"}} {{end}} {{end}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 46bb060877334..da239b694a429 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -94,12 +94,13 @@ {{svg "octicon-clock" 14}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} - {{svg "octicon-calendar" 14}} {{if .DeadlineString}} - + + {{svg "octicon-calendar" 14}} {{DateTime "short" .DeadlineString}} {{else}} + {{svg "octicon-calendar" 14}} {{$.locale.Tr "repo.milestones.no_due_date"}} {{end}} {{end}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 8ae00a2ba944c..192911d13a3b0 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -84,7 +84,7 @@ {{end}} {{if ne .DeadlineUnix 0}} - + {{svg "octicon-calendar" 14 "gt-mr-2"}} {{DateTime "short" .DeadlineUnix}} diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl index 23b7b27116bbc..c68d0783b82a3 100644 --- a/templates/user/dashboard/milestones.tmpl +++ b/templates/user/dashboard/milestones.tmpl @@ -115,12 +115,13 @@ {{svg "octicon-clock" 14}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} - {{svg "octicon-calendar" 14}} {{if .DeadlineString}} - + + {{svg "octicon-calendar" 14}} {{DateTime "short" .DeadlineString}} {{else}} + {{svg "octicon-calendar" 14}} {{$.locale.Tr "repo.milestones.no_due_date"}} {{end}} {{end}} diff --git a/web_src/css/shared/issuelist.css b/web_src/css/shared/issuelist.css index ecbeaf1dfdb40..b20fd1a80e1b9 100644 --- a/web_src/css/shared/issuelist.css +++ b/web_src/css/shared/issuelist.css @@ -135,10 +135,6 @@ margin-right: -4px; } -.issue.list > .item .desc .overdue { - color: var(--color-red); -} - .issue.list .branches { display: inline-flex; padding: 0 4px; diff --git a/web_src/css/shared/milestone.css b/web_src/css/shared/milestone.css index 511a1be714e07..91e6b5e387c4f 100644 --- a/web_src/css/shared/milestone.css +++ b/web_src/css/shared/milestone.css @@ -44,10 +44,6 @@ gap: 8px; } -.milestone-toolbar .group .overdue { - color: var(--color-red); -} - .milestone-toolbar .group > a { font-size: 15px; color: var(--color-text-light-2);
    {{svg "octicon-reply"}}..{{svg "octicon-reply"}}..