mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Clean template/helper.go (#23922)
The first step of #23328 This PR cleans: 1. Dead function like `SubStr` 2. Unnecessary function like `UseHTTPS`, it should be provided by `window.origin` 3. Duplicate function like `IsShowFullName`, there was already a `DeafultShowFullName` I have searched these removed functions globally, no use in code.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<dt>{{.locale.Tr "admin.config.app_name"}}</dt>
|
||||
<dd>{{AppName}}</dd>
|
||||
<dt>{{.locale.Tr "admin.config.app_ver"}}</dt>
|
||||
<dd>{{AppVer}}{{AppBuiltWith}}</dd>
|
||||
<dd>{{AppVer}}{{.AppBuiltWith}}</dd>
|
||||
<dt>{{.locale.Tr "admin.config.custom_conf"}}</dt>
|
||||
<dd>{{.CustomConf}}</dd>
|
||||
<dt>{{.locale.Tr "admin.config.app_url"}}</dt>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<!-- there is always at least one button (by context/repo.go) -->
|
||||
{{if $.CloneButtonShowHTTPS}}
|
||||
<button class="ui basic small compact clone button gt-no-transition" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
|
||||
{{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
|
||||
HTTPS
|
||||
</button>
|
||||
{{end}}
|
||||
{{if $.CloneButtonShowSSH}}
|
||||
|
@@ -11,7 +11,10 @@
|
||||
const value = localStorage.getItem('repo-clone-protocol') || 'https';
|
||||
const isSSH = value === 'ssh' && sshBtn || value !== 'ssh' && !httpsBtn;
|
||||
|
||||
if (httpsBtn) httpsBtn.classList[!isSSH ? 'add' : 'remove']('primary');
|
||||
if (httpsBtn) {
|
||||
httpsBtn.textContent = window.origin.split(':')[0].toUpperCase();
|
||||
httpsBtn.classList[!isSSH ? 'add' : 'remove']('primary');
|
||||
}
|
||||
if (sshBtn) sshBtn.classList[isSSH ? 'add' : 'remove']('primary');
|
||||
|
||||
const btn = isSSH ? sshBtn : httpsBtn;
|
||||
|
@@ -1 +1 @@
|
||||
<span class="gt-ellipsis">{{.Name}}{{if IsShowFullName}}<span class="search-fullname"> {{.FullName}}</span>{{end}}</span>
|
||||
<span class="gt-ellipsis">{{.Name}}{{if DefaultShowFullName}}<span class="search-fullname"> {{.FullName}}</span>{{end}}</span>
|
||||
|
Reference in New Issue
Block a user