]> source.dussan.org Git - gitea.git/log
gitea.git
7 months agoRefactor the "attachments" sub-template data key to RenderedContent (#29517)
wxiaoguang [Fri, 1 Mar 2024 10:56:29 +0000 (18:56 +0800)]
Refactor the "attachments" sub-template data key to RenderedContent (#29517)

The value passed into "attachments" sub-template is from
"RedneredContent", so use the same name for consistent. And it makes
readers easy to know its data type.

7 months agoRename Str2html to SanitizeHTML and clarify its behavior (#29516)
wxiaoguang [Fri, 1 Mar 2024 10:16:19 +0000 (18:16 +0800)]
Rename Str2html to SanitizeHTML and clarify its behavior (#29516)

Str2html was abused a lot. So use a proper name for it: SanitizeHTML

And add some tests to show its behavior.

7 months agoAdd admin API route for managing user's badges (#23106)
techknowlogick [Fri, 1 Mar 2024 08:23:28 +0000 (03:23 -0500)]
Add admin API route for managing user's badges (#23106)

Fix #22785

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoRefactor some Str2html code (#29397)
wxiaoguang [Fri, 1 Mar 2024 07:11:51 +0000 (15:11 +0800)]
Refactor some Str2html code (#29397)

This PR touches the most interesting part of the "template refactoring".

1. Unclear variable type. Especially for "web/feed/convert.go":
sometimes it uses text, sometimes it uses HTML.
2. Assign text content to "RenderedContent" field, for example: `
project.RenderedContent = project.Description` in web/org/projects.go
3. Assign rendered content to text field, for example: `r.Note =
rendered content` in web/repo/release.go
4. (possible) Incorrectly calling `{{Str2html
.PackageDescriptor.Metadata.ReleaseNotes}}` in
package/content/nuget.tmpl, I guess the name Str2html misleads
developers to use it to "render string to html", but it only sanitizes.
if ReleaseNotes really contains HTML, then this is not a problem.

7 months agoMove migration functions to services layer (#29497)
Lunny Xiao [Fri, 1 Mar 2024 02:23:00 +0000 (10:23 +0800)]
Move migration functions to services layer (#29497)

7 months agoDon’t comment when locking (#29508)
techknowlogick [Fri, 1 Mar 2024 01:43:42 +0000 (20:43 -0500)]
Don’t comment when locking (#29508)

This reduces the number of emails/notifications on outdated issues.

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 1 Mar 2024 00:27:12 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

7 months agomigrate some more "OptionalBool" to "Option[bool]" (#29479)
6543 [Thu, 29 Feb 2024 18:52:49 +0000 (19:52 +0100)]
migrate some more "OptionalBool" to "Option[bool]" (#29479)

just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoUpdate FAQ about git hook problems (#29495)
Jason Song [Thu, 29 Feb 2024 14:16:02 +0000 (22:16 +0800)]
Update FAQ about git hook problems (#29495)

Close
https://github.com/go-gitea/gitea/issues/29338#issuecomment-1970363817

7 months agoLighten text colors on dark theme for increased contrast (#29481)
silverwind [Thu, 29 Feb 2024 05:11:11 +0000 (06:11 +0100)]
Lighten text colors on dark theme for increased contrast (#29481)

Improve contrast by lightening the text colors in dark theme by around
35%. Additionally, share some variables that had the same or similar
color, which will ease future theme creation.

7 months agoFix wrong test usage of `AppSubURL` (#29459)
KN4CK3R [Thu, 29 Feb 2024 03:39:24 +0000 (04:39 +0100)]
Fix wrong test usage of `AppSubURL` (#29459)

The tests use an invalid `setting.AppSubURL`. The wrong behaviour
disturbs other PRs like #29222 and #29427.

7 months agoImprove contrast on blame timestamp, fix double border (#29482)
silverwind [Thu, 29 Feb 2024 02:00:33 +0000 (03:00 +0100)]
Improve contrast on blame timestamp, fix double border (#29482)

Before, double border on top, bad contrast on dark:
<img width="155" alt="Screenshot 2024-02-29 at 02 06 17"
src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb">
<img width="126" alt="Screenshot 2024-02-29 at 02 07 28"
src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16">

After, no double border on top, good contrast:
<img width="154" alt="Screenshot 2024-02-29 at 02 20 20"
src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac">
<img width="147" alt="Screenshot 2024-02-29 at 02 20 38"
src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">

7 months agoFix/Improve `processWindowErrorEvent` (#29407)
silverwind [Wed, 28 Feb 2024 22:20:53 +0000 (23:20 +0100)]
Fix/Improve `processWindowErrorEvent` (#29407)

- `e.error` can be undefined in some cases which would raise an error
inside this error handler, fixed that.
- The displayed message mentions looking into the console, but in my
case of error from `ResizeObserver` there was nothing there, so add this
logging. I think this logging was once there but got lost during
refactoring.

7 months agoApply compact padding to small buttons with svg icons (#29471)
silverwind [Wed, 28 Feb 2024 20:26:12 +0000 (21:26 +0100)]
Apply compact padding to small buttons with svg icons (#29471)

The buttons on the repo release tab were larger in height than on other
tabs because one of them contained the RSS icon which stretched the
button height by 3px. Workaround this problem by applying the "compact"
padding to any such button. They are within 0.4px in height now to
non-icon buttons.

Before:

<img width="406" alt="Screenshot 2024-02-28 at 15 30 23"
src="https://github.com/go-gitea/gitea/assets/115237/805bb93a-6fe4-40a0-82d1-03001bee8ecf">

After:

<img width="407" alt="Screenshot 2024-02-28 at 15 38 43"
src="https://github.com/go-gitea/gitea/assets/115237/27707588-890f-4852-ab08-105a57eda880">

For comparison, button on issue tab:

<img width="452" alt="Screenshot 2024-02-28 at 15 31 46"
src="https://github.com/go-gitea/gitea/assets/115237/74ac13d5-d016-49ba-9dd9-40ed32a748e9">

7 months agoFix counter display number incorrectly displayed on the page (#29448)
charles [Wed, 28 Feb 2024 20:23:49 +0000 (04:23 +0800)]
Fix counter display number incorrectly displayed on the page (#29448)

issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

7 months agoFix incorrect user location link on profile page (#29474)
wxiaoguang [Wed, 28 Feb 2024 16:03:06 +0000 (00:03 +0800)]
Fix incorrect user location link on profile page (#29474)

Fix #29472. Regression of #29236, a "if" check was missing.

7 months agoFix workflow trigger event bugs (#29467)
Zettat123 [Wed, 28 Feb 2024 15:35:04 +0000 (23:35 +0800)]
Fix workflow trigger event bugs (#29467)

1. Fix incorrect `HookEventType` for issue-related events in
`IssueChangeAssignee`
2. Add `case "types"` in the `switch` block in `matchPullRequestEvent`
to avoid warning logs

7 months agoFix URL calculation in clone input box (#29470)
silverwind [Wed, 28 Feb 2024 15:04:04 +0000 (16:04 +0100)]
Fix URL calculation in clone input box (#29470)

Ported the function as-is and added comments so we don't forget about
this in the future.

Fixes: https://github.com/go-gitea/gitea/issues/29462
7 months agoRemove jQuery from the "find file" page (#29456)
Yarden Shoham [Wed, 28 Feb 2024 14:11:54 +0000 (16:11 +0200)]
Remove jQuery from the "find file" page (#29456)

- Switched to plain JavaScript
- Tested the file searching functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/8ceef0ed-ab87-448c-8b9b-9b5c0cd8bebd)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoMove generate from module to service (#29465)
Lunny Xiao [Wed, 28 Feb 2024 13:40:36 +0000 (21:40 +0800)]
Move generate from module to service (#29465)

7 months agoThe job should always run when `if` is `always()` (#29464)
Zettat123 [Wed, 28 Feb 2024 10:54:44 +0000 (18:54 +0800)]
The job should always run when `if` is `always()` (#29464)

Fix #27906

According to GitHub's
[documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds),
a job should always run when its `if` is `always()`

> If you would like a job to run even if a job it is dependent on did
not succeed, use the `always()` conditional expression in
`jobs.<job_id>.if`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRecolor dark theme to blue shade (#29283)
silverwind [Wed, 28 Feb 2024 10:16:15 +0000 (11:16 +0100)]
Recolor dark theme to blue shade (#29283)

Now uses the same primary color as light theme. The secondary colors are
shifted towards a slightly blue shade. Could maybe desaturate a bit
more, but overall I think I'm happy with it.

Fixes: https://github.com/go-gitea/gitea/issues/27097
<img width="1343" alt="Screenshot 2024-02-27 at 22 21 46"
src="https://github.com/go-gitea/gitea/assets/115237/4163c393-b469-4a53-8f4b-1c33aa04f3ac">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/e621f7f8-5679-4605-bf42-3d5ff1071e1e">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/20e66493-2457-482b-b8f1-e5710934e189">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoLet ctx.FormOptionalBool() return optional.Option[bool] (#29461)
6543 [Wed, 28 Feb 2024 05:39:12 +0000 (06:39 +0100)]
Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)

just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

7 months agoImplement actions badge svgs (#28102)
Nanguan Lin [Tue, 27 Feb 2024 17:56:18 +0000 (01:56 +0800)]
Implement actions badge svgs (#28102)

replace #27187
close #23688
The badge has two parts: label(workflow name) and message(action
status). 5 colors are provided with 7 statuses.
Color mapping:
```go
var statusColorMap = map[actions_model.Status]string{
actions_model.StatusSuccess:   "#4c1",    // Green
actions_model.StatusSkipped:   "#dfb317", // Yellow
actions_model.StatusUnknown:   "#97ca00", // Light Green
actions_model.StatusFailure:   "#e05d44", // Red
actions_model.StatusCancelled: "#fe7d37", // Orange
actions_model.StatusWaiting:   "#dfb317", // Yellow
actions_model.StatusRunning:   "#dfb317", // Yellow
actions_model.StatusBlocked:   "#dfb317", // Yellow
}
```
preview:

![1](https://github.com/go-gitea/gitea/assets/70063547/5465cbaf-23cd-4437-9848-2738c3cb8985)

![2](https://github.com/go-gitea/gitea/assets/70063547/ec393d26-c6e6-4d38-b72c-51f2494c5e71)

![3](https://github.com/go-gitea/gitea/assets/70063547/3edb4fdf-1b08-4a02-ab2a-6bdd7f532fb2)

![4](https://github.com/go-gitea/gitea/assets/70063547/8c189de2-2169-4251-b115-0e39a52f3df8)

![5](https://github.com/go-gitea/gitea/assets/70063547/3fe22c73-c2d7-4fec-9ea4-c501a1e4e3bd)

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoFix missed return (#29450)
Lunny Xiao [Tue, 27 Feb 2024 15:09:13 +0000 (23:09 +0800)]
Fix missed return (#29450)

7 months agoUse tailwind instead of `gt-[wh]-` helper classes (#29423)
Lunny Xiao [Tue, 27 Feb 2024 14:31:41 +0000 (22:31 +0800)]
Use tailwind instead of `gt-[wh]-` helper classes (#29423)

Follow #29357
- Replace `gt-w-*` -> `tw-w-*` and remove `gt-w-*`
- Replace `gt-h-*` -> `tw-h-*` and remove `gt-h-*`

7 months agoLock issues and pulls faster (#29436)
6543 [Tue, 27 Feb 2024 11:51:51 +0000 (12:51 +0100)]
Lock issues and pulls faster (#29436)

also point to the docs to explain why we do so

followup to  #29433

7 months agoAllow to change primary email before account activation (#29412)
wxiaoguang [Tue, 27 Feb 2024 10:55:13 +0000 (18:55 +0800)]
Allow to change primary email before account activation (#29412)

7 months agoUpdate docs about `DEFAULT_ACTIONS_URL` (#29442)
Jason Song [Tue, 27 Feb 2024 09:18:35 +0000 (17:18 +0800)]
Update docs about `DEFAULT_ACTIONS_URL` (#29442)

Follow #25581.

7 months agoOnly use supported sort order for "explore/users" page (#29430)
wxiaoguang [Tue, 27 Feb 2024 09:10:51 +0000 (17:10 +0800)]
Only use supported sort order for "explore/users" page (#29430)

Thanks to inferenceus : some sort orders on the "explore/users" page
could list users by their lastlogintime/updatetime.

It leaks user's activity unintentionally. This PR makes that page only
use "supported" sort orders.

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.

![image](https://github.com/go-gitea/gitea/assets/2114189/ce5c39c1-1e86-484a-80c3-33cac6419af8)

7 months agoNot trigger all jobs any more, when re-running the first job (#29439)
sillyguodong [Tue, 27 Feb 2024 07:40:21 +0000 (15:40 +0800)]
Not trigger all jobs any more, when re-running the first job (#29439)

Previously, it will be treated as "re-run all jobs" when `jobIndex ==
0`. So when you click re-run button on the first job, it triggers all
the jobs actually.

7 months agoMove context from modules to services (#29440)
Lunny Xiao [Tue, 27 Feb 2024 07:12:22 +0000 (15:12 +0800)]
Move context from modules to services (#29440)

Since `modules/context` has to depend on `models` and many other
packages, it should be moved from `modules/context` to
`services/context` according to design principles. There is no logic
code change on this PR, only move packages.

- Move `code.gitea.io/gitea/modules/context` to
`code.gitea.io/gitea/services/context`
- Move `code.gitea.io/gitea/modules/contexttest` to
`code.gitea.io/gitea/services/contexttest` because of depending on
context
- Move `code.gitea.io/gitea/modules/upload` to
`code.gitea.io/gitea/services/context/upload` because of depending on
context

7 months agoApply tailwindcss rules with `!important` (#29437)
silverwind [Tue, 27 Feb 2024 03:04:46 +0000 (04:04 +0100)]
Apply tailwindcss rules with `!important` (#29437)

As per discussion in https://github.com/go-gitea/gitea/pull/29423, I
think this is the right way that does not burden developers having to
think about CSS precedence which should be irrelevant with an atomic CSS
framework.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix mail template error (#29410)
wxiaoguang [Mon, 26 Feb 2024 22:31:30 +0000 (06:31 +0800)]
Fix mail template error (#29410)

7 months agoDocument our issue locking policy (#29433)
delvh [Mon, 26 Feb 2024 22:04:44 +0000 (23:04 +0100)]
Document our issue locking policy (#29433)

7 months agoFix htmx rendering the login page in frame on session logout (#29405)
Yarden Shoham [Mon, 26 Feb 2024 12:40:41 +0000 (14:40 +0200)]
Fix htmx rendering the login page in frame on session logout (#29405)

- Fix #29391

With this change, htmx will not follow the redirect in the AJAX request
but instead redirect the whole browser.

To reproduce the bug fixed by this change without waiting a long time
for the token to expire, you can logout in another tab then look in the
original tab. Just make sure to comment out both instances of
`window.location.href = appSubUrl` in the codebase so you won't be
redirected immediately on logout. This is what I did in the following
gifs.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoIgnore empty repo for CreateRepository in action notifier (#29416)
yp05327 [Mon, 26 Feb 2024 09:38:15 +0000 (18:38 +0900)]
Ignore empty repo for CreateRepository in action notifier (#29416)

Fix #29415

7 months agoFix incorrect tree path value for patch editor (#29377)
wxiaoguang [Mon, 26 Feb 2024 09:05:22 +0000 (17:05 +0800)]
Fix incorrect tree path value for patch editor (#29377)

Regression of #18718. When submitting the form,
EditRepoFileForm.TreePath is marked as "Required", so the value can't be
empty. The value is not used by backend, so use a meaningful dummy value
for it.

7 months agoFix logic error from #28138 (#29417)
yp05327 [Mon, 26 Feb 2024 08:10:14 +0000 (17:10 +0900)]
Fix logic error from #28138 (#29417)

There's a miss in #28138:

![image](https://github.com/go-gitea/gitea/assets/18380374/b1e0c5fc-0e6e-44ab-9f6e-34bc8ffbe1cc)

https://github.com/go-gitea/gitea/pull/28138/files#diff-2556e62ad7204a230c91927a3f2115e25a2b688240d0ee1de6d34f0277f37dfeR162

@lunny
Not sure about the impact of this, but it will only effect 1.22, and
maybe we should fix it ASAP.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoInclude resource state events in Gitlab downloads (#29382)
Sebastian Brückner [Mon, 26 Feb 2024 04:08:21 +0000 (04:08 +0000)]
Include resource state events in Gitlab downloads (#29382)

Some specific events on Gitlab issues and merge requests are stored
separately from comments as "resource state events". With this change,
all relevant resource state events are downloaded during issue and merge
request migration, and converted to comments.

This PR also updates the template used to render comments to add support
for migrated comments of these types.

ref: https://docs.gitlab.com/ee/api/resource_state_events.html

7 months agoAdd API to get PR by base/head (#29242)
qwerty287 [Mon, 26 Feb 2024 02:39:01 +0000 (03:39 +0100)]
Add API to get PR by base/head (#29242)

Closes https://github.com/go-gitea/gitea/issues/16289

Add a new API `/repos/{owner}/{repo}/pulls/{base}/{head}` to get a PR by
its base and head branch.

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 26 Feb 2024 00:24:51 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoImprove Documentation for Restoration from backup (#29321)
kralo [Sun, 25 Feb 2024 23:35:52 +0000 (00:35 +0100)]
Improve Documentation for Restoration from backup (#29321)

Comment the default path for repos and suggest using doctor for when
things are stuck

7 months agoRefactor "user/active" related logic (#29390)
wxiaoguang [Sun, 25 Feb 2024 21:55:00 +0000 (05:55 +0800)]
Refactor "user/active" related logic (#29390)

And add more tests. Remove a lot of fragile "if" blocks.

The old logic is kept as-is.

7 months agoRemove jQuery AJAX from the archive download links (#29380)
Yarden Shoham [Sun, 25 Feb 2024 16:53:44 +0000 (18:53 +0200)]
Remove jQuery AJAX from the archive download links (#29380)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo archive download links dropdown functionality and it
works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/db791249-bca1-4d22-ac5e-623f68023e15)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoAdd tailwindcss (#29357)
silverwind [Sun, 25 Feb 2024 16:46:46 +0000 (17:46 +0100)]
Add tailwindcss (#29357)

This will get tailwindcss working on a basic level. It provides only the
utility classes, e.g. no tailwind base which we don't need because we
have our own CSS reset. Without the base, we also do not have their CSS
variables so a small amount of features do not work and I removed the
generated classes for them.

***Note for future developers: This currently uses a `tw-` prefix, so we
use it like `tw-p-3`.***

<details>
<summary>Currently added CSS, all false-positives</summary>

```
.\!visible{

    visibility: visible !important
}

.visible{

    visibility: visible
}

.invisible{

    visibility: hidden
}

.collapse{

    visibility: collapse
}

.static{

    position: static
}

.\!fixed{

    position: fixed !important
}

.absolute{

    position: absolute
}

.relative{

    position: relative
}

.sticky{

    position: sticky
}

.left-10{

    left: 2.5rem
}

.isolate{

    isolation: isolate
}

.float-right{

    float: right
}

.float-left{

    float: left
}

.mr-2{

    margin-right: 0.5rem
}

.mr-3{

    margin-right: 0.75rem
}

.\!block{

    display: block !important
}

.block{

    display: block
}

.inline-block{

    display: inline-block
}

.inline{

    display: inline
}

.flex{

    display: flex
}

.inline-flex{

    display: inline-flex
}

.\!table{

    display: table !important
}

.inline-table{

    display: inline-table
}

.table-caption{

    display: table-caption
}

.table-cell{

    display: table-cell
}

.table-column{

    display: table-column
}

.table-column-group{

    display: table-column-group
}

.table-footer-group{

    display: table-footer-group
}

.table-header-group{

    display: table-header-group
}

.table-row-group{

    display: table-row-group
}

.table-row{

    display: table-row
}

.flow-root{

    display: flow-root
}

.inline-grid{

    display: inline-grid
}

.contents{

    display: contents
}

.list-item{

    display: list-item
}

.\!hidden{

    display: none !important
}

.hidden{

    display: none
}

.flex-shrink{

    flex-shrink: 1
}

.shrink{

    flex-shrink: 1
}

.flex-grow{

    flex-grow: 1
}

.grow{

    flex-grow: 1
}

.border-collapse{

    border-collapse: collapse
}

.select-all{

    user-select: all
}

.resize{

    resize: both
}

.flex-wrap{

    flex-wrap: wrap
}

.overflow-visible{

    overflow: visible
}

.rounded{

    border-radius: 0.25rem
}

.border{

    border-width: 1px
}

.text-justify{

    text-align: justify
}

.uppercase{

    text-transform: uppercase
}

.lowercase{

    text-transform: lowercase
}

.capitalize{

    text-transform: capitalize
}

.italic{

    font-style: italic
}

.text-red{

    color: var(--color-red)
}

.text-shadow{

    color: var(--color-shadow)
}

.underline{

    text-decoration-line: underline
}

.overline{

    text-decoration-line: overline
}

.line-through{

    text-decoration-line: line-through
}

.outline{

    outline-style: solid
}

.ease-in{

    transition-timing-function: cubic-bezier(0.4, 0, 1, 1)
}

.ease-in-out{

    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
}

.ease-out{

    transition-timing-function: cubic-bezier(0, 0, 0.2, 1)
}
```

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoAdd missing space (#29393)
KN4CK3R [Sun, 25 Feb 2024 15:42:36 +0000 (16:42 +0100)]
Add missing space (#29393)

7 months agoIntegrate alpine `noarch` packages into other architectures index (#29137)
KN4CK3R [Sun, 25 Feb 2024 15:10:55 +0000 (16:10 +0100)]
Integrate alpine `noarch` packages into other architectures index (#29137)

Fixes #26691
Revert #24972

The alpine package manager expects `noarch` packages in the index of
other architectures too.

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoenforce maxlength in frontend (#29389)
Tim-Niclas Oelschläger [Sun, 25 Feb 2024 14:31:15 +0000 (15:31 +0100)]
enforce maxlength in frontend (#29389)

Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

7 months agoRemove incorrect and unnecessary Escape from templates (#29394)
wxiaoguang [Sun, 25 Feb 2024 14:02:20 +0000 (22:02 +0800)]
Remove incorrect and unnecessary Escape from templates (#29394)

Follow #29165

* some of them are incorrect, which would lead to double escaping (eg:
`(print (Escape $.RepoLink)`)
* other of them are not necessary, because `Tr` handles strings&HTML
automatically

Suggest to review by "unified view":
https://github.com/go-gitea/gitea/pull/29394/files?diff=unified&w=0

7 months agoMake actions animation rotate counterclockwisely (#29378)
wxiaoguang [Sun, 25 Feb 2024 13:37:35 +0000 (21:37 +0800)]
Make actions animation rotate counterclockwisely (#29378)

Because the icon is:

![image](https://github.com/go-gitea/gitea/assets/2114189/be7e78ab-bc64-46d9-8259-fd7f0037471a)

So it must rotate counterclockwisely

7 months agoUse `crypto/sha256` (#29386)
KN4CK3R [Sun, 25 Feb 2024 13:32:13 +0000 (14:32 +0100)]
Use `crypto/sha256` (#29386)

Go 1.21 improved the performance of `crypto/sha256`. It's now similar to
`minio/sha256-simd`, so we should just use the standard libs.

https://go.dev/doc/go1.21#crypto/sha256
https://go-review.googlesource.com/c/go/+/408795
https://github.com/multiformats/go-multihash/pull/173

7 months agoAdd `io.Closer` guidelines (#29387)
KN4CK3R [Sun, 25 Feb 2024 13:05:23 +0000 (14:05 +0100)]
Add `io.Closer` guidelines (#29387)

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRemove jQuery AJAX from the notice selection deletion button (#29381)
Yarden Shoham [Sun, 25 Feb 2024 12:36:11 +0000 (14:36 +0200)]
Remove jQuery AJAX from the notice selection deletion button (#29381)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo notice selection deletion button functionality and it
works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRefactor Safe modifier (#29392)
wxiaoguang [Sun, 25 Feb 2024 10:45:56 +0000 (18:45 +0800)]
Refactor Safe modifier (#29392)

After this PR: no need to play with the Safe/Escape tricks anymore. See
the changes for more details.

7 months agoAdd attachment support for code review comments (#29220)
Jimmy Praet [Sun, 25 Feb 2024 06:00:55 +0000 (07:00 +0100)]
Add attachment support for code review comments (#29220)

Fixes #27960, #24411, #12183

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor modules/git global variables (#29376)
wxiaoguang [Sun, 25 Feb 2024 05:35:47 +0000 (13:35 +0800)]
Refactor modules/git global variables (#29376)

Move some global variables into a struct to improve maintainability

7 months agoRemove jQuery from the code diff expansion buttons (#29385)
Yarden Shoham [Sun, 25 Feb 2024 05:07:23 +0000 (07:07 +0200)]
Remove jQuery from the code diff expansion buttons (#29385)

- Removed all jQuery AJAX calls and replaced with htmx
- Tested the code diff expansion buttons functionality and it works as
before plus a loading indicator

# Demo using `htmx` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/afba7442-ed56-4d39-b764-835d1f6c3a9c)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRemove jQuery AJAX from the markdown editor preview (#29384)
Yarden Shoham [Sun, 25 Feb 2024 04:42:29 +0000 (06:42 +0200)]
Remove jQuery AJAX from the markdown editor preview (#29384)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the markdown editor preview button functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/3fc7abb8-4fdc-46e9-95f6-087d9526bb52)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoRefactor `copy` button event handler (#29379)
wxiaoguang [Sun, 25 Feb 2024 04:17:11 +0000 (12:17 +0800)]
Refactor `copy` button event handler (#29379)

Use "closest" instead of "for-loop"

7 months agoRemove jQuery AJAX from the repo commit graph (#29373)
Yarden Shoham [Sun, 25 Feb 2024 04:09:55 +0000 (06:09 +0200)]
Remove jQuery AJAX from the repo commit graph (#29373)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/7e2f166e-9941-4f26-9666-d00cdf3d9f60)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoMove citiation button to proper place (#29374)
wxiaoguang [Sun, 25 Feb 2024 00:13:04 +0000 (08:13 +0800)]
Move citiation button to proper place (#29374)

The citiation button shouldn't be controlled by
DisableDownloadSourceArchives (line 134)

So move it out of that "if" block.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery AJAX from repo collaborator mode dropdown (#29371)
Yarden Shoham [Sat, 24 Feb 2024 23:08:51 +0000 (01:08 +0200)]
Remove jQuery AJAX from repo collaborator mode dropdown (#29371)

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/04466629-19b2-4469-9231-38820ee13c36)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove RenderEmojiPlain from template helper (#29375)
wxiaoguang [Sat, 24 Feb 2024 22:34:51 +0000 (06:34 +0800)]
Remove RenderEmojiPlain from template helper (#29375)

RenderEmojiPlain(emoji.ReplaceAliases) should be called explicitly for
some contents, but not for everything.

Actually in modern days, in most cases it doesn't need such
"ReplaceAliases". So only keep it for issue/PR titles.

If anyone really needs to do ReplaceAliases for some contents, I will
propose a following fix.

7 months agoApply to become a maintainer (zokkis) (#29383)
Tim-Nicas Oelschläger [Sat, 24 Feb 2024 20:19:49 +0000 (21:19 +0100)]
Apply to become a maintainer (zokkis) (#29383)

7 months agoRemove jQuery from the Unicode escape button (#29369)
Yarden Shoham [Sat, 24 Feb 2024 19:11:51 +0000 (21:11 +0200)]
Remove jQuery from the Unicode escape button (#29369)

- Switched to plain JavaScript
- Tested the Unicode escape button functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/664f0ced-876b-4cb7-a668-bd62169fc843)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor git attributes (#29356)
KN4CK3R [Sat, 24 Feb 2024 18:46:49 +0000 (19:46 +0100)]
Refactor git attributes (#29356)

7 months agoUsers with `read` permission of pull requests can be assigned too (#27263)
Lunny Xiao [Sat, 24 Feb 2024 14:14:48 +0000 (22:14 +0800)]
Users with `read` permission of pull requests can be assigned too (#27263)

This PR will also keep the consistent between list assigned users and
check assigned users.

7 months agoCustomizable "Open with" applications for repository clone (#29320)
wxiaoguang [Sat, 24 Feb 2024 13:12:17 +0000 (21:12 +0800)]
Customizable "Open with" applications for repository clone (#29320)

Users could customize the "clone" menu with their own application URLs on the admin panel.

Replace #22378
Close #21121
Close #22149

7 months agoAllow non-admin users to delete review requests (#29057)
Zettat123 [Sat, 24 Feb 2024 12:38:43 +0000 (20:38 +0800)]
Allow non-admin users to delete review requests (#29057)

Fix #14459

The following users can add/remove review requests of a PR
- the poster of the PR
- the owner or collaborators of the repository
- members with read permission on the pull requests unit

7 months agoRemove jQuery from the issue reference context popup (#29367)
Yarden Shoham [Sat, 24 Feb 2024 12:03:53 +0000 (14:03 +0200)]
Remove jQuery from the issue reference context popup (#29367)

- Removed all jQuery calls
- Tested the context popup functionality and it works as before

# Demo without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/90b53de5-a8e9-4ed7-9236-1c9dfc324f38)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoDo not double close reader (#29354)
KN4CK3R [Sat, 24 Feb 2024 11:45:59 +0000 (12:45 +0100)]
Do not double close reader (#29354)

Fixes #29346

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoImplement recent commits graph (#29210)
Şahin Akkaya [Sat, 24 Feb 2024 10:22:51 +0000 (13:22 +0300)]
Implement recent commits graph (#29210)

This is the implementation of Recent Commits page. This feature was
mentioned on #18262.

It adds another tab to Activity page called Recent Commits. Recent
Commits tab shows number of commits since last year for the repository.

7 months agoAdd API to get merged PR of a commit (#29243)
qwerty287 [Sat, 24 Feb 2024 08:18:39 +0000 (09:18 +0100)]
Add API to get merged PR of a commit (#29243)

Adds a new API `/repos/{owner}/{repo}/commits/{sha}/pull` that allows
you to get the merged PR associated to a commit.

---------

Co-authored-by: 6543 <6543@obermui.de>
7 months agoProperly migrate target branch change GitLab comment (#29340)
Sebastian Brückner [Sat, 24 Feb 2024 07:49:16 +0000 (07:49 +0000)]
Properly migrate target branch change GitLab comment (#29340)

GitLab generates "system notes" whenever an event happens within the
platform. Unlike Gitea, those events are stored and retrieved as text
comments with no semantic details. The only way to tell whether a
comment was generated in this manner is the `system` flag on the note
type.

This PR adds detection for a new specific kind of event: Changing the
target branch of a PR. When detected, it is downloaded using Gitea's
type for this event, and eventually uploaded into Gitea in the expected
format, i.e. with no text content in the comment.

This PR also updates the template used to render comments to add support
for migrated comments of this type.

ref:
https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L102

7 months agoUse the database object format name but not read from git repoisitory everytime and...
Lunny Xiao [Sat, 24 Feb 2024 06:55:19 +0000 (14:55 +0800)]
Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294)

Now we can get object format name from git command line or from the
database repository table. Assume the column is right, we don't need to
read from git command line every time.

This also fixed a possible bug that the object format is wrong when
migrating a sha256 repository from external.

<img width="658" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/6e9a9dcf-13bf-4267-928b-6bf2c2560423">

7 months agoRevert "Support SAML authentication (#25165)" (#29358)
6543 [Sat, 24 Feb 2024 04:18:49 +0000 (05:18 +0100)]
Revert "Support SAML authentication (#25165)" (#29358)

This reverts #25165 (5bb8d1924d77c675467694de26697b876d709a17), as there
was a chance some important reviews got missed.

so after reverting this patch it will be resubmitted for reviewing again

https://github.com/go-gitea/gitea/pull/25165#issuecomment-1960670242

temporary Open #5512 again

7 months agoImplement code frequency graph (#29191)
Şahin Akkaya [Fri, 23 Feb 2024 23:41:24 +0000 (02:41 +0300)]
Implement code frequency graph (#29191)

### Overview
This is the implementation of Code Frequency page. This feature was
mentioned on these issues: #18262, #7392.

It adds another tab to Activity page called Code Frequency. Code
Frequency tab shows additions and deletions over time since the
repository existed.

Before:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/2603504f-aee7-4929-a8c4-fb3412a7a0f6">

After:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/58c03721-729f-4536-a663-9f337f240963">

---

#### Features
- See additions deletions over time since repository existed
- Click on "Additions" or "Deletions" legend to show only one type of
contribution
- Use the same cache from Contributors page so that the loading of data
will be fast once it is cached by visiting either one of the pages

---------

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix validity of the FROM email address not being checked (#29347)
Carlos Felgueiras [Fri, 23 Feb 2024 23:02:14 +0000 (00:02 +0100)]
Fix validity of the FROM email address not being checked (#29347)

Fixes #27188.
Introduces a check on the installation that tries to parse the FROM
address. If it fails, shows a new error message to the user.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRefactor generate-svg.js (#29348)
silverwind [Fri, 23 Feb 2024 22:07:27 +0000 (23:07 +0100)]
Refactor generate-svg.js (#29348)

Small refactor to avoid `process` global and to sync it with
`generate-images`.

7 months agoMake optional.Option[T] type serializable (#29282)
6543 [Fri, 23 Feb 2024 21:51:46 +0000 (22:51 +0100)]
Make optional.Option[T] type serializable (#29282)

make the generic `Option` type de-/serializable for json and yaml

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRemove jQuery from the stopwatch (#29351)
Yarden Shoham [Fri, 23 Feb 2024 21:19:54 +0000 (23:19 +0200)]
Remove jQuery from the stopwatch (#29351)

- Switched to plain JavaScript
- Tested the stopwatch functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/c8e9a401-45e5-4a1d-a683-0d655f1d570e)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoFix tarball/zipball download bug (#29342)
Zettat123 [Fri, 23 Feb 2024 17:49:46 +0000 (01:49 +0800)]
Fix tarball/zipball download bug (#29342)

Fix #29249

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply #26430 to archive download URLs.

7 months agoAdd support for `linguist-detectable` and `linguist-documentation` (#29267)
KN4CK3R [Fri, 23 Feb 2024 17:24:27 +0000 (18:24 +0100)]
Add support for `linguist-detectable` and `linguist-documentation` (#29267)

Add support for `linguist-detectable` and `linguist-documentation`
Add tests for the attributes

https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#detectable

https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#documentation

7 months agoAdjust changelog for v1.21.6 to move prs to correct labels (#29339) (#29343)
Lunny Xiao [Fri, 23 Feb 2024 11:09:18 +0000 (19:09 +0800)]
Adjust changelog for v1.21.6 to move prs to correct labels (#29339) (#29343)

When releasing, the releaser should read all the pull requests carefully
and do some adjustments because some of pull requests' labels are not
right when it's merged.

And the changelog tool needs to be adjusted. If one pull request has
both `bug` and `API`, it should mark it as `bug` but not `API`.

Backport #29339

7 months agoAllow options to disable user deletion from the interface on app.ini (#29275)
Lunny Xiao [Fri, 23 Feb 2024 07:24:04 +0000 (15:24 +0800)]
Allow options to disable user deletion from the interface on app.ini (#29275)

Extract from #20549

This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to
allow the site administrator to disable users visiting deletion user
interface or allow.
This options are also potentially allowed to define more features in
future PRs.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoStart to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)
6543 [Fri, 23 Feb 2024 02:18:33 +0000 (03:18 +0100)]
Start to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)

just create transition helper and migrate two structs

7 months agoAdd slow SQL query warning (#27545)
Earl Warren [Fri, 23 Feb 2024 00:57:24 +0000 (01:57 +0100)]
Add slow SQL query warning (#27545)

- Databases are one of the most important parts of Forgejo, every
interaction uses the database in one way or another. Therefore, it is
important to maintain the database and recognize when the server is not
doing well with the database. There already is the option to log *every*
SQL query along with its execution time, but monitoring becomes
impractical for larger instances and takes up unnecessary storage in the
logs.
- Add a QoL enhancement that allows instance administrators to specify a
threshold value beyond which query execution time is logged as a warning
in the xorm logger. The default value is a conservative five seconds to
avoid this becoming a source of spam in the logs.
- The use case for this patch is that with an instance the size of
Codeberg, monitoring SQL logs is not very fruitful and most of them are
uninteresting. Recently, in the context of persistent deadlock issues
(https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that
certain queries hold locks on tables like comment and issue for several
seconds. This patch helps to identify which queries these are and when
they happen.
- Added unit test.

(cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
7 months agoUnify organizations header (#29248)
Tim-Nicas Oelschläger [Fri, 23 Feb 2024 00:24:57 +0000 (01:24 +0100)]
Unify organizations header (#29248)

Unify organizations header

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74474e0d-33c3-4bbf-9324-d130ea2c62f8)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/1c65de0d-fa0f-4b17-ab8d-067de8c7113b)

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFrontport changelogs of minor releases (#29337)
6543 [Fri, 23 Feb 2024 00:24:07 +0000 (01:24 +0100)]
Frontport changelogs of minor releases (#29337)

as title

7 months agoSupport SAML authentication (#25165)
techknowlogick [Fri, 23 Feb 2024 00:08:17 +0000 (19:08 -0500)]
Support SAML authentication (#25165)

Closes https://github.com/go-gitea/gitea/issues/5512

This PR adds basic SAML support
- Adds SAML 2.0 as an auth source
- Adds SAML configuration documentation
- Adds integration test:
- Use bare-bones SAML IdP to test protocol flow and test account is
linked successfully (only runs on Postgres by default)
- Adds documentation for configuring and running SAML integration test
locally

Future PRs:
- Support group mapping
- Support auto-registration (account linking)

Co-Authored-By: @jackHay22
---------

Co-authored-by: jackHay22 <jack@allspice.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoUpgrade to fabric 6 (#29334)
silverwind [Thu, 22 Feb 2024 23:31:24 +0000 (00:31 +0100)]
Upgrade to fabric 6 (#29334)

Upgrade fabric to latest v6 beta. It works for our use case, even
thought it does not fix the upstream issue
https://github.com/fabricjs/fabric.js/issues/9679 that
https://github.com/go-gitea/gitea/issues/29326 relates to.

7 months agoDon't show third-party JS errors in production builds (#29303)
silverwind [Thu, 22 Feb 2024 21:21:43 +0000 (22:21 +0100)]
Don't show third-party JS errors in production builds (#29303)

So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

7 months agoRemove bountysource (#29330)
Kyle D [Thu, 22 Feb 2024 18:53:03 +0000 (13:53 -0500)]
Remove bountysource (#29330)

[Bountysource is dead](https://github.com/bountysource/core/issues/1586). So remove them from our repo.

7 months ago Remove unnecessary "Str2html" modifier from templates (#29319)
wxiaoguang [Thu, 22 Feb 2024 18:05:47 +0000 (02:05 +0800)]
 Remove unnecessary "Str2html" modifier from templates (#29319)

Follow #29165

7 months agoIgnore the linux anchor point to avoid linux migrate failure (#29295)
Lunny Xiao [Thu, 22 Feb 2024 17:40:53 +0000 (01:40 +0800)]
Ignore the linux anchor point to avoid linux migrate failure (#29295)

Fix #28843

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove jQuery from the repo commit functions (#29230)
Yarden Shoham [Thu, 22 Feb 2024 17:13:25 +0000 (19:13 +0200)]
Remove jQuery from the repo commit functions (#29230)

- Switched to plain JavaScript
- Tested the commit ellipsis button functionality and it works as before
- Tested the commits statuses tippy functionality and it works as before
- Tested the last commit loader functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/465516f8-0ff3-438c-a17e-26cbab82750b)

![action](https://github.com/go-gitea/gitea/assets/20454870/968da210-9382-4b50-a4c2-09419dc86e07)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRemove unnecessary "Safe" modifier from templates (#29318)
wxiaoguang [Thu, 22 Feb 2024 17:02:33 +0000 (01:02 +0800)]
Remove unnecessary "Safe" modifier from templates (#29318)

Follow #29165

7 months agoRemove jQuery from the image pasting functionality (#29324)
Yarden Shoham [Thu, 22 Feb 2024 16:35:58 +0000 (18:35 +0200)]
Remove jQuery from the image pasting functionality (#29324)

- Switched to plain JavaScript
- Tested the image pasting functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/018993ff-7b09-4d5f-88e0-f276368bacd6)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoImprove the `issue_comment` workflow trigger event (#29277)
Zettat123 [Thu, 22 Feb 2024 14:47:35 +0000 (22:47 +0800)]
Improve the `issue_comment` workflow trigger event (#29277)

Fix #29175
Replace #29207

This PR makes some improvements to the `issue_comment` workflow trigger
event.

1. Fix the bug that pull requests cannot trigger `issue_comment`
workflows
2. Previously the `issue_comment` event only supported the `created`
activity type. This PR adds support for the missing `edited` and
`deleted` activity types.
3. Some events (including `issue_comment`, `issues`, etc. ) only trigger
workflows that belong to the workflow file on the default branch. This
PR introduces the `IsDefaultBranchWorkflow` function to check for these
events.