Compare commits

...

7 commits

Author SHA1 Message Date
zokki
64193310ee fix(ui): compare branches even with pull requests disabled (#8496)
Resolves #8428

Its currently showing the diff of two branches, even if the PR-unit is disabled. But the POST to create the PR is still returning an error when the unit is disabled, so its only a change for UI.

Preview:
https://codeberg.org/attachments/610d6b81-a50f-4c43-91c2-db4c38e7b701

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8496
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: zokki <zokki.softwareschmiede@gmail.com>
Co-committed-by: zokki <zokki.softwareschmiede@gmail.com>
2025-08-03 06:19:45 +02:00
0ko
4392dee96d chore(ui): improve hashbox (#8721)
Followup to https://codeberg.org/forgejo/forgejo/pulls/7822

* Fix signaturebox's background breaking out of hashbox and thus breaking it's rounded corners
* Fix a bug where an extra right margin was applied to signbox's avatar on pull request overview by unrelated rule
* Untangle hashbox's CSS from .label - it was not a good partnership between them. Some extra properties, some that we had to override
* Move CSS out of "repo.css" to a separate file - it's clearly not only related to repos

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8721
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-08-03 05:49:24 +02:00
Renovate Bot
2269831c9f Update module code.forgejo.org/forgejo/runner/v9 to v9.0.2 (forgejo) (#8762)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| code.forgejo.org/forgejo/runner/v9 | `v9.0.1` -> `v9.0.2` | [![age](https://developer.mend.io/api/mc/badges/age/go/code.forgejo.org%2fforgejo%2frunner%2fv9/v9.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/code.forgejo.org%2fforgejo%2frunner%2fv9/v9.0.1/v9.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40My41IiwidXBkYXRlZEluVmVyIjoiNDEuNDMuNSIsInRhcmdldEJyYW5jaCI6ImZvcmdlam8iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeS11cGdyYWRlIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8762
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-08-03 04:17:41 +02:00
Renovate Bot
cdb6296d58 Update dependency eslint-plugin-unicorn to v60 (forgejo) (#8766)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-08-03 03:41:36 +02:00
Renovate Bot
a8ef6af0fd Update dependency @stylistic/stylelint-plugin to v4 (forgejo) (#8765)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-08-03 03:39:00 +02:00
Renovate Bot
7af647025a Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.3.1 (forgejo) (#8763)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-08-03 03:37:09 +02:00
Renovate Bot
a2d6b79195 Update dependency @playwright/test to v1.54.2 (forgejo) (#8761)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-08-03 03:36:45 +02:00
20 changed files with 236 additions and 227 deletions

View file

@ -39,7 +39,7 @@ XGO_VERSION := go-1.21.x
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.3.0 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.3.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.3.1 # renovate: datasource=go
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest

2
go.mod
View file

@ -10,7 +10,7 @@ require (
code.forgejo.org/forgejo/go-rpmutils v1.0.0
code.forgejo.org/forgejo/levelqueue v1.0.0
code.forgejo.org/forgejo/reply v1.0.2
code.forgejo.org/forgejo/runner/v9 v9.0.1
code.forgejo.org/forgejo/runner/v9 v9.0.2
code.forgejo.org/go-chi/binding v1.0.1
code.forgejo.org/go-chi/cache v1.0.1
code.forgejo.org/go-chi/captcha v1.0.2

4
go.sum
View file

@ -14,8 +14,8 @@ code.forgejo.org/forgejo/levelqueue v1.0.0 h1:9krYpU6BM+j/1Ntj6m+VCAIu0UNnne1/Uf
code.forgejo.org/forgejo/levelqueue v1.0.0/go.mod h1:fmG6zhVuqim2rxSFOoasgXO8V2W/k9U31VVYqLIRLhQ=
code.forgejo.org/forgejo/reply v1.0.2 h1:dMhQCHV6/O3L5CLWNTol+dNzDAuyCK88z4J/lCdgFuQ=
code.forgejo.org/forgejo/reply v1.0.2/go.mod h1:RyZUfzQLc+fuLIGjTSQWDAJWPiL4WtKXB/FifT5fM7U=
code.forgejo.org/forgejo/runner/v9 v9.0.1 h1:Qdg7c0yvqgjXj9NMQ+Vsq+GuUoGshHFHGYF79Bz+/2g=
code.forgejo.org/forgejo/runner/v9 v9.0.1/go.mod h1:b6JWcpwHnBwLuWeQERM4pCRzFbnsEvC9gagQfxbZeJw=
code.forgejo.org/forgejo/runner/v9 v9.0.2 h1:ajTyjmn3tjJs3fkJ58498CgI4kvxifVY8gbh46SWAgc=
code.forgejo.org/forgejo/runner/v9 v9.0.2/go.mod h1:b6JWcpwHnBwLuWeQERM4pCRzFbnsEvC9gagQfxbZeJw=
code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616 h1:kEZL84+02jY9RxXM4zHBWZ3Fml0B09cmP1LGkDsCfIA=
code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
code.forgejo.org/go-chi/binding v1.0.1 h1:coKNI+X1NzRN7X85LlrpvBRqk0TXpJ+ja28vusQWEuY=

View file

@ -111,5 +111,6 @@
"settings.visibility.description": "Profile visibility affects others' ability to access your non-private repositories. <a href=\"%s\" target=\"_blank\">Learn more</a>.",
"avatar.constraints_hint": "Custom avatar may not exceed %[1]s in size or be larger than %[2]dx%[3]d pixels",
"og.repo.summary_card.alt_description": "Summary card of repository %[1]s, described as: %[2]s",
"compare.branches.title": "Compare branches",
"meta.last_line": "Thank you for translating Forgejo! This line isn't seen by the users but it serves other purposes in the translation management. You can place a fun fact in the translation instead of translating it."
}

183
package-lock.json generated
View file

@ -63,10 +63,10 @@
"devDependencies": {
"@axe-core/playwright": "4.10.2",
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
"@playwright/test": "1.54.1",
"@playwright/test": "1.54.2",
"@stoplight/spectral-cli": "6.15.0",
"@stylistic/eslint-plugin": "5.2.2",
"@stylistic/stylelint-plugin": "3.1.3",
"@stylistic/stylelint-plugin": "4.0.0",
"@vitejs/plugin-vue": "6.0.1",
"@vitest/coverage-v8": "3.2.4",
"@vitest/eslint-plugin": "1.3.4",
@ -81,7 +81,7 @@
"eslint-plugin-regexp": "2.9.0",
"eslint-plugin-sonarjs": "3.0.4",
"eslint-plugin-toml": "0.12.0",
"eslint-plugin-unicorn": "59.0.1",
"eslint-plugin-unicorn": "60.0.0",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "10.4.0",
"eslint-plugin-vue-scoped-css": "2.11.0",
@ -481,9 +481,9 @@
}
},
"node_modules/@csstools/media-query-list-parser": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-3.0.1.tgz",
"integrity": "sha512-HNo8gGD02kHmcbX6PvCoUuOQvn4szyB9ca63vZHKX5A81QytgDG4oxG4IaEfHTlEZSZ6MjPEMWIVU+zF2PZcgw==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.3.tgz",
"integrity": "sha512-HAYH7d3TLRHDOUQK4mZKf9k9Ph/m8Akstg66ywKR4SFAigjs3yBiUeZtFxywiTm5moZMAp/5W/ZuFnNXXYLuuQ==",
"dev": true,
"funding": [
{
@ -500,8 +500,8 @@
"node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^3.0.1",
"@csstools/css-tokenizer": "^3.0.1"
"@csstools/css-parser-algorithms": "^3.0.5",
"@csstools/css-tokenizer": "^3.0.4"
}
},
"node_modules/@discoveryjs/json-ext": {
@ -2172,13 +2172,13 @@
}
},
"node_modules/@playwright/test": {
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.54.1.tgz",
"integrity": "sha512-FS8hQ12acieG2dYSksmLOF7BNxnVf2afRJdCuM1eMSxj6QTSE6G4InGF7oApGgDb65MX7AwMVlIkpru0yZA4Xw==",
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.54.2.tgz",
"integrity": "sha512-A+znathYxPf+72riFd1r1ovOLqsIIB0jKIoPjyK2kqEIe30/6jF6BC7QNluHuwUmsD2tv1XZVugN8GqfTMOxsA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.54.1"
"playwright": "1.54.2"
},
"bin": {
"playwright": "cli.js"
@ -3082,18 +3082,17 @@
}
},
"node_modules/@stylistic/stylelint-plugin": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-3.1.3.tgz",
"integrity": "sha512-85fsmzgsIVmyG3/GFrjuYj6Cz8rAM7IZiPiXCMiSMfoDOC1lOrzrXPDk24WqviAghnPqGpx8b0caK2PuewWGFg==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-4.0.0.tgz",
"integrity": "sha512-CFwt3K4Y/7bygNCLCQ8Sy4Hzgbhxq3BsNW0FIuYxl17HD3ywptm54ocyeiLVRrk5jtz1Zwks7Xr9eiZt8SWHAw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@csstools/css-parser-algorithms": "^3.0.1",
"@csstools/css-tokenizer": "^3.0.1",
"@csstools/media-query-list-parser": "^3.0.1",
"is-plain-object": "^5.0.0",
"postcss": "^8.4.41",
"postcss-selector-parser": "^6.1.2",
"@csstools/css-parser-algorithms": "^3.0.5",
"@csstools/css-tokenizer": "^3.0.4",
"@csstools/media-query-list-parser": "^4.0.3",
"postcss": "^8.5.6",
"postcss-selector-parser": "^7.1.0",
"postcss-value-parser": "^4.2.0",
"style-search": "^0.1.0"
},
@ -3101,7 +3100,50 @@
"node": "^18.12 || >=20.9"
},
"peerDependencies": {
"stylelint": "^16.8.0"
"stylelint": "^16.22.0"
}
},
"node_modules/@stylistic/stylelint-plugin/node_modules/postcss": {
"version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
"integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/@stylistic/stylelint-plugin/node_modules/postcss-selector-parser": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz",
"integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
"dev": true,
"license": "MIT",
"dependencies": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@swc/helpers": {
@ -5425,6 +5467,13 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/change-case": {
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz",
"integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==",
"dev": true,
"license": "MIT"
},
"node_modules/character-entities": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
@ -7637,65 +7686,39 @@
}
},
"node_modules/eslint-plugin-unicorn": {
"version": "59.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-59.0.1.tgz",
"integrity": "sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q==",
"version": "60.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz",
"integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-validator-identifier": "^7.25.9",
"@eslint-community/eslint-utils": "^4.5.1",
"@eslint/plugin-kit": "^0.2.7",
"ci-info": "^4.2.0",
"@babel/helper-validator-identifier": "^7.27.1",
"@eslint-community/eslint-utils": "^4.7.0",
"@eslint/plugin-kit": "^0.3.3",
"change-case": "^5.4.4",
"ci-info": "^4.3.0",
"clean-regexp": "^1.0.0",
"core-js-compat": "^3.41.0",
"core-js-compat": "^3.44.0",
"esquery": "^1.6.0",
"find-up-simple": "^1.0.1",
"globals": "^16.0.0",
"globals": "^16.3.0",
"indent-string": "^5.0.0",
"is-builtin-module": "^5.0.0",
"jsesc": "^3.1.0",
"pluralize": "^8.0.0",
"regexp-tree": "^0.1.27",
"regjsparser": "^0.12.0",
"semver": "^7.7.1",
"semver": "^7.7.2",
"strip-indent": "^4.0.0"
},
"engines": {
"node": "^18.20.0 || ^20.10.0 || >=21.0.0"
"node": "^20.10.0 || >=21.0.0"
},
"funding": {
"url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1"
},
"peerDependencies": {
"eslint": ">=9.22.0"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/@eslint/core": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz",
"integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@types/json-schema": "^7.0.15"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/eslint-plugin-unicorn/node_modules/@eslint/plugin-kit": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz",
"integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@eslint/core": "^0.13.0",
"levn": "^0.4.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
"eslint": ">=9.29.0"
}
},
"node_modules/eslint-plugin-vitest-globals": {
@ -11987,13 +12010,13 @@
}
},
"node_modules/playwright": {
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.1.tgz",
"integrity": "sha512-peWpSwIBmSLi6aW2auvrUtf2DqY16YYcCMO8rTVx486jKmDTJg7UAhyrraP98GB8BoPURZP8+nxO7TSd4cPr5g==",
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.2.tgz",
"integrity": "sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.54.1"
"playwright-core": "1.54.2"
},
"bin": {
"playwright": "cli.js"
@ -12006,9 +12029,9 @@
}
},
"node_modules/playwright-core": {
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.1.tgz",
"integrity": "sha512-Nbjs2zjj0htNhzgiy5wu+3w09YetDx5pkrpI/kZotDlDUaYk0HVA5xrBVPdow4SAUIlhgKcJeJg4GRKW6xHusA==",
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.2.tgz",
"integrity": "sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@ -13940,30 +13963,6 @@
"stylelint": ">=16"
}
},
"node_modules/stylelint/node_modules/@csstools/media-query-list-parser": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.3.tgz",
"integrity": "sha512-HAYH7d3TLRHDOUQK4mZKf9k9Ph/m8Akstg66ywKR4SFAigjs3yBiUeZtFxywiTm5moZMAp/5W/ZuFnNXXYLuuQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT",
"engines": {
"node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^3.0.5",
"@csstools/css-tokenizer": "^3.0.4"
}
},
"node_modules/stylelint/node_modules/@csstools/selector-specificity": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz",

View file

@ -62,10 +62,10 @@
"devDependencies": {
"@axe-core/playwright": "4.10.2",
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
"@playwright/test": "1.54.1",
"@playwright/test": "1.54.2",
"@stoplight/spectral-cli": "6.15.0",
"@stylistic/eslint-plugin": "5.2.2",
"@stylistic/stylelint-plugin": "3.1.3",
"@stylistic/stylelint-plugin": "4.0.0",
"@vitejs/plugin-vue": "6.0.1",
"@vitest/coverage-v8": "3.2.4",
"@vitest/eslint-plugin": "1.3.4",
@ -80,7 +80,7 @@
"eslint-plugin-regexp": "2.9.0",
"eslint-plugin-sonarjs": "3.0.4",
"eslint-plugin-toml": "0.12.0",
"eslint-plugin-unicorn": "59.0.1",
"eslint-plugin-unicorn": "60.0.0",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "10.4.0",
"eslint-plugin-vue-scoped-css": "2.11.0",

View file

@ -520,17 +520,6 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
ctx.Data["PageIsComparePull"] = headIsBranch && baseIsBranch
}
if ctx.Data["PageIsComparePull"] == true && !permBase.CanReadIssuesOrPulls(true) {
if log.IsTrace() {
log.Trace("Permission Denied: User: %-v cannot create/read pull requests in Repo: %-v\nUser in baseRepo has Permissions: %-+v",
ctx.Doer,
baseRepo,
permBase)
}
ctx.NotFound("ParseCompareInfo", nil)
return nil
}
baseBranchRef := ci.BaseBranch
if baseIsBranch {
baseBranchRef = git.BranchPrefix + ci.BaseBranch

View file

@ -121,7 +121,11 @@
{{end}}
</td>
<td class="two wide right aligned">
{{if not .LatestPullRequest}}
{{if not ($.Permission.CanRead $.UnitTypePullRequests)}}
<a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
<button class="ui compact basic button tw-mr-0">{{ctx.Locale.Tr "compare.branches.title"}}</button>
</a>
{{else if not .LatestPullRequest}}
{{if .IsIncluded}}
<span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}">
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}}

View file

@ -181,11 +181,11 @@
<span>{{ctx.Locale.Tr "repo.diff.parent"}}</span>
{{range .Parents}}
{{if $.PageIsWiki}}
<a class="ui primary sha label" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .}}">
<a class="primary sha label" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .}}">
<span class="shortsha">{{ShortSha .}}</span>
</a>
{{else}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{PathEscape .}}">
<a class="primary sha label" href="{{$.RepoLink}}/commit/{{PathEscape .}}">
<span class="shortsha">{{ShortSha .}}</span>
</a>
{{end}}
@ -200,7 +200,7 @@
<span class="shortsha">{{ShortSha .CommitID}}</span>
</a>
{{else}}
<span class="ui primary sha label">
<span class="primary sha label">
<span class="shortsha">{{ShortSha .CommitID}}</span>
</span>
{{end}}

View file

@ -10,11 +10,11 @@
</div>
{{if .IsDiffCompare}}
<div class="commits-table-right tw-whitespace-nowrap">
<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui primary sha label tw-mx-0">
<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="primary sha label tw-mx-0">
<span class="shortsha">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</span>
</a>
...
<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui primary sha label tw-mx-0">
<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="primary sha label tw-mx-0">
<span class="shortsha">{{if not .HeadIsCommit}}{{if .HeadIsBranch}}{{svg "octicon-git-branch"}}{{else if .HeadIsTag}}{{svg "octicon-tag"}}{{end}}{{.HeadBranch}}{{else}}{{ShortSha .HeadBranch}}{{end}}</span>
</a>
</div>

View file

@ -2,11 +2,16 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
{{template "repo/header" .}}
{{$showDiffBox := false}}
{{$canReadPullRequests := .Permission.CanRead $.UnitTypePullRequests}}
<div class="ui container fluid padded">
<h2 class="ui header">
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
<div class="sub header">{{ctx.Locale.Tr "repo.pulls.compare_changes_desc"}}</div>
{{if $canReadPullRequests}}
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
<div class="sub header">{{ctx.Locale.Tr "repo.pulls.compare_changes_desc"}}</div>
{{else}}
{{ctx.Locale.Tr "compare.branches.title"}}
{{end}}
{{else}}
{{ctx.Locale.Tr "action.compare_commits_general"}}
{{end}}
@ -166,7 +171,7 @@
{{else}}
<div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_have_tag"}}</div>
{{end}}
{{else if and .PageIsComparePull (gt .CommitCount 0)}}
{{else if and .PageIsComparePull (gt .CommitCount 0) $canReadPullRequests}}
{{if .HasPullRequest}}
<div class="ui segment grid title">
<div class="twelve wide column issue-title">

View file

@ -11,7 +11,7 @@
<div class="repo-editor-header">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
{{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s"><span class="shortsha">%s</span></a>` $shaurl (ShortSha .SHA)}}
{{$shalink := HTMLFormat `<a class="primary sha label" href="%s"><span class="shortsha">%s</span></a>` $shaurl (ShortSha .SHA)}}
{{if eq .CherryPickType "revert"}}
{{ctx.Locale.Tr "repo.editor.revert" $shalink}}
{{else}}

View file

@ -26,13 +26,13 @@
{{if .ParentHashes}}
{{ctx.Locale.Tr "repo.diff.parent"}}
{{range .ParentHashes}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">
<a class="primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">
<span class="shortsha">{{ShortSha .String}}</span>
</a>
{{end}}
{{end}}
{{ctx.Locale.Tr "repo.diff.commit"}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">
<a class="primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">
<span class="shortsha">{{ShortSha .SHA}}</span>
</a>
</td>

View file

@ -417,7 +417,7 @@
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
<span class="field">
{{if .CodeIndexerStatus}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
<a rel="nofollow" class="sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
<span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
</a>
{{else}}
@ -444,7 +444,7 @@
{{end}}
<span class="field">
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
<a rel="nofollow" class="sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
</a>
{{else}}

View file

@ -26,7 +26,7 @@
{{else}}
<span class="text red">{{svg "octicon-alert"}}</span>
{{end}}
<a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">
<a class="primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">
<span class="shortsha">{{.UUID}}</span>
</a>
</div>

View file

@ -1,4 +1,4 @@
{{$class := "ui sha label"}}
{{$class := "sha label"}}
{{if .signature}}
{{$class = (print $class " isSigned")}}
{{if .verification.Verified}}

View file

@ -267,13 +267,14 @@ func TestCompareWithPRsDisabled(t *testing.T) {
[]unit_model.Type{unit_model.TypePullRequests})
require.NoError(t, err)
t.Run("branch view doesn't offer creating PRs", func(t *testing.T) {
t.Run("branch view offer comparing branches", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/user1/repo1/branches")
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
htmlDoc.AssertElement(t, "a[href='/user1/repo1/compare/master...recent-push']", false)
compareLink := htmlDoc.Find("a[href='/user1/repo1/compare/master...recent-push']")
assert.Equal(t, "Compare branches", strings.TrimSpace(compareLink.Text()))
})
t.Run("compare doesn't offer local branches", func(t *testing.T) {
@ -290,11 +291,13 @@ func TestCompareWithPRsDisabled(t *testing.T) {
}
})
t.Run("comparing against a disabled-PR repo is 404", func(t *testing.T) {
t.Run("comparing against a disabled-PR repo", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/user1/repo1/compare/master...recent-push")
session.MakeRequest(t, req, http.StatusNotFound)
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
assert.Equal(t, "Compare branches", strings.TrimSpace(htmlDoc.Find("h2.header").Text()))
})
})
}

View file

@ -30,6 +30,7 @@
@import "./modules/svg.css";
@import "./modules/flexcontainer.css";
@import "./modules/user-cards.css";
@import "./modules/hashbox.css";
@import "./shared/flex-list.css";
@import "./shared/milestone.css";

View file

@ -0,0 +1,104 @@
.sha.label {
display: inline-flex;
flex-shrink: 0;
gap: 0;
align-items: center;
margin: 0 6px; /* needs to go but looked into case-by-case */
padding: 0;
min-width: 0; /* from .ui.label, may be bad actually */
background: var(--color-label-bg);
color: var(--color-label-text);
border: 1px solid var(--color-light-border);
border-radius: var(--border-radius);
white-space: nowrap;
font-family: var(--fonts-monospace);
font-size: 13px;
font-weight: var(--font-weight-normal);
line-height: 1;
}
.primary.sha.label {
border: none;
background: var(--color-primary);
color: var(--color-primary-contrast);
}
.sha.label .shortsha {
padding: 0.33rem 0.5rem;
}
.sha.label .signature {
color: var(--color-text);
background: var(--color-light);
padding: 0.25rem 0.33rem;
border-left: 1px solid var(--color-light-border);
border-top-right-radius: inherit;
border-bottom-right-radius: inherit;
}
.sha.label .signature-author {
display: flex;
gap: 0.25rem;
}
.sha.label .signature-author .avatar {
height: 16px;
width: 16px;
margin: 0 !important; /* In some areas selectors with .avatar are too broad */
}
.sha.label.isSigned.isWarning {
border: 1px solid var(--color-red-badge);
background: var(--color-red-badge-bg);
}
.sha.label.isSigned.isWarning .signature {
border-left: 1px solid var(--color-red-badge);
color: var(--color-red-badge);
}
.sha.label.isSigned.isWarning:hover {
background: var(--color-red-badge-hover-bg);
}
.sha.label.isSigned.isVerified {
border: 1px solid var(--color-green-badge);
background: var(--color-green-badge-bg);
}
.sha.label.isSigned.isVerified .signature {
border-left: 1px solid var(--color-green-badge);
color: var(--color-green-badge);
}
.sha.label.isSigned.isVerified:hover {
background: var(--color-green-badge-hover-bg);
}
.sha.label.isSigned.isVerifiedUntrusted {
border: 1px solid var(--color-yellow-badge);
background: var(--color-yellow-badge-bg);
}
.sha.label.isSigned.isVerifiedUntrusted .signature {
border-left: 1px solid var(--color-yellow-badge);
color: var(--color-yellow-badge);
}
.sha.label.isSigned.isVerifiedUntrusted:hover {
background: var(--color-yellow-badge-hover-bg);
}
.sha.label.isSigned.isVerifiedUnmatched {
border: 1px solid var(--color-orange-badge);
background: var(--color-orange-badge-bg);
}
.sha.label.isSigned.isVerifiedUnmatched .signature {
border-left: 1px solid var(--color-orange-badge);
color: var(--color-orange-badge);
}
.sha.label.isSigned.isVerifiedUnmatched:hover {
background: var(--color-orange-badge-hover-bg);
}

View file

@ -1238,103 +1238,6 @@ pdf-object {
background-color: var(--color-light) !important;
}
.ui .sha.label {
font-family: var(--fonts-monospace);
font-size: 13px;
font-weight: var(--font-weight-normal);
margin: 0 6px;
padding: 0;
gap: 0;
flex-shrink: 0;
}
.ui.ui .sha.label {
border: 1px solid var(--color-light-border);
}
.ui.primary.sha.label {
border: none !important;
background: var(--color-primary) !important;
}
.sha.label .shortsha {
padding: 0.33rem 0.5rem;
}
.sha.label .signature {
color: var(--color-text);
background: var(--color-light);
padding: 0.25rem 0.33rem;
border-left: 1px solid var(--color-light-border);
}
.sha.label .signature-author {
display: flex;
gap: 0.25rem;
}
.sha.label .signature-author .avatar {
height: 16px;
margin-bottom: 0;
width: 16px;
}
.sha.label.isSigned.isWarning {
border: 1px solid var(--color-red-badge);
background: var(--color-red-badge-bg);
}
.sha.label.isSigned.isWarning .signature {
border-left: 1px solid var(--color-red-badge);
color: var(--color-red-badge);
}
.sha.label.isSigned.isWarning:hover {
background: var(--color-red-badge-hover-bg) !important;
}
.sha.label.isSigned.isVerified {
border: 1px solid var(--color-green-badge);
background: var(--color-green-badge-bg);
}
.sha.label.isSigned.isVerified .signature {
border-left: 1px solid var(--color-green-badge);
color: var(--color-green-badge);
}
.sha.label.isSigned.isVerified:hover {
background: var(--color-green-badge-hover-bg) !important;
}
.sha.label.isSigned.isVerifiedUntrusted {
border: 1px solid var(--color-yellow-badge);
background: var(--color-yellow-badge-bg);
}
.sha.label.isSigned.isVerifiedUntrusted .signature {
border-left: 1px solid var(--color-yellow-badge);
color: var(--color-yellow-badge);
}
.sha.label.isSigned.isVerifiedUntrusted:hover {
background: var(--color-yellow-badge-hover-bg) !important;
}
.sha.label.isSigned.isVerifiedUnmatched {
border: 1px solid var(--color-orange-badge);
background: var(--color-orange-badge-bg);
}
.sha.label.isSigned.isVerifiedUnmatched .signature {
border-left: 1px solid var(--color-orange-badge);
color: var(--color-orange-badge);
}
.sha.label.isSigned.isVerifiedUnmatched:hover {
background: var(--color-orange-badge-hover-bg) !important;
}
.repository .data-table {
width: 100%;
}