Re-enable listing of forks when logged out (#14992)

* Re-enable listing of forks when logged out

* Further improvements on repo button logic
tokarchuk/v1.17
Mike L 4 years ago committed by GitHub
parent f5aaa74b90
commit 9566c9f0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      templates/repo/header.tmpl
  2. 1
      web_src/less/_base.less
  3. 19
      web_src/less/_repository.less

@ -83,8 +83,8 @@
</div> </div>
</form> </form>
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}} {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
<div class="ui labeled button {{if not $.IsSigned}} disabled{{end}}" tabindex="0"> <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 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"> <a class="ui compact small basic button"{{if $.CanSignedUserFork}} href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{end}}>
{{svg "octicon-repo-forked"}}{{$.i18n.Tr "repo.fork"}} {{svg "octicon-repo-forked"}}{{$.i18n.Tr "repo.fork"}}
</a> </a>
<a class="ui basic label" href="{{.Link}}/forks"> <a class="ui basic label" href="{{.Link}}/forks">

@ -1585,6 +1585,7 @@ a.ui.label:hover {
border-left: none; border-left: none;
} }
.ui.labeled.button.disabled > .button,
.ui.basic.buttons .button, .ui.basic.buttons .button,
.ui.basic.button { .ui.basic.button {
color: var(--color-text-light); color: var(--color-text-light);

@ -2856,14 +2856,25 @@ tbody.commit-list {
align-items: center; align-items: center;
} }
.repo-buttons button[disabled],
.repo-buttons button[disabled] ~ .label { .repo-buttons button[disabled] ~ .label {
opacity: var(--opacity-disabled); opacity: var(--opacity-disabled);
} }
.repo-buttons .ui.labeled.button > .label { .repo-buttons .ui.labeled.button {
border-left: 0 !important; cursor: initial;
margin: 0 !important;
> .label {
border-left: 0 !important;
margin: 0 !important;
}
&.disabled {
pointer-events: inherit !important;
> .button {
pointer-events: none !important;
}
}
} }
.tag-code { .tag-code {

Loading…
Cancel
Save