Dropdown
+Selection
+Dropdown Button (demo only without menu)
++ + +
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 @@
Do not use if there is no strong requirement. Do not use grey/black buttons, they don't work well with dark theme.
- - - - - - - - - - - - - - + +{{ctx.Locale.Tr "install.admin_setting_desc"}}
-{{ctx.Locale.Tr "install.admin_setting_desc"}}
+{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 6c2e08a985..c4f73875f2 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -69,9 +69,9 @@{{ctx.Locale.Tr "repo.commits.author"}} | +{{StringUtils.ToUpper $.Repository.ObjectFormatName}} | +{{ctx.Locale.Tr "repo.commits.message"}} | +{{ctx.Locale.Tr "repo.commits.date"}} | ++ | |||
---|---|---|---|---|---|---|---|
{{ctx.Locale.Tr "repo.commits.author"}} | -{{StringUtils.ToUpper $.Repository.ObjectFormatName}} | -{{ctx.Locale.Tr "repo.commits.message"}} | -{{ctx.Locale.Tr "repo.commits.date"}} | -- | |||
+ |
+
{{$userName := .Author.Name}}
{{if .User}}
{{if and .User.FullName DefaultShowFullName}}
@@ -24,69 +25,69 @@
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}}
{{$userName}}
{{end}}
- |
- - {{$class := "ui sha label"}} - {{if .Signature}} - {{$class = (print $class " isSigned")}} - {{if .Verification.Verified}} - {{if eq .Verification.TrustStatus "trusted"}} - {{$class = (print $class " isVerified")}} - {{else if eq .Verification.TrustStatus "untrusted"}} - {{$class = (print $class " isVerifiedUntrusted")}} - {{else}} - {{$class = (print $class " isVerifiedUnmatched")}} - {{end}} - {{else if .Verification.Warning}} - {{$class = (print $class " isWarning")}} + + | ++ {{$class := "ui sha label"}} + {{if .Signature}} + {{$class = (print $class " isSigned")}} + {{if .Verification.Verified}} + {{if eq .Verification.TrustStatus "trusted"}} + {{$class = (print $class " isVerified")}} + {{else if eq .Verification.TrustStatus "untrusted"}} + {{$class = (print $class " isVerifiedUntrusted")}} + {{else}} + {{$class = (print $class " isVerifiedUnmatched")}} {{end}} + {{else if .Verification.Warning}} + {{$class = (print $class " isWarning")}} {{end}} - {{$commitShaLink := ""}} - {{if $.PageIsWiki}} - {{$commitShaLink = (printf "%s/wiki/commit/%s" $commitRepoLink (PathEscape .ID.String))}} - {{else if $.PageIsPullCommits}} - {{$commitShaLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} - {{else if $.Reponame}} - {{$commitShaLink = (printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String))}} - {{end}} - - {{ShortSha .ID.String}} - {{if .Signature}}{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}{{end}} - - | -
-
- {{if $.PageIsWiki}}
- {{.Summary | RenderEmoji $.Context}}
- {{else}}
- {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
- {{RenderCommitMessageLinkSubject $.Context .Message $commitLink ($.Repository.ComposeMetas ctx)}}
- {{end}}
-
- {{if IsMultilineCommitMessage .Message}}
-
- {{end}}
- {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
- {{if IsMultilineCommitMessage .Message}}
- {{RenderCommitBody $.Context .Message ($.Repository.ComposeMetas ctx)}}- {{end}} - |
- {{if .Committer}}
- {{TimeSince .Committer.When ctx.Locale}} | - {{else}} -{{TimeSince .Author.When ctx.Locale}} | {{end}} -- - - {{svg "octicon-file-code"}} - - | -
{{RenderCommitBody $.Context .Message ($.Repository.ComposeMetas ctx)}}+ {{end}} +
{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}- {{end}}
+ {{- RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}} ++ {{end}} {{end}}
{{/*
*/}}{{end}}{{/*
*/}}
{{/*
*/}}{{end}}{{/*
@@ -46,7 +46,7 @@
{{end}}
{{else}}
{{range $k, $line := $.section.Lines}}
- {{$inlineDiff.Content}}
{{$inlineDiff.Content}}
{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}
{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}
{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc"}}
{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc"}}
-
+ {{if $canReadReleases}} - {{.TagName}} + {{.TagName}} {{else}} - {{.TagName}} + {{.TagName}} {{end}}
- {{if $.Permission.CanRead $.UnitTypeCode}}
+ {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
{{if .CreatedUnix}}
{{svg "octicon-clock" 16 "tw-mr-1"}}{{TimeSinceUnix .CreatedUnix ctx.Locale}}
{{end}}
@@ -40,7 +41,7 @@
{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.new_release"}}
{{end}}
- {{if (and ($.Permission.CanWrite $.UnitTypeCode) $release.IsTag)}}
+ {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
{{svg "octicon-trash" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
@@ -57,12 +58,13 @@
|
{{if .FileContent}}{{.FileContent}}{{end}}@@ -108,19 +110,10 @@ {{else if .IsPDFFile}} {{else}} - {{ctx.Locale.Tr "repo.file_view_raw"}} + {{ctx.Locale.Tr "repo.file_view_raw"}} {{end}}
{{ctx.Locale.Tr "repo.file_too_large"}} | -
- {{template "repo/latest_commit" .}} + |
+
+
+ {{template "repo/latest_commit" .}}
+
+ |
{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When ctx.Locale}}{{end}}{{end}} |
---|
{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}