]> source.dussan.org Git - gitea.git/commitdiff
Re-enable listing of forks when logged out (#14992)
authorMike L <cl.jeremy@qq.com>
Sun, 14 Mar 2021 14:48:28 +0000 (15:48 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Mar 2021 14:48:28 +0000 (14:48 +0000)
* Re-enable listing of forks when logged out

* Further improvements on repo button logic

templates/repo/header.tmpl
web_src/less/_base.less
web_src/less/_repository.less

index f9df4062747b329482b036b9f272874af1b4134e..71963d698c71f68b6e83207d42df5ee28ff77ea1 100644 (file)
@@ -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">
index 8c99fa4349e5629238d61bb199f4c5c673e72e0d..351dbf5da013e8fdbd94bc970e0f846b73bccb36 100644 (file)
@@ -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);
index 0984dd7cf3a6f92bc707cb1bf7475b311cb34668..5a8476322c900e688f6e33e132c5c43977a355ac 100644 (file)
@@ -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 {