Skip to content

Commit abb364f

Browse files
adelowotechknowlogick
authored andcommitted
allow user fork repo even when as a guest.. This will prompt the user to login and if authentication was successful, the user will be redirected to fork the repo (#5690)
1 parent 6630a33 commit abb364f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ migrate.lfs_mirror_unsupported = Mirroring LFS objects is not supported - use 'g
561561
mirror_from = mirror of
562562
forked_from = forked from
563563
fork_from_self = You cannot fork a repository you own.
564+
fork_guest_user = Sign in to fork this repository.
564565
copy_link = Copy
565566
copy_link_success = Link has been copied
566567
copy_link_error = Use ⌘C or Ctrl-C to copy

templates/repo/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</div>
3333
{{if and (not .IsBare) ($.Permission.CanRead $.UnitTypeCode)}}
3434
<div class="ui compact labeled button" tabindex="0">
35-
<a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
35+
<a class="ui compact 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">
3636
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
3737
</a>
3838
<a class="ui basic label" href="{{.Link}}/forks">

0 commit comments

Comments
 (0)