custom org and repo clone
This commit is contained in:
18
org/header.tmpl
Normal file
18
org/header.tmpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<div class="ui container tw-flex">
|
||||||
|
{{ctx.AvatarUtils.Avatar .Org 100 "org-avatar"}}
|
||||||
|
<div id="org-info" class="tw-flex tw-flex-col">
|
||||||
|
<div class="ui header">
|
||||||
|
{{.Org.DisplayName}}
|
||||||
|
<span class="org-visibility">
|
||||||
|
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
|
||||||
|
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
|
||||||
|
</span>
|
||||||
|
{{if .IsOrganizationOwner}}<a class="middle text grey" href="{{.OrgLink}}/settings">{{svg "octicon-gear" 16 "mb-3"}}</a>{{end}}
|
||||||
|
</div>
|
||||||
|
{{if .RenderedDescription}}<div class="render-content markup">{{.RenderedDescription}}</div>{{end}}
|
||||||
|
<div class="text light meta tw-mt-1">
|
||||||
|
{{if .Org.Location}}<div class="flex-text-block">{{svg "octicon-location"}} <span>{{.Org.Location}}</span></div>{{end}}
|
||||||
|
{{if .Org.Website}}<div class="flex-text-block">{{svg "octicon-link"}} <a class="muted" target="_blank" rel="noopener noreferrer me" href="{{.Org.Website}}">{{.Org.Website}}</a></div>{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -8,36 +8,33 @@
|
|||||||
{{if .ProfileReadme}}
|
{{if .ProfileReadme}}
|
||||||
<div id="readme_profile" class="markup">{{.ProfileReadme}}</div>
|
<div id="readme_profile" class="markup">{{.ProfileReadme}}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{template "shared/repo_search" .}}
|
{{template "explore/repo_search" .}}
|
||||||
{{template "explore/repo_list" .}}
|
{{template "explore/repo_list" .}}
|
||||||
{{template "base/paginate" .}}
|
{{template "base/paginate" .}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if .ShowMemberAndTeamTab}}
|
{{ if .IsAdmin }}
|
||||||
<div class="ui five wide column">
|
<div class="ui five wide column">
|
||||||
{{if .CanCreateOrgRepo}}
|
<h4 class="ui top attached header df">
|
||||||
<div class="center aligned tw-mb-4">
|
<strong class="f1">{{.i18n.Tr "org.people"}}</strong>
|
||||||
<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
|
{{if .IsOrganizationMember}}
|
||||||
{{if not .DisableNewPullMirrors}}
|
<div class="ui">
|
||||||
<a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
|
<a class="text grey dif ac"
|
||||||
{{end}}
|
href="{{.OrgLink}}/members"><span>{{.Org.NumMembers}}</span> {{svg "octicon-chevron-right"}}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="divider"></div>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .NumMembers}}
|
|
||||||
<h4 class="ui top attached header tw-flex">
|
|
||||||
<strong class="tw-flex-1">{{ctx.Locale.Tr "org.members"}}</strong>
|
|
||||||
<a class="text grey tw-flex tw-items-center" href="{{.OrgLink}}/members"><span>{{.NumMembers}}</span> {{svg "octicon-chevron-right"}}</a>
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="ui attached segment members">
|
<div class="ui attached segment members">
|
||||||
{{$isMember := .IsOrganizationMember}}
|
{{$isMember := .IsOrganizationMember}}
|
||||||
{{range .Members}}
|
{{range .Members}}
|
||||||
{{if or $isMember (call $.IsPublicMember .ID)}}
|
{{if or $isMember (.IsPublicMember $.Org.ID)}}
|
||||||
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
|
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">
|
||||||
|
{{ctx.AvatarUtils .}}
|
||||||
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
|
||||||
{{if .IsOrganizationMember}}
|
{{if .IsOrganizationMember}}
|
||||||
<div class="ui top attached header tw-flex">
|
<div class="ui top attached header tw-flex">
|
||||||
<strong class="tw-flex-1">{{ctx.Locale.Tr "org.teams"}}</strong>
|
<strong class="tw-flex-1">{{ctx.Locale.Tr "org.teams"}}</strong>
|
||||||
@ -60,6 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,15 +1,26 @@
|
|||||||
<!-- there is always at least one button (by context/repo.go) -->
|
<!-- there is always at least one button (by context/repo.go) -->
|
||||||
{{if $.CloneButtonShowHTTPS}}
|
<button class="ui small button" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
|
||||||
<button class="ui small button" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
|
|
||||||
HTTPS
|
|
||||||
</button>
|
|
||||||
{{end}}
|
|
||||||
{{if $.CloneButtonShowSSH}}
|
|
||||||
<button class="ui small button" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
|
|
||||||
SSH
|
SSH
|
||||||
</button>
|
</button>
|
||||||
{{end}}
|
|
||||||
<input id="repo-clone-url" size="10" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
|
<input id="repo-clone-url" size="10" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}"
|
||||||
<button class="ui small icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
|
readonly>
|
||||||
|
|
||||||
|
<button class="ui small icon button" id="clipboard-btn"
|
||||||
|
data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}"
|
||||||
|
data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
|
||||||
{{svg "octicon-copy" 14}}
|
{{svg "octicon-copy" 14}}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{{if not (and $.DisableHTTP $.DisableSSH)}}
|
||||||
|
<script defer>
|
||||||
|
const isSSH = true
|
||||||
|
const sshButton = document.getElementById('repo-clone-ssh');
|
||||||
|
const input = document.getElementById('repo-clone-url');
|
||||||
|
if (input) input.value = sshButton.dataset.link;
|
||||||
|
if (sshButton) sshButton.classList['add']('primary');
|
||||||
|
setTimeout(() => {
|
||||||
|
if (sshButton) sshButton.classList.remove('no-transition');
|
||||||
|
}, 100);
|
||||||
|
</script>
|
||||||
|
{{end}}
|
Reference in New Issue
Block a user