summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2021-10-21 15:37:43 +0800
committerGitHub <noreply@github.com>2021-10-21 15:37:43 +0800
commit2add8fe9beede4aa82c913fcb70c0cf5bb1c6185 (patch)
treebe2555d0a8f0ae926d56eefd3a3b3e533985074a /templates
parent5879ab83b5fab57a71aed4c8b3c4d9293b4a4398 (diff)
downloadgitea-2add8fe9beede4aa82c913fcb70c0cf5bb1c6185.tar.gz
gitea-2add8fe9beede4aa82c913fcb70c0cf5bb1c6185.zip
Frontend refactor, PascalCase to camelCase, remove unused code (#17365)
* Frontend refactor, PascalCase to camelCase, remove unused code * fix
Diffstat (limited to 'templates')
-rw-r--r--templates/base/head.tmpl35
-rw-r--r--templates/repo/projects/list.tmpl2
-rw-r--r--templates/repo/projects/new.tmpl2
-rw-r--r--templates/repo/projects/view.tmpl10
4 files changed, 20 insertions, 29 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 80bb121c6b..23d1190d94 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>{{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} </title>
+ <title>{{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="data:{{.ManifestData}}"/>
<meta name="theme-color" content="{{ThemeColorMetaTag}}">
<meta name="default-theme" content="{{DefaultTheme}}" />
@@ -11,7 +11,6 @@
<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}" />
<meta name="keywords" content="{{MetaKeywords}}">
<meta name="referrer" content="no-referrer" />
- <meta name="_csrf" content="{{.CsrfToken}}" />
{{if .GoGetImport}}
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
@@ -19,25 +18,17 @@
<script>
<!-- /* eslint-disable */ -->
window.config = {
- AppVer: '{{AppVer}}',
- AppSubUrl: '{{AppSubUrl}}',
- AssetUrlPrefix: '{{AssetUrlPrefix}}',
- IsProd: {{.IsProd}},
- CustomEmojis: {{CustomEmojis}},
- UseServiceWorker: {{UseServiceWorker}},
- csrf: '{{.CsrfToken}}',
- pageData: {{ .PageData }},
- HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
- SimpleMDE: {{if .RequireSimpleMDE}}true{{else}}false{{end}},
- Tribute: {{if .RequireTribute}}true{{else}}false{{end}},
- NotificationSettings: {
- MinTimeout: {{NotificationSettings.MinTimeout}},
- TimeoutStep: {{NotificationSettings.TimeoutStep}},
- MaxTimeout: {{NotificationSettings.MaxTimeout}},
- EventSourceUpdateTime: {{NotificationSettings.EventSourceUpdateTime}},
- },
- EnableTimetracking: {{if EnableTimetracking}}true{{else}}false{{end}},
- PageIsProjects: {{if .PageIsProjects }}true{{else}}false{{end}},
+ appVer: '{{AppVer}}',
+ appSubUrl: '{{AppSubUrl}}',
+ assetUrlPrefix: '{{AssetUrlPrefix}}',
+ runModeIsProd: {{.RunModeIsProd}},
+ customEmojis: {{CustomEmojis}},
+ useServiceWorker: {{UseServiceWorker}},
+ csrfToken: '{{.CsrfToken}}',
+ pageData: {{.PageData}},
+ requireTribute: {{.RequireTribute}},
+ notificationSettings: {{NotificationSettings}}, {{/*a map provided by NewFuncMap in helper.go*/}}
+ enableTimeTracking: {{EnableTimetracking}},
{{if .RequireTribute}}
tributeValues: Array.from(new Map([
{{ range .Participants }}
@@ -54,7 +45,7 @@
{{ end }}
]).values()),
{{end}}
- MermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},
+ mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},
};
</script>
<link rel="icon" href="{{AssetUrlPrefix}}/img/logo.svg" type="image/svg+xml">
diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl
index ec7370709f..f152d20915 100644
--- a/templates/repo/projects/list.tmpl
+++ b/templates/repo/projects/list.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div class="page-content repository milestones">
+<div class="page-content repository projects milestones">
{{template "repo/header" .}}
<div class="ui container">
<div class="navbar">
diff --git a/templates/repo/projects/new.tmpl b/templates/repo/projects/new.tmpl
index 3a99d56f9e..e015f7d7af 100644
--- a/templates/repo/projects/new.tmpl
+++ b/templates/repo/projects/new.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div class="page-content repository new milestone">
+<div class="page-content repository projects edit-project new milestone">
{{template "repo/header" .}}
<div class="ui container">
<div class="navbar">
diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl
index 082f4d8eb9..d4a2eaa4c3 100644
--- a/templates/repo/projects/view.tmpl
+++ b/templates/repo/projects/view.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div class="page-content repository">
+<div class="page-content repository projects view-project">
{{template "repo/header" .}}
<div class="ui container">
<div class="ui two column stackable grid">
@@ -7,7 +7,7 @@
{{template "repo/issue/navbar" .}}
</div>
<div class="column right aligned">
- {{if and .CanWriteProjects (not .Repository.IsArchived) .PageIsProjects}}
+ {{if and .CanWriteProjects (not .Repository.IsArchived)}}
<a class="ui green button show-modal item" href="{{$.RepoLink}}/issues/new?project={{$.Project.ID}}">{{.i18n.Tr "repo.issues.new"}}</a>
<a class="ui green button show-modal item" data-modal="#new-board-item">{{.i18n.Tr "new_project_board"}}</a>
{{end}}
@@ -80,10 +80,10 @@
<div class="board">
{{ range $board := .Boards }}
- <div class="ui segment board-column" style="background: {{.Color}}!important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">
+ <div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">
<div class="board-column-header df ac sb">
<div class="ui large label board-label py-2">{{.Title}}</div>
- {{if and $.CanWriteProjects (not $.Repository.IsArchived) $.PageIsProjects (ne .ID 0)}}
+ {{if and $.CanWriteProjects (not $.Repository.IsArchived) (ne .ID 0)}}
<div class="ui dropdown jump item poping up" data-variation="tiny inverted">
<div class="not-mobile px-3" tabindex="-1">
{{svg "octicon-kebab-horizontal"}}
@@ -232,7 +232,7 @@
{{if .Labels}}
<div class="extra content labels-list p-0 pt-2">
{{ range .Labels }}
- <a class="ui label" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
+ <a class="ui label" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}};" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
{{ end }}
</div>
{{end}}