Skip to content

Commit c1a2887

Browse files
CirnoTlunnylafriks
authored
Use octicons for all repo header buttons (#11890)
* Use octicons for all repo header buttons * ensure margin isn't set on any other svg outside repo buttons Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: Lauris BH <[email protected]>
1 parent 3b685e1 commit c1a2887

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

templates/repo/header.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{{$.CsrfTokenHtml}}
2626
<div class="ui labeled button" tabindex="0">
2727
<button type="submit" class="ui compact basic button">
28-
<i class="icon fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
28+
{{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye" 16}}{{$.i18n.Tr "repo.watch"}}{{end}}
2929
</button>
3030
<a class="ui basic label" href="{{.Link}}/watchers">
3131
{{.NumWatches}}
@@ -36,7 +36,8 @@
3636
{{$.CsrfTokenHtml}}
3737
<div class="ui labeled button" tabindex="0">
3838
<button type="submit" class="ui compact basic button">
39-
<i class="icon star{{if not $.IsStaringRepo}} outline{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
39+
<!-- TODO use star-filled once octicons v2 are in place */ -->
40+
{{if $.IsStaringRepo}}{{svg "octicon-star" 16}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{svg "octicon-star" 16}}{{$.i18n.Tr "repo.star"}}{{end}}
4041
</button>
4142
<a class="ui basic label" href="{{.Link}}/stars">
4243
{{.NumStars}}
@@ -46,7 +47,7 @@
4647
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
4748
<div class="ui labeled button {{if and ($.IsSigned) (not $.CanSignedUserFork)}}disabled-repo-button{{end}}" tabindex="0">
4849
<a class="ui compact basic button {{if or (not $.IsSigned) (not $.CanSignedUserFork)}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{ else }} data-content="{{$.i18n.Tr "repo.fork_guest_user" }}" rel="nofollow" href="{{AppSubUrl}}/user/login?redirect_to={{AppSubUrl}}/repo/fork/{{.ID}}" {{end}} data-position="top center" data-variation="tiny">
49-
{{svg "octicon-repo-forked" 15}}{{$.i18n.Tr "repo.fork"}}
50+
{{svg "octicon-repo-forked" 16}}{{$.i18n.Tr "repo.fork"}}
5051
</a>
5152
<a class="ui basic label" href="{{.Link}}/forks">
5253
{{.NumForks}}

web_src/less/_repository.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
white-space: nowrap;
3333
}
3434

35-
.svg.octicon-repo-forked {
36-
margin-top: -1px;
35+
.repo-buttons .svg {
36+
margin: 0 .42857143em 0 -.21428571em;
3737
}
3838

3939
.button {

0 commit comments

Comments
 (0)