Skip to content

Commit 00dbba7

Browse files
denyskonwxiaoguangsilverwind
authored
Several fixes for mobile UI (#25634)
Resolves #25622 <details> <summary>Screenshots</summary> ![Bildschirmfoto vom 2023-07-02 20-47-34](https://github.com/go-gitea/gitea/assets/47871822/a8a0bff6-9ae3-48f3-b008-00c196a3f8fd) ![Bildschirmfoto vom 2023-07-02 20-47-45](https://github.com/go-gitea/gitea/assets/47871822/172a0021-af74-4690-aa67-0e66688ce733) ![Bildschirmfoto vom 2023-07-02 20-48-37](https://github.com/go-gitea/gitea/assets/47871822/14572ebd-0106-4c8a-ba27-b6b631375ee6) ![Bildschirmfoto vom 2023-07-02 20-49-08](https://github.com/go-gitea/gitea/assets/47871822/7c0ba3aa-1712-482c-aae9-13394dbdaf8a) ![Bildschirmfoto vom 2023-07-02 20-50-28](https://github.com/go-gitea/gitea/assets/47871822/8bd68e26-099a-4abd-8817-16d52af13167) ![Bildschirmfoto vom 2023-07-02 20-51-46](https://github.com/go-gitea/gitea/assets/47871822/3beab8c6-3747-4829-be50-bafaed11000c) ![Bildschirmfoto vom 2023-07-02 20-54-12](https://github.com/go-gitea/gitea/assets/47871822/51f82ef3-a32c-4c27-9056-e8711ed469cc) </details> --------- Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: silverwind <[email protected]>
1 parent f35ea2b commit 00dbba7

File tree

11 files changed

+71
-39
lines changed

11 files changed

+71
-39
lines changed

templates/repo/branch/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</div>
3030
<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
3131
</td>
32-
<td class="right aligned overflow-visible">
32+
<td class="right aligned middle aligned overflow-visible">
3333
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
3434
<button class="btn interact-bg show-create-branch-modal gt-p-3"
3535
data-modal="#create-branch-modal"

templates/repo/commits_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="ui attached table segment commit-table">
2-
<table class="ui very basic striped table unstackable fixed" id="commits-table">
2+
<table class="ui very basic striped table unstackable" id="commits-table">
33
<thead>
44
<tr>
55
<th class="three wide">{{.locale.Tr "repo.commits.author"}}</th>

templates/repo/commits_table.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88
{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}}
99
{{end}}
1010
</div>
11-
<div class="commits-table-right gt-df gt-ac">
11+
<div class="commits-table-right">
1212
{{if .PageIsCommits}}
1313
<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
1414
<div class="ui tiny search input">
1515
<input name="q" placeholder="{{.locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
1616
</div>
17-
&nbsp;
18-
<div class="ui checkbox">
19-
<input type="checkbox" name="all" id="all" value="true" {{.All}}>
20-
<label for="all">{{.locale.Tr "repo.commits.search_all"}} &nbsp;&nbsp;</label>
17+
18+
<div class="ui tiny checkbox">
19+
<input type="checkbox" name="all" value="true" {{.All}}>
20+
<label>{{.locale.Tr "repo.commits.search_all"}}</label>
2121
</div>
2222
<button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{.locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button>
2323
</form>
2424
{{else if .IsDiffCompare}}
25-
<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a>
25+
<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a>
2626
...
27-
<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui green sha label">{{if not .HeadIsCommit}}{{if .HeadIsBranch}}{{svg "octicon-git-branch"}}{{else if .HeadIsTag}}{{svg "octicon-tag"}}{{end}}{{.HeadBranch}}{{else}}{{ShortSha .HeadBranch}}{{end}}</a>
27+
<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .HeadIsCommit}}{{if .HeadIsBranch}}{{svg "octicon-git-branch"}}{{else if .HeadIsTag}}{{svg "octicon-tag"}}{{end}}{{.HeadBranch}}{{else}}{{ShortSha .HeadBranch}}{{end}}</a>
2828
{{end}}
2929
</div>
3030
</h4>

templates/repo/issue/labels/labels_selector_field.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
2-
<span class="text gt-df gt-ac muted">
2+
<span class="text muted flex-text-block">
33
<strong>{{.locale.Tr "repo.issues.new.labels"}}</strong>
44
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
55
{{svg "octicon-gear" 16 "gt-ml-2"}}

templates/repo/issue/new_form.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959

6060
<input id="milestone_id" name="milestone_id" type="hidden" value="{{.milestone_id}}">
6161
<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-milestone dropdown">
62-
<span class="text">
62+
<span class="text flex-text-block">
6363
<strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong>
6464
{{if .HasIssuesOrPullsWritePermission}}
65-
{{svg "octicon-gear"}}
65+
{{svg "octicon-gear" 16 "gt-ml-2"}}
6666
{{end}}
6767
</span>
6868
<div class="menu">
@@ -86,10 +86,10 @@
8686

8787
<input id="project_id" name="project_id" type="hidden" value="{{.project_id}}">
8888
<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-project dropdown">
89-
<span class="text">
89+
<span class="text flex-text-block">
9090
<strong>{{.locale.Tr "repo.issues.new.projects"}}</strong>
9191
{{if .HasIssuesOrPullsWritePermission}}
92-
{{svg "octicon-gear"}}
92+
{{svg "octicon-gear" 16 "gt-ml-2"}}
9393
{{end}}
9494
</span>
9595
<div class="menu">
@@ -144,10 +144,10 @@
144144
<div class="divider"></div>
145145
<input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_ids}}">
146146
<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-assignees dropdown">
147-
<span class="text">
147+
<span class="text flex-text-block">
148148
<strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong>
149149
{{if .HasIssuesOrPullsWritePermission}}
150-
{{svg "octicon-gear"}}
150+
{{svg "octicon-gear" 16 "gt-ml-2"}}
151151
{{end}}
152152
</span>
153153
<div class="filter menu" data-id="#assignee_ids">

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<div class="divider"></div>
128128

129129
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
130-
<a class="text gt-df gt-ac muted">
130+
<a class="text muted flex-text-block">
131131
<strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong>
132132
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
133133
{{svg "octicon-gear" 16 "gt-ml-2"}}
@@ -153,7 +153,7 @@
153153
<div class="divider"></div>
154154

155155
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
156-
<a class="text gt-df gt-ac muted">
156+
<a class="text muted flex-text-block">
157157
<strong>{{.locale.Tr "repo.issues.new.projects"}}</strong>
158158
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
159159
{{svg "octicon-gear" 16 "gt-ml-2"}}
@@ -207,7 +207,7 @@
207207

208208
<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
209209
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
210-
<a class="text gt-df gt-ac muted">
210+
<a class="text muted flex-text-block">
211211
<strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong>
212212
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
213213
{{svg "octicon-gear" 16 "gt-ml-2"}}

templates/shared/combomarkdowneditor.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Template Attributes:
1919
</div>
2020
{{end}}
2121
<div class="ui tab active" data-tab-panel="markdown-writer">
22-
<markdown-toolbar class="gt-gap-3">
22+
<markdown-toolbar>
2323
<div class="markdown-toolbar-group">
2424
<md-header class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.buttons.heading.tooltip"}}">{{svg "octicon-heading"}}</md-header>
2525
<md-bold class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.buttons.bold.tooltip"}}">{{svg "octicon-bold"}}</md-bold>

web_src/css/admin.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@
4242
.admin .ui.table.segment {
4343
overflow-x: auto; /* if the screen width is small, many wide tables (eg: user list) need scroll bars */
4444
}
45+
46+
.admin .table th {
47+
white-space: nowrap;
48+
}

web_src/css/editor/combomarkdowneditor.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
display: flex;
88
align-items: center;
99
padding-bottom: 10px;
10+
gap: .5rem;
11+
flex-wrap: wrap;
1012
}
1113

1214
.combo-markdown-editor .markdown-toolbar-group {

web_src/css/repo.css

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,26 @@
655655
.repository.view.issue .issue-title {
656656
flex-direction: column;
657657
}
658+
.repository.view.issue .issue-title-buttons,
659+
.repository.view.issue .edit-buttons {
660+
width: 100%;
661+
justify-content: space-between;
662+
}
658663
.repository.view.issue .edit-buttons {
659664
margin-top: .5rem;
660665
}
666+
.comment.form .issue-content-left .avatar {
667+
display: none;
668+
}
669+
.comment.form .issue-content-left .content {
670+
margin-left: 0 !important;
671+
}
672+
.comment.form .issue-content-left .content::before,
673+
.comment.form .issue-content-left .content::after,
674+
.comment.form .content .form::before,
675+
.comment.form .content .form::after {
676+
display: none;
677+
}
661678
}
662679

663680
.repository.view.issue .issue-title {
@@ -1197,7 +1214,14 @@
11971214
text-align: left;
11981215
}
11991216

1200-
.repository.compare.pull .choose.branch .svg {
1217+
.repository .choose.branch {
1218+
display: flex;
1219+
align-items: center;
1220+
gap: 8px;
1221+
flex-wrap: wrap;
1222+
}
1223+
1224+
.repository .choose.branch .svg {
12011225
margin-right: 10px;
12021226
}
12031227

@@ -2036,12 +2060,15 @@
20362060
.repository .ui.segment.sub-menu .list {
20372061
width: 100%;
20382062
display: flex;
2039-
align-items: center;
2063+
align-items: stretch;
20402064
}
20412065

20422066
.repository .ui.segment.sub-menu .list .item {
20432067
width: 100%;
20442068
color: var(--color-text);
2069+
display: flex;
2070+
align-items: center;
2071+
justify-content: center;
20452072
}
20462073

20472074
.repository .ui.segment.sub-menu .list .item:first-of-type {
@@ -3124,6 +3151,14 @@ tbody.commit-list {
31243151
text-wrap: balance;
31253152
}
31263153

3154+
.commits-table .commits-table-right form {
3155+
display: flex;
3156+
align-items: center;
3157+
gap: 0.75em;
3158+
justify-content: center;
3159+
flex-wrap: wrap;
3160+
}
3161+
31273162
@media (max-width: 767.98px) {
31283163
.repository.file.list #repo-files-table .entry,
31293164
.repository.file.list #repo-files-table .commit-list {
@@ -3193,21 +3228,14 @@ tbody.commit-list {
31933228
align-items: initial !important;
31943229
margin-bottom: 6px;
31953230
}
3196-
.commits-table .commits-table-right form {
3197-
display: flex;
3198-
flex-wrap: wrap;
3199-
}
32003231
.commits-table .commits-table-right form > div:nth-child(1) {
3201-
order: 1;
3232+
order: 1; /* the "commit search" input */
32023233
}
32033234
.commits-table .commits-table-right form > div:nth-child(2) {
3204-
order: 3;
3205-
margin-left: 0.5rem;
3206-
margin-top: 0.5rem;
3235+
order: 3; /* the "search all" checkbox */
32073236
}
32083237
.commits-table .commits-table-right form > button:nth-child(3) {
3209-
order: 2;
3210-
margin-left: 0.25rem;
3238+
order: 2; /* the "search" button */
32113239
}
32123240
.commit-table {
32133241
overflow-x: auto;
@@ -3219,9 +3247,9 @@ tbody.commit-list {
32193247
.commit-table .commit-list span.message-wrapper {
32203248
max-width: none;
32213249
}
3250+
.commit-table .commit-list tr td:first-child,
32223251
.commit-table .commit-list tr td:last-child {
3223-
display: block;
3224-
width: max-content;
3252+
white-space: nowrap;
32253253
}
32263254
.commit-table .commit-list td.author {
32273255
display: block;

web_src/js/components/RepoActionView.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ export function initRepositoryActionView() {
498498
499499
<style scoped>
500500
.action-view-body {
501+
padding-top: 12px;
502+
padding-bottom: 12px;
501503
display: flex;
502504
gap: 12px;
503505
}
@@ -531,11 +533,6 @@ export function initRepositoryActionView() {
531533
margin: 0 0 0 28px;
532534
}
533535
534-
.action-view-left, .action-view-right {
535-
padding-top: 12px;
536-
padding-bottom: 12px;
537-
}
538-
539536
/* ================ */
540537
/* action view left */
541538
@@ -749,6 +746,7 @@ export function initRepositoryActionView() {
749746
background-color: var(--color-console-bg);
750747
max-height: 100%;
751748
border-radius: 0 0 var(--border-radius) var(--border-radius);
749+
z-index: 0;
752750
}
753751
754752
.job-step-container .job-step-summary {

0 commit comments

Comments
 (0)