Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fork button #6223

Merged
merged 10 commits into from
Mar 6, 2019
Merged
2 changes: 1 addition & 1 deletion public/css/index.css

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -1875,3 +1875,23 @@ tbody.commit-list {
display: flex;
align-items: center;
}

.repo-buttons .disabled-repo-button .label {
opacity: .5;
}

.repo-buttons .disabled-repo-button a.button {
opacity: .5;
cursor: not-allowed;
}

.repo-buttons .disabled-repo-button a.button:hover {
background: none !important;
color: rgba(0,0,0,.6) !important;
box-shadow: 0 0 0 1px rgba(34,36,38,.15) inset !important;
}

.repo-buttons .ui.labeled.button > .label {
border-left: none !important;
margin: 0 !important;
}
2 changes: 1 addition & 1 deletion templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</a>
</div>
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
<div class="ui labeled button {{if and (not $.CanSignedUserFork) ($.IsSigned)}}disabled{{end}}" tabindex="0">
<div class="ui labeled button {{if and ($.IsSigned) (not $.CanSignedUserFork)}}disabled-repo-button{{end}}" tabindex="0">
<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" }}" href="{{AppSubUrl}}/user/login?redirect_to={{AppSubUrl}}/repo/fork/{{.ID}}" {{end}} data-position="top center" data-variation="tiny">
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
</a>
Expand Down