Skip to content

Commit

Permalink
Remove fomantic breadcrumb module
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed May 1, 2023
1 parent 5987f00 commit cb83dcd
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 231 deletions.
28 changes: 13 additions & 15 deletions templates/repo/editor/cherry_pick.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@
<input type="hidden" name="last_commit" value="{{.last_commit}}">
<input type="hidden" name="page_has_posted" value="true">
<input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}">
<div class="ui secondary menu">
<div class="fitted item treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
{{$shalink := printf "<a class=\"ui primary sha label\" href=\"%s\">%s</a>" (Escape $shaurl) (ShortSha .SHA)}}
{{if eq .CherryPickType "revert"}}
{{.locale.Tr "repo.editor.revert" $shalink | Str2html}}
{{else}}
{{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
{{end}}
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
<div class="divider">:</div>
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
</div>
<div class="repo-editor-header">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
{{$shalink := printf "<a class=\"ui primary sha label\" href=\"%s\">%s</a>" (Escape $shaurl) (ShortSha .SHA)}}
{{if eq .CherryPickType "revert"}}
{{.locale.Tr "repo.editor.revert" $shalink | Str2html}}
{{else}}
{{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
{{end}}
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
<div class="divider">:</div>
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
</div>
</div>
{{template "repo/editor/commit_form" .}}
Expand Down
32 changes: 15 additions & 17 deletions templates/repo/editor/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="last_commit" value="{{.last_commit}}">
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
<div class="ui secondary menu">
<div class="fitted item treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
{{range $i, $v := .TreeNames}}
<div class="divider"> / </div>
{{if eq $i $l}}
<input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.Editorconfig}}" required autofocus>
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
{{else}}
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
{{end}}
<div class="repo-editor-header">
<div class="ui breadcrumb field{{if .Err_TreePath}} error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
{{range $i, $v := .TreeNames}}
<div class="divider"> / </div>
{{if eq $i $l}}
<input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.Editorconfig}}" required autofocus>
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
{{else}}
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
{{end}}
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
</div>
{{end}}
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
</div>
</div>
<div class="field">
Expand Down
20 changes: 9 additions & 11 deletions templates/repo/editor/patch.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="last_commit" value="{{.last_commit}}">
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
<div class="ui secondary menu">
<div class="fitted item treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
{{.locale.Tr "repo.editor.patching"}}
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
<div class="divider">:</div>
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="" required>
<input id="file-name" type="hidden" value="diff.patch">
</div>
<div class="repo-editor-header">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
{{.locale.Tr "repo.editor.patching"}}
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
<div class="divider">:</div>
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="" required>
<input id="file-name" type="hidden" value="diff.patch">
</div>
</div>
<div class="field">
Expand Down
32 changes: 15 additions & 17 deletions templates/repo/editor/upload.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
{{template "base/alert" .}}
<form class="ui comment form" method="post">
{{.CsrfTokenHtml}}
<div class="ui secondary menu">
<div class="item fitted treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
{{range $i, $v := .TreeNames}}
<div class="divider"> / </div>
{{if eq $i $l}}
<input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus>
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
{{else}}
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
{{end}}
<div class="repo-editor-header">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
{{range $i, $v := .TreeNames}}
<div class="divider"> / </div>
{{if eq $i $l}}
<input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus>
<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
{{else}}
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
{{end}}
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
</div>
{{end}}
<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
</div>
</div>
<div class="field">
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</a>
{{end}}
{{if ne $n 0}}
<span class="ui breadcrumb repo-path gt-ml-2">
<span class="breadcrumb repo-path gt-ml-2">
<a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{StringUtils.EllipsisString .Repository.Name 30}}</a>
{{- range $i, $v := .TreeNames -}}
<span class="divider">/</span>
Expand Down
14 changes: 2 additions & 12 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ progress::-moz-progress-bar {
user-select: none;
}

a,
.ui.breadcrumb a {
a {
color: var(--color-primary);
cursor: pointer;
text-decoration-skip-ink: all;
Expand All @@ -347,8 +346,7 @@ a.muted,
a:hover,
a.muted:hover,
a.muted:hover [class*="color-text"],
.muted-links a:hover,
.ui.breadcrumb a:hover {
.muted-links a:hover {
color: var(--color-primary);
}

Expand Down Expand Up @@ -737,14 +735,6 @@ a.label,
padding-bottom: 7.42px !important;
}

.ui.breadcrumb a:hover {
text-decoration: underline !important;
}

.ui.breadcrumb .divider {
color: var(--color-text-light-2);
}

.ui.divider:not(.vertical,.horizontal) {
border-top-color: var(--color-secondary) !important;
border-bottom: none !important;
Expand Down
6 changes: 6 additions & 0 deletions web_src/css/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
border-bottom: 0;
}

.repo-editor-header {
display: flex;
margin: 1rem 0;
padding: 3px 0;
}

.editor-toolbar {
border-color: var(--color-secondary);
}
Expand Down
1 change: 1 addition & 0 deletions web_src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import "./features/projects.css";
@import "./modules/tippy.css";
@import "./modules/modal.css";
@import "./modules/breadcrumb.css";
@import "./code/linebutton.css";
@import "./markup/content.css";
@import "./markup/codecopy.css";
Expand Down
9 changes: 9 additions & 0 deletions web_src/css/modules/breadcrumb.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.breadcrumb .divider {
color: var(--color-text-light-2);
margin-left: 3px;
margin-right: 3px;
}

.breadcrumb > * {
display: inline;
}
18 changes: 6 additions & 12 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,6 @@
word-break: break-word;
}

.repository.file.list .repo-path .section,
.repository.file.list .repo-path .divider {
display: inline;
}

.repository.file.list #repo-files-table {
table-layout: fixed;
}
Expand Down Expand Up @@ -448,16 +443,15 @@
width: 16px;
}

.repository.file.editor .treepath {
.repo-editor-header {
width: 100%;
}

.repository.file.editor .treepath input {
vertical-align: middle;
box-shadow: rgba(0, 0, 0, 0.0745098) 0 1px 2px inset;
width: inherit;
padding: 7px 8px;
margin-right: 5px;
.repo-editor-header input {
vertical-align: middle !important;
width: auto !important;
padding: 7px 8px !important;
margin-right: 5px !important;
}

.repository.file.editor .tabular.menu .svg {
Expand Down
Loading

0 comments on commit cb83dcd

Please sign in to comment.