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

Re-enable listing of forks when logged out #14992

Merged
merged 2 commits into from
Mar 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
</div>
</form>
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
<div class="ui labeled button {{if not $.IsSigned}} disabled{{end}}" tabindex="0">
<a class="ui compact small 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">
<div class="ui labeled button{{if not $.CanSignedUserFork}} poping up disabled{{end}}"{{if and (not $.CanSignedUserFork) $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{else if not $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_guest_user"}}"{{end}} data-position="top center" data-variation="tiny" tabindex="0">
<a class="ui compact small basic button"{{if $.CanSignedUserFork}} href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{end}}>
{{svg "octicon-repo-forked"}}{{$.i18n.Tr "repo.fork"}}
</a>
<a class="ui basic label" href="{{.Link}}/forks">
Expand Down
1 change: 1 addition & 0 deletions web_src/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,7 @@ a.ui.label:hover {
border-left: none;
}

.ui.labeled.button.disabled > .button,
.ui.basic.buttons .button,
.ui.basic.button {
color: var(--color-text-light);
Expand Down
19 changes: 15 additions & 4 deletions web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -2856,14 +2856,25 @@ tbody.commit-list {
align-items: center;
}

.repo-buttons button[disabled],
.repo-buttons button[disabled] ~ .label {
opacity: var(--opacity-disabled);
}

.repo-buttons .ui.labeled.button > .label {
border-left: 0 !important;
margin: 0 !important;
.repo-buttons .ui.labeled.button {
cursor: initial;

> .label {
border-left: 0 !important;
margin: 0 !important;
}

&.disabled {
pointer-events: inherit !important;

> .button {
pointer-events: none !important;
}
}
}

.tag-code {
Expand Down