Merge branch 'main' into fix-incorrect-recently-pushed-new-branches-check
|
@ -422,7 +422,6 @@ rules:
|
|||
no-restricted-imports: [0]
|
||||
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
|
||||
no-return-assign: [0]
|
||||
no-return-await: [0]
|
||||
no-script-url: [2]
|
||||
no-self-assign: [2, {props: true}]
|
||||
no-self-compare: [2]
|
||||
|
|
1
.ignore
|
@ -5,4 +5,5 @@
|
|||
/modules/public/bindata.go
|
||||
/modules/templates/bindata.go
|
||||
/vendor
|
||||
/public/assets
|
||||
node_modules
|
||||
|
|
28
CHANGELOG.md
|
@ -4,6 +4,34 @@ This changelog goes through all the changes that have been made in each release
|
|||
without substantial changes to our git log; to see the highlights of what has
|
||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
|
||||
## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/1.20.2) - 2023-07-29
|
||||
|
||||
* ENHANCEMENTS
|
||||
* Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)
|
||||
* Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)
|
||||
* BUGFIXES
|
||||
* Fix allowed user types setting problem (#26200) (#26206)
|
||||
* Fix handling of plenty Nuget package versions (#26075) (#26173)
|
||||
* Fix UI regression of asciinema player (#26159) (#26162)
|
||||
* Fix LFS object list style (#26133) (#26147)
|
||||
* Fix allowed user types setting problem (#26200) (#26206)
|
||||
* Prevent primary key update on migration (#26192) (#26199)
|
||||
* Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)
|
||||
* Fix bugs in LFS meta garbage collection (#26122) (#26157)
|
||||
* Update xorm version (#26128) (#26150)
|
||||
* Remove "misc" scope check from public API endpoints (#26134) (#26149)
|
||||
* Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)
|
||||
* Fix incorrect router logger (#26137) (#26143)
|
||||
* Improve commit graph alignment and truncating (#26112) (#26127)
|
||||
* Avoid writing config file if not installed (#26107) (#26113)
|
||||
* Fix escape problems in the branch selector (#25875) (#26103)
|
||||
* Fix handling of Debian files with trailing slash (#26087) (#26098)
|
||||
* Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
|
||||
* Use stderr as fallback if the log file can't be opened (#26074) (#26083)
|
||||
* Increase table cell horizontal padding (#26140) (#26142)
|
||||
* Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)
|
||||
* Fix duplicated url prefix on issue context menu (#26066) (#26067)
|
||||
|
||||
## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/1.20.1) - 2023-07-22
|
||||
|
||||
* SECURITY
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
- [Backport PRs](#backport-prs)
|
||||
- [Documentation](#documentation)
|
||||
- [API v1](#api-v1)
|
||||
- [GitHub API compatability](#github-api-compatability)
|
||||
- [GitHub API compatibility](#github-api-compatibility)
|
||||
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
|
||||
- [When to use what HTTP method](#when-to-use-what-http-method)
|
||||
- [Requirements for API routes](#requirements-for-api-routes)
|
||||
|
@ -339,7 +339,7 @@ If you add a new feature or change an existing aspect of Gitea, the documentatio
|
|||
|
||||
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
|
||||
|
||||
### GitHub API compatability
|
||||
### GitHub API compatibility
|
||||
|
||||
Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \
|
||||
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \
|
||||
|
|
8
Makefile
|
@ -29,12 +29,12 @@ AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
|
|||
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
|
||||
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
|
||||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
|
||||
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
|
||||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
|
||||
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
|
||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
|
||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v0.2.0
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.0.0
|
||||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.25
|
||||
|
||||
DOCKER_IMAGE ?= gitea/gitea
|
||||
|
@ -864,7 +864,7 @@ release-check: | $(DIST_DIRS)
|
|||
|
||||
.PHONY: release-compress
|
||||
release-compress: | $(DIST_DIRS)
|
||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PAGAGE) -k -9 $${file}; done;
|
||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PACKAGE) -k -9 $${file}; done;
|
||||
|
||||
.PHONY: release-sources
|
||||
release-sources: | $(DIST_DIRS)
|
||||
|
@ -903,7 +903,7 @@ deps-tools:
|
|||
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
|
||||
$(GO) install $(GOFUMPT_PACKAGE)
|
||||
$(GO) install $(GOLANGCI_LINT_PACKAGE)
|
||||
$(GO) install $(GXZ_PAGAGE)
|
||||
$(GO) install $(GXZ_PACKAGE)
|
||||
$(GO) install $(MISSPELL_PACKAGE)
|
||||
$(GO) install $(SWAGGER_PACKAGE)
|
||||
$(GO) install $(XGO_PACKAGE)
|
||||
|
|
|
@ -1420,8 +1420,8 @@ LEVEL = Info
|
|||
;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections.
|
||||
;SET_NAME = "_unique"
|
||||
;;
|
||||
;; Dynamically scale the worker pool to at this many workers
|
||||
;MAX_WORKERS = 10
|
||||
;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
|
||||
;MAX_WORKERS = ; (dynamic)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -488,7 +488,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv
|
|||
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
|
||||
- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section.
|
||||
- `SET_NAME`: **_unique**: The suffix that will be added to the default redis and disk queue `set` name for unique queues. Individual queues will default to **`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific `queue.name` section.
|
||||
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
|
||||
- `MAX_WORKERS`: **(dynamic)**: Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
|
||||
|
||||
Gitea creates the following non-unique queues:
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ Note: For Internet-facing sites consult documentation of your MTA for instructio
|
|||
[mailer]
|
||||
ENABLED = true
|
||||
FROM = gitea@mydomain.com
|
||||
MAILER_TYPE = sendmail
|
||||
PROTOCOL = sendmail
|
||||
SENDMAIL_PATH = /usr/sbin/sendmail
|
||||
SENDMAIL_ARGS = "--" ; most "sendmail" programs take options, "--" will prevent an email address being interpreted as an option.
|
||||
```
|
||||
|
@ -44,10 +44,9 @@ Directly use SMTP server as relay. This option is useful if you don't want to se
|
|||
[mailer]
|
||||
ENABLED = true
|
||||
FROM = gitea@mydomain.com
|
||||
MAILER_TYPE = smtp
|
||||
PROTOCOL = smtps
|
||||
SMTP_ADDR = mail.mydomain.com
|
||||
SMTP_PORT = 587
|
||||
IS_TLS_ENABLED = true
|
||||
USER = gitea@mydomain.com
|
||||
PASSWD = `password`
|
||||
```
|
||||
|
@ -80,7 +79,7 @@ SMTP_PORT = 465
|
|||
FROM = example.user@gmail.com
|
||||
USER = example.user
|
||||
PASSWD = `***`
|
||||
MAILER_TYPE = smtp
|
||||
PROTOCOL = smtp
|
||||
IS_TLS_ENABLED = true
|
||||
```
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ Gitea 具有邮件功能,用于发送事务性邮件(例如注册确认邮
|
|||
[mailer]
|
||||
ENABLED = true
|
||||
FROM = gitea@mydomain.com
|
||||
MAILER_TYPE = sendmail
|
||||
PROTOCOL = sendmail
|
||||
SENDMAIL_PATH = /usr/sbin/sendmail
|
||||
SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受选项,使用 "--" 将防止电子邮件地址被解释为选项。
|
||||
```
|
||||
|
@ -44,10 +44,9 @@ SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受选项,使用 "--"
|
|||
[mailer]
|
||||
ENABLED = true
|
||||
FROM = gitea@mydomain.com
|
||||
MAILER_TYPE = smtp
|
||||
PROTOCOL = smtps
|
||||
SMTP_ADDR = mail.mydomain.com
|
||||
SMTP_PORT = 587
|
||||
IS_TLS_ENABLED = true
|
||||
USER = gitea@mydomain.com
|
||||
PASSWD = `password`
|
||||
```
|
||||
|
@ -80,8 +79,7 @@ SMTP_PORT = 465
|
|||
FROM = example.user@gmail.com
|
||||
USER = example.user
|
||||
PASSWD = `***`
|
||||
MAILER_TYPE = smtp
|
||||
IS_TLS_ENABLED = true
|
||||
PROTOCOL = smtps
|
||||
```
|
||||
|
||||
请注意,您需要创建并使用一个 [应用密码](https://support.google.com/accounts/answer/185833?hl=en) 并在您的 Google 帐户上启用 2FA。您将无法直接使用您的 Google 帐户密码。
|
||||
|
|
|
@ -306,7 +306,7 @@ services:
|
|||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__MAILER_TYPE=smtp
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__IS_TLS_ENABLED=true
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
|
|
|
@ -274,7 +274,7 @@ services:
|
|||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__MAILER_TYPE=smtp
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__IS_TLS_ENABLED=true
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
|
|
|
@ -303,9 +303,8 @@ services:
|
|||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__MAILER_TYPE=smtp
|
||||
- GITEA__mailer__PROTOCOL=smtps
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__IS_TLS_ENABLED=true
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
- GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
|
||||
```
|
||||
|
|
|
@ -287,9 +287,8 @@ services:
|
|||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__MAILER_TYPE=smtp
|
||||
- GITEA__mailer__PROTOCOL=smtps
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__IS_TLS_ENABLED=true
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
- GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
|
||||
```
|
||||
|
|
After Width: | Height: | Size: 18 KiB |
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="155" height="37" id="svg4152" version="1.1" inkscape:version="0.91 r13725" viewBox="0 0 155 37" sodipodi:docname="button.svg" inkscape:export-filename="/home/nebulon/Cloudron/Assets/button_64.png" inkscape:export-xdpi="155.6129" inkscape:export-ydpi="155.6129">
|
||||
<defs id="defs4154"/>
|
||||
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="1" inkscape:pageshadow="2" inkscape:zoom="3.6203867" inkscape:cx="121.3823" inkscape:cy="1.1988893" inkscape:current-layer="g4481" showgrid="true" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:window-width="1280" inkscape:window-height="736" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" showguides="false"/>
|
||||
<metadata id="metadata4157">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer" transform="translate(0,-27)">
|
||||
<g id="g5138">
|
||||
<rect inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" ry="3.2883968" y="27.493248" x="0.49324799" height="36.013504" width="154.0135" id="rect4424" style="opacity:1;fill:none;fill-opacity:1;stroke:#03a9f4;stroke-width:0.98649561;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
<g transform="translate(-17.67767,3.2702403)" id="g4467">
|
||||
<g id="g4382" transform="matrix(0.59473169,0,0,0.59473169,31.04719,102.48374)" inkscape:export-xdpi="67.349998" inkscape:export-ydpi="67.349998">
|
||||
<g id="g4496">
|
||||
<path inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" transform="matrix(0.8660254,-0.49999999,0.49999999,0.8660254,51.102849,-7.8015133)" d="m 29.166669,-109.50348 c 1.200386,2.08567 1.17988,17.183595 -0.02617,19.265993 -1.206046,2.082397 -14.291486,9.613601 -16.697919,9.610333 -2.406432,-0.0033 -15.4713664,-7.56999 -16.671752,-9.655655 -1.2003857,-2.085666 -1.1798799,-17.183591 0.026167,-19.265991 1.2060467,-2.0824 14.2914862,-9.6136 16.6979192,-9.61033 2.406432,0.003 15.471366,7.56999 16.671752,9.65565 z" inkscape:randomized="0" inkscape:rounded="0.12490573" inkscape:flatsided="true" sodipodi:arg2="0.0013581913" sodipodi:arg1="-0.52224059" sodipodi:r2="16.307295" sodipodi:r1="19.266006" sodipodi:cy="-99.893143" sodipodi:cx="12.46875" sodipodi:sides="6" id="path4162" style="opacity:1;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1.10000002;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" sodipodi:type="star"/>
|
||||
<rect style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4168-1-1" width="8.7434387" height="8.7434387" x="2.2207832" y="-104.9176" ry="2.4183984" inkscape:transform-center-x="0.40624986"/>
|
||||
<g id="g4491" transform="translate(0,0.14463441)">
|
||||
<rect ry="2.4183986" y="-98.734459" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
<rect ry="2.4183986" y="-111.39002" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7-2" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g style="fill:#03a9f4;fill-opacity:1" transform="translate(0,-12.132814)" id="g4481">
|
||||
<g style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4135">
|
||||
<path d="m 41.656508,62.625017 c -2.555847,0 -3.639656,-1.261747 -3.639656,-4.173473 0,-2.927901 1.083809,-4.173472 3.639656,-4.173472 1.16469,0 2.216146,0.274996 3.122016,0.679402 l 0,-1.391157 c -0.970575,-0.38823 -2.07056,-0.64705 -3.299955,-0.64705 -2.280851,0 -5.014637,0.954399 -5.014637,5.532277 0,4.577879 2.733786,5.532278 5.014637,5.532278 1.229395,0 2.32938,-0.25882 3.299955,-0.64705 l 0,-1.391157 c -0.90587,0.404406 -1.957326,0.679402 -3.122016,0.679402 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4149"/>
|
||||
<path d="m 47.031573,52.708976 0,11.145436 1.488215,0 0,-11.145436 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4151"/>
|
||||
<path d="m 54.478208,55.669229 c -1.730858,0 -3.801418,0.727932 -3.801418,4.157297 0,3.429365 2.07056,4.157296 3.801418,4.157296 1.730859,0 3.801419,-0.727931 3.801419,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801419,-4.157297 z m 0,7.004317 c -1.213218,0 -2.313203,-0.339701 -2.313203,-2.84702 0,-2.507319 1.099985,-2.84702 2.313203,-2.84702 1.213219,0 2.313204,0.339701 2.313204,2.84702 0,2.507319 -1.099985,2.84702 -2.313204,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4153"/>
|
||||
<path d="m 65.458345,55.782463 0,4.78817 c 0,1.472039 -0.598521,2.119089 -1.924974,2.119089 -1.342629,0 -1.94115,-0.64705 -1.94115,-2.119089 l 0,-4.78817 -1.472039,0 0,4.674936 c 0,2.248499 1.245572,3.542599 3.413189,3.542599 2.167618,0 3.413189,-1.2941 3.413189,-3.542599 l 0,-4.674936 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4155"/>
|
||||
<path d="m 69.133133,59.713292 c 0,3.720538 2.232322,4.27053 3.574951,4.27053 3.089664,0 3.332308,-2.005855 3.332308,-2.620552 l 0,-8.654294 -1.472039,0 0,3.186721 c -0.566169,-0.161763 -1.132338,-0.242644 -1.730859,-0.242644 -1.68233,0 -3.704361,0.711755 -3.704361,4.060239 z m 1.472039,0 c 0,-2.410261 1.083808,-2.749963 2.232322,-2.749963 0.598521,0 1.180866,0.113234 1.730859,0.339702 l 0,4.157296 c 0,0.808813 -0.630874,1.213219 -1.860269,1.213219 -0.986751,0 -2.102912,-0.339701 -2.102912,-2.960254 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4157"/>
|
||||
<path d="m 79.727313,57.351559 c 0.630874,-0.161762 1.488215,-0.323525 2.442614,-0.339701 l 0,-1.358805 c -2.167618,0 -3.849948,0.77646 -3.930829,0.808813 l 0,7.392546 1.488215,0 0,-6.502853 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4159"/>
|
||||
<path d="m 86.957085,55.669229 c -1.730859,0 -3.801419,0.727932 -3.801419,4.157297 0,3.429365 2.07056,4.157296 3.801419,4.157296 1.730858,0 3.801418,-0.727931 3.801418,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801418,-4.157297 z m 0,7.004317 c -1.213219,0 -2.313204,-0.339701 -2.313204,-2.84702 0,-2.507319 1.099985,-2.84702 2.313204,-2.84702 1.213218,0 2.313203,0.339701 2.313203,2.84702 0,2.507319 -1.099985,2.84702 -2.313203,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4161"/>
|
||||
<path d="m 94.118867,63.854412 0,-6.551381 c 0.501464,-0.161763 1.16469,-0.291173 1.892621,-0.291173 1.617625,0 1.827916,0.77646 1.827916,1.536744 l 0,5.30581 1.488215,0 0,-5.208753 c 0,-1.876445 -1.213218,-3.008782 -3.251426,-3.008782 -1.892621,0 -3.380836,0.808812 -3.445541,0.841165 l 0,7.37637 1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4163"/>
|
||||
</g>
|
||||
<g style="font-style:normal;font-weight:normal;font-size:32.19625854px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4477">
|
||||
<path d="m 105.24414,53.529928 0,-1.351991 1.41487,0 0,1.351991 -1.41487,0 z m 0,10.312865 0,-8.504969 1.41487,0 0,8.504969 -1.41487,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4156"/>
|
||||
<path d="m 114.23645,63.842793 0,-5.392245 q 0,-0.841064 -0.16507,-1.304829 -0.16507,-0.463764 -0.52665,-0.668135 -0.36158,-0.204371 -1.06115,-0.204371 -1.02186,0 -1.61139,0.699577 -0.58953,0.699577 -0.58953,1.941523 l 0,4.92848 -1.41487,0 0,-6.689213 q 0,-1.485619 -0.0472,-1.815756 l 1.33628,0 q 0.008,0.0393 0.0157,0.212231 0.008,0.172929 0.0157,0.400881 0.0157,0.220092 0.0314,0.841065 l 0.0236,0 q 0.48735,-0.880367 1.12404,-1.241946 0.64455,-0.369439 1.59566,-0.369439 1.39916,0 2.04371,0.699576 0.65242,0.691717 0.65242,2.295242 l 0,5.667359 -1.42274,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4158"/>
|
||||
<path d="m 124.17987,61.492529 q 0,1.202643 -0.9118,1.855057 -0.90395,0.652415 -2.53892,0.652415 -1.5878,0 -2.45245,-0.518788 -0.85678,-0.526647 -1.11618,-1.634966 l 1.24981,-0.243673 q 0.18079,0.683856 0.74674,1.006133 0.56595,0.314417 1.57208,0.314417 1.07688,0 1.57209,-0.330137 0.50306,-0.330138 0.50306,-0.990413 0,-0.503066 -0.34586,-0.817483 -0.34585,-0.314416 -1.11618,-0.518787 l -1.01399,-0.267254 q -1.21836,-0.314417 -1.73715,-0.613113 -0.51093,-0.306556 -0.80176,-0.738879 -0.29084,-0.432322 -0.29084,-1.061156 0,-1.163341 0.82535,-1.768593 0.8332,-0.613112 2.421,-0.613112 1.40702,0 2.23236,0.495206 0.83321,0.495206 1.0533,1.587804 l -1.27339,0.157208 q -0.11791,-0.56595 -0.63669,-0.864646 -0.51093,-0.306556 -1.37558,-0.306556 -0.95897,0 -1.41487,0.290836 -0.45591,0.290835 -0.45591,0.880366 0,0.361579 0.18865,0.597391 0.18865,0.235813 0.55809,0.400882 0.36944,0.165068 1.55637,0.455904 1.12404,0.282975 1.61924,0.526647 0.49521,0.235813 0.77818,0.526648 0.29084,0.290836 0.44805,0.675996 0.1572,0.3773 0.1572,0.864646 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4160"/>
|
||||
<path d="m 129.11621,63.779909 q -0.69957,0.18865 -1.43059,0.18865 -1.69785,0 -1.69785,-1.925801 l 0,-5.67522 -0.98255,0 0,-1.029714 1.03757,0 0.4166,-1.902221 0.94325,0 0,1.902221 1.57209,0 0,1.029714 -1.57209,0 0,5.368663 q 0,0.613113 0.19651,0.864646 0.20438,0.243673 0.69958,0.243673 0.28298,0 0.81748,-0.110046 l 0,1.045435 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4164"/>
|
||||
<path d="m 132.48047,64.000001 q -1.28124,0 -1.9258,-0.675996 -0.64455,-0.675996 -0.64455,-1.855058 0,-1.320549 0.86464,-2.027987 0.87251,-0.707437 2.80617,-0.7546 l 1.91008,-0.03144 0,-0.463765 q 0,-1.037574 -0.44018,-1.485618 -0.44018,-0.448044 -1.38343,-0.448044 -0.95111,0 -1.38344,0.322277 -0.43232,0.322277 -0.51878,1.029715 l -1.47776,-0.133627 q 0.36158,-2.295241 3.41142,-2.295241 1.60352,0 2.41314,0.738879 0.80963,0.731018 0.80963,2.122311 l 0,3.662954 q 0,0.628833 0.16507,0.95111 0.16506,0.314416 0.62883,0.314416 0.20437,0 0.46376,-0.05502 l 0,0.880366 q -0.5345,0.125767 -1.09259,0.125767 -0.78605,0 -1.14762,-0.408742 -0.35372,-0.416602 -0.40089,-1.296968 l -0.0472,0 q -0.54237,0.974691 -1.26553,1.383433 -0.71529,0.400881 -1.74501,0.400881 z m 0.32228,-1.061156 q 0.77818,0 1.38343,-0.353719 0.60525,-0.353718 0.95111,-0.966831 0.35372,-0.620973 0.35372,-1.273387 l 0,-0.699577 -1.5485,0.03144 q -0.99827,0.01572 -1.51706,0.204371 -0.51093,0.188649 -0.78604,0.58167 -0.27512,0.393021 -0.27512,1.029715 0,0.691716 0.36944,1.069016 0.3773,0.3773 1.06902,0.3773 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4166"/>
|
||||
<path d="m 139.27187,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4168"/>
|
||||
<path d="m 142.85622,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4170"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 412 KiB |
|
@ -0,0 +1,23 @@
|
|||
<svg width="160" height="45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_d)">
|
||||
<rect x="2" y="2" width="156" height="40" rx="16" fill="#F9F9F9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.425 11.174c.604 1.114.233 2.53-.83 3.164l-6.986 4.166a.378.378 0 00-.18.325v6.748c0 .134.069.258.18.325l5.714 3.407c.11.066.244.066.354 0l5.714-3.407a.378.378 0 00.18-.325V21.29l-4.986 2.936c-1.067.628-2.416.231-3.015-.886-.6-1.118-.22-2.532.846-3.16l7.008-4.127c2.048-1.206 4.576.345 4.576 2.806v6.718c0 1.803-.924 3.467-2.42 4.36l-5.713 3.407a4.596 4.596 0 01-4.734 0l-5.714-3.408C18.924 29.044 18 27.38 18 25.576V18.83c0-1.803.924-3.467 2.42-4.36l6.985-4.165c1.063-.634 2.415-.245 3.02.87z" fill="url(#paint0_linear)"/>
|
||||
<path fill="#F9F9F9" d="M47 12.5h95v-1H47z"/>
|
||||
<path d="M52.538 27.752c2.744 0 4.844-1.876 4.844-5.152 0-3.108-2.1-5.152-4.844-5.152s-4.802 2.002-4.802 5.152c0 3.29 2.058 5.152 4.802 5.152zm0-1.554c-1.736 0-2.912-1.316-2.912-3.598 0-2.226 1.162-3.598 2.912-3.598s2.954 1.4 2.954 3.598c0 2.31-1.218 3.598-2.954 3.598zm7.89 4.158V27.22c0-.196-.013-.378-.055-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308H58.72v9.688h1.708zm1.695-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.866 1.344c1.848 0 3.052-1.078 3.192-2.478h-1.736c-.112.714-.714 1.134-1.456 1.134-1.036 0-1.722-.826-1.736-1.904h4.97v-.378c0-2.226-1.204-3.682-3.29-3.682-1.988 0-3.43 1.47-3.43 3.626 0 2.366 1.442 3.682 3.486 3.682zm-1.75-4.48c.098-.896.756-1.554 1.68-1.554.924 0 1.526.63 1.554 1.554H68.24zm8.006 4.228v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm8.911-7.868h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm5.097 6.832v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm13.238.252c1.526 0 2.52-.658 2.982-1.54-.07.322-.098.644-.098.98v.308h1.68v-5.222h-4.34v1.554h2.66v.07c0 1.4-1.134 2.296-2.59 2.296-1.792 0-3.024-1.372-3.024-3.598s1.26-3.598 3.066-3.598c1.302 0 2.17.756 2.296 1.736h1.89c-.182-1.904-1.764-3.29-4.214-3.29-2.954 0-4.928 2.128-4.928 5.152 0 3.136 1.848 5.152 4.62 5.152zm6.063-8.12h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm6.413 6.958c.434 0 .84-.07 1.008-.126v-1.288c-.168.028-.35.042-.518.042-.728 0-1.008-.42-1.008-1.134v-3.094h1.68v-1.358h-1.68v-2.464h-1.708v2.464h-1.554v1.358h1.554v3.346c0 1.526.77 2.254 2.226 2.254zm3.961 2.73V27.22c0-.196-.014-.378-.056-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308h-1.708v9.688h1.708zm1.694-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.88 1.344c2.058 0 3.514-1.372 3.514-3.64 0-2.24-1.456-3.668-3.514-3.668-2.044 0-3.5 1.428-3.5 3.668 0 2.268 1.442 3.64 3.5 3.64zm0-1.344c-1.064 0-1.764-.84-1.764-2.296 0-1.484.728-2.31 1.764-2.31 1.05 0 1.778.826 1.778 2.31 0 1.456-.714 2.296-1.778 2.296zm7.551 1.344c1.26 0 1.876-.686 2.142-1.19-.056.238-.056.42-.056.658v.28h1.708v-9.8h-1.708v3.276c0 .21 0 .42.056.672-.392-.658-1.05-1.204-2.114-1.204-1.596 0-3.15 1.218-3.15 3.668 0 2.408 1.316 3.64 3.122 3.64zm.406-1.344c-1.022 0-1.792-.896-1.792-2.31 0-1.358.77-2.296 1.792-2.296s1.778.896 1.778 2.296c0 1.372-.756 2.31-1.778 2.31z" fill="#12100C"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="33.806" y1="13.629" x2="22.389" y2="30.86" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFB45B"/>
|
||||
<stop offset="1" stop-color="#FF8A00"/>
|
||||
</linearGradient>
|
||||
<filter id="filter0_d" x="0" y=".5" width="160" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset dy=".5"/>
|
||||
<feGaussianBlur stdDeviation="1"/>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
||||
<feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -114,7 +114,7 @@ func FindLatestReviews(ctx context.Context, opts FindReviewOptions) (ReviewList,
|
|||
}
|
||||
|
||||
sess.In("id", builder.
|
||||
Select("max ( id ) ").
|
||||
Select("max(id)").
|
||||
From("review").
|
||||
Where(cond).
|
||||
GroupBy("reviewer_id"))
|
||||
|
|
|
@ -521,6 +521,8 @@ var migrations = []Migration{
|
|||
NewMigration("Update Action Ref", v1_21.UpdateActionsRefIndex),
|
||||
// v269 -> v270
|
||||
NewMigration("Drop deleted branch table", v1_21.DropDeletedBranchTable),
|
||||
// v270 -> v271
|
||||
NewMigration("Fix PackageProperty typo", v1_21.FixPackagePropertyTypo),
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current db version
|
||||
|
|
|
@ -20,7 +20,7 @@ func ChangeContainerMetadataMultiArch(x *xorm.Engine) error {
|
|||
}
|
||||
|
||||
type PackageVersion struct {
|
||||
ID int64 `xorm:"pk"`
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
MetadataJSON string `xorm:"metadata_json"`
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_21 //nolint
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func FixPackagePropertyTypo(x *xorm.Engine) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
if err := sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := sess.Exec(`UPDATE package_property SET name = 'rpm.metadata' WHERE name = 'rpm.metdata'`); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := sess.Exec(`UPDATE package_property SET name = 'conda.metadata' WHERE name = 'conda.metdata'`); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
|
@ -14,6 +14,7 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
@ -336,6 +337,17 @@ func (s releaseMetaSearch) Less(i, j int) bool {
|
|||
return s.ID[i] < s.ID[j]
|
||||
}
|
||||
|
||||
func hasDuplicateName(attaches []*Attachment) bool {
|
||||
attachSet := container.Set[string]{}
|
||||
for _, attachment := range attaches {
|
||||
if attachSet.Contains(attachment.Name) {
|
||||
return true
|
||||
}
|
||||
attachSet.Add(attachment.Name)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetReleaseAttachments retrieves the attachments for releases
|
||||
func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) {
|
||||
if len(rels) == 0 {
|
||||
|
@ -360,7 +372,7 @@ func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) {
|
|||
err = db.GetEngine(ctx).
|
||||
Asc("release_id", "name").
|
||||
In("release_id", sortedRels.ID).
|
||||
Find(&attachments, Attachment{})
|
||||
Find(&attachments)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -381,21 +393,8 @@ func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Check if there are two or more attachments with the same name
|
||||
hasDuplicates := false
|
||||
foundNames := make(map[string]bool)
|
||||
for _, attachment := range release.Attachments {
|
||||
_, found := foundNames[attachment.Name]
|
||||
if found {
|
||||
hasDuplicates = true
|
||||
break
|
||||
} else {
|
||||
foundNames[attachment.Name] = true
|
||||
}
|
||||
}
|
||||
|
||||
// If the names unique, use the URL with the Name instead of the UUID
|
||||
if !hasDuplicates {
|
||||
if !hasDuplicateName(release.Attachments) {
|
||||
for _, attachment := range release.Attachments {
|
||||
attachment.CustomDownloadURL = release.Repo.HTMLURL() + "/releases/download/" + url.PathEscape(release.TagName) + "/" + url.PathEscape(attachment.Name)
|
||||
}
|
||||
|
|
|
@ -203,11 +203,16 @@ func UpdateUserTheme(u *User, themeName string) error {
|
|||
return UpdateUserCols(db.DefaultContext, u, "theme")
|
||||
}
|
||||
|
||||
// GetPlaceholderEmail returns an noreply email
|
||||
func (u *User) GetPlaceholderEmail() string {
|
||||
return fmt.Sprintf("%s@%s", u.LowerName, setting.Service.NoReplyAddress)
|
||||
}
|
||||
|
||||
// GetEmail returns an noreply email, if the user has set to keep his
|
||||
// email address private, otherwise the primary email address.
|
||||
func (u *User) GetEmail() string {
|
||||
if u.KeepEmailPrivate {
|
||||
return fmt.Sprintf("%s@%s", u.LowerName, setting.Service.NoReplyAddress)
|
||||
return u.GetPlaceholderEmail()
|
||||
}
|
||||
return u.Email
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ func createTestCache() {
|
|||
Adapter: "memory",
|
||||
TTL: time.Minute,
|
||||
})
|
||||
setting.CacheService.TTL = 24 * time.Hour
|
||||
}
|
||||
|
||||
func TestNewContext(t *testing.T) {
|
||||
|
@ -54,12 +55,12 @@ func TestGetString(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Equal(t, "", data)
|
||||
|
||||
// data, err = GetString("key", func() (string, error) {
|
||||
// return "some data", nil
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, "", data)
|
||||
// Remove("key")
|
||||
data, err = GetString("key", func() (string, error) {
|
||||
return "some data", nil
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "", data)
|
||||
Remove("key")
|
||||
|
||||
data, err = GetString("key", func() (string, error) {
|
||||
return "some data", nil
|
||||
|
@ -67,13 +68,12 @@ func TestGetString(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Equal(t, "some data", data)
|
||||
|
||||
// data, err = GetString("key", func() (string, error) {
|
||||
// return "", fmt.Errorf("some error")
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, "some data", data)
|
||||
|
||||
// TODO: uncommented code works in IDE but not with go test
|
||||
data, err = GetString("key", func() (string, error) {
|
||||
return "", fmt.Errorf("some error")
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "some data", data)
|
||||
Remove("key")
|
||||
}
|
||||
|
||||
func TestGetInt(t *testing.T) {
|
||||
|
@ -91,12 +91,12 @@ func TestGetInt(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Equal(t, 0, data)
|
||||
|
||||
// data, err = GetInt("key", func() (int, error) {
|
||||
// return 100, nil
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, 0, data)
|
||||
// Remove("key")
|
||||
data, err = GetInt("key", func() (int, error) {
|
||||
return 100, nil
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 0, data)
|
||||
Remove("key")
|
||||
|
||||
data, err = GetInt("key", func() (int, error) {
|
||||
return 100, nil
|
||||
|
@ -104,13 +104,12 @@ func TestGetInt(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Equal(t, 100, data)
|
||||
|
||||
// data, err = GetInt("key", func() (int, error) {
|
||||
// return 0, fmt.Errorf("some error")
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, 100, data)
|
||||
|
||||
// TODO: uncommented code works in IDE but not with go test
|
||||
data, err = GetInt("key", func() (int, error) {
|
||||
return 0, fmt.Errorf("some error")
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 100, data)
|
||||
Remove("key")
|
||||
}
|
||||
|
||||
func TestGetInt64(t *testing.T) {
|
||||
|
@ -128,12 +127,12 @@ func TestGetInt64(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, 0, data)
|
||||
|
||||
// data, err = GetInt64("key", func() (int64, error) {
|
||||
// return 100, nil
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.EqualValues(t, 0, data)
|
||||
// Remove("key")
|
||||
data, err = GetInt64("key", func() (int64, error) {
|
||||
return 100, nil
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, 0, data)
|
||||
Remove("key")
|
||||
|
||||
data, err = GetInt64("key", func() (int64, error) {
|
||||
return 100, nil
|
||||
|
@ -141,11 +140,10 @@ func TestGetInt64(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, 100, data)
|
||||
|
||||
// data, err = GetInt64("key", func() (int, error) {
|
||||
// return 0, fmt.Errorf("some error")
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
// assert.EqualValues(t, 100, data)
|
||||
|
||||
// TODO: uncommented code works in IDE but not with go test
|
||||
data, err = GetInt64("key", func() (int64, error) {
|
||||
return 0, fmt.Errorf("some error")
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, 100, data)
|
||||
Remove("key")
|
||||
}
|
||||
|
|
|
@ -166,6 +166,7 @@ func (ctx *Context) serverErrorInternal(logMsg string, logErr error) {
|
|||
// NotFoundOrServerError use error check function to determine if the error
|
||||
// is about not found. It responds with 404 status code for not found error,
|
||||
// or error context description for logging purpose of 500 server error.
|
||||
// TODO: remove the "errCheck" and use util.ErrNotFound to check
|
||||
func (ctx *Context) NotFoundOrServerError(logMsg string, errCheck func(error) bool, logErr error) {
|
||||
if errCheck(logErr) {
|
||||
ctx.notFoundInternal(logMsg, logErr)
|
||||
|
|
|
@ -20,7 +20,6 @@ import (
|
|||
|
||||
// Commit represents a git commit.
|
||||
type Commit struct {
|
||||
Branch string // Branch this commit belongs to
|
||||
Tree
|
||||
ID SHA1 // The ID of this commit object
|
||||
Author *Signature
|
||||
|
@ -432,31 +431,6 @@ func (c *Commit) GetBranchName() (string, error) {
|
|||
return strings.SplitN(strings.TrimSpace(data), "~", 2)[0], nil
|
||||
}
|
||||
|
||||
// LoadBranchName load branch name for commit
|
||||
func (c *Commit) LoadBranchName() (err error) {
|
||||
if len(c.Branch) != 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
c.Branch, err = c.GetBranchName()
|
||||
return err
|
||||
}
|
||||
|
||||
// GetTagName gets the current tag name for given commit
|
||||
func (c *Commit) GetTagName() (string, error) {
|
||||
data, _, err := NewCommand(c.repo.Ctx, "describe", "--exact-match", "--tags", "--always").AddDynamicArguments(c.ID.String()).RunStdString(&RunOpts{Dir: c.repo.Path})
|
||||
if err != nil {
|
||||
// handle special case where there is no tag for this commit
|
||||
if strings.Contains(err.Error(), "no tag exactly matches") {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strings.TrimSpace(data), nil
|
||||
}
|
||||
|
||||
// CommitFileStatus represents status of files in a commit.
|
||||
type CommitFileStatus struct {
|
||||
Added []string
|
||||
|
|
|
@ -3,7 +3,61 @@
|
|||
|
||||
package git
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
// GetRefs returns all references of the repository.
|
||||
func (repo *Repository) GetRefs() ([]*Reference, error) {
|
||||
return repo.GetRefsFiltered("")
|
||||
}
|
||||
|
||||
// ListOccurrences lists all refs of the given refType the given commit appears in sorted by creation date DESC
|
||||
// refType should only be a literal "branch" or "tag" and nothing else
|
||||
func (repo *Repository) ListOccurrences(ctx context.Context, refType, commitSHA string) ([]string, error) {
|
||||
cmd := NewCommand(ctx)
|
||||
if refType == "branch" {
|
||||
cmd.AddArguments("branch")
|
||||
} else if refType == "tag" {
|
||||
cmd.AddArguments("tag")
|
||||
} else {
|
||||
return nil, util.NewInvalidArgumentErrorf(`can only use "branch" or "tag" for refType, but got %q`, refType)
|
||||
}
|
||||
stdout, _, err := cmd.AddArguments("--no-color", "--sort=-creatordate", "--contains").AddDynamicArguments(commitSHA).RunStdString(&RunOpts{Dir: repo.Path})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
refs := strings.Split(strings.TrimSpace(stdout), "\n")
|
||||
if refType == "branch" {
|
||||
return parseBranches(refs), nil
|
||||
}
|
||||
return parseTags(refs), nil
|
||||
}
|
||||
|
||||
func parseBranches(refs []string) []string {
|
||||
results := make([]string, 0, len(refs))
|
||||
for _, ref := range refs {
|
||||
if strings.HasPrefix(ref, "* ") { // current branch (main branch)
|
||||
results = append(results, ref[len("* "):])
|
||||
} else if strings.HasPrefix(ref, " ") { // all other branches
|
||||
results = append(results, ref[len(" "):])
|
||||
} else if ref != "" {
|
||||
results = append(results, ref)
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func parseTags(refs []string) []string {
|
||||
results := make([]string, 0, len(refs))
|
||||
for _, ref := range refs {
|
||||
if ref != "" {
|
||||
results = append(results, ref)
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
|
|
@ -96,6 +96,9 @@ func createDefaultPolicy() *bluemonday.Policy {
|
|||
// Allow classes for task lists
|
||||
policy.AllowAttrs("class").Matching(regexp.MustCompile(`task-list-item`)).OnElements("li")
|
||||
|
||||
// Allow classes for org mode list item status.
|
||||
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^(unchecked|checked|indeterminate)$`)).OnElements("li")
|
||||
|
||||
// Allow icons
|
||||
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^icon(\s+[\p{L}\p{N}_-]+)+$`)).OnElements("i")
|
||||
|
||||
|
|
|
@ -53,6 +53,11 @@ func Test_Sanitizer(t *testing.T) {
|
|||
`<p style="bad-color: red">Hello World</p>`, `<p>Hello World</p>`,
|
||||
`<code style="bad-color: red">Hello World</code>`, `<code>Hello World</code>`,
|
||||
|
||||
// Org mode status of list items.
|
||||
`<li class="checked"></li>`, `<li class="checked"></li>`,
|
||||
`<li class="unchecked"></li>`, `<li class="unchecked"></li>`,
|
||||
`<li class="indeterminate"></li>`, `<li class="indeterminate"></li>`,
|
||||
|
||||
// URLs
|
||||
`<a href="cbthunderlink://somebase64string)">my custom URL scheme</a>`, `<a href="cbthunderlink://somebase64string)" rel="nofollow">my custom URL scheme</a>`,
|
||||
`<a href="matrix:roomid/psumPMeAfzgAeQpXMG:feneas.org?action=join">my custom URL scheme</a>`, `<a href="matrix:roomid/psumPMeAfzgAeQpXMG:feneas.org?action=join" rel="nofollow">my custom URL scheme</a>`,
|
||||
|
|
|
@ -27,7 +27,7 @@ const (
|
|||
PropertyName = "conda.name"
|
||||
PropertyChannel = "conda.channel"
|
||||
PropertySubdir = "conda.subdir"
|
||||
PropertyMetadata = "conda.metdata"
|
||||
PropertyMetadata = "conda.metadata"
|
||||
)
|
||||
|
||||
// Package represents a Conda package
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
PropertyMetadata = "rpm.metdata"
|
||||
PropertyMetadata = "rpm.metadata"
|
||||
|
||||
SettingKeyPrivate = "rpm.key.private"
|
||||
SettingKeyPublic = "rpm.key.public"
|
||||
|
|
|
@ -51,7 +51,7 @@ CONN_STR = redis://
|
|||
assert.Equal(t, "", q.baseConfig.ConnStr)
|
||||
assert.Equal(t, "default_queue", q.baseConfig.QueueFullName)
|
||||
assert.Equal(t, "default_queue_unique", q.baseConfig.SetFullName)
|
||||
assert.Equal(t, 10, q.GetWorkerMaxNumber())
|
||||
assert.NotZero(t, q.GetWorkerMaxNumber())
|
||||
assert.Equal(t, 0, q.GetWorkerNumber())
|
||||
assert.Equal(t, 0, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 0, q.GetQueueItemNumber())
|
||||
|
@ -75,7 +75,7 @@ BATCH_LENGTH = 22
|
|||
CONN_STR =
|
||||
QUEUE_NAME = _q2
|
||||
SET_NAME = _u2
|
||||
MAX_WORKERS = 2
|
||||
MAX_WORKERS = 123
|
||||
`)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
@ -89,7 +89,7 @@ MAX_WORKERS = 2
|
|||
assert.Equal(t, "addrs=127.0.0.1:6379 db=0", q1.baseConfig.ConnStr)
|
||||
assert.Equal(t, "no-such_queue1", q1.baseConfig.QueueFullName)
|
||||
assert.Equal(t, "no-such_queue1_unique", q1.baseConfig.SetFullName)
|
||||
assert.Equal(t, 10, q1.GetWorkerMaxNumber())
|
||||
assert.NotZero(t, q1.GetWorkerMaxNumber())
|
||||
assert.Equal(t, 0, q1.GetWorkerNumber())
|
||||
assert.Equal(t, 0, q1.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 0, q1.GetQueueItemNumber())
|
||||
|
@ -105,7 +105,7 @@ MAX_WORKERS = 2
|
|||
assert.Equal(t, "", q2.baseConfig.ConnStr)
|
||||
assert.Equal(t, "sub_q2", q2.baseConfig.QueueFullName)
|
||||
assert.Equal(t, "sub_q2_u2", q2.baseConfig.SetFullName)
|
||||
assert.Equal(t, 2, q2.GetWorkerMaxNumber())
|
||||
assert.Equal(t, 123, q2.GetWorkerMaxNumber())
|
||||
assert.Equal(t, 0, q2.GetWorkerNumber())
|
||||
assert.Equal(t, 0, q2.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 0, q2.GetQueueItemNumber())
|
||||
|
|
|
@ -5,6 +5,7 @@ package setting
|
|||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
@ -25,18 +26,24 @@ type QueueSettings struct {
|
|||
MaxWorkers int
|
||||
}
|
||||
|
||||
var queueSettingsDefault = QueueSettings{
|
||||
Type: "level", // dummy, channel, level, redis
|
||||
Datadir: "queues/common", // relative to AppDataPath
|
||||
Length: 100, // queue length before a channel queue will block
|
||||
|
||||
QueueName: "_queue",
|
||||
SetName: "_unique",
|
||||
BatchLength: 20,
|
||||
MaxWorkers: 10,
|
||||
}
|
||||
|
||||
func GetQueueSettings(rootCfg ConfigProvider, name string) (QueueSettings, error) {
|
||||
queueSettingsDefault := QueueSettings{
|
||||
Type: "level", // dummy, channel, level, redis
|
||||
Datadir: "queues/common", // relative to AppDataPath
|
||||
Length: 100, // queue length before a channel queue will block
|
||||
|
||||
QueueName: "_queue",
|
||||
SetName: "_unique",
|
||||
BatchLength: 20,
|
||||
MaxWorkers: runtime.NumCPU() / 2,
|
||||
}
|
||||
if queueSettingsDefault.MaxWorkers < 1 {
|
||||
queueSettingsDefault.MaxWorkers = 1
|
||||
}
|
||||
if queueSettingsDefault.MaxWorkers > 10 {
|
||||
queueSettingsDefault.MaxWorkers = 10
|
||||
}
|
||||
|
||||
// deep copy default settings
|
||||
cfg := QueueSettings{}
|
||||
if cfgBs, err := json.Marshal(queueSettingsDefault); err != nil {
|
||||
|
|
|
@ -188,15 +188,33 @@ func loadServiceFrom(rootCfg ConfigProvider) {
|
|||
Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true)
|
||||
Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true)
|
||||
Service.AutoWatchOnChanges = sec.Key("AUTO_WATCH_ON_CHANGES").MustBool(false)
|
||||
Service.DefaultUserVisibility = sec.Key("DEFAULT_USER_VISIBILITY").In("public", structs.ExtractKeysFromMapString(structs.VisibilityModes))
|
||||
Service.DefaultUserVisibilityMode = structs.VisibilityModes[Service.DefaultUserVisibility]
|
||||
Service.AllowedUserVisibilityModes = sec.Key("ALLOWED_USER_VISIBILITY_MODES").Strings(",")
|
||||
if len(Service.AllowedUserVisibilityModes) != 0 {
|
||||
modes := sec.Key("ALLOWED_USER_VISIBILITY_MODES").Strings(",")
|
||||
if len(modes) != 0 {
|
||||
Service.AllowedUserVisibilityModes = []string{}
|
||||
Service.AllowedUserVisibilityModesSlice = []bool{false, false, false}
|
||||
for _, sMode := range Service.AllowedUserVisibilityModes {
|
||||
Service.AllowedUserVisibilityModesSlice[structs.VisibilityModes[sMode]] = true
|
||||
for _, sMode := range modes {
|
||||
if tp, ok := structs.VisibilityModes[sMode]; ok { // remove unsupported modes
|
||||
Service.AllowedUserVisibilityModes = append(Service.AllowedUserVisibilityModes, sMode)
|
||||
Service.AllowedUserVisibilityModesSlice[tp] = true
|
||||
} else {
|
||||
log.Warn("ALLOWED_USER_VISIBILITY_MODES %s is unsupported", sMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(Service.AllowedUserVisibilityModes) == 0 {
|
||||
Service.AllowedUserVisibilityModes = []string{"public", "limited", "private"}
|
||||
Service.AllowedUserVisibilityModesSlice = []bool{true, true, true}
|
||||
}
|
||||
|
||||
Service.DefaultUserVisibility = sec.Key("DEFAULT_USER_VISIBILITY").String()
|
||||
if Service.DefaultUserVisibility == "" {
|
||||
Service.DefaultUserVisibility = Service.AllowedUserVisibilityModes[0]
|
||||
} else if !Service.AllowedUserVisibilityModesSlice[structs.VisibilityModes[Service.DefaultUserVisibility]] {
|
||||
log.Warn("DEFAULT_USER_VISIBILITY %s is wrong or not in ALLOWED_USER_VISIBILITY_MODES, using first allowed", Service.DefaultUserVisibility)
|
||||
Service.DefaultUserVisibility = Service.AllowedUserVisibilityModes[0]
|
||||
}
|
||||
Service.DefaultUserVisibilityMode = structs.VisibilityModes[Service.DefaultUserVisibility]
|
||||
Service.DefaultOrgVisibility = sec.Key("DEFAULT_ORG_VISIBILITY").In("public", structs.ExtractKeysFromMapString(structs.VisibilityModes))
|
||||
Service.DefaultOrgVisibilityMode = structs.VisibilityModes[Service.DefaultOrgVisibility]
|
||||
Service.DefaultOrgMemberVisible = sec.Key("DEFAULT_ORG_MEMBER_VISIBLE").MustBool()
|
||||
|
|
|
@ -6,6 +6,8 @@ package setting
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -44,3 +46,87 @@ EMAIL_DOMAIN_BLOCKLIST = d3, *.b
|
|||
assert.True(t, match(Service.EmailDomainBlockList, "foo.b"))
|
||||
assert.False(t, match(Service.EmailDomainBlockList, "d1"))
|
||||
}
|
||||
|
||||
func TestLoadServiceVisibilityModes(t *testing.T) {
|
||||
oldService := Service
|
||||
defer func() {
|
||||
Service = oldService
|
||||
}()
|
||||
|
||||
kases := map[string]func(){
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = public
|
||||
ALLOWED_USER_VISIBILITY_MODES = public,limited,private
|
||||
`: func() {
|
||||
assert.Equal(t, "public", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypePublic, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"public", "limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = public
|
||||
`: func() {
|
||||
assert.Equal(t, "public", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypePublic, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"public", "limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = limited
|
||||
`: func() {
|
||||
assert.Equal(t, "limited", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypeLimited, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"public", "limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
ALLOWED_USER_VISIBILITY_MODES = public,limited,private
|
||||
`: func() {
|
||||
assert.Equal(t, "public", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypePublic, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"public", "limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = public
|
||||
ALLOWED_USER_VISIBILITY_MODES = limited,private
|
||||
`: func() {
|
||||
assert.Equal(t, "limited", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypeLimited, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = my_type
|
||||
ALLOWED_USER_VISIBILITY_MODES = limited,private
|
||||
`: func() {
|
||||
assert.Equal(t, "limited", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypeLimited, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"limited", "private"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
`
|
||||
[service]
|
||||
DEFAULT_USER_VISIBILITY = public
|
||||
ALLOWED_USER_VISIBILITY_MODES = public, limit, privated
|
||||
`: func() {
|
||||
assert.Equal(t, "public", Service.DefaultUserVisibility)
|
||||
assert.Equal(t, structs.VisibleTypePublic, Service.DefaultUserVisibilityMode)
|
||||
assert.Equal(t, []string{"public"}, Service.AllowedUserVisibilityModes)
|
||||
},
|
||||
}
|
||||
|
||||
for kase, fun := range kases {
|
||||
t.Run(kase, func(t *testing.T) {
|
||||
cfg, err := NewConfigProviderFromData(kase)
|
||||
assert.NoError(t, err)
|
||||
loadServiceFrom(cfg)
|
||||
fun()
|
||||
// reset
|
||||
Service.AllowedUserVisibilityModesSlice = []bool{true, true, true}
|
||||
Service.AllowedUserVisibilityModes = []string{}
|
||||
Service.DefaultUserVisibility = ""
|
||||
Service.DefaultUserVisibilityMode = structs.VisibleTypePublic
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
package structs
|
||||
|
||||
// CommitStatusState holds the state of a CommitStatus
|
||||
// It can be "pending", "success", "error", "failure", and "warning"
|
||||
// It can be "pending", "success", "error" and "failure"
|
||||
type CommitStatusState string
|
||||
|
||||
const (
|
||||
|
@ -18,14 +18,25 @@ const (
|
|||
CommitStatusFailure CommitStatusState = "failure"
|
||||
)
|
||||
|
||||
var commitStatusPriorities = map[CommitStatusState]int{
|
||||
CommitStatusError: 0,
|
||||
CommitStatusFailure: 1,
|
||||
CommitStatusPending: 2,
|
||||
CommitStatusSuccess: 3,
|
||||
}
|
||||
|
||||
// NoBetterThan returns true if this State is no better than the given State
|
||||
// This function only handles the states defined in CommitStatusPriorities
|
||||
func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool {
|
||||
commitStatusPriorities := map[CommitStatusState]int{
|
||||
CommitStatusError: 0,
|
||||
CommitStatusFailure: 1,
|
||||
CommitStatusPending: 2,
|
||||
CommitStatusSuccess: 3,
|
||||
// NoBetterThan only handles the 4 states above
|
||||
if _, exist := commitStatusPriorities[css]; !exist {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, exist := commitStatusPriorities[css2]; !exist {
|
||||
return false
|
||||
}
|
||||
|
||||
return commitStatusPriorities[css] <= commitStatusPriorities[css2]
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package structs
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNoBetterThan(t *testing.T) {
|
||||
type args struct {
|
||||
css CommitStatusState
|
||||
css2 CommitStatusState
|
||||
}
|
||||
var unExpectedState CommitStatusState
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
name: "success is no better than success",
|
||||
args: args{
|
||||
css: CommitStatusSuccess,
|
||||
css2: CommitStatusSuccess,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "success is no better than pending",
|
||||
args: args{
|
||||
css: CommitStatusSuccess,
|
||||
css2: CommitStatusPending,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "success is no better than failure",
|
||||
args: args{
|
||||
css: CommitStatusSuccess,
|
||||
css2: CommitStatusFailure,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "success is no better than error",
|
||||
args: args{
|
||||
css: CommitStatusSuccess,
|
||||
css2: CommitStatusError,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "pending is no better than success",
|
||||
args: args{
|
||||
css: CommitStatusPending,
|
||||
css2: CommitStatusSuccess,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "pending is no better than pending",
|
||||
args: args{
|
||||
css: CommitStatusPending,
|
||||
css2: CommitStatusPending,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "pending is no better than failure",
|
||||
args: args{
|
||||
css: CommitStatusPending,
|
||||
css2: CommitStatusFailure,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "pending is no better than error",
|
||||
args: args{
|
||||
css: CommitStatusPending,
|
||||
css2: CommitStatusError,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "failure is no better than success",
|
||||
args: args{
|
||||
css: CommitStatusFailure,
|
||||
css2: CommitStatusSuccess,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "failure is no better than pending",
|
||||
args: args{
|
||||
css: CommitStatusFailure,
|
||||
css2: CommitStatusPending,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "failure is no better than failure",
|
||||
args: args{
|
||||
css: CommitStatusFailure,
|
||||
css2: CommitStatusFailure,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "failure is no better than error",
|
||||
args: args{
|
||||
css: CommitStatusFailure,
|
||||
css2: CommitStatusError,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "error is no better than success",
|
||||
args: args{
|
||||
css: CommitStatusError,
|
||||
css2: CommitStatusSuccess,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "error is no better than pending",
|
||||
args: args{
|
||||
css: CommitStatusError,
|
||||
css2: CommitStatusPending,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "error is no better than failure",
|
||||
args: args{
|
||||
css: CommitStatusError,
|
||||
css2: CommitStatusFailure,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "error is no better than error",
|
||||
args: args{
|
||||
css: CommitStatusError,
|
||||
css2: CommitStatusError,
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "unExpectedState is no better than success",
|
||||
args: args{
|
||||
css: unExpectedState,
|
||||
css2: CommitStatusSuccess,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "unExpectedState is no better than unExpectedState",
|
||||
args: args{
|
||||
css: unExpectedState,
|
||||
css2: unExpectedState,
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := tt.args.css.NoBetterThan(tt.args.css2)
|
||||
if result != tt.want {
|
||||
t.Errorf("NoBetterThan() = %v, want %v", result, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -29,10 +29,10 @@ type CreateTeamOption struct {
|
|||
IncludesAllRepositories bool `json:"includes_all_repositories"`
|
||||
// enum: read,write,admin
|
||||
Permission string `json:"permission"`
|
||||
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||
// example: ["repo.actions","repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.ext_wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||
Units []string `json:"units"`
|
||||
// example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
|
||||
// example: {"repo.actions","repo.packages","repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
|
||||
UnitsMap map[string]string `json:"units_map"`
|
||||
CanCreateOrgRepo bool `json:"can_create_org_repo"`
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
As a special exception to the GNU General Public License, if you
|
||||
distribute this file as part of a program that contains a
|
||||
configuration script generated by Autoconf, you may include it under
|
||||
the same distribution terms that you use for the rest of that
|
||||
program. This Exception is an additional permission under section 7
|
||||
of the GNU General Public License, version 3 ("GPLv3").
|
|
@ -0,0 +1,4 @@
|
|||
Everyone is permitted to do anything on this program including copying,
|
||||
modifying, and improving, unless you try to pretend that you wrote it.
|
||||
i.e., the above copyright notice has to appear in all copies.
|
||||
THE AUTHOR DISCLAIMS ANY RESPONSIBILITY WITH REGARD TO THIS SOFTWARE.
|
|
@ -0,0 +1,3 @@
|
|||
Copyright 1988 Jon Zeeff (zeeff@b-tech.ann-arbor.mi.us)
|
||||
You can use this code in any manner, as long as you leave my
|
||||
name on it and don't hold me responsible for any problems with it.
|
|
@ -0,0 +1,2 @@
|
|||
Permission is granted to copy and/or distribute this file, with or
|
||||
without modifications, provided this notice is preserved.
|
|
@ -1170,6 +1170,9 @@ commit_graph.select = Select branches
|
|||
commit_graph.hide_pr_refs = Hide Pull Requests
|
||||
commit_graph.monochrome = Mono
|
||||
commit_graph.color = Color
|
||||
commit.contained_in = This commit is contained in:
|
||||
commit.contained_in_default_branch = This commit is part of the default branch
|
||||
commit.load_referencing_branches_and_tags = Load branches and tags referencing this commit
|
||||
blame = Blame
|
||||
download_file = Download file
|
||||
normal_view = Normal View
|
||||
|
@ -1384,7 +1387,7 @@ issues.delete_branch_at = `deleted branch <b>%s</b> %s`
|
|||
issues.filter_label = Label
|
||||
issues.filter_label_exclude = `Use <code>alt</code> + <code>click/enter</code> to exclude labels`
|
||||
issues.filter_label_no_select = All labels
|
||||
issues.filter_label_select_no_label = No Label
|
||||
issues.filter_label_select_no_label = No label
|
||||
issues.filter_milestone = Milestone
|
||||
issues.filter_milestone_all = All milestones
|
||||
issues.filter_milestone_none = No milestones
|
||||
|
@ -1659,6 +1662,13 @@ pulls.switch_comparison_type = Switch comparison type
|
|||
pulls.switch_head_and_base = Switch head and base
|
||||
pulls.filter_branch = Filter branch
|
||||
pulls.no_results = No results found.
|
||||
pulls.show_all_commits = Show all commits
|
||||
pulls.show_changes_since_your_last_review = Show changes since your last review
|
||||
pulls.showing_only_single_commit = Showing only changes of commit %[1]s
|
||||
pulls.showing_specified_commit_range = Showing only changes between %[1]s..%[2]s
|
||||
pulls.select_commit_hold_shift_for_range = Select commit. Hold shift + click to select a range
|
||||
pulls.review_only_possible_for_full_diff = Review is only possible when viewing the full diff
|
||||
pulls.filter_changes_by_commit = Filter by commit
|
||||
pulls.nothing_to_compare = These branches are equal. There is no need to create a pull request.
|
||||
pulls.nothing_to_compare_and_allow_empty_pr = These branches are equal. This PR will be empty.
|
||||
pulls.has_pull_request = `A pull request between these branches already exists: <a href="%[1]s">%[2]s#%[3]d</a>`
|
||||
|
|
24
package.json
|
@ -13,24 +13,24 @@
|
|||
"@github/relative-time-element": "4.3.0",
|
||||
"@github/text-expander-element": "2.5.0",
|
||||
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
|
||||
"@primer/octicons": "19.4.0",
|
||||
"@primer/octicons": "19.5.0",
|
||||
"@webcomponents/custom-elements": "1.6.0",
|
||||
"add-asset-webpack-plugin": "2.0.1",
|
||||
"ansi_up": "5.2.1",
|
||||
"asciinema-player": "3.5.0",
|
||||
"clippie": "4.0.1",
|
||||
"clippie": "4.0.6",
|
||||
"css-loader": "6.8.1",
|
||||
"dropzone": "6.0.0-beta.2",
|
||||
"easymde": "2.18.0",
|
||||
"esbuild-loader": "3.0.1",
|
||||
"escape-goat": "4.0.0",
|
||||
"fast-glob": "3.3.0",
|
||||
"fast-glob": "3.3.1",
|
||||
"jquery": "3.7.0",
|
||||
"jquery.are-you-sure": "1.9.0",
|
||||
"katex": "0.16.8",
|
||||
"license-checker-webpack-plugin": "0.2.1",
|
||||
"lightningcss-loader": "2.1.0",
|
||||
"mermaid": "10.2.4",
|
||||
"mermaid": "10.3.0",
|
||||
"mini-css-extract-plugin": "2.7.6",
|
||||
"minimatch": "9.0.3",
|
||||
"monaco-editor": "0.40.0",
|
||||
|
@ -38,7 +38,7 @@
|
|||
"pdfobject": "2.2.12",
|
||||
"pretty-ms": "8.0.0",
|
||||
"sortablejs": "1.15.0",
|
||||
"swagger-ui-dist": "5.1.3",
|
||||
"swagger-ui-dist": "5.2.0",
|
||||
"throttle-debounce": "5.0.0",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tippy.js": "6.3.7",
|
||||
|
@ -55,20 +55,20 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
|
||||
"@playwright/test": "1.36.1",
|
||||
"@stoplight/spectral-cli": "6.8.0",
|
||||
"@playwright/test": "1.36.2",
|
||||
"@stoplight/spectral-cli": "6.10.0",
|
||||
"@vitejs/plugin-vue": "4.2.3",
|
||||
"eslint": "8.45.0",
|
||||
"eslint": "8.46.0",
|
||||
"eslint-plugin-array-func": "3.1.8",
|
||||
"eslint-plugin-custom-elements": "0.0.8",
|
||||
"eslint-plugin-import": "2.27.5",
|
||||
"eslint-plugin-import": "2.28.0",
|
||||
"eslint-plugin-jquery": "1.5.1",
|
||||
"eslint-plugin-no-jquery": "2.7.0",
|
||||
"eslint-plugin-no-use-extend-native": "0.5.0",
|
||||
"eslint-plugin-regexp": "1.15.0",
|
||||
"eslint-plugin-sonarjs": "0.19.0",
|
||||
"eslint-plugin-unicorn": "48.0.0",
|
||||
"eslint-plugin-vue": "9.15.1",
|
||||
"eslint-plugin-unicorn": "48.0.1",
|
||||
"eslint-plugin-vue": "9.16.0",
|
||||
"eslint-plugin-wc": "1.5.0",
|
||||
"jsdom": "22.1.0",
|
||||
"markdownlint-cli": "0.35.0",
|
||||
|
@ -79,7 +79,7 @@
|
|||
"stylelint-stylistic": "0.4.3",
|
||||
"svgo": "3.0.2",
|
||||
"updates": "14.3.4",
|
||||
"vite-string-plugin": "1.1.1",
|
||||
"vite-string-plugin": "1.1.2",
|
||||
"vitest": "0.33.0"
|
||||
},
|
||||
"browserslist": [
|
||||
|
|
|
@ -27,12 +27,12 @@ files = [
|
|||
|
||||
[[package]]
|
||||
name = "cssbeautifier"
|
||||
version = "1.14.8"
|
||||
version = "1.14.9"
|
||||
description = "CSS unobfuscator and beautifier."
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
files = [
|
||||
{file = "cssbeautifier-1.14.8.tar.gz", hash = "sha256:9ad4c5b2ffe0b439a4bed278bc440b6a89c40823c3f19db38f808d256216a592"},
|
||||
{file = "cssbeautifier-1.14.9.tar.gz", hash = "sha256:2da432472f68170eb854aff97b16a24721f5090ee36af2e31199590a89e7f71f"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
|
@ -42,13 +42,13 @@ six = ">=1.13.0"
|
|||
|
||||
[[package]]
|
||||
name = "djlint"
|
||||
version = "1.32.0"
|
||||
version = "1.32.1"
|
||||
description = "HTML Template Linter and Formatter"
|
||||
optional = false
|
||||
python-versions = ">=3.8.0,<4.0.0"
|
||||
files = [
|
||||
{file = "djlint-1.32.0-py3-none-any.whl", hash = "sha256:b1b14731a39c36be654712a930c6a8b41dd0eefddf83641d8d6e00cfa798644c"},
|
||||
{file = "djlint-1.32.0.tar.gz", hash = "sha256:0f53692b9b9731966d955b805dc8c6d43c99b967a7c2222d112451cb96145bd2"},
|
||||
{file = "djlint-1.32.1-py3-none-any.whl", hash = "sha256:8aaec6776376cfd41f3e742ed9f5e3c46dc7c6cd7646abf9e99860fb1ec9f19a"},
|
||||
{file = "djlint-1.32.1.tar.gz", hash = "sha256:c1e2141acf1547d244af7ef8abd15fbbae2abcc7a03e2bf31f8a491de69a6c72"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
|
@ -100,12 +100,12 @@ files = [
|
|||
|
||||
[[package]]
|
||||
name = "jsbeautifier"
|
||||
version = "1.14.8"
|
||||
version = "1.14.9"
|
||||
description = "JavaScript unobfuscator and beautifier."
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
files = [
|
||||
{file = "jsbeautifier-1.14.8.tar.gz", hash = "sha256:d4c4e263a42dd6194afb9dbe54710be3c5604492cbec3e89c92dd98513f98b9f"},
|
||||
{file = "jsbeautifier-1.14.9.tar.gz", hash = "sha256:c738ebc36b47bd94e4ca6dd17a9004c3cc74edad582ca1d60e0e5d5945a63cb9"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
|
@ -128,13 +128,13 @@ dev = ["hypothesis"]
|
|||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
description = "Utility library for gitignore style pattern matching of file paths."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"},
|
||||
{file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"},
|
||||
{file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"},
|
||||
{file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -328,4 +328,4 @@ telegram = ["requests"]
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "69e0bae3b5139a7980b1fd8cca7a1e4c8096aea9833b721d3b1a808f83eb26f0"
|
||||
content-hash = "1b154f70c35b75d47c843959af9df0e7343f3bb579835825ca889ec9350afc41"
|
||||
|
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 16" class="svg octicon-pin-slash" width="16" height="16" aria-hidden="true"><path d="m2.155.595 13.75 13.75a.749.749 0 1 1-1.06 1.06l-3.311-3.31-.14.588c-.317 1.332-1.972 1.8-2.94.832L6.25 11.311 2.28 15.28a.749.749 0 1 1-1.06-1.06l3.969-3.97-2.204-2.204c-.968-.968-.5-2.623.832-2.94l.588-.14-3.31-3.311a.749.749 0 1 1 1.06-1.06Zm8.134 10.254L5.651 6.211l-1.486.354a.25.25 0 0 0-.119.42l2.731 2.732.003.003.003.003 2.732 2.731a.25.25 0 0 0 .42-.119ZM11.794.984l3.722 3.722a1.75 1.75 0 0 1-.504 2.826l-1.627.751a1.25 1.25 0 0 0-.355.247.749.749 0 1 1-1.06-1.06c.228-.228.494-.414.787-.549l1.627-.751a.25.25 0 0 0 .072-.404l-3.722-3.722a.25.25 0 0 0-.404.072l-.751 1.627a2.726 2.726 0 0 1-.549.787.749.749 0 1 1-1.06-1.06 1.25 1.25 0 0 0 .247-.355l.751-1.627a1.75 1.75 0 0 1 2.826-.504Z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-pin-slash" width="16" height="16" aria-hidden="true"><path d="m1.655.595 13.75 13.75q.22.219.22.53 0 .311-.22.53-.219.22-.53.22-.311 0-.53-.22L.595 1.655q-.22-.219-.22-.53 0-.311.22-.53.219-.22.53-.22.311 0 .53.22ZM.72 14.22l4.5-4.5q.219-.22.53-.22.311 0 .53.22.22.219.22.53 0 .311-.22.53l-4.5 4.5q-.219.22-.53.22-.311 0-.53-.22-.22-.219-.22-.53 0-.311.22-.53Z"/><path d="m5.424 6.146-1.759.419q-.143.034-.183.175-.04.141.064.245l5.469 5.469q.104.104.245.064.141-.04.175-.183l.359-1.509q.072-.302.337-.465.264-.163.567-.091.302.072.465.337.162.264.09.567l-.359 1.509q-.238.999-1.226 1.278-.988.28-1.714-.446L2.485 8.046q-.726-.726-.446-1.714.279-.988 1.278-1.226l1.759-.419q.303-.072.567.091.265.163.337.465.072.302-.091.567-.163.264-.465.336ZM7.47 3.47q.155-.156.247-.355l.751-1.627Q8.851.659 9.75.498q.899-.16 1.544.486l3.722 3.722q.646.645.486 1.544-.161.899-.99 1.282l-1.627.751q-.199.092-.355.247-.219.22-.53.22-.311 0-.53-.22-.22-.219-.22-.53 0-.311.22-.53.344-.345.787-.549l1.627-.751q.118-.055.141-.183.023-.128-.069-.221l-3.722-3.722q-.092-.092-.221-.069-.128.023-.183.141l-.751 1.627q-.204.443-.549.787-.219.22-.53.22-.311 0-.53-.22-.22-.219-.22-.53 0-.311.22-.53Z"/></svg>
|
Before Width: | Height: | Size: 849 B After Width: | Height: | Size: 1.2 KiB |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-repo-clone" width="16" height="16" aria-hidden="true"><path d="M2 1v9h10v3c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h7v1Zm13-1c.55 0 1 .45 1 1v6c0 .55-.45 1-1 1h-3v1h-1V8h-1c-.55 0-1-.45-1-1V0Zm-4 11H1v2h2v-1h3v1h5Zm4-6V1h-4v4Zm0 2V6h-3v1ZM4 3H3V2h1Zm0 2H3V4h1Zm0 2H3V6h1Zm7 0V6h-1v1ZM3 8h1v1H3Z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-repo-clone" width="16" height="16" aria-hidden="true"><path d="M3.5 0A2.5 2.5 0 0 0 1 2.5v9A2.5 2.5 0 0 0 3.5 14h2.75a.75.75 0 0 0 0-1.5H3.5a1 1 0 0 1 0-2h2.75a.75.75 0 0 0 0-1.5H3.5c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8v2.75a.75.75 0 0 0 1.5 0V.75a.75.75 0 0 0-.75-.75H3.5Z"/><path d="M8 8.058C8 7.023 8.75 6 9.887 6h5.363a.75.75 0 0 1 .75.75v8.5a.75.75 0 0 1-.75.75h-5A2.25 2.25 0 0 1 8 13.75Zm6.5 3.442v-4H9.887c-.07 0-.156.031-.238.125a.663.663 0 0 0-.149.433v3.57c.235-.083.487-.128.75-.128Zm-5 2.25c0 .414.336.75.75.75h4.25V13h-4.25a.75.75 0 0 0-.75.75Z"/></svg>
|
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 653 B |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-repo-pull" width="16" height="16" aria-hidden="true"><path d="M11 7h1v6c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v2h-1V1H2v9h9Zm2 1V6H7V4h6V2l3 3Zm-2 3H1v2h2v-1h3v1h5ZM4 2v1H3V2Zm0 2v1H3V4Zm0 2v1H3V6ZM3 9V8h1v1Z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-repo-pull" width="16" height="16" aria-hidden="true"><path d="M1 2.5A2.5 2.5 0 0 1 3.5 0h8.75a.75.75 0 0 1 .75.75V6a.75.75 0 0 1-1.5 0V1.5h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 3.5 9h3a.75.75 0 0 1 0 1.5h-3a1 1 0 0 0 0 2h3a.75.75 0 0 1 0 1.5h-3A2.5 2.5 0 0 1 1 11.5v-9Z"/><path d="M12.21 13.479a.75.75 0 1 0 1.061 1.061l2.504-2.505a.75.75 0 0 0 0-1.061L13.271 8.47a.75.75 0 0 0-1.061 1.06l1.224 1.225H8.75a.75.75 0 1 0 0 1.5h4.685l-1.225 1.224Z"/></svg>
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 535 B |
|
@ -8,7 +8,7 @@ authors = []
|
|||
python = "^3.8"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
djlint = "1.32.0"
|
||||
djlint = "1.32.1"
|
||||
|
||||
[tool.djlint]
|
||||
profile="golang"
|
||||
|
|
|
@ -289,7 +289,7 @@ type FeedResponse struct {
|
|||
ID string `xml:"id"`
|
||||
Title TypedValue[string] `xml:"title"`
|
||||
Updated time.Time `xml:"updated"`
|
||||
Link FeedEntryLink `xml:"link"`
|
||||
Links []FeedEntryLink `xml:"link"`
|
||||
Entries []*FeedEntry `xml:"entry"`
|
||||
Count int64 `xml:"m:count"`
|
||||
}
|
||||
|
@ -300,6 +300,16 @@ func createFeedResponse(l *linkBuilder, totalEntries int64, pds []*packages_mode
|
|||
entries = append(entries, createEntry(l, pd, false))
|
||||
}
|
||||
|
||||
links := []FeedEntryLink{
|
||||
{Rel: "self", Href: l.Base},
|
||||
}
|
||||
if l.Next != nil {
|
||||
links = append(links, FeedEntryLink{
|
||||
Rel: "next",
|
||||
Href: l.GetNextURL(),
|
||||
})
|
||||
}
|
||||
|
||||
return &FeedResponse{
|
||||
Xmlns: "http://www.w3.org/2005/Atom",
|
||||
Base: l.Base,
|
||||
|
@ -307,7 +317,7 @@ func createFeedResponse(l *linkBuilder, totalEntries int64, pds []*packages_mode
|
|||
XmlnsM: "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata",
|
||||
ID: "http://schemas.datacontract.org/2004/07/",
|
||||
Updated: time.Now(),
|
||||
Link: FeedEntryLink{Rel: "self", Href: l.Base},
|
||||
Links: links,
|
||||
Count: totalEntries,
|
||||
Entries: entries,
|
||||
}
|
||||
|
|
|
@ -166,10 +166,10 @@ type PackageVersionsResponse struct {
|
|||
Versions []string `json:"versions"`
|
||||
}
|
||||
|
||||
func createPackageVersionsResponse(pds []*packages_model.PackageDescriptor) *PackageVersionsResponse {
|
||||
versions := make([]string, 0, len(pds))
|
||||
for _, pd := range pds {
|
||||
versions = append(versions, pd.Version.Version)
|
||||
func createPackageVersionsResponse(pvs []*packages_model.PackageVersion) *PackageVersionsResponse {
|
||||
versions := make([]string, 0, len(pvs))
|
||||
for _, pv := range pvs {
|
||||
versions = append(versions, pv.Version)
|
||||
}
|
||||
|
||||
return &PackageVersionsResponse{
|
||||
|
|
|
@ -5,10 +5,17 @@ package nuget
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type nextOptions struct {
|
||||
Path string
|
||||
Query url.Values
|
||||
}
|
||||
|
||||
type linkBuilder struct {
|
||||
Base string
|
||||
Next *nextOptions
|
||||
}
|
||||
|
||||
// GetRegistrationIndexURL builds the registration index url
|
||||
|
@ -30,3 +37,16 @@ func (l *linkBuilder) GetPackageDownloadURL(id, version string) string {
|
|||
func (l *linkBuilder) GetPackageMetadataURL(id, version string) string {
|
||||
return fmt.Sprintf("%s/Packages(Id='%s',Version='%s')", l.Base, id, version)
|
||||
}
|
||||
|
||||
func (l *linkBuilder) GetNextURL() string {
|
||||
u, _ := url.Parse(l.Base)
|
||||
u = u.JoinPath(l.Next.Path)
|
||||
q := u.Query()
|
||||
for k, vs := range l.Next.Query {
|
||||
for _, v := range vs {
|
||||
q.Add(k, v)
|
||||
}
|
||||
}
|
||||
u.RawQuery = q.Encode()
|
||||
return u.String()
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -111,13 +112,8 @@ func getSearchTerm(ctx *context.Context) string {
|
|||
|
||||
// https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Protocol/LegacyFeed/V2FeedQueryBuilder.cs
|
||||
func SearchServiceV2(ctx *context.Context) {
|
||||
skip, take := ctx.FormInt("skip"), ctx.FormInt("take")
|
||||
if skip == 0 {
|
||||
skip = ctx.FormInt("$skip")
|
||||
}
|
||||
if take == 0 {
|
||||
take = ctx.FormInt("$top")
|
||||
}
|
||||
skip, take := ctx.FormInt("$skip"), ctx.FormInt("$top")
|
||||
paginator := db.NewAbsoluteListOptions(skip, take)
|
||||
|
||||
pvs, total, err := packages_model.SearchVersions(ctx, &packages_model.PackageSearchOptions{
|
||||
OwnerID: ctx.Package.Owner.ID,
|
||||
|
@ -126,10 +122,7 @@ func SearchServiceV2(ctx *context.Context) {
|
|||
Value: getSearchTerm(ctx),
|
||||
},
|
||||
IsInternal: util.OptionalBoolFalse,
|
||||
Paginator: db.NewAbsoluteListOptions(
|
||||
skip,
|
||||
take,
|
||||
),
|
||||
Paginator: paginator,
|
||||
})
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
|
@ -142,8 +135,28 @@ func SearchServiceV2(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
skip, take = paginator.GetSkipTake()
|
||||
|
||||
var next *nextOptions
|
||||
if len(pvs) == take {
|
||||
next = &nextOptions{
|
||||
Path: "Search()",
|
||||
Query: url.Values{},
|
||||
}
|
||||
searchTerm := ctx.FormTrim("searchTerm")
|
||||
if searchTerm != "" {
|
||||
next.Query.Set("searchTerm", searchTerm)
|
||||
}
|
||||
filter := ctx.FormTrim("$filter")
|
||||
if filter != "" {
|
||||
next.Query.Set("$filter", filter)
|
||||
}
|
||||
next.Query.Set("$skip", strconv.Itoa(skip+take))
|
||||
next.Query.Set("$top", strconv.Itoa(take))
|
||||
}
|
||||
|
||||
resp := createFeedResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget", Next: next},
|
||||
total,
|
||||
pds,
|
||||
)
|
||||
|
@ -193,7 +206,7 @@ func SearchServiceV3(ctx *context.Context) {
|
|||
}
|
||||
|
||||
resp := createSearchResultResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
count,
|
||||
pds,
|
||||
)
|
||||
|
@ -222,7 +235,7 @@ func RegistrationIndex(ctx *context.Context) {
|
|||
}
|
||||
|
||||
resp := createRegistrationIndexResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
pds,
|
||||
)
|
||||
|
||||
|
@ -251,7 +264,7 @@ func RegistrationLeafV2(ctx *context.Context) {
|
|||
}
|
||||
|
||||
resp := createEntryResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
pd,
|
||||
)
|
||||
|
||||
|
@ -280,7 +293,7 @@ func RegistrationLeafV3(ctx *context.Context) {
|
|||
}
|
||||
|
||||
resp := createRegistrationLeafResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
pd,
|
||||
)
|
||||
|
||||
|
@ -291,7 +304,19 @@ func RegistrationLeafV3(ctx *context.Context) {
|
|||
func EnumeratePackageVersionsV2(ctx *context.Context) {
|
||||
packageName := strings.Trim(ctx.FormTrim("id"), "'")
|
||||
|
||||
pvs, err := packages_model.GetVersionsByPackageName(ctx, ctx.Package.Owner.ID, packages_model.TypeNuGet, packageName)
|
||||
skip, take := ctx.FormInt("$skip"), ctx.FormInt("$top")
|
||||
paginator := db.NewAbsoluteListOptions(skip, take)
|
||||
|
||||
pvs, total, err := packages_model.SearchVersions(ctx, &packages_model.PackageSearchOptions{
|
||||
OwnerID: ctx.Package.Owner.ID,
|
||||
Type: packages_model.TypeNuGet,
|
||||
Name: packages_model.SearchValue{
|
||||
ExactMatch: true,
|
||||
Value: packageName,
|
||||
},
|
||||
IsInternal: util.OptionalBoolFalse,
|
||||
Paginator: paginator,
|
||||
})
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
|
@ -303,9 +328,22 @@ func EnumeratePackageVersionsV2(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
skip, take = paginator.GetSkipTake()
|
||||
|
||||
var next *nextOptions
|
||||
if len(pvs) == take {
|
||||
next = &nextOptions{
|
||||
Path: "FindPackagesById()",
|
||||
Query: url.Values{},
|
||||
}
|
||||
next.Query.Set("id", packageName)
|
||||
next.Query.Set("$skip", strconv.Itoa(skip+take))
|
||||
next.Query.Set("$top", strconv.Itoa(take))
|
||||
}
|
||||
|
||||
resp := createFeedResponse(
|
||||
&linkBuilder{setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget"},
|
||||
int64(len(pds)),
|
||||
&linkBuilder{Base: setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/nuget", Next: next},
|
||||
total,
|
||||
pds,
|
||||
)
|
||||
|
||||
|
@ -345,13 +383,7 @@ func EnumeratePackageVersionsV3(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
pds, err := packages_model.GetPackageDescriptors(ctx, pvs)
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
resp := createPackageVersionsResponse(pds)
|
||||
resp := createPackageVersionsResponse(pvs)
|
||||
|
||||
ctx.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/services/gitdiff"
|
||||
git_service "code.gitea.io/gitea/services/repository"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -255,6 +256,15 @@ func FileHistory(ctx *context.Context) {
|
|||
ctx.HTML(http.StatusOK, tplCommits)
|
||||
}
|
||||
|
||||
func LoadBranchesAndTags(ctx *context.Context) {
|
||||
response, err := git_service.LoadBranchesAndTags(ctx, ctx.Repo, ctx.Params("sha"))
|
||||
if err == nil {
|
||||
ctx.JSON(http.StatusOK, response)
|
||||
return
|
||||
}
|
||||
ctx.NotFoundOrServerError(fmt.Sprintf("could not load branches and tags the commit %s belongs to", ctx.Params("sha")), git.IsErrNotExist, err)
|
||||
}
|
||||
|
||||
// Diff show different from current commit to previous commit
|
||||
func Diff(ctx *context.Context) {
|
||||
ctx.Data["PageIsDiff"] = true
|
||||
|
@ -374,11 +384,6 @@ func Diff(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
ctx.Data["TagName"], err = commit.GetTagName()
|
||||
if err != nil {
|
||||
ctx.ServerError("commit.GetTagName", err)
|
||||
return
|
||||
}
|
||||
ctx.HTML(http.StatusOK, tplCommitPage)
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,11 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
|||
// 0 means issues with no label
|
||||
// blank means labels will not be filtered for issues
|
||||
selectLabels := ctx.FormString("labels")
|
||||
if len(selectLabels) > 0 {
|
||||
if selectLabels == "" {
|
||||
ctx.Data["AllLabels"] = true
|
||||
} else if selectLabels == "0" {
|
||||
ctx.Data["NoLabel"] = true
|
||||
} else if len(selectLabels) > 0 {
|
||||
labelIDs, err = base.StringsToInt64s(strings.Split(selectLabels, ","))
|
||||
if err != nil {
|
||||
ctx.ServerError("StringsToInt64s", err)
|
||||
|
@ -514,6 +518,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
|
|||
}
|
||||
|
||||
func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
|
||||
// Distinguish whether the owner of the repository
|
||||
// is an individual or an organization
|
||||
repoOwnerType := project_model.TypeIndividual
|
||||
if repo.Owner.IsOrganization() {
|
||||
repoOwnerType = project_model.TypeOrganization
|
||||
}
|
||||
var err error
|
||||
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
|
||||
RepoID: repo.ID,
|
||||
|
@ -529,7 +539,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
|
|||
OwnerID: repo.OwnerID,
|
||||
Page: -1,
|
||||
IsClosed: util.OptionalBoolFalse,
|
||||
Type: project_model.TypeOrganization,
|
||||
Type: repoOwnerType,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetProjects", err)
|
||||
|
@ -552,7 +562,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
|
|||
OwnerID: repo.OwnerID,
|
||||
Page: -1,
|
||||
IsClosed: util.OptionalBoolTrue,
|
||||
Type: project_model.TypeOrganization,
|
||||
Type: repoOwnerType,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetProjects", err)
|
||||
|
|
|
@ -694,6 +694,42 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
|
|||
return compareInfo
|
||||
}
|
||||
|
||||
type pullCommitList struct {
|
||||
Commits []pull_service.CommitInfo `json:"commits"`
|
||||
LastReviewCommitSha string `json:"last_review_commit_sha"`
|
||||
Locale map[string]string `json:"locale"`
|
||||
}
|
||||
|
||||
// GetPullCommits get all commits for given pull request
|
||||
func GetPullCommits(ctx *context.Context) {
|
||||
issue := checkPullInfo(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
resp := &pullCommitList{}
|
||||
|
||||
commits, lastReviewCommitSha, err := pull_service.GetPullCommits(ctx, issue)
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Get the needed locale
|
||||
resp.Locale = map[string]string{
|
||||
"lang": ctx.Locale.Language(),
|
||||
"filter_changes_by_commit": ctx.Tr("repo.pulls.filter_changes_by_commit"),
|
||||
"show_all_commits": ctx.Tr("repo.pulls.show_all_commits"),
|
||||
"stats_num_commits": ctx.TrN(len(commits), "repo.activity.git_stats_commit_1", "repo.activity.git_stats_commit_n", len(commits)),
|
||||
"show_changes_since_your_last_review": ctx.Tr("repo.pulls.show_changes_since_your_last_review"),
|
||||
"select_commit_hold_shift_for_range": ctx.Tr("repo.pulls.select_commit_hold_shift_for_range"),
|
||||
}
|
||||
|
||||
resp.Commits = commits
|
||||
resp.LastReviewCommitSha = lastReviewCommitSha
|
||||
|
||||
ctx.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// ViewPullCommits show commits for a pull request
|
||||
func ViewPullCommits(ctx *context.Context) {
|
||||
ctx.Data["PageIsPullList"] = true
|
||||
|
@ -739,7 +775,7 @@ func ViewPullCommits(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// ViewPullFiles render pull request changed files list page
|
||||
func ViewPullFiles(ctx *context.Context) {
|
||||
func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommit string, willShowSpecifiedCommitRange, willShowSpecifiedCommit bool) {
|
||||
ctx.Data["PageIsPullList"] = true
|
||||
ctx.Data["PageIsPullFiles"] = true
|
||||
|
||||
|
@ -762,6 +798,33 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
prInfo = PrepareViewPullInfo(ctx, issue)
|
||||
}
|
||||
|
||||
// Validate the given commit sha to show (if any passed)
|
||||
if willShowSpecifiedCommit || willShowSpecifiedCommitRange {
|
||||
|
||||
foundStartCommit := len(specifiedStartCommit) == 0
|
||||
foundEndCommit := len(specifiedEndCommit) == 0
|
||||
|
||||
if !(foundStartCommit && foundEndCommit) {
|
||||
for _, commit := range prInfo.Commits {
|
||||
if commit.ID.String() == specifiedStartCommit {
|
||||
foundStartCommit = true
|
||||
}
|
||||
if commit.ID.String() == specifiedEndCommit {
|
||||
foundEndCommit = true
|
||||
}
|
||||
|
||||
if foundStartCommit && foundEndCommit {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !(foundStartCommit && foundEndCommit) {
|
||||
ctx.NotFound("Given SHA1 not found for this PR", nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.Written() {
|
||||
return
|
||||
} else if prInfo == nil {
|
||||
|
@ -775,12 +838,30 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
startCommitID = prInfo.MergeBase
|
||||
endCommitID = headCommitID
|
||||
ctx.Data["IsShowingOnlySingleCommit"] = willShowSpecifiedCommit
|
||||
|
||||
if willShowSpecifiedCommit || willShowSpecifiedCommitRange {
|
||||
if len(specifiedEndCommit) > 0 {
|
||||
endCommitID = specifiedEndCommit
|
||||
} else {
|
||||
endCommitID = headCommitID
|
||||
}
|
||||
if len(specifiedStartCommit) > 0 {
|
||||
startCommitID = specifiedStartCommit
|
||||
} else {
|
||||
startCommitID = prInfo.MergeBase
|
||||
}
|
||||
ctx.Data["IsShowingAllCommits"] = false
|
||||
} else {
|
||||
endCommitID = headCommitID
|
||||
startCommitID = prInfo.MergeBase
|
||||
ctx.Data["IsShowingAllCommits"] = true
|
||||
}
|
||||
|
||||
ctx.Data["Username"] = ctx.Repo.Owner.Name
|
||||
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
|
||||
ctx.Data["AfterCommitID"] = endCommitID
|
||||
ctx.Data["BeforeCommitID"] = startCommitID
|
||||
|
||||
fileOnly := ctx.FormBool("file-only")
|
||||
|
||||
|
@ -789,8 +870,8 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
if fileOnly && (len(files) == 2 || len(files) == 1) {
|
||||
maxLines, maxFiles = -1, -1
|
||||
}
|
||||
|
||||
diffOptions := &gitdiff.DiffOptions{
|
||||
BeforeCommitID: startCommitID,
|
||||
AfterCommitID: endCommitID,
|
||||
SkipTo: ctx.FormString("skip-to"),
|
||||
MaxLines: maxLines,
|
||||
|
@ -799,9 +880,18 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
WhitespaceBehavior: gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string)),
|
||||
}
|
||||
|
||||
if !willShowSpecifiedCommit {
|
||||
diffOptions.BeforeCommitID = startCommitID
|
||||
}
|
||||
|
||||
var methodWithError string
|
||||
var diff *gitdiff.Diff
|
||||
if !ctx.IsSigned {
|
||||
|
||||
// if we're not logged in or only a single commit (or commit range) is shown we
|
||||
// have to load only the diff and not get the viewed information
|
||||
// as the viewed information is designed to be loaded only on latest PR
|
||||
// diff and if you're signed in.
|
||||
if !ctx.IsSigned || willShowSpecifiedCommit || willShowSpecifiedCommitRange {
|
||||
diff, err = gitdiff.GetDiff(gitRepo, diffOptions, files...)
|
||||
methodWithError = "GetDiff"
|
||||
} else {
|
||||
|
@ -908,6 +998,22 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
ctx.HTML(http.StatusOK, tplPullFiles)
|
||||
}
|
||||
|
||||
func ViewPullFilesForSingleCommit(ctx *context.Context) {
|
||||
viewPullFiles(ctx, "", ctx.Params("sha"), true, true)
|
||||
}
|
||||
|
||||
func ViewPullFilesForRange(ctx *context.Context) {
|
||||
viewPullFiles(ctx, ctx.Params("shaFrom"), ctx.Params("shaTo"), true, false)
|
||||
}
|
||||
|
||||
func ViewPullFilesStartingFromCommit(ctx *context.Context) {
|
||||
viewPullFiles(ctx, "", ctx.Params("sha"), true, false)
|
||||
}
|
||||
|
||||
func ViewPullFilesForAllCommitsOfPr(ctx *context.Context) {
|
||||
viewPullFiles(ctx, "", "", false, false)
|
||||
}
|
||||
|
||||
// UpdatePullRequest merge PR's baseBranch into headBranch
|
||||
func UpdatePullRequest(ctx *context.Context) {
|
||||
issue := checkPullInfo(ctx)
|
||||
|
|
|
@ -254,9 +254,10 @@ func registerRoutes(m *web.Route) {
|
|||
}
|
||||
}
|
||||
|
||||
reqUnitAccess := func(unitType unit.Type, accessMode perm.AccessMode) func(ctx *context.Context) {
|
||||
reqUnitAccess := func(unitType unit.Type, accessMode perm.AccessMode, ignoreGlobal bool) func(ctx *context.Context) {
|
||||
return func(ctx *context.Context) {
|
||||
if unitType.UnitGlobalDisabled() {
|
||||
// only check global disabled units when ignoreGlobal is false
|
||||
if !ignoreGlobal && unitType.UnitGlobalDisabled() {
|
||||
ctx.NotFound(unitType.String(), nil)
|
||||
return
|
||||
}
|
||||
|
@ -374,8 +375,9 @@ func registerRoutes(m *web.Route) {
|
|||
m.Get("/milestones", reqSignIn, reqMilestonesDashboardPageEnabled, user.Milestones)
|
||||
|
||||
// ***** START: User *****
|
||||
// "user/login" doesn't need signOut, then logged-in users can still access this route for redirection purposes by "/user/login?redirec_to=..."
|
||||
m.Get("/user/login", auth.SignIn)
|
||||
m.Group("/user", func() {
|
||||
m.Get("/login", auth.SignIn)
|
||||
m.Post("/login", web.Bind(forms.SignInForm{}), auth.SignInPost)
|
||||
m.Group("", func() {
|
||||
m.Combo("/login/openid").
|
||||
|
@ -831,7 +833,7 @@ func registerRoutes(m *web.Route) {
|
|||
m.Group("", func() {
|
||||
m.Get("", org.Projects)
|
||||
m.Get("/{id}", org.ViewProject)
|
||||
}, reqUnitAccess(unit.TypeProjects, perm.AccessModeRead))
|
||||
}, reqUnitAccess(unit.TypeProjects, perm.AccessModeRead, true))
|
||||
m.Group("", func() { //nolint:dupl
|
||||
m.Get("/new", org.RenderNewProject)
|
||||
m.Post("/new", web.Bind(forms.CreateProjectForm{}), org.NewProjectPost)
|
||||
|
@ -852,17 +854,17 @@ func registerRoutes(m *web.Route) {
|
|||
m.Post("/move", org.MoveIssues)
|
||||
})
|
||||
})
|
||||
}, reqSignIn, reqUnitAccess(unit.TypeProjects, perm.AccessModeWrite), func(ctx *context.Context) {
|
||||
}, reqSignIn, reqUnitAccess(unit.TypeProjects, perm.AccessModeWrite, true), func(ctx *context.Context) {
|
||||
if ctx.ContextUser.IsIndividual() && ctx.ContextUser.ID != ctx.Doer.ID {
|
||||
ctx.NotFound("NewProject", nil)
|
||||
return
|
||||
}
|
||||
})
|
||||
}, repo.MustEnableProjects)
|
||||
})
|
||||
|
||||
m.Group("", func() {
|
||||
m.Get("/code", user.CodeSearch)
|
||||
}, reqUnitAccess(unit.TypeCode, perm.AccessModeRead))
|
||||
}, reqUnitAccess(unit.TypeCode, perm.AccessModeRead, false))
|
||||
}, ignSignIn, context_service.UserAssignmentWeb(), context.OrgAssignment()) // for "/{username}/-" (packages, projects, code)
|
||||
|
||||
// ***** Release Attachment Download without Signin
|
||||
|
@ -1278,14 +1280,20 @@ func registerRoutes(m *web.Route) {
|
|||
m.Get("", repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewIssue)
|
||||
m.Get(".diff", repo.DownloadPullDiff)
|
||||
m.Get(".patch", repo.DownloadPullPatch)
|
||||
m.Get("/commits", context.RepoRef(), repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewPullCommits)
|
||||
m.Group("/commits", func() {
|
||||
m.Get("", context.RepoRef(), repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewPullCommits)
|
||||
m.Get("/list", context.RepoRef(), repo.GetPullCommits)
|
||||
m.Get("/{sha:[a-f0-9]{7,40}}", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForSingleCommit)
|
||||
})
|
||||
m.Post("/merge", context.RepoMustNotBeArchived(), web.Bind(forms.MergePullRequestForm{}), repo.MergePullRequest)
|
||||
m.Post("/cancel_auto_merge", context.RepoMustNotBeArchived(), repo.CancelAutoMergePullRequest)
|
||||
m.Post("/update", repo.UpdatePullRequest)
|
||||
m.Post("/set_allow_maintainer_edit", web.Bind(forms.UpdateAllowEditsForm{}), repo.SetAllowEdits)
|
||||
m.Post("/cleanup", context.RepoMustNotBeArchived(), context.RepoRef(), repo.CleanUpPullRequest)
|
||||
m.Group("/files", func() {
|
||||
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFiles)
|
||||
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForAllCommitsOfPr)
|
||||
m.Get("/{sha:[a-f0-9]{7,40}}", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesStartingFromCommit)
|
||||
m.Get("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForRange)
|
||||
m.Group("/reviews", func() {
|
||||
m.Get("/new_comment", repo.RenderNewCodeCommentForm)
|
||||
m.Post("/comments", web.Bind(forms.CodeCommentForm{}), repo.SetShowOutdatedComments, repo.CreateCodeComment)
|
||||
|
@ -1336,6 +1344,7 @@ func registerRoutes(m *web.Route) {
|
|||
m.Group("", func() {
|
||||
m.Get("/graph", repo.Graph)
|
||||
m.Get("/commit/{sha:([a-f0-9]{7,40})$}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.Diff)
|
||||
m.Get("/commit/{sha:([a-f0-9]{7,40})$}/load-branches-and-tags", repo.LoadBranchesAndTags)
|
||||
m.Get("/cherry-pick/{sha:([a-f0-9]{7,40})$}", repo.SetEditorconfigIfExists, repo.CherryPick)
|
||||
}, repo.MustBeNotEmpty, context.RepoRef(), reqRepoCodeReader)
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ func ToCombinedStatus(ctx context.Context, statuses []*git_model.CommitStatus, r
|
|||
retStatus.Statuses = make([]*api.CommitStatus, 0, len(statuses))
|
||||
for _, status := range statuses {
|
||||
retStatus.Statuses = append(retStatus.Statuses, ToCommitStatus(ctx, status))
|
||||
if status.State.NoBetterThan(retStatus.State) {
|
||||
if retStatus.State == "" || status.State.NoBetterThan(retStatus.State) {
|
||||
retStatus.State = status.State
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap
|
|||
ID: user.ID,
|
||||
UserName: user.Name,
|
||||
FullName: user.FullName,
|
||||
Email: user.GetEmail(),
|
||||
Email: user.GetPlaceholderEmail(),
|
||||
AvatarURL: user.AvatarLink(ctx),
|
||||
Created: user.CreatedUnix.AsTime(),
|
||||
Restricted: user.IsRestricted,
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
|
@ -17,7 +18,9 @@ import (
|
|||
issues_model "code.gitea.io/gitea/models/issues"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
gitea_context "code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
|
@ -856,3 +859,71 @@ func IsHeadEqualWithBranch(ctx context.Context, pr *issues_model.PullRequest, br
|
|||
}
|
||||
return baseCommit.HasPreviousCommit(headCommit.ID)
|
||||
}
|
||||
|
||||
type CommitInfo struct {
|
||||
Summary string `json:"summary"`
|
||||
CommitterOrAuthorName string `json:"committer_or_author_name"`
|
||||
ID string `json:"id"`
|
||||
ShortSha string `json:"short_sha"`
|
||||
Time string `json:"time"`
|
||||
}
|
||||
|
||||
// GetPullCommits returns all commits on given pull request and the last review commit sha
|
||||
func GetPullCommits(ctx *gitea_context.Context, issue *issues_model.Issue) ([]CommitInfo, string, error) {
|
||||
pull := issue.PullRequest
|
||||
|
||||
baseGitRepo := ctx.Repo.GitRepo
|
||||
|
||||
if err := pull.LoadBaseRepo(ctx); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
baseBranch := pull.BaseBranch
|
||||
if pull.HasMerged {
|
||||
baseBranch = pull.MergeBase
|
||||
}
|
||||
prInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(), baseBranch, pull.GetGitRefName(), true, false)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
commits := make([]CommitInfo, 0, len(prInfo.Commits))
|
||||
|
||||
for _, commit := range prInfo.Commits {
|
||||
var committerOrAuthorName string
|
||||
var commitTime time.Time
|
||||
if commit.Committer != nil {
|
||||
committerOrAuthorName = commit.Committer.Name
|
||||
commitTime = commit.Committer.When
|
||||
} else {
|
||||
committerOrAuthorName = commit.Author.Name
|
||||
commitTime = commit.Author.When
|
||||
}
|
||||
|
||||
commits = append(commits, CommitInfo{
|
||||
Summary: commit.Summary(),
|
||||
CommitterOrAuthorName: committerOrAuthorName,
|
||||
ID: commit.ID.String(),
|
||||
ShortSha: base.ShortSha(commit.ID.String()),
|
||||
Time: commitTime.Format(time.RFC3339),
|
||||
})
|
||||
}
|
||||
|
||||
var lastReviewCommitID string
|
||||
if ctx.IsSigned {
|
||||
// get last review of current user and store information in context (if available)
|
||||
lastreview, err := issues_model.FindLatestReviews(ctx, issues_model.FindReviewOptions{
|
||||
IssueID: issue.ID,
|
||||
ReviewerID: ctx.Doer.ID,
|
||||
Type: issues_model.ReviewTypeUnknown,
|
||||
})
|
||||
|
||||
if err != nil && !issues_model.IsErrReviewNotExist(err) {
|
||||
return nil, "", err
|
||||
}
|
||||
if len(lastreview) > 0 {
|
||||
lastReviewCommitID = lastreview[0].CommitID
|
||||
}
|
||||
}
|
||||
|
||||
return commits, lastReviewCommitID, nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
gitea_ctx "code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
type ContainedLinks struct { // TODO: better name?
|
||||
Branches []*namedLink `json:"branches"`
|
||||
Tags []*namedLink `json:"tags"`
|
||||
DefaultBranch string `json:"default_branch"`
|
||||
}
|
||||
|
||||
type namedLink struct { // TODO: better name?
|
||||
Name string `json:"name"`
|
||||
WebLink string `json:"web_link"`
|
||||
}
|
||||
|
||||
// LoadBranchesAndTags creates a new repository branch
|
||||
func LoadBranchesAndTags(ctx context.Context, baseRepo *gitea_ctx.Repository, commitSHA string) (*ContainedLinks, error) {
|
||||
containedTags, err := baseRepo.GitRepo.ListOccurrences(ctx, "tag", commitSHA)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encountered a problem while querying %s: %w", "tags", err)
|
||||
}
|
||||
containedBranches, err := baseRepo.GitRepo.ListOccurrences(ctx, "branch", commitSHA)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encountered a problem while querying %s: %w", "branches", err)
|
||||
}
|
||||
|
||||
result := &ContainedLinks{
|
||||
DefaultBranch: baseRepo.Repository.DefaultBranch,
|
||||
Branches: make([]*namedLink, 0, len(containedBranches)),
|
||||
Tags: make([]*namedLink, 0, len(containedTags)),
|
||||
}
|
||||
for _, tag := range containedTags {
|
||||
// TODO: Use a common method to get the link to a branch/tag instead of hard-coding it here
|
||||
result.Tags = append(result.Tags, &namedLink{
|
||||
Name: tag,
|
||||
WebLink: fmt.Sprintf("%s/src/tag/%s", baseRepo.RepoLink, util.PathEscapeSegments(tag)),
|
||||
})
|
||||
}
|
||||
for _, branch := range containedBranches {
|
||||
result.Branches = append(result.Branches, &namedLink{
|
||||
Name: branch,
|
||||
WebLink: fmt.Sprintf("%s/src/branch/%s", baseRepo.RepoLink, util.PathEscapeSegments(branch)),
|
||||
})
|
||||
}
|
||||
return result, nil
|
||||
}
|
|
@ -5,6 +5,7 @@ package webhook
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
@ -111,7 +112,11 @@ func handler(items ...int64) []int64 {
|
|||
for _, taskID := range items {
|
||||
task, err := webhook_model.GetHookTaskByID(ctx, taskID)
|
||||
if err != nil {
|
||||
log.Error("GetHookTaskByID[%d] failed: %v", taskID, err)
|
||||
if errors.Is(err, util.ErrNotExist) {
|
||||
log.Warn("GetHookTaskByID[%d] warn: %v", taskID, err)
|
||||
} else {
|
||||
log.Error("GetHookTaskByID[%d] failed: %v", taskID, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{{svg "octicon-link"}}
|
||||
<a href="{{.Website}}" rel="nofollow">{{.Website}}</a>
|
||||
{{end}}
|
||||
{{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
{{svg "octicon-calendar"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{svg "octicon-mail"}}
|
||||
<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
|
||||
{{end}}
|
||||
{{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
{{svg "octicon-calendar"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<button class="btn interact-bg gt-p-3 show-modal show-rename-branch-modal"
|
||||
data-is-default-branch="true"
|
||||
data-modal="#rename-branch-modal"
|
||||
data-old-branch-name="{{$.DefaultBranchBranch}}"
|
||||
data-old-branch-name="{{$.DefaultBranchBranch.DBBranch.Name}}"
|
||||
data-tooltip-content="{{$.locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}"
|
||||
>
|
||||
{{svg "octicon-pencil"}}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{.locale.Tr "repo.commit.contained_in_default_branch"}}">
|
||||
<button class="ui button ellipsis-button load-branches-and-tags gt-mt-3" aria-expanded="false"
|
||||
data-fetch-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags"
|
||||
data-tooltip-content="{{.locale.Tr "repo.commit.load_referencing_branches_and_tags"}}"
|
||||
>...</button>
|
||||
<div class="branch-and-tag-detail gt-hidden">
|
||||
<div class="divider"></div>
|
||||
<div>{{.locale.Tr "repo.commit.contained_in"}}</div>
|
||||
<div class="gt-df gt-mt-3">
|
||||
<div class="gt-p-2">{{svg "octicon-git-branch"}}</div>
|
||||
<div class="branch-area flex-text-block gt-f1"></div>
|
||||
</div>
|
||||
<div class="gt-df gt-mt-3">
|
||||
<div class="gt-p-2">{{svg "octicon-tag"}}</div>
|
||||
<div class="tag-area flex-text-block gt-f1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -137,12 +137,7 @@
|
|||
{{if IsMultilineCommitMessage .Commit.Message}}
|
||||
<pre class="commit-body gt-mt-0">{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
|
||||
{{end}}
|
||||
{{if .BranchName}}
|
||||
<span class="text grey gt-mr-3">{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.BranchName}}</span>
|
||||
{{end}}
|
||||
{{if .TagName}}
|
||||
<span class="text grey gt-mr-3">{{svg "octicon-tag" 16 "gt-mr-2"}}{{.TagName}}</span>
|
||||
{{end}}
|
||||
{{template "repo/commit_load_branches_and_tags" .}}
|
||||
</div>
|
||||
<div class="ui attached segment gt-df gt-ac gt-sb gt-py-2 commit-header-row gt-fw {{$class}}">
|
||||
<div class="gt-df gt-ac author">
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
{{end}}
|
||||
</span>
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
<button class="ui button ellipsis-button" aria-expanded="false">...</button>
|
||||
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
|
||||
{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<span class="gt-mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</span>
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
<button class="ui button ellipsis-button" aria-expanded="false">...</button>
|
||||
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
|
||||
{{end}}
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
<pre class="commit-body gt-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</pre>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="commits-table-right">
|
||||
<div class="commits-table-right gt-whitespace-nowrap">
|
||||
{{if .PageIsCommits}}
|
||||
<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
|
||||
<div class="ui tiny search input">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div>
|
||||
<div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac gt-fw">
|
||||
<div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac">
|
||||
<div class="gt-df gt-ac gt-fw">
|
||||
{{if not .DiffNotAvailable}}
|
||||
<button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}">
|
||||
|
@ -31,12 +31,32 @@
|
|||
{{end}}
|
||||
{{template "repo/diff/whitespace_dropdown" .}}
|
||||
{{template "repo/diff/options_dropdown" .}}
|
||||
{{if .PageIsPullFiles}}
|
||||
<div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">
|
||||
{{/*
|
||||
the following will be replaced by vue component
|
||||
but this avoids any loading artifacts till the vue component is initialized
|
||||
*/}}
|
||||
<div class="ui jump dropdown basic button custom">
|
||||
{{svg "octicon-git-commit"}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
|
||||
{{template "repo/diff/new_review" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if not .DiffNotAvailable}}
|
||||
{{if and .IsShowingOnlySingleCommit .PageIsPullFiles}}
|
||||
<div class="ui info message">
|
||||
<div>{{.locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .BeforeCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div>
|
||||
</div>
|
||||
{{else if and (not .IsShowingAllCommits) .PageIsPullFiles}}
|
||||
<div class="ui info message">
|
||||
<div>{{.locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div>
|
||||
</div>
|
||||
{{end}}
|
||||
<script id="diff-data-script" type="module">
|
||||
const diffDataFiles = [{{range $i, $file := .Diff.Files}}{Name:"{{$file.Name}}",NameHash:"{{$file.NameHash}}",Type:{{$file.Type}},IsBin:{{$file.IsBin}},Addition:{{$file.Addition}},Deletion:{{$file.Deletion}},IsViewed:{{$file.IsViewed}}},{{end}}];
|
||||
const diffData = {
|
||||
|
@ -81,8 +101,8 @@
|
|||
{{$isCsv := (call $.IsCsvFile $file)}}
|
||||
{{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
|
||||
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
|
||||
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}}
|
||||
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-3" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
|
||||
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}}
|
||||
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
|
||||
<h4 class="diff-file-header sticky-2nd-row ui top attached normal header gt-df gt-ac gt-sb gt-fw">
|
||||
<div class="diff-file-name gt-df gt-ac gt-gap-2 gt-fw">
|
||||
<button class="fold-file btn interact-bg gt-p-2{{if not $isExpandable}} gt-invisible{{end}}">
|
||||
|
@ -146,7 +166,7 @@
|
|||
{{end}}
|
||||
</div>
|
||||
</h4>
|
||||
<div class="diff-file-body ui attached unstackable table segment" {{if $file.IsViewed}}data-folded="true"{{end}}>
|
||||
<div class="diff-file-body ui attached unstackable table segment" {{if and $file.IsViewed $.IsShowingAllCommits}}data-folded="true"{{end}}>
|
||||
<div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} gt-hidden{{end}}">
|
||||
{{if or $file.IsIncomplete $file.IsBin}}
|
||||
<div class="diff-file-body binary" style="padding: 5px 10px;">
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"TextareaName" "content"
|
||||
"TextareaPlaceholder" ($.locale.Tr "repo.diff.comment.placeholder")
|
||||
"DropzoneParentContainer" "form"
|
||||
"DisableAutosize" "true"
|
||||
)}}
|
||||
|
||||
<div class="field footer gt-mx-3">
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<div id="review-box">
|
||||
<button class="ui tiny green button gt-pr-2 gt-df js-btn-review">
|
||||
<button class="ui tiny green button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
|
||||
{{.locale.Tr "repo.diff.review"}}
|
||||
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</button>
|
||||
{{if $.IsShowingAllCommits}}
|
||||
<div class="review-box-panel tippy-target">
|
||||
<div class="ui segment">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post">
|
||||
|
@ -48,4 +49,5 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
</div>
|
||||
<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
|
||||
<div class="divider"></div>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
|
||||
<a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
|
||||
<a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
|
||||
{{$previousExclusiveScope := "_no_scope"}}
|
||||
{{range .Labels}}
|
||||
{{$exclusiveScope := .ExclusiveScope}}
|
||||
|
@ -84,8 +84,8 @@
|
|||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
|
||||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}">
|
||||
</div>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a>
|
||||
<a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a>
|
||||
<a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a>
|
||||
{{if .OpenProjects}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
|
@ -141,8 +141,8 @@
|
|||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
|
||||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}">
|
||||
</div>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a>
|
||||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
|
||||
<a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
|
||||
<a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a>
|
||||
<div class="divider"></div>
|
||||
{{range .Assignees}}
|
||||
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}">
|
||||
|
|
|
@ -299,19 +299,28 @@
|
|||
{{$.CsrfTokenHtml}}
|
||||
</form>
|
||||
{{if $.IsStopwatchRunning}}
|
||||
<button class="ui fluid button issue-stop-time">{{.locale.Tr "repo.issues.stop_tracking"}}</button>
|
||||
<button class="ui fluid negative button issue-cancel-time gt-mt-3">{{.locale.Tr "repo.issues.cancel_tracking"}}</button>
|
||||
<button class="ui fluid button issue-stop-time">
|
||||
{{svg "octicon-stopwatch" 16 "gt-mr-3"}}
|
||||
{{.locale.Tr "repo.issues.stop_tracking"}}
|
||||
</button>
|
||||
<button class="ui fluid button issue-cancel-time gt-mt-3">
|
||||
{{svg "octicon-trash" 16 "gt-mr-3"}}
|
||||
{{.locale.Tr "repo.issues.cancel_tracking"}}
|
||||
</button>
|
||||
{{else}}
|
||||
{{if .HasUserStopwatch}}
|
||||
<div class="ui warning message">
|
||||
{{.locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}}
|
||||
</div>
|
||||
{{end}}
|
||||
<button class="ui fluid button issue-start-time" data-tooltip-content='{{.locale.Tr "repo.issues.start_tracking"}}'>{{.locale.Tr "repo.issues.start_tracking_short"}}</button>
|
||||
<button class="ui fluid button issue-start-time" data-tooltip-content='{{.locale.Tr "repo.issues.start_tracking"}}'>
|
||||
{{svg "octicon-stopwatch" 16 "gt-mr-3"}}
|
||||
{{.locale.Tr "repo.issues.start_tracking_short"}}
|
||||
</button>
|
||||
<div class="ui mini modal issue-start-time-modal">
|
||||
<div class="header">{{.locale.Tr "repo.issues.add_time"}}</div>
|
||||
<div class="content">
|
||||
<form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui action input fluid">
|
||||
<form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui input fluid gt-gap-3">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input placeholder='{{.locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
|
||||
<input placeholder='{{.locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
|
||||
|
@ -322,7 +331,10 @@
|
|||
<button class="ui red cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui fluid button green issue-add-time gt-mt-3" data-tooltip-content='{{.locale.Tr "repo.issues.add_time"}}'>{{.locale.Tr "repo.issues.add_time_short"}}</button>
|
||||
<button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{.locale.Tr "repo.issues.add_time"}}'>
|
||||
{{svg "octicon-plus" 16 "gt-mr-3"}}
|
||||
{{.locale.Tr "repo.issues.add_time_short"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -381,7 +393,7 @@
|
|||
<form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input required placeholder="{{.locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">
|
||||
<button class="ui green icon button">
|
||||
<button class="ui icon button">
|
||||
{{if ne .Issue.DeadlineUnix 0}}
|
||||
{{svg "octicon-pencil"}}
|
||||
{{else}}
|
||||
|
@ -417,7 +429,7 @@
|
|||
{{range .BlockingDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
||||
<a class="title" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||
</a>
|
||||
<div class="text small">
|
||||
|
@ -449,7 +461,7 @@
|
|||
{{range .BlockedByDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
||||
<a class="title" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||
</a>
|
||||
<div class="text small">
|
||||
|
@ -507,7 +519,7 @@
|
|||
<input type="text" class="search">
|
||||
<div class="default text">{{.locale.Tr "repo.issues.dependency.add"}}</div>
|
||||
</div>
|
||||
<button class="ui green icon button">
|
||||
<button class="ui icon button">
|
||||
{{svg "octicon-plus"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -643,7 +655,7 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<button class="gt-mt-2 fluid ui show-modal button negative" data-modal="#delete">
|
||||
<button class="gt-mt-2 fluid ui show-modal button" data-modal="#delete">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "repo.issues.delete"}}
|
||||
</button>
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
<td>{{TimeSince .CreatedUnix.AsTime $.locale}}</td>
|
||||
<td class="right aligned">
|
||||
<a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
|
||||
<button class="ui basic show-modal icon button" data-modal="#delete-{{.Oid}}">
|
||||
<span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{$.locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
|
||||
<button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}">
|
||||
<span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{$.locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<th class="four wide">{{.locale.Tr "repo.settings.lfs_pointers.oid"}}</th>
|
||||
<th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th>
|
||||
<th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.exists"}}</th>
|
||||
<th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
|
||||
<th class="two wide" data-tooltip-content="{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
|
||||
<th class="three wide"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="four wide column">
|
||||
<div class="ui fluid vertical menu">
|
||||
<div class="header item">{{.locale.Tr "org.settings"}}</div>
|
||||
<div class="header item">{{.locale.Tr "repo.settings"}}</div>
|
||||
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
|
||||
{{.locale.Tr "repo.settings.options"}}
|
||||
</a>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{else if .Location}}
|
||||
{{svg "octicon-location"}} {{.Location}}
|
||||
{{else}}
|
||||
{{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
{{svg "octicon-calendar"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
|
||||
{{end}}
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
{{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
|
||||
<span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
|
||||
{{if IsMultilineCommitMessage .LatestCommit.Message}}
|
||||
<button class="ui button ellipsis-button" aria-expanded="false">...</button>
|
||||
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
|
||||
<pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
|
||||
{{end}}
|
||||
</span>
|
||||
|
|
|
@ -10,6 +10,7 @@ Template Attributes:
|
|||
* TextareaPlaceholder: placeholder attribute for the textarea
|
||||
* TextareaAriaLabel: aria-label attribute for the textarea
|
||||
* DropzoneParentContainer: container for file upload (leave it empty if no upload)
|
||||
* DisableAutosize: whether to disable automatic height resizing
|
||||
*/}}
|
||||
<div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}">
|
||||
{{if .MarkdownPreviewUrl}}
|
||||
|
@ -45,7 +46,7 @@ Template Attributes:
|
|||
</div>
|
||||
</markdown-toolbar>
|
||||
<text-expander keys=": @" suffix="">
|
||||
<textarea class="markdown-text-editor js-quick-submit"{{if .TextareaName}} name="{{.TextareaName}}"{{end}}{{if .TextareaPlaceholder}} placeholder="{{.TextareaPlaceholder}}"{{end}}{{if .TextareaAriaLabel}} aria-label="{{.TextareaAriaLabel}}"{{end}}>{{.TextareaContent}}</textarea>
|
||||
<textarea class="markdown-text-editor js-quick-submit"{{if .TextareaName}} name="{{.TextareaName}}"{{end}}{{if .TextareaPlaceholder}} placeholder="{{.TextareaPlaceholder}}"{{end}}{{if .TextareaAriaLabel}} aria-label="{{.TextareaAriaLabel}}"{{end}}{{if .DisableAutosize}} data-disable-autosize="{{.DisableAutosize}}"{{end}}>{{.TextareaContent}}</textarea>
|
||||
</text-expander>
|
||||
<script>
|
||||
if (localStorage?.getItem('markdown-editor-monospace') === 'true') {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<li>{{svg "octicon-clock"}} {{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</li>
|
||||
<li>{{svg "octicon-calendar"}} {{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</li>
|
||||
{{if and .Orgs .HasOrgsVisible}}
|
||||
<li>
|
||||
<ul class="user-orgs">
|
||||
|
|
|
@ -16514,7 +16514,7 @@
|
|||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
},
|
||||
"CommitStatusState": {
|
||||
"description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"",
|
||||
"description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\" and \"failure\"",
|
||||
"type": "string",
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
},
|
||||
|
@ -17483,10 +17483,12 @@
|
|||
},
|
||||
"x-go-name": "Units",
|
||||
"example": [
|
||||
"repo.actions",
|
||||
"repo.code",
|
||||
"repo.issues",
|
||||
"repo.ext_issues",
|
||||
"repo.wiki",
|
||||
"repo.ext_wiki",
|
||||
"repo.pulls",
|
||||
"repo.releases",
|
||||
"repo.projects",
|
||||
|
@ -17499,16 +17501,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"x-go-name": "UnitsMap",
|
||||
"example": {
|
||||
"repo.code": "read",
|
||||
"repo.ext_issues": "none",
|
||||
"repo.ext_wiki": "none",
|
||||
"repo.issues": "write",
|
||||
"repo.projects": "none",
|
||||
"repo.pulls": "owner",
|
||||
"repo.releases": "none",
|
||||
"repo.wiki": "admin"
|
||||
}
|
||||
"example": "{\"repo.actions\",\"repo.packages\",\"repo.code\":\"read\",\"repo.issues\":\"write\",\"repo.ext_issues\":\"none\",\"repo.wiki\":\"admin\",\"repo.pulls\":\"owner\",\"repo.releases\":\"none\",\"repo.projects\":\"none\",\"repo.ext_wiki\":\"none\"}"
|
||||
}
|
||||
},
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="four wide column">
|
||||
<div class="ui fluid vertical menu">
|
||||
<div class="header item">{{.locale.Tr "org.settings"}}</div>
|
||||
<div class="header item">{{.locale.Tr "settings"}}</div>
|
||||
<a class="{{if .PageIsSettingsProfile}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
||||
{{.locale.Tr "settings.profile"}}
|
||||
</a>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/main
|
|
@ -0,0 +1,4 @@
|
|||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = true
|
|
@ -0,0 +1 @@
|
|||
Unnamed repository; edit this file 'description' to name the repository.
|
|
@ -0,0 +1,6 @@
|
|||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
|
@ -0,0 +1,3 @@
|
|||
1978192d98bb1b65e11c2cf37da854fbf94bffd6 refs/heads/branch1
|
||||
cbff181af4c9c7fee3cf6c106699e07d9a3f54e6 refs/heads/main
|
||||
1978192d98bb1b65e11c2cf37da854fbf94bffd6 refs/pull/1/head
|
|
@ -0,0 +1 @@
|
|||
0000000000000000000000000000000000000000 cbff181af4c9c7fee3cf6c106699e07d9a3f54e6 Gitea <gitea@fake.local> 1688672318 +0200
|
|
@ -0,0 +1 @@
|
|||
0000000000000000000000000000000000000000 1978192d98bb1b65e11c2cf37da854fbf94bffd6 Gitea <gitea@fake.local> 1688672383 +0200 push
|
|
@ -0,0 +1 @@
|
|||
0000000000000000000000000000000000000000 cbff181af4c9c7fee3cf6c106699e07d9a3f54e6 root <sauer.sebastian@gmail.com> 1688672317 +0200 push
|
|
@ -0,0 +1,2 @@
|
|||
x¥ŽA
|
||||
Â0E]ç³$™´™D¼ƒ'˜If´`´éýOàêÁƒ÷ùež¦±váÐUˆC©\Q;_ò<5F>™…%VÏHÆæ<C386>DS Ú»7/újPú„ÉJV³žT‚ å$>Ô®zC‹Foí1/pSáµ<C3A1>ü‚oºÀyýâ´þôõ>ñø<•yº@HÃ<48>#E8zôÞív?Ûöì¯×tmйJÝNê
|