Browse Source

Fix language label vertical alignment (#11061)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
for-closed-social
silverwind 4 years ago
committed by GitHub
parent
commit
063b1d260f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions
  1. +1
    -1
      templates/explore/code.tmpl
  2. +1
    -1
      templates/repo/search.tmpl
  3. +9
    -0
      web_src/less/_base.less

+ 1
- 1
templates/explore/code.tmpl View File

@ -18,7 +18,7 @@
</h3> </h3>
<div> <div>
{{range $term := .SearchResultLanguages}} {{range $term := .SearchResultLanguages}}
<a class="ui {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{AppSubUrl}}/explore/code?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}">
<a class="ui language-label {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{AppSubUrl}}/explore/code?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}">
<i class="color-icon" style="background-color: {{$term.Color}}"></i> <i class="color-icon" style="background-color: {{$term.Color}}"></i>
{{$term.Language}} {{$term.Language}}
<div class="detail">{{$term.Count}}</div> <div class="detail">{{$term.Count}}</div>

+ 1
- 1
templates/repo/search.tmpl View File

@ -18,7 +18,7 @@
</h3> </h3>
<div> <div>
{{range $term := .SearchResultLanguages}} {{range $term := .SearchResultLanguages}}
<a class="ui {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{EscapePound $.SourcePath}}/search?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}">
<a class="ui language-label {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{EscapePound $.SourcePath}}/search?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}">
<i class="color-icon" style="background-color: {{$term.Color}}"></i> <i class="color-icon" style="background-color: {{$term.Color}}"></i>
{{$term.Language}} {{$term.Language}}
<div class="detail">{{$term.Count}}</div> <div class="detail">{{$term.Count}}</div>

+ 9
- 0
web_src/less/_base.less View File

@ -1228,3 +1228,12 @@ i.icon.centerlock {
overflow-x: hidden; overflow-x: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.language-label {
display: inline-flex !important;
align-items: center !important;
}
.language-label .color-icon {
position: static !important;
}

Loading…
Cancel
Save