Skip to content

Commit 3c014a8

Browse files
author
0ko
committed
ui: improve branch/tag dropdown selector consistency (go-gitea#7187)
Improve consistency of these tag/branch selector menus between these areas: repo file/dir view, issue branch selection, compare page. Improve the look slightly by aligning icons properly, adding consistent gap and ensuring consistent vertical gaps with no excessive space waste. Preview: https://codeberg.org/attachments/0740a811-d6bf-4c27-a16d-bdc7e2aa63eb Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7187 Reviewed-by: Gusted <[email protected]>
1 parent d53dfcb commit 3c014a8

File tree

4 files changed

+36
-58
lines changed

4 files changed

+36
-58
lines changed

templates/repo/diff/compare.tmpl

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,13 @@
3939
<i class="icon">{{svg "octicon-filter" 16}}</i>
4040
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
4141
</div>
42-
<div class="header">
43-
<div class="ui grid">
44-
<div class="two column row">
45-
<a class="reference column" href="#" data-target=".base-branch-list">
46-
<span class="text black">
47-
{{svg "octicon-git-branch" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.branches"}}
48-
</span>
49-
</a>
50-
<a class="reference column" href="#" data-target=".base-tag-list">
51-
<span class="text black">
52-
{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.tags"}}
53-
</span>
54-
</a>
55-
</div>
56-
</div>
42+
<div class="branch-tag-tab">
43+
<a class="branch-tag-item muted" href="#" data-target=".base-branch-list">
44+
{{svg "octicon-git-branch"}}{{ctx.Locale.Tr "repo.branches"}}
45+
</a>
46+
<a class="branch-tag-item muted" href="#" data-target=".base-tag-list">
47+
{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.tags"}}
48+
</a>
5749
</div>
5850
<div class="scrolling menu reference-list-menu base-branch-list">
5951
{{range .Branches}}
@@ -108,21 +100,13 @@
108100
<i class="icon">{{svg "octicon-filter" 16}}</i>
109101
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
110102
</div>
111-
<div class="header">
112-
<div class="ui grid">
113-
<div class="two column row">
114-
<a class="reference column" href="#" data-target=".head-branch-list">
115-
<span class="text black">
116-
{{svg "octicon-git-branch" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.branches"}}
117-
</span>
118-
</a>
119-
<a class="reference column" href="#" data-target=".head-tag-list">
120-
<span class="text black">
121-
{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.tags"}}
122-
</span>
123-
</a>
124-
</div>
125-
</div>
103+
<div class="branch-tag-tab">
104+
<a class="branch-tag-item muted" href="#" data-target=".head-branch-list">
105+
{{svg "octicon-git-branch"}}{{ctx.Locale.Tr "repo.branches"}}
106+
</a>
107+
<a class="branch-tag-item muted" href="#" data-target=".head-tag-list">
108+
{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.tags"}}
109+
</a>
126110
</div>
127111
<div class="scrolling menu reference-list-menu head-branch-list">
128112
{{range .HeadBranches}}

templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,13 @@
1515
<i class="icon">{{svg "octicon-filter" 16}}</i>
1616
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
1717
</div>
18-
<div class="header">
19-
<div class="ui grid">
20-
<div class="two column row">
21-
<a class="reference column muted" href="#" data-target="#branch-list">
22-
<span class="text black">
23-
{{svg "octicon-git-branch" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.branches"}}
24-
</span>
25-
</a>
26-
<a class="reference column muted" href="#" data-target="#tag-list">
27-
<span class="text">
28-
{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.tags"}}
29-
</span>
30-
</a>
31-
</div>
32-
</div>
18+
<div class="branch-tag-tab">
19+
<a class="branch-tag-item muted" href="#" data-target="#branch-list">
20+
{{svg "octicon-git-branch"}}{{ctx.Locale.Tr "repo.branches"}}
21+
</a>
22+
<a class="branch-tag-item muted" href="#" data-target="#tag-list">
23+
{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.tags"}}
24+
</a>
3325
</div>
3426
<div class="branch-tag-divider"></div>
3527
<div id="branch-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}}">

web_src/css/repo.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,19 @@ td .commit-summary {
11531153
text-align: center;
11541154
}
11551155

1156+
.branch-tag-tab {
1157+
padding: 0 10px 10px;
1158+
}
1159+
1160+
.branch-tag-item {
1161+
display: inline-flex;
1162+
align-items: center;
1163+
gap: 0.5rem;
1164+
padding: 0 10px;
1165+
border: 1px solid transparent;
1166+
border-bottom: none;
1167+
}
1168+
11561169
.repository.compare.pull .comment.form .content::before,
11571170
.repository.compare.pull .comment.form .content::after {
11581171
right: 100%;

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ export default sfc; // activate IDE's Vue plugin
265265
</div>
266266
<div v-if="showBranchesInDropdown" class="branch-tag-tab">
267267
<a class="branch-tag-item muted" :class="{active: mode === 'branches'}" href="#" @click="handleTabSwitch('branches')">
268-
<svg-icon name="octicon-git-branch" :size="16" class="tw-mr-1"/>{{ textBranches }}
268+
<svg-icon name="octicon-git-branch" :size="16"/>{{ textBranches }}
269269
</a>
270270
<a v-if="!noTag" class="branch-tag-item muted" :class="{active: mode === 'tags'}" href="#" @click="handleTabSwitch('tags')">
271-
<svg-icon name="octicon-tag" :size="16" class="tw-mr-1"/>{{ textTags }}
271+
<svg-icon name="octicon-tag" :size="16"/>{{ textTags }}
272272
</a>
273273
</div>
274274
<div class="branch-tag-divider"/>
@@ -316,17 +316,6 @@ export default sfc; // activate IDE's Vue plugin
316316
</div>
317317
</template>
318318
<style scoped>
319-
.branch-tag-tab {
320-
padding: 0 10px;
321-
}
322-
323-
.branch-tag-item {
324-
display: inline-block;
325-
padding: 10px;
326-
border: 1px solid transparent;
327-
border-bottom: none;
328-
}
329-
330319
.branch-tag-item.active {
331320
border-color: var(--color-secondary);
332321
background: var(--color-menu);

0 commit comments

Comments
 (0)