Skip to content

Commit b673edb

Browse files
GiteaBotdenyskonsilverwind
authored
Fix UI on mobile view (#25315) (#25340)
Backport #25315 by @denyskon Various fixes to pages or elements which were looking ugly on mobile. <details> <summary>Screenshots</summary> ![Bildschirmfoto vom 2023-06-17 20-38-41](https://github.com/go-gitea/gitea/assets/47871822/30b5d3ce-df3b-43eb-a4c2-c3790667fb9d) ![Bildschirmfoto vom 2023-06-17 20-39-27](https://github.com/go-gitea/gitea/assets/47871822/27c07b25-3602-4fb2-b34d-d5e875e054e9) ![Bildschirmfoto vom 2023-06-17 20-41-27](https://github.com/go-gitea/gitea/assets/47871822/dacdbb4e-e3dd-4b94-abf0-c68e3d64bd3b) ![Bildschirmfoto vom 2023-06-17 20-41-48](https://github.com/go-gitea/gitea/assets/47871822/72432c35-7c4a-4c7f-a767-3562f26a5c14) ![Bildschirmfoto vom 2023-06-17 20-42-37](https://github.com/go-gitea/gitea/assets/47871822/737c26ed-1910-4467-98ef-e8769bbbe6f0) ![Bildschirmfoto vom 2023-06-17 20-42-52](https://github.com/go-gitea/gitea/assets/47871822/1813b4bc-43c0-4912-8acb-5d799c090bf3) ![Bildschirmfoto vom 2023-06-17 20-43-06](https://github.com/go-gitea/gitea/assets/47871822/136466e8-34e5-419d-97ec-5202ff819fd2) ![Bildschirmfoto vom 2023-06-17 20-43-42](https://github.com/go-gitea/gitea/assets/47871822/59270bb2-d661-4a84-8504-3e50f771f767) ![Bildschirmfoto vom 2023-06-17 20-44-44](https://github.com/go-gitea/gitea/assets/47871822/494e274d-3771-4141-9419-0a4bbd8b7f64) </details> Co-authored by: @silverwind Co-authored-by: Denys Konovalov <[email protected]> Co-authored-by: silverwind <[email protected]>
1 parent 0543159 commit b673edb

File tree

17 files changed

+329
-201
lines changed

17 files changed

+329
-201
lines changed

templates/projects/list.tmpl

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,36 @@
3535
</div>
3636
</div>
3737
</div>
38-
<div class="milestone list">
38+
<div class="milestone-list">
3939
{{range .Projects}}
40-
<li class="item">
41-
{{svg .IconName}} <a href="{{.Link}}">{{.Title}}</a>
42-
<div class="meta">
43-
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
44-
{{if .IsClosed}}
45-
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
40+
<li class="milestone-card">
41+
<h3 class="flex-text-block gt-m-0">
42+
{{svg .IconName 16}}
43+
<a class="muted" href="{{.Link}}">{{.Title}}</a>
44+
</h3>
45+
<div class="milestone-toolbar">
46+
<div class="group">
47+
<div class="flex-text-block">
48+
{{svg "octicon-issue-opened" 14}}
49+
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
50+
</div>
51+
<div class="flex-text-block">
52+
{{svg "octicon-check" 14}}
53+
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
54+
</div>
55+
</div>
56+
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
57+
<div class="group">
58+
<a class="flex-text-inline" href="{{.Link}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
59+
{{if .IsClosed}}
60+
<a class="link-action flex-text-inline" href data-url="{{.Link}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.projects.open"}}</a>
61+
{{else}}
62+
<a class="link-action flex-text-inline" href data-url="{{.Link}}/close">{{svg "octicon-skip" 14}}{{$.locale.Tr "repo.projects.close"}}</a>
63+
{{end}}
64+
<a class="delete-button flex-text-inline" href="#" data-url="{{.Link}}/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}} tesssst</a>
65+
</div>
4666
{{end}}
47-
<span class="issue-stats">
48-
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
49-
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
50-
{{svg "octicon-check" 16 "gt-mr-3"}}
51-
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
52-
</span>
5367
</div>
54-
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
55-
<div class="ui right operate">
56-
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
57-
{{if .IsClosed}}
58-
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
59-
{{else}}
60-
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
61-
{{end}}
62-
<a class="delete-button" href="#" data-url="{{$.Link}}/{{.ID}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
63-
</div>
64-
{{end}}
6568
{{if .Description}}
6669
<div class="content">
6770
{{.RenderedContent|Str2html}}

templates/projects/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
{{if $.CanWriteProjects}}
4747
<div class="column right aligned">
4848
<div class="ui compact right small menu">
49-
<a class="item" href="{{$.Link}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
49+
<a class="item" href="{{$.Link}}/edit?redirect=project">
5050
{{svg "octicon-pencil"}}
5151
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
5252
</a>

templates/repo/activity.tmpl

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<h2 class="ui header">{{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}}
6-
<div class="ui right">
7-
<!-- Period -->
8-
<div class="ui floating dropdown jump filter">
9-
<div class="ui basic compact button">
10-
<span class="text">
11-
{{.locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
12-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
13-
</span>
14-
</div>
15-
<div class="menu">
16-
<a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.locale.Tr "repo.activity.period.daily"}}</a>
17-
<a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.locale.Tr "repo.activity.period.halfweekly"}}</a>
18-
<a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.locale.Tr "repo.activity.period.weekly"}}</a>
19-
<a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.locale.Tr "repo.activity.period.monthly"}}</a>
20-
<a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.locale.Tr "repo.activity.period.quarterly"}}</a>
21-
<a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.locale.Tr "repo.activity.period.semiyearly"}}</a>
22-
<a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.locale.Tr "repo.activity.period.yearly"}}</a>
23-
</div>
5+
<h2 class="ui header activity-header">
6+
<span>{{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}}</span>
7+
<!-- Period -->
8+
<div class="ui floating dropdown jump filter">
9+
<div class="ui basic compact button">
10+
<span class="text">
11+
{{.locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
12+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
13+
</span>
14+
</div>
15+
<div class="menu">
16+
<a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.locale.Tr "repo.activity.period.daily"}}</a>
17+
<a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.locale.Tr "repo.activity.period.halfweekly"}}</a>
18+
<a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.locale.Tr "repo.activity.period.weekly"}}</a>
19+
<a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.locale.Tr "repo.activity.period.monthly"}}</a>
20+
<a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.locale.Tr "repo.activity.period.quarterly"}}</a>
21+
<a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.locale.Tr "repo.activity.period.semiyearly"}}</a>
22+
<a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.locale.Tr "repo.activity.period.yearly"}}</a>
2423
</div>
2524
</div>
2625
</h2>

templates/repo/empty.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="item">
2727
<h3>{{.locale.Tr "repo.clone_this_repo"}} <small>{{.locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3>
2828

29-
<div class="gt-df">
29+
<div class="repo-button-row">
3030
{{if and .CanWriteCode (not .Repository.IsArchived)}}
3131
<a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/">
3232
{{.locale.Tr "repo.editor.new_file"}}
@@ -44,7 +44,7 @@
4444
</div>
4545

4646
{{if not .Repository.IsArchived}}
47-
<div class="ui divider"></div>
47+
<div class="ui divider gt-my-0"></div>
4848

4949
<div class="item">
5050
<h3>{{.locale.Tr "repo.create_new_repo_command"}}</h3>

templates/repo/issue/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@
7171
{{template "repo/issue/search" .}}
7272
{{if not .Repository.IsArchived}}
7373
{{if .PageIsIssueList}}
74-
<a class="ui small green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
74+
<a class="ui small green button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
7575
{{else}}
76-
<a class="ui small green button new-pr-button{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
76+
<a class="ui small green button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
7777
{{end}}
7878
{{else}}
7979
{{if not .PageIsIssueList}}
80-
<a class="ui small green small button{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
80+
<a class="ui small green small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
8181
{{end}}
8282
{{end}}
8383
</div>

templates/repo/issue/milestones.tmpl

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{template "base/alert" .}}
1414

1515
<div class="list-header">
16-
<div class="small-menu-items ui compact tiny menu">
16+
<div class="small-menu-items ui compact tiny menu list-header-toggle">
1717
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}">
1818
{{svg "octicon-milestone" 16 "gt-mr-3"}}
1919
{{.locale.PrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
@@ -53,50 +53,70 @@
5353
</div>
5454

5555
<!-- milestone list -->
56-
<div class="milestone list">
56+
<div class="milestone-list">
5757
{{range .Milestones}}
58-
<li class="item">
59-
<div class="gt-df gt-ac gt-sb">
60-
<h3 class="gt-df gt-ac gt-m-0 gt-fw">
61-
{{svg "octicon-milestone" 16 "gt-mr-3"}}<a class="muted" href="{{$.RepoLink}}/milestone/{{.ID}}">{{.Name}}</a>
58+
<li class="milestone-card">
59+
<div class="milestone-header">
60+
<h3 class="flex-text-block gt-m-0">
61+
{{svg "octicon-milestone" 16}}
62+
<a class="muted" href="{{$.RepoLink}}/milestone/{{.ID}}">{{.Name}}</a>
6263
</h3>
6364
<div class="gt-df gt-ac">
6465
<span class="gt-mr-3">{{.Completeness}}%</span>
6566
<progress value="{{.Completeness}}" max="100"></progress>
6667
</div>
6768
</div>
68-
<div class="meta">
69-
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
70-
{{if .IsClosed}}
71-
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
72-
{{else}}
73-
{{svg "octicon-calendar"}}
74-
{{if .DeadlineString}}
75-
<span {{if .IsOverdue}}class="overdue"{{end}}>{{DateTime "short" .DeadlineString}}</span>
76-
{{else}}
77-
{{$.locale.Tr "repo.milestones.no_due_date"}}
69+
<div class="milestone-toolbar">
70+
<div class="group">
71+
<div class="flex-text-block">
72+
{{svg "octicon-issue-opened" 14}}
73+
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
74+
</div>
75+
<div class="flex-text-block">
76+
{{svg "octicon-check" 14}}
77+
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
78+
</div>
79+
{{if .TotalTrackedTime}}
80+
<div class="flex-text-block">
81+
{{svg "octicon-clock"}}
82+
{{.TotalTrackedTime|Sec2Time}}
83+
</div>
7884
{{end}}
79-
{{end}}
80-
<span class="issue-stats">
81-
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
82-
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
83-
{{svg "octicon-check" 16 "gt-mr-3"}}
84-
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
85-
{{if .TotalTrackedTime}}{{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}{{end}}
86-
{{if .UpdatedUnix}}{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}}{{end}}
87-
</span>
88-
</div>
89-
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
90-
<div class="ui right operate">
91-
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
92-
{{if .IsClosed}}
93-
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.milestones.open"}}</a>
94-
{{else}}
95-
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x"}} {{$.locale.Tr "repo.milestones.close"}}</a>
85+
{{if .UpdatedUnix}}
86+
<div class="flex-text-block">
87+
{{svg "octicon-clock"}}
88+
{{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}}
89+
</div>
9690
{{end}}
97-
<a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
91+
<div class="flex-text-block">
92+
{{if .IsClosed}}
93+
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
94+
{{svg "octicon-clock" 14}}
95+
{{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
96+
{{else}}
97+
{{svg "octicon-calendar" 14}}
98+
{{if .DeadlineString}}
99+
<span {{if .IsOverdue}}class="overdue"{{end}}>
100+
{{DateTime "short" .DeadlineString}}
101+
</span>
102+
{{else}}
103+
{{$.locale.Tr "repo.milestones.no_due_date"}}
104+
{{end}}
105+
{{end}}
106+
</div>
98107
</div>
99-
{{end}}
108+
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
109+
<div class="group">
110+
<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
111+
{{if .IsClosed}}
112+
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.milestones.open"}}</a>
113+
{{else}}
114+
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a>
115+
{{end}}
116+
<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
117+
</div>
118+
{{end}}
119+
</div>
100120
{{if .Content}}
101121
<div class="markup content">
102122
{{.RenderedContent|Str2html}}

templates/repo/issue/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 class="ui compact small menu header small-menu-items">
1+
<h2 class="ui compact small menu header small-menu-items issue-list-navbar">
22
<a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{.locale.Tr "repo.labels"}}</a>
33
<a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{.locale.Tr "repo.milestones"}}</a>
44
</h2>

templates/repo/issue/search.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form class="list-header-search ui form ignore-dirty">
1+
<form class="list-header-search ui form ignore-dirty issue-list-search">
22
<div class="ui small search fluid action input">
33
<input type="hidden" name="type" value="{{$.ViewType}}">
44
<input type="hidden" name="state" value="{{$.State}}">

templates/repo/projects/list.tmpl

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository projects milestones">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<div class="navbar gt-mb-4">
5+
<div class="navbar projects-header">
66
<div>
77
<div class="small-menu-items ui compact tiny menu">
88
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/projects?state=open">
@@ -15,7 +15,7 @@
1515
</a>
1616
</div>
1717
</div>
18-
<div>
18+
<div class="projects-toolbar">
1919
<!-- Sort -->
2020
<div class="ui small dropdown type jump item">
2121
<span class="text">
@@ -35,33 +35,36 @@
3535
</div>
3636
{{template "base/alert" .}}
3737

38-
<div class="milestone list">
38+
<div class="milestone-list">
3939
{{range .Projects}}
40-
<li class="item">
41-
{{svg .IconName}} <a href="{{.Link}}">{{.Title}}</a>
42-
<div class="meta">
43-
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
44-
{{if .IsClosed}}
45-
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
46-
{{end}}
47-
<span class="issue-stats">
48-
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
49-
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
50-
{{svg "octicon-check" 16 "gt-mr-3"}}
51-
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
52-
</span>
53-
</div>
54-
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
55-
<div class="ui right operate">
56-
<a href="{{.Link}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
57-
{{if .IsClosed}}
58-
<a class="link-action" href data-url="{{.Link}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
59-
{{else}}
60-
<a class="link-action" href data-url="{{.Link}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
40+
<li class="milestone-card">
41+
<h3 class="flex-text-block gt-m-0">
42+
{{svg .IconName 16}}
43+
<a class="muted" href="{{.Link}}">{{.Title}}</a>
44+
</h3>
45+
<div class="milestone-toolbar">
46+
<div class="group">
47+
<div class="flex-text-block">
48+
{{svg "octicon-issue-opened" 14}}
49+
{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
50+
</div>
51+
<div class="flex-text-block">
52+
{{svg "octicon-check" 14}}
53+
{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
54+
</div>
55+
</div>
56+
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
57+
<div class="group">
58+
<a class="flex-text-inline" href="{{.Link}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
59+
{{if .IsClosed}}
60+
<a class="link-action flex-text-inline" href data-url="{{.Link}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.projects.open"}}</a>
61+
{{else}}
62+
<a class="link-action flex-text-inline" href data-url="{{.Link}}/close">{{svg "octicon-skip" 14}}{{$.locale.Tr "repo.projects.close"}}</a>
63+
{{end}}
64+
<a class="delete-button flex-text-inline" href="#" data-url="{{.Link}}/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
65+
</div>
6166
{{end}}
62-
<a class="delete-button" href="#" data-url="{{.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
6367
</div>
64-
{{end}}
6568
{{if .Description}}
6669
<div class="content">
6770
{{.RenderedContent|Str2html}}

templates/repo/projects/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
5151
<div class="column right aligned">
5252
<div class="ui compact right small menu">
53-
<a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
53+
<a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit?redirect=project">
5454
{{svg "octicon-pencil"}}
5555
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
5656
</a>

0 commit comments

Comments
 (0)