diff --git a/.air.toml b/.air.toml index de97bd8b29..3740c4d4aa 100644 --- a/.air.toml +++ b/.air.toml @@ -2,9 +2,10 @@ root = "." tmp_dir = ".air" [build] +pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs cmd = "make --no-print-directory backend" bin = "gitea" -delay = 1000 +delay = 2000 include_ext = ["go", "tmpl"] include_file = ["main.go"] include_dir = ["cmd", "models", "modules", "options", "routers", "services"] diff --git a/.dockerignore b/.dockerignore index b299c7313d..b696e1603c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -95,6 +95,9 @@ cpu.out /.air /.go-licenses +# Files and folders that were previously generated +/public/assets/img/webpack + # Snapcraft snap/.snapcraft/ parts/ diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 99ce2e97d6..0eda8a1877 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -3,6 +3,8 @@ reportUnusedDisableDirectives: true ignorePatterns: - /web_src/js/vendor + - /web_src/fomantic + - /public/assets/js parserOptions: sourceType: module @@ -125,19 +127,21 @@ rules: "@stylistic/js/computed-property-spacing": [2, never] "@stylistic/js/dot-location": [2, property] "@stylistic/js/eol-last": [2] - "@stylistic/js/function-call-spacing": [2, never] "@stylistic/js/function-call-argument-newline": [0] + "@stylistic/js/function-call-spacing": [2, never] "@stylistic/js/function-paren-newline": [0] "@stylistic/js/generator-star-spacing": [0] "@stylistic/js/implicit-arrow-linebreak": [0] "@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}] "@stylistic/js/key-spacing": [2] "@stylistic/js/keyword-spacing": [2] + "@stylistic/js/line-comment-position": [0] "@stylistic/js/linebreak-style": [2, unix] "@stylistic/js/lines-around-comment": [0] "@stylistic/js/lines-between-class-members": [0] "@stylistic/js/max-len": [0] "@stylistic/js/max-statements-per-line": [0] + "@stylistic/js/multiline-comment-style": [0] "@stylistic/js/multiline-ternary": [0] "@stylistic/js/new-parens": [2] "@stylistic/js/newline-per-chained-call": [0] @@ -309,7 +313,7 @@ rules: jquery/no-merge: [2] jquery/no-param: [2] jquery/no-parent: [0] - jquery/no-parents: [0] + jquery/no-parents: [2] jquery/no-parse-html: [2] jquery/no-prop: [2] jquery/no-proxy: [2] @@ -317,9 +321,9 @@ rules: jquery/no-serialize: [2] jquery/no-show: [2] jquery/no-size: [2] - jquery/no-sizzle: [0] - jquery/no-slide: [0] - jquery/no-submit: [0] + jquery/no-sizzle: [2] + jquery/no-slide: [2] + jquery/no-submit: [2] jquery/no-text: [0] jquery/no-toggle: [2] jquery/no-trigger: [0] @@ -457,7 +461,7 @@ rules: no-jquery/no-other-utils: [2] no-jquery/no-param: [2] no-jquery/no-parent: [0] - no-jquery/no-parents: [0] + no-jquery/no-parents: [2] no-jquery/no-parse-html-literal: [0] no-jquery/no-parse-html: [2] no-jquery/no-parse-json: [2] @@ -469,7 +473,7 @@ rules: no-jquery/no-selector-prop: [2] no-jquery/no-serialize: [2] no-jquery/no-size: [2] - no-jquery/no-sizzle: [0] + no-jquery/no-sizzle: [2] no-jquery/no-slide: [2] no-jquery/no-sub: [2] no-jquery/no-support: [2] @@ -536,7 +540,7 @@ rules: no-underscore-dangle: [0] no-unexpected-multiline: [2] no-unmodified-loop-condition: [2] - no-unneeded-ternary: [0] + no-unneeded-ternary: [2] no-unreachable-loop: [2] no-unreachable: [2] no-unsafe-finally: [2] @@ -703,6 +707,7 @@ rules: unicorn/better-regex: [0] unicorn/catch-error-name: [0] unicorn/consistent-destructuring: [2] + unicorn/consistent-empty-array-spread: [2] unicorn/consistent-function-scoping: [2] unicorn/custom-error-definition: [0] unicorn/empty-brace-spaces: [2] @@ -715,21 +720,25 @@ rules: unicorn/import-style: [0] unicorn/new-for-builtins: [2] unicorn/no-abusive-eslint-disable: [0] + unicorn/no-anonymous-default-export: [0] unicorn/no-array-callback-reference: [0] unicorn/no-array-for-each: [2] unicorn/no-array-method-this-argument: [2] unicorn/no-array-push-push: [2] unicorn/no-array-reduce: [2] unicorn/no-await-expression-member: [0] + unicorn/no-await-in-promise-methods: [2] unicorn/no-console-spaces: [0] unicorn/no-document-cookie: [2] unicorn/no-empty-file: [2] unicorn/no-for-loop: [0] unicorn/no-hex-escape: [0] unicorn/no-instanceof-array: [0] + unicorn/no-invalid-fetch-options: [2] unicorn/no-invalid-remove-event-listener: [2] unicorn/no-keyword-prefix: [0] unicorn/no-lonely-if: [2] + unicorn/no-magic-array-flat-depth: [0] unicorn/no-negated-condition: [0] unicorn/no-nested-ternary: [0] unicorn/no-new-array: [0] @@ -737,6 +746,7 @@ rules: unicorn/no-null: [0] unicorn/no-object-as-default-parameter: [0] unicorn/no-process-exit: [0] + unicorn/no-single-promise-in-promise-methods: [2] unicorn/no-static-only-class: [2] unicorn/no-thenable: [2] unicorn/no-this-assignment: [2] @@ -794,10 +804,12 @@ rules: unicorn/prefer-set-has: [0] unicorn/prefer-set-size: [2] unicorn/prefer-spread: [0] + unicorn/prefer-string-raw: [0] unicorn/prefer-string-replace-all: [0] unicorn/prefer-string-slice: [0] unicorn/prefer-string-starts-ends-with: [2] unicorn/prefer-string-trim-start-end: [2] + unicorn/prefer-structured-clone: [2] unicorn/prefer-switch: [0] unicorn/prefer-ternary: [0] unicorn/prefer-text-content: [2] diff --git a/.gitattributes b/.gitattributes index 467b8a47b5..9fb4a4e83d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto eol=lf *.tmpl linguist-language=Handlebars +*.pb.go linguist-generated /assets/*.json linguist-generated /public/assets/img/svg/*.svg linguist-generated /templates/swagger/v1_json.tmpl linguist-generated diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md index 9ad186cca7..cf173a67ca 100644 --- a/.gitea/issue_template.md +++ b/.gitea/issue_template.md @@ -3,7 +3,7 @@ {{else if .IsSigned}} - {{if EnableTimetracking}} - + {{if and EnableTimetracking .ActiveStopwatch}} +
{{svg "octicon-stopwatch"}}
- {{ctx.Locale.Tr "active_stopwatch"}}
-
-
- - {{svg "octicon-issue-opened" 16 "tw-mr-2"}} - {{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}} - - {{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}} - - -
- {{.CsrfTokenHtml}} - -
-
- {{.CsrfTokenHtml}} - -
-
-
{{end}} @@ -202,4 +182,33 @@ {{end}} + + {{if and .IsSigned EnableTimetracking .ActiveStopwatch}} +
+
+ + {{svg "octicon-issue-opened" 16}} + {{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}} + +
+
+ {{.CsrfTokenHtml}} + +
+
+ {{.CsrfTokenHtml}} + +
+
+
+
+ {{end}} diff --git a/templates/base/head_style.tmpl b/templates/base/head_style.tmpl index 0793eaca20..f97e1880ce 100644 --- a/templates/base/head_style.tmpl +++ b/templates/base/head_style.tmpl @@ -1,2 +1,2 @@ - + diff --git a/templates/base/markup_codepreview.tmpl b/templates/base/markup_codepreview.tmpl new file mode 100644 index 0000000000..a1a4f26b47 --- /dev/null +++ b/templates/base/markup_codepreview.tmpl @@ -0,0 +1,25 @@ +
+
+ {{.FilePath}} + {{$link := HTMLFormat `%s` .RepoLink .CommitID (.CommitID | ShortSha) -}} + {{- if eq .LineStart .LineStop -}} + {{ctx.Locale.Tr "repo.code_preview_line_in" .LineStart $link}} + {{- else -}} + {{ctx.Locale.Tr "repo.code_preview_line_from_to" .LineStart .LineStop $link}} + {{- end}} +
+ + + {{- range $idx, $line := .HighlightLines -}} + + + {{- if $.EscapeStatus.Escaped -}} + {{- $lineEscapeStatus := index $.LineEscapeStatus $idx -}} + + {{- end}} + {{/* only div works, span generates incorrect HTML structure */}} + + {{- end -}} + +
{{if $lineEscapeStatus.Escaped}}{{end}}
{{$line.FormattedContent}}
+
diff --git a/templates/base/modal_actions_confirm.tmpl b/templates/base/modal_actions_confirm.tmpl index c44320deff..9f7eb4adf2 100644 --- a/templates/base/modal_actions_confirm.tmpl +++ b/templates/base/modal_actions_confirm.tmpl @@ -1,7 +1,6 @@ {{/* Two buttons (negative, positive): * ModalButtonTypes: "yes" (default) or "confirm" -* ModalButtonColors: "primary" (default) / "blue" / "yellow" * ModalButtonCancelText * ModalButtonOkText @@ -22,14 +21,7 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal {{end}} {{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}} {{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}} - - {{$stylePositive := "primary"}} - {{if eq .ModalButtonColors "blue"}} - {{$stylePositive = "blue"}} - {{else if eq .ModalButtonColors "yellow"}} - {{$stylePositive = "yellow"}} - {{end}} - + {{end}} diff --git a/templates/devtest/fetch-action.tmpl b/templates/devtest/fetch-action.tmpl index 7b0bbba554..2b25e6c9c4 100644 --- a/templates/devtest/fetch-action.tmpl +++ b/templates/devtest/fetch-action.tmpl @@ -21,7 +21,7 @@
-
+
diff --git a/templates/devtest/fomantic-dropdown.tmpl b/templates/devtest/fomantic-dropdown.tmpl new file mode 100644 index 0000000000..57a7c1313e --- /dev/null +++ b/templates/devtest/fomantic-dropdown.tmpl @@ -0,0 +1,109 @@ +{{template "base/head" .}} + +
+
+

Dropdown

+
+ + + + +
+ + +
+
+ +

Selection

+
+ {{/* the "selection" class is optional, it will be added by JS automatically */}} + + +
+

Dropdown Button (demo only without menu)

+
+ + + +
+ +
+ + + +
+ +
+
+
Other button align with ...
+ +
+
+
+{{template "base/footer" .}} diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index 5cd36721a7..f31cdc1983 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/devtest/fomantic-modal.tmpl @@ -1,6 +1,15 @@ {{template "base/head" .}}
{{template "base/alert" .}} + + - - - - - - -
{{template "base/footer" .}} diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 76de4a93d7..ea293fd3b4 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -29,41 +29,13 @@ - - - -
  • Recommended colors:

    - - - - - - - - -
  • -
  • -

    Supported but not recommended:

    -

    Do not use if there is no strong requirement. Do not use grey/black buttons, they don't work well with dark theme.

    - - - - - - - - - - - - - - + +
  • Inline / Plain:

    @@ -102,7 +74,7 @@

    Loading

    -
    loading ...
    +
    loading ...

    loading ...

    loading ...

    @@ -198,7 +170,7 @@ 123
    - +

    Input with SVG

    @@ -208,102 +180,6 @@ - -

    Dropdown with SVG

    -
    - - - - -
    - - -
    -
    - -
    - - - - -
    - -
    - - - - -
    - -
    -
    -
    Button align with ...
    - -
    diff --git a/templates/devtest/label.tmpl b/templates/devtest/label.tmpl new file mode 100644 index 0000000000..c4b52a3e23 --- /dev/null +++ b/templates/devtest/label.tmpl @@ -0,0 +1,27 @@ +{{template "base/head" .}} + +
    +
    +

    Label

    +
    + simple label + red label + green label +
    +
    + basic label + basic red label + basic green label +
    +
    + long content must be in a non-flex "gt-ellipsis" element, otherwise it won't get ellipsis. very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label +
    +
    + very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label +
    +
    + very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl index 8e619fa66f..a157cd4b75 100644 --- a/templates/explore/navbar.tmpl +++ b/templates/explore/navbar.tmpl @@ -11,7 +11,7 @@ {{svg "octicon-organization"}} {{ctx.Locale.Tr "explore.organizations"}} - {{if and (not $.UnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}} + {{if and (not ctx.Consts.RepoUnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}} {{svg "octicon-code"}} {{ctx.Locale.Tr "explore.code"}} diff --git a/templates/install.tmpl b/templates/install.tmpl index 8a6956b546..965e57f213 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -157,168 +157,171 @@

    {{ctx.Locale.Tr "install.optional_title"}}

    - - -
    - - {{ctx.Locale.Tr "install.email_title"}} - -
    - - -
    -
    - - -
    -
    - - - {{ctx.Locale.Tr "install.smtp_from_helper"}} -
    -
    - - -
    -
    - - -
    -
    -
    - - +
    + +
    + + {{ctx.Locale.Tr "install.email_title"}} + +
    + +
    -
    -
    -
    - - +
    + +
    -
    -
    - - -
    - - {{ctx.Locale.Tr "install.server_service_title"}} - -
    -
    - - +
    + + + {{ctx.Locale.TrString "install.smtp_from_helper"}}{{/* it contains lt/gt chars*/}}
    -
    -
    -
    - - +
    + +
    -
    -
    -
    - - +
    + +
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    - - - {{ctx.Locale.Tr "install.no_reply_address_helper"}} -
    -
    - -
    +
    +
    + + +
    +
    + - -
    - - {{ctx.Locale.Tr "install.admin_title"}} - -

    {{ctx.Locale.Tr "install.admin_setting_desc"}}

    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    + +
    + + {{ctx.Locale.Tr "install.server_service_title"}} + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + + + {{ctx.Locale.Tr "install.no_reply_address_helper"}} +
    +
    + + + {{ctx.Locale.Tr "install.password_algorithm_helper"}} +
    +
    + + +
    + + {{ctx.Locale.Tr "install.admin_title"}} + +

    {{ctx.Locale.Tr "install.admin_setting_desc"}}

    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + +
    {{if .EnvConfigKeys}} @@ -333,12 +336,11 @@ {{end}} -
    These configuration options will be written into: {{.CustomConfFile}}
    -
    +
    diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl index c519606d1f..698a9559c5 100644 --- a/templates/org/menu.tmpl +++ b/templates/org/menu.tmpl @@ -40,8 +40,9 @@ {{end}} {{if .IsOrganizationOwner}} + - {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} {{end}}
    diff --git a/templates/org/projects/list.tmpl b/templates/org/projects/list.tmpl index ec9cfece9a..80dde1c4d2 100644 --- a/templates/org/projects/list.tmpl +++ b/templates/org/projects/list.tmpl @@ -13,11 +13,9 @@
    {{template "shared/user/profile_big_avatar" .}}
    -
    -
    +
    {{template "user/overview/header" .}} -
    - {{template "projects/list" .}} + {{template "projects/list" .}}
    diff --git a/templates/org/projects/view.tmpl b/templates/org/projects/view.tmpl index 495204b06d..e1ab81c4cd 100644 --- a/templates/org/projects/view.tmpl +++ b/templates/org/projects/view.tmpl @@ -1,7 +1,7 @@ {{template "base/head" .}}
    {{template "shared/user/org_profile_avatar" .}} -
    +
    {{template "user/overview/header" .}}
    diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 5719328a27..5433f01530 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -8,7 +8,7 @@
    {{template "org/team/navbar" .}} {{if .IsOrganizationOwner}} -
    +
    {{.CsrfTokenHtml}} @@ -21,7 +21,7 @@
    {{end}} -
    +
    {{range .Team.Members}}
    @@ -46,7 +46,7 @@
    {{else}}
    - {{ctx.Locale.Tr "org.teams.members.none"}} + {{ctx.Locale.Tr "org.teams.members.none"}}
    {{end}}
    diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl index 8f2571e1f6..9704f63f6f 100644 --- a/templates/org/team/navbar.tmpl +++ b/templates/org/team/navbar.tmpl @@ -1,4 +1,4 @@ -
    {{end}} -
    +
    {{range .Team.Repos}}
    @@ -48,7 +48,7 @@
    {{else}}
    - {{ctx.Locale.Tr "org.teams.repos.none"}} + {{ctx.Locale.Tr "org.teams.repos.none"}}
    {{end}}
    diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index 9311a46e38..ac41cda716 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -22,7 +22,7 @@ {{if .Team.Description}} {{.Team.Description}} {{else}} - {{ctx.Locale.Tr "org.teams.no_desc"}} + {{ctx.Locale.Tr "org.teams.no_desc"}} {{end}}
    {{if eq .Team.LowerName "owners"}} @@ -79,7 +79,7 @@
    {{if .IsOrganizationOwner}} {{end}}
    diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index 3a7de335de..f56595a830 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -1,4 +1,8 @@ -{{if eq .PackageDescriptor.Package.Type "maven"}} +{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}} +

    {{ctx.Locale.Tr "packages.installation"}}

    +
    {{ctx.Locale.Tr "packages.no_metadata"}}
    +{{end}} +{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}}

    {{ctx.Locale.Tr "packages.installation"}}

    diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index a78a07d874..01298a664c 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -45,6 +45,15 @@
    {{end}} + {{if .PackageDescriptor.Metadata.BundleDependencies}} +

    {{ctx.Locale.Tr "packages.npm.dependencies.bundle"}}

    +
    + {{range .PackageDescriptor.Metadata.BundleDependencies}} + {{.}} + {{end}} +
    + {{end}} + {{if .PackageDescriptor.Metadata.Keywords}}

    {{ctx.Locale.Tr "packages.keywords"}}

    diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index 0911260fba..f1fe420c0b 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -16,12 +16,11 @@
    - {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.ReleaseNotes}} + {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.ReleaseNotes .PackageDescriptor.Metadata.Readme}}

    {{ctx.Locale.Tr "packages.about"}}

    -
    - {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}} - {{if .PackageDescriptor.Metadata.ReleaseNotes}}{{.PackageDescriptor.Metadata.ReleaseNotes}}{{end}} -
    + {{if .PackageDescriptor.Metadata.Description}}
    {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Description}}
    {{end}} + {{if .PackageDescriptor.Metadata.Readme}}
    {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}
    {{end}} + {{if .PackageDescriptor.Metadata.ReleaseNotes}}
    {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.ReleaseNotes}}
    {{end}} {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} diff --git a/templates/package/metadata/maven.tmpl b/templates/package/metadata/maven.tmpl index 548be61790..36412723d2 100644 --- a/templates/package/metadata/maven.tmpl +++ b/templates/package/metadata/maven.tmpl @@ -1,4 +1,7 @@ -{{if eq .PackageDescriptor.Package.Type "maven"}} +{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}} +
    {{svg "octicon-note" 16 "tw-mr-2"}} {{ctx.Locale.Tr "packages.no_metadata"}}
    +{{end}} +{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}} {{if .PackageDescriptor.Metadata.Name}}
    {{svg "octicon-note" 16 "tw-mr-2"}} {{.PackageDescriptor.Metadata.Name}}
    {{end}} {{if .PackageDescriptor.Metadata.ProjectURL}}
    {{svg "octicon-link-external" 16 "tw-mr-2"}} {{ctx.Locale.Tr "packages.details.project_site"}}
    {{end}} {{range .PackageDescriptor.Metadata.Licenses}}
    {{svg "octicon-law" 16 "tw-mr-2"}} {{.}}
    {{end}} diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index ec02e9a6fc..b2f48fe2c9 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -41,9 +41,9 @@
    {{range .Projects}}
  • -

    +

    {{svg .IconName 16}} - {{.Title}} + {{.Title}}

    diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl index 92ee36c1c4..bd173b54bc 100644 --- a/templates/projects/new.tmpl +++ b/templates/projects/new.tmpl @@ -25,11 +25,11 @@
    diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 33dd758c79..45c8461218 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -1,8 +1,8 @@ {{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}} -
    -
    -

    {{.Project.Title}}

    +
    +
    +

    {{.Project.Title}}

    {{if $canWriteProject}}
    -
    +
    {{range .Columns}} -
    +
    -
    -
    - {{.NumIssues ctx}} -
    - {{.Title}} +
    + {{.NumIssues ctx}}
    +
    {{.Title}}
    {{if $canWriteProject}} -
  • -
    - {{svg "octicon-tag" 16 "tw-mr-1"}}{{$release.TagName}} - {{if and $release.Sha1 ($.Permission.CanRead $.UnitTypeCode)}} +
  • +
    + {{svg "octicon-tag" 16 "tw-mr-1"}}{{$release.TagName}} + {{if and $release.Sha1 ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha $release.Sha1}} {{template "repo/branch_dropdown" dict "root" $ "release" $release}} {{end}}
    -
    +

    - {{if $.PageIsSingleTag}}{{$release.Title}}{{else}}{{$release.Title}}{{end}} + {{if $.PageIsSingleTag}}{{$release.Title}}{{else}}{{$release.Title}}{{end}} {{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}} {{if $release.IsDraft}} {{ctx.Locale.Tr "repo.release.draft"}} @@ -53,7 +53,7 @@ {{if $release.CreatedUnix}} {{TimeSinceUnix $release.CreatedUnix ctx.Locale}} {{end}} - {{if and (not $release.IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} + {{if and (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} | {{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}} {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}} {{end}}

    @@ -62,22 +62,22 @@

    - + {{ctx.Locale.Tr "repo.release.downloads"}}
    -
  • {{end}} @@ -99,7 +98,7 @@ -{{if (and ($.Permission.CanWrite $.UnitTypeCode) .PageIsTagList)}} +{{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) .PageIsTagList)}} - @@ -75,7 +75,7 @@ {{if $allowedToChangeTeams}}
    -
    diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index da1a321785..190ca1af6c 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -28,7 +28,7 @@
    -
    diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index 43afba96c3..a015cc8bd1 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -11,10 +11,12 @@ {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}} -
    +
    {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
    - {{if .IsMarkup}} + {{if .IsFileTooLarge}} + {{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}} + {{else if .IsMarkup}} {{if .FileContent}}{{.FileContent | SafeHTML}}{{end}} {{else if .IsPlainText}}
    {{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}
    @@ -33,19 +35,15 @@ {{else if .IsPDFFile}}
    {{else}} - {{ctx.Locale.Tr "repo.file_view_raw"}} + {{ctx.Locale.Tr "repo.file_view_raw"}} {{end}}
    {{else if .FileSize}} - {{if .IsFileTooLarge}} - - {{else}} - {{end}}
    {{ctx.Locale.Tr "repo.file_too_large"}}{{.LineNums}}
      {{.FileContent}}
    diff --git a/templates/repo/settings/lfs_pointers.tmpl b/templates/repo/settings/lfs_pointers.tmpl index a0bb8c46f0..758aec6bb0 100644 --- a/templates/repo/settings/lfs_pointers.tmpl +++ b/templates/repo/settings/lfs_pointers.tmpl @@ -37,7 +37,7 @@ - + {{ShortSha .Oid}} diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index 0b0ef0b6e8..414effbf2f 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -12,7 +12,7 @@ {{ctx.Locale.Tr "repo.settings.hooks"}} {{end}} - {{if .Repository.UnitEnabled $.Context $.UnitTypeCode}} + {{if .Repository.UnitEnabled $.Context ctx.Consts.RepoUnitTypeCode}} {{if not .Repository.IsEmpty}} {{ctx.Locale.Tr "repo.settings.branches"}} @@ -35,7 +35,7 @@ {{end}} {{end}} - {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeActions)}}
    {{ctx.Locale.Tr "actions.actions"}}