Skip to content

Commit 5adf32b

Browse files
authored
Remove fomantic breadcrumb module (#24463)
### File path before/after <img width="522" alt="Screenshot 2023-05-01 at 13 23 33" src="https://user-images.githubusercontent.com/115237/235445636-57776038-c98e-4cab-8abe-045138a76958.png"> <img width="522" alt="Screenshot 2023-05-01 at 13 24 08" src="https://user-images.githubusercontent.com/115237/235445638-70bef62a-1b70-41f8-ba51-728db4d54402.png"> ### File edit before/after <img width="499" alt="Screenshot 2023-05-01 at 13 24 46" src="https://user-images.githubusercontent.com/115237/235445676-7b3cc23e-289b-40a6-8d4f-0d7fb2efb55e.png"> <img width="497" alt="Screenshot 2023-05-01 at 13 24 52" src="https://user-images.githubusercontent.com/115237/235445677-db9f3974-8456-46de-a32b-9198110c0540.png"> ### Cherry-pick before/after <img width="590" alt="Screenshot 2023-05-01 at 13 25 30" src="https://user-images.githubusercontent.com/115237/235445717-99445024-1bb2-46d4-9bd8-8086bad57d34.png"> <img width="582" alt="Screenshot 2023-05-01 at 13 25 37" src="https://user-images.githubusercontent.com/115237/235445720-9c1dc497-eb23-4e10-a727-27f4d6df69e6.png">
1 parent 5987f00 commit 5adf32b

File tree

12 files changed

+77
-231
lines changed

12 files changed

+77
-231
lines changed

templates/repo/editor/cherry_pick.tmpl

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
<input type="hidden" name="last_commit" value="{{.last_commit}}">
99
<input type="hidden" name="page_has_posted" value="true">
1010
<input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}">
11-
<div class="ui secondary menu">
12-
<div class="fitted item treepath">
13-
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
14-
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
15-
{{$shalink := printf "<a class=\"ui primary sha label\" href=\"%s\">%s</a>" (Escape $shaurl) (ShortSha .SHA)}}
16-
{{if eq .CherryPickType "revert"}}
17-
{{.locale.Tr "repo.editor.revert" $shalink | Str2html}}
18-
{{else}}
19-
{{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
20-
{{end}}
21-
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
22-
<div class="divider">:</div>
23-
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
24-
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
25-
</div>
11+
<div class="repo-editor-header">
12+
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
13+
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
14+
{{$shalink := printf "<a class=\"ui primary sha label\" href=\"%s\">%s</a>" (Escape $shaurl) (ShortSha .SHA)}}
15+
{{if eq .CherryPickType "revert"}}
16+
{{.locale.Tr "repo.editor.revert" $shalink | Str2html}}
17+
{{else}}
18+
{{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
19+
{{end}}
20+
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
21+
<div class="divider">:</div>
22+
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
23+
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
2624
</div>
2725
</div>
2826
{{template "repo/editor/commit_form" .}}

templates/repo/editor/edit.tmpl

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,22 @@
77
{{.CsrfTokenHtml}}
88
<input type="hidden" name="last_commit" value="{{.last_commit}}">
99
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
10-
<div class="ui secondary menu">
11-
<div class="fitted item treepath">
12-
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
13-
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
14-
{{$n := len .TreeNames}}
15-
{{$l := Eval $n "-" 1}}
16-
{{range $i, $v := .TreeNames}}
17-
<div class="divider"> / </div>
18-
{{if eq $i $l}}
19-
<input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.Editorconfig}}" required autofocus>
20-
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
21-
{{else}}
22-
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
23-
{{end}}
10+
<div class="repo-editor-header">
11+
<div class="ui breadcrumb field{{if .Err_TreePath}} error{{end}}">
12+
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
13+
{{$n := len .TreeNames}}
14+
{{$l := Eval $n "-" 1}}
15+
{{range $i, $v := .TreeNames}}
16+
<div class="divider"> / </div>
17+
{{if eq $i $l}}
18+
<input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.Editorconfig}}" required autofocus>
19+
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
20+
{{else}}
21+
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
2422
{{end}}
25-
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
26-
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
27-
</div>
23+
{{end}}
24+
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
25+
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
2826
</div>
2927
</div>
3028
<div class="field">

templates/repo/editor/patch.tmpl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
{{.CsrfTokenHtml}}
88
<input type="hidden" name="last_commit" value="{{.last_commit}}">
99
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
10-
<div class="ui secondary menu">
11-
<div class="fitted item treepath">
12-
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
13-
{{.locale.Tr "repo.editor.patching"}}
14-
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
15-
<div class="divider">:</div>
16-
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
17-
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
18-
<input type="hidden" id="tree_path" name="tree_path" value="" required>
19-
<input id="file-name" type="hidden" value="diff.patch">
20-
</div>
10+
<div class="repo-editor-header">
11+
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
12+
{{.locale.Tr "repo.editor.patching"}}
13+
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
14+
<div class="divider">:</div>
15+
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
16+
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
17+
<input type="hidden" id="tree_path" name="tree_path" value="" required>
18+
<input id="file-name" type="hidden" value="diff.patch">
2119
</div>
2220
</div>
2321
<div class="field">

templates/repo/editor/upload.tmpl

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,22 @@
55
{{template "base/alert" .}}
66
<form class="ui comment form" method="post">
77
{{.CsrfTokenHtml}}
8-
<div class="ui secondary menu">
9-
<div class="item fitted treepath">
10-
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
11-
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
12-
{{$n := len .TreeNames}}
13-
{{$l := Eval $n "-" 1}}
14-
{{range $i, $v := .TreeNames}}
15-
<div class="divider"> / </div>
16-
{{if eq $i $l}}
17-
<input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus>
18-
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
19-
{{else}}
20-
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
21-
{{end}}
8+
<div class="repo-editor-header">
9+
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
10+
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
11+
{{$n := len .TreeNames}}
12+
{{$l := Eval $n "-" 1}}
13+
{{range $i, $v := .TreeNames}}
14+
<div class="divider"> / </div>
15+
{{if eq $i $l}}
16+
<input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus>
17+
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
18+
{{else}}
19+
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
2220
{{end}}
23-
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
24-
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
25-
</div>
21+
{{end}}
22+
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
23+
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
2624
</div>
2725
</div>
2826
<div class="field">

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</a>
110110
{{end}}
111111
{{if ne $n 0}}
112-
<span class="ui breadcrumb repo-path gt-ml-2">
112+
<span class="breadcrumb repo-path gt-ml-2">
113113
<a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{StringUtils.EllipsisString .Repository.Name 30}}</a>
114114
{{- range $i, $v := .TreeNames -}}
115115
<span class="divider">/</span>

web_src/css/base.css

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ progress::-moz-progress-bar {
332332
user-select: none;
333333
}
334334

335-
a,
336-
.ui.breadcrumb a {
335+
a {
337336
color: var(--color-primary);
338337
cursor: pointer;
339338
text-decoration-skip-ink: all;
@@ -347,8 +346,7 @@ a.muted,
347346
a:hover,
348347
a.muted:hover,
349348
a.muted:hover [class*="color-text"],
350-
.muted-links a:hover,
351-
.ui.breadcrumb a:hover {
349+
.muted-links a:hover {
352350
color: var(--color-primary);
353351
}
354352

@@ -737,14 +735,6 @@ a.label,
737735
padding-bottom: 7.42px !important;
738736
}
739737

740-
.ui.breadcrumb a:hover {
741-
text-decoration: underline !important;
742-
}
743-
744-
.ui.breadcrumb .divider {
745-
color: var(--color-text-light-2);
746-
}
747-
748738
.ui.divider:not(.vertical,.horizontal) {
749739
border-top-color: var(--color-secondary) !important;
750740
border-bottom: none !important;

web_src/css/editor.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
border-bottom: 0;
1313
}
1414

15+
.repo-editor-header {
16+
display: flex;
17+
margin: 1rem 0;
18+
padding: 3px 0;
19+
}
20+
1521
.editor-toolbar {
1622
border-color: var(--color-secondary);
1723
}

web_src/css/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@import "./features/projects.css";
1212
@import "./modules/tippy.css";
1313
@import "./modules/modal.css";
14+
@import "./modules/breadcrumb.css";
1415
@import "./code/linebutton.css";
1516
@import "./markup/content.css";
1617
@import "./markup/codecopy.css";

web_src/css/modules/breadcrumb.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.breadcrumb .divider {
2+
color: var(--color-text-light-2);
3+
margin-left: 3px;
4+
margin-right: 3px;
5+
}
6+
7+
.breadcrumb > * {
8+
display: inline;
9+
}

web_src/css/repository.css

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@
223223
word-break: break-word;
224224
}
225225

226-
.repository.file.list .repo-path .section,
227-
.repository.file.list .repo-path .divider {
228-
display: inline;
229-
}
230-
231226
.repository.file.list #repo-files-table {
232227
table-layout: fixed;
233228
}
@@ -448,16 +443,15 @@
448443
width: 16px;
449444
}
450445

451-
.repository.file.editor .treepath {
446+
.repo-editor-header {
452447
width: 100%;
453448
}
454449

455-
.repository.file.editor .treepath input {
456-
vertical-align: middle;
457-
box-shadow: rgba(0, 0, 0, 0.0745098) 0 1px 2px inset;
458-
width: inherit;
459-
padding: 7px 8px;
460-
margin-right: 5px;
450+
.repo-editor-header input {
451+
vertical-align: middle !important;
452+
width: auto !important;
453+
padding: 7px 8px !important;
454+
margin-right: 5px !important;
461455
}
462456

463457
.repository.file.editor .tabular.menu .svg {

0 commit comments

Comments
 (0)