diff options
author | Achilleas Koutsou <achilleas.k@gmail.com> | 2020-09-03 21:04:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 03:04:22 +0800 |
commit | c4360747a3bdd0d5a5a673bfcdee05f9d911ba1e (patch) | |
tree | 4c8ca23dc3f449bc946b6c75c0fec8dd928dbb73 /templates/repo | |
parent | 23ff182d1f8df2978785772bc58cf0ebfd2aeb0c (diff) |
repo: support unlisted but publicly accessible repositories (#6176)
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/create.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/pulls/fork.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 16 |
5 files changed, 36 insertions, 5 deletions
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 87cc9b1a..176a781a 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -50,6 +50,13 @@ {{end}} </div> </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="unlisted" type="checkbox"> + <label>{{.i18n.Tr "repo.unlisted_helper" | Safe}}</label> + </div> + </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label> <textarea class="autosize" id="description" name="description" rows="3">{{.description}}</textarea> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index cacda1ed..ff1fb2eb 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -7,9 +7,9 @@ <div class="ui huge breadcrumb"> {{if .UseCustomAvatar}} <img class="ui mini spaced image" src="{{.RelAvatarLink}}"> - <i class="{{if .IsPrivate}}mega-octicon octicon-lock{{else if .IsMirror}}mega-octicon octicon-repo-clone{{else if .IsFork}}mega-octicon octicon-repo-forked{{end}}"></i> + <i class="{{if .IsPrivate}}mega-octicon octicon-lock{{else if .IsUnlisted}}mega-octicon octicon-eye{{else if .IsMirror}}mega-octicon octicon-repo-clone{{else if .IsFork}}mega-octicon octicon-repo-forked{{end}}"></i> {{else}} - <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i> + <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsUnlisted}}eye{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i> {{end}} <a href="{{AppSubURL}}/{{.Owner.Name}}">{{.Owner.Name}}</a> <div class="divider"> / </div> diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl index e10b07cd..055a29c1 100644 --- a/templates/repo/migrate.tmpl +++ b/templates/repo/migrate.tmpl @@ -81,6 +81,13 @@ </div> </div> <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="unlisted" type="checkbox"> + <label>{{.i18n.Tr "repo.unlisted_helper" | Safe}}</label> + </div> + </div> + <div class="inline field"> <label>{{.i18n.Tr "repo.migrate_type"}}</label> <div class="ui checkbox"> <input name="mirror" type="checkbox" {{if .mirror}}checked{{end}}> diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl index f10c2aa8..e8dac97c 100644 --- a/templates/repo/pulls/fork.tmpl +++ b/templates/repo/pulls/fork.tmpl @@ -49,6 +49,13 @@ <input type="checkbox" {{if .IsPrivate}}checked{{end}}> <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label> </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui read-only checkbox"> + <input type="checkbox" {{if .IsUnlisted}}checked{{end}}> + <label>{{.i18n.Tr "repo.unlisted_helper" | Safe}}</label> + </div> <span class="help">{{.i18n.Tr "repo.fork_visiblity_helper"}}</span> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index c8cb973d..5122fc37 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -31,10 +31,20 @@ {{if not .Repository.IsFork}} <div class="inline field"> <label>{{.i18n.Tr "repo.visibility"}}</label> - <div class="ui checkbox"> - <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}> - <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label> + <div class="ui segment"> + <div class="field"> + <div class="ui checkbox"> + <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}> + <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label> + </div> </div> + <div class="field"> + <div class="ui checkbox"> + <input name="unlisted" type="checkbox" {{if .Repository.IsUnlisted}}checked{{end}}> + <label>{{.i18n.Tr "repo.unlisted_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label> + </div> + </div> + </div> </div> {{end}} |