Skip to content

Commit 211135b

Browse files
authored
Fix various problems (#35012)
* Fix #35011 * Fix incorrect log message for "Protocol" * Remove unnecessary styles, fix "comment-header" wrap, fix label height
1 parent bb0c84e commit 211135b

File tree

14 files changed

+55
-62
lines changed

14 files changed

+55
-62
lines changed

modules/setting/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
275275
HTTPAddr = filepath.Join(AppWorkPath, HTTPAddr)
276276
}
277277
default:
278-
log.Fatal("Invalid PROTOCOL %q", Protocol)
278+
log.Fatal("Invalid PROTOCOL %q", protocolCfg)
279279
}
280280
UseProxyProtocol = sec.Key("USE_PROXY_PROTOCOL").MustBool(false)
281281
ProxyProtocolTLSBridging = sec.Key("PROXY_PROTOCOL_TLS_BRIDGING").MustBool(false)

templates/repo/diff/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{end}}
1010
<div class="content comment-container">
1111
<div class="comment-header">
12-
<div class="comment-header-left tw-flex tw-items-center">
12+
<div class="comment-header-left">
1313
{{if .OriginalAuthor}}
1414
<span class="text black tw-font-semibold tw-mr-1">
1515
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
@@ -30,7 +30,7 @@
3030
</span>
3131
{{end}}
3232
</div>
33-
<div class="comment-header-right actions tw-flex tw-items-center">
33+
<div class="comment-header-right">
3434
{{if .Invalidated}}
3535
{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
3636
<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">

templates/repo/issue/view_content.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{{end}}
1515
<div class="content comment-container">
1616
<div class="comment-header" role="heading" aria-level="3">
17-
<div class="comment-header-left tw-flex tw-items-center">
17+
<div class="comment-header-left">
1818
{{if .Issue.OriginalAuthor}}
1919
<span class="text black tw-font-semibold">
2020
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
@@ -36,7 +36,7 @@
3636
</span>
3737
{{end}}
3838
</div>
39-
<div class="comment-header-right actions tw-flex tw-items-center">
39+
<div class="comment-header-right">
4040
{{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true}}
4141
{{if not $.Repository.IsArchived}}
4242
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{{end}}
2828
<div class="content comment-container">
2929
<div class="comment-header" role="heading" aria-level="3">
30-
<div class="comment-header-left tw-flex tw-items-center">
30+
<div class="comment-header-left">
3131
{{if .OriginalAuthor}}
3232
<span class="text black tw-font-semibold tw-mr-1">
3333
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
@@ -51,7 +51,7 @@
5151
</span>
5252
{{end}}
5353
</div>
54-
<div class="comment-header-right actions tw-flex tw-items-center">
54+
<div class="comment-header-right">
5555
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
5656
{{if not $.Repository.IsArchived}}
5757
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
@@ -395,7 +395,7 @@
395395
<div class="timeline-item comment">
396396
<div class="content comment-container">
397397
<div class="comment-header">
398-
<div class="comment-header-left tw-flex tw-items-center">
398+
<div class="comment-header-left">
399399
{{if gt .Poster.ID 0}}
400400
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
401401
{{ctx.AvatarUtils.Avatar .Poster 24}}
@@ -416,7 +416,7 @@
416416
{{ctx.Locale.Tr "repo.issues.review.left_comment"}}
417417
</span>
418418
</div>
419-
<div class="comment-header-right actions tw-flex tw-items-center">
419+
<div class="comment-header-right">
420420
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
421421
{{if not $.Repository.IsArchived}}
422422
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}

templates/repo/issue/view_content/conversation.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<div class="comment code-comment" id="{{.HashTag}}">
5959
<div class="content comment-container">
6060
<div class="comment-header">
61-
<div class="comment-header-left tw-flex tw-items-center">
61+
<div class="comment-header-left">
6262
{{if not .OriginalAuthor}}
6363
<a class="avatar">
6464
{{ctx.AvatarUtils.Avatar .Poster 20}}
@@ -79,7 +79,7 @@
7979
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdSubStr}}
8080
</span>
8181
</div>
82-
<div class="comment-header-right actions tw-flex tw-items-center">
82+
<div class="comment-header-right">
8383
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
8484
{{if not $.Repository.IsArchived}}
8585
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}

web_src/css/base.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ details summary {
185185
cursor: pointer;
186186
}
187187

188-
details summary > * {
189-
display: inline;
190-
}
191-
192188
progress {
193189
background: var(--color-secondary-dark-1);
194190
border-radius: var(--border-radius);
@@ -474,15 +470,6 @@ a.label,
474470
color: var(--color-text-light-2);
475471
}
476472

477-
.ui.comments .comment .actions a {
478-
color: var(--color-text-light);
479-
}
480-
481-
.ui.comments .comment .actions a.active,
482-
.ui.comments .comment .actions a:hover {
483-
color: var(--color-primary);
484-
}
485-
486473
img.ui.avatar,
487474
.ui.avatar img,
488475
.ui.avatar svg {

web_src/css/modules/label.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ a.ui.label:hover {
9393
background: var(--color-button);
9494
border: 1px solid var(--color-light-border);
9595
color: var(--color-text-light);
96-
padding: calc(0.5833em - 1px) calc(0.833em - 1px);
9796
}
9897
a.ui.basic.label:hover {
9998
text-decoration: none;
@@ -254,6 +253,7 @@ a.ui.ui.ui.basic.grey.label:hover {
254253
color: var(--color-label-hover-bg);
255254
}
256255

256+
/* "horizontal label" is actually "fat label" which has enough padding spaces to be used standalone in headers */
257257
.ui.horizontal.label {
258258
margin: 0 0.5em 0 0;
259259
padding: 0.4em 0.833em;

web_src/css/repo.css

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,13 +1420,15 @@ td .commit-summary {
14201420
.comment-header {
14211421
background: var(--color-box-header);
14221422
border-bottom: 1px solid var(--color-secondary);
1423-
padding: 0 1rem;
1423+
padding: 0.5em 1rem;
14241424
position: relative;
14251425
color: var(--color-text);
14261426
min-height: 41px;
14271427
display: flex;
14281428
justify-content: space-between;
14291429
align-items: center;
1430+
flex-wrap: wrap;
1431+
gap: 0.25em;
14301432
}
14311433

14321434
.comment-header::before,
@@ -1468,17 +1470,16 @@ td .commit-summary {
14681470
left: 7px;
14691471
}
14701472

1471-
.comment-header .actions a:not(.label) {
1472-
padding: 0.5rem !important;
1473-
}
1474-
1475-
.comment-header .actions .label {
1476-
margin: 0 !important;
1473+
.comment-header-left,
1474+
.comment-header-right {
1475+
display: flex;
1476+
align-items: center;
1477+
gap: 0.5em;
14771478
}
14781479

1479-
.comment-header-left,
14801480
.comment-header-right {
1481-
gap: 4px;
1481+
flex: 1;
1482+
justify-content: end;
14821483
}
14831484

14841485
.comment-body {
@@ -2014,15 +2015,6 @@ tbody.commit-list {
20142015
.commit-table th.sha {
20152016
display: none !important;
20162017
}
2017-
.comment-header {
2018-
flex-wrap: wrap;
2019-
}
2020-
.comment-header .comment-header-left {
2021-
flex-wrap: wrap;
2022-
}
2023-
.comment-header .comment-header-right {
2024-
margin-left: auto;
2025-
}
20262018
}
20272019

20282020
.commit-status-header {

web_src/js/features/file-view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {FileRenderPlugin} from '../render/plugin.ts';
22
import {newRenderPlugin3DViewer} from '../render/plugins/3d-viewer.ts';
33
import {newRenderPluginPdfViewer} from '../render/plugins/pdf-viewer.ts';
44
import {registerGlobalInitFunc} from '../modules/observer.ts';
5-
import {createElementFromHTML, showElem, toggleClass} from '../utils/dom.ts';
5+
import {createElementFromHTML, showElem, toggleElemClass} from '../utils/dom.ts';
66
import {html} from '../utils/html.ts';
77
import {basename} from '../utils.ts';
88

@@ -21,8 +21,8 @@ function showRenderRawFileButton(elFileView: HTMLElement, renderContainer: HTMLE
2121
const toggleButtons = elFileView.querySelector('.file-view-toggle-buttons');
2222
showElem(toggleButtons);
2323
const displayingRendered = Boolean(renderContainer);
24-
toggleClass(toggleButtons.querySelectorAll('.file-view-toggle-source'), 'active', !displayingRendered); // it may not exist
25-
toggleClass(toggleButtons.querySelector('.file-view-toggle-rendered'), 'active', displayingRendered);
24+
toggleElemClass(toggleButtons.querySelectorAll('.file-view-toggle-source'), 'active', !displayingRendered); // it may not exist
25+
toggleElemClass(toggleButtons.querySelector('.file-view-toggle-rendered'), 'active', displayingRendered);
2626
// TODO: if there is only one button, hide it?
2727
}
2828

web_src/js/features/repo-graph.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {toggleClass} from '../utils/dom.ts';
1+
import {toggleElemClass} from '../utils/dom.ts';
22
import {GET} from '../modules/fetch.ts';
33
import {fomanticQuery} from '../modules/fomantic/base.ts';
44

@@ -9,11 +9,11 @@ export function initRepoGraphGit() {
99
const elColorMonochrome = document.querySelector<HTMLElement>('#flow-color-monochrome');
1010
const elColorColored = document.querySelector<HTMLElement>('#flow-color-colored');
1111
const toggleColorMode = (mode: 'monochrome' | 'colored') => {
12-
toggleClass(graphContainer, 'monochrome', mode === 'monochrome');
13-
toggleClass(graphContainer, 'colored', mode === 'colored');
12+
toggleElemClass(graphContainer, 'monochrome', mode === 'monochrome');
13+
toggleElemClass(graphContainer, 'colored', mode === 'colored');
1414

15-
toggleClass(elColorMonochrome, 'active', mode === 'monochrome');
16-
toggleClass(elColorColored, 'active', mode === 'colored');
15+
toggleElemClass(elColorMonochrome, 'active', mode === 'monochrome');
16+
toggleElemClass(elColorColored, 'active', mode === 'colored');
1717

1818
const params = new URLSearchParams(window.location.search);
1919
params.set('mode', mode);

0 commit comments

Comments
 (0)