Skip to content

Commit 9566c9f

Browse files
authored
Re-enable listing of forks when logged out (#14992)
* Re-enable listing of forks when logged out * Further improvements on repo button logic
1 parent f5aaa74 commit 9566c9f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

templates/repo/header.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
</div>
8484
</form>
8585
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
86-
<div class="ui labeled button {{if not $.IsSigned}} disabled{{end}}" tabindex="0">
87-
<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">
86+
<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">
87+
<a class="ui compact small basic button"{{if $.CanSignedUserFork}} href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{end}}>
8888
{{svg "octicon-repo-forked"}}{{$.i18n.Tr "repo.fork"}}
8989
</a>
9090
<a class="ui basic label" href="{{.Link}}/forks">

web_src/less/_base.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ a.ui.label:hover {
15851585
border-left: none;
15861586
}
15871587

1588+
.ui.labeled.button.disabled > .button,
15881589
.ui.basic.buttons .button,
15891590
.ui.basic.button {
15901591
color: var(--color-text-light);

web_src/less/_repository.less

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,14 +2856,25 @@ tbody.commit-list {
28562856
align-items: center;
28572857
}
28582858

2859-
.repo-buttons button[disabled],
28602859
.repo-buttons button[disabled] ~ .label {
28612860
opacity: var(--opacity-disabled);
28622861
}
28632862

2864-
.repo-buttons .ui.labeled.button > .label {
2865-
border-left: 0 !important;
2866-
margin: 0 !important;
2863+
.repo-buttons .ui.labeled.button {
2864+
cursor: initial;
2865+
2866+
> .label {
2867+
border-left: 0 !important;
2868+
margin: 0 !important;
2869+
}
2870+
2871+
&.disabled {
2872+
pointer-events: inherit !important;
2873+
2874+
> .button {
2875+
pointer-events: none !important;
2876+
}
2877+
}
28672878
}
28682879

28692880
.tag-code {

0 commit comments

Comments
 (0)