Skip to content

Commit b5677da

Browse files
committed
Repo button row tweaks
1 parent 2ee93ea commit b5677da

File tree

4 files changed

+40
-19
lines changed

4 files changed

+40
-19
lines changed

templates/repo/clone_buttons.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SSH
1010
</button>
1111
{{end}}
12-
<input id="repo-clone-url" size="20" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
12+
<input id="repo-clone-url" size="10" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
1313
<button class="ui small icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
1414
{{svg "octicon-copy" 14}}
1515
</button>

templates/repo/home.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
{{$l := Eval $n "-" 1}}
4747
{{$isHomepage := (eq $n 0)}}
4848
<div class="repo-button-row">
49-
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-y-2">
49+
<div class="repo-button-row-left tw-flex tw-flex-1 tw-items-center tw-gap-2">
5050
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}}
5151
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
5252
{{$cmpBranch := ""}}
@@ -66,7 +66,7 @@
6666
{{end}}
6767

6868
{{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}}
69-
<button class="ui dropdown basic compact jump button tw-mr-1"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
69+
<button class="ui dropdown basic compact jump button"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
7070
{{ctx.Locale.Tr "repo.editor.add_file"}}
7171
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
7272
<div class="menu">
@@ -104,14 +104,14 @@
104104
</span>
105105
{{end}}
106106

107-
<form class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
108-
<div class="ui small action input">
109-
<input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
107+
<form class="tw-flex tw-flex-1" class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
108+
<div class="ui small action input tw-flex-1">
109+
<input name="q" value="{{.Keyword}}" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
110110
{{template "shared/search/button"}}
111111
</div>
112112
</form>
113113
</div>
114-
<div class="tw-flex tw-items-center">
114+
<div class="repo-button-row-right tw-flex tw-flex-1 tw-items-center">
115115
<!-- Only show clone panel in repository home page -->
116116
{{if $isHomepage}}
117117
<div class="clone-panel ui action tiny input">

web_src/css/modules/input.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188
.ui.action.input:not([class*="left action"]) > input:focus + .ui.dropdown.selection:hover,
189189
.ui.action.input:not([class*="left action"]) > input:focus + .button,
190190
.ui.action.input:not([class*="left action"]) > input:focus + .button:hover,
191-
.ui.action.input:not([class*="left action"]) > input:focus + .icon + .button,
192-
.ui.action.input:not([class*="left action"]) > input:focus + .icon + .button:hover {
191+
.ui.action.input:not([class*="left action"]) > input:focus + i.icon + .button,
192+
.ui.action.input:not([class*="left action"]) > input:focus + i.icon + .button:hover {
193193
border-left-color: var(--color-primary);
194194
}
195195
.ui.action.input:not([class*="left action"]) > input:focus {

web_src/css/repo.css

+31-10
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,22 @@
128128
margin-bottom: 12px;
129129
}
130130

131-
.repository .clone-panel #repo-clone-url {
132-
width: 320px;
133-
border-radius: 0;
131+
.repository .clone-panel {
132+
display: flex;
133+
flex: 1;
134134
}
135135

136-
@media (max-width: 991.98px) {
137-
.repository .clone-panel #repo-clone-url {
138-
width: 200px;
139-
}
136+
.repository.wiki .clone-panel {
137+
flex: 0;
138+
}
139+
140+
.repository.wiki .clone-panel input {
141+
width: 20ch;
142+
}
143+
144+
.repository .clone-panel #repo-clone-url {
145+
border-radius: 0;
146+
flex: 1;
140147
}
141148

142149
.repository .ui.action.input.clone-panel > button + button,
@@ -2234,17 +2241,25 @@ td .commit-summary {
22342241
}
22352242

22362243
.repo-button-row {
2237-
margin: 10px 0;
2244+
margin: 8px 0;
22382245
display: flex;
22392246
align-items: center;
2240-
gap: 0.5em;
2241-
flex-wrap: wrap;
2247+
gap: 8px;
22422248
justify-content: space-between;
22432249
}
22442250

2251+
@media (max-width: 991px) {
2252+
.repository:not(.wiki) .repo-button-row {
2253+
flex-direction: column;
2254+
align-items: stretch;
2255+
}
2256+
}
2257+
22452258
.repo-button-row .button {
22462259
padding: 6px 10px !important;
22472260
height: 30px;
2261+
flex-shrink: 0;
2262+
margin: 0;
22482263
}
22492264

22502265
.repo-button-row .button.dropdown:not(.icon) {
@@ -2255,6 +2270,12 @@ td .commit-summary {
22552270
height: 30px;
22562271
}
22572272

2273+
@media (max-width: 600px) {
2274+
.repo-button-row-left {
2275+
flex-wrap: wrap;
2276+
}
2277+
}
2278+
22582279
tbody.commit-list {
22592280
vertical-align: baseline;
22602281
}

0 commit comments

Comments
 (0)