4f32abaf94
move repository deletion to service layer ( #26948 )
...
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-09-08 04:51:15 +00:00
f20e317d6d
Improve hint when uploading a too large avatar ( #26935 )
...
Fix #26390
---------
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Giteabot <teabot@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
2023-09-07 13:35:45 +00:00
a78c2eae24
Replace util.SliceXxx
with slices.Xxx
( #26958 )
2023-09-07 09:37:47 +00:00
1ee4882b88
Fix the missing repo count ( #26942 )
...
The commit
(958d148043
)
forgot two pages 😝

BTW, the `leave` button is in a weird position
2023-09-07 01:44:47 +00:00
b9df9fa2e2
Move createrepository from module to service layer ( #26927 )
...
Repository creation depends on many models, so moving it to service
layer is better.
2023-09-06 12:08:51 +00:00
a7d9a70552
allow "latest" to be used in release vTag when downloading file ( #26748 )
...
Hello,
In the discord I saw
[someone](https://discord.com/channels/322538954119184384/1069795723178160168/1145061200644800514 )
complaining that you can't use the "latest" keyword as release tag to
download a specific file:
In his example:
https://www.uberwald.me/gitea/public/fvtt-ecryme/releases/latest/system.json
However the latest keyword works for the release page, so I think it's a
good thing to implement this on the release attachment download url too.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-09-06 11:06:04 +00:00
958d148043
Show always repo count in header ( #26842 )
...
A few pages don't load the repo count of an user/org, so it is not shown
in the header. This happens mostly on org pages, but the package
settings applies to the user page as well.
Before:

After:

Seen on #26826
Regression of #25928
2023-09-06 08:49:36 +00:00
460a2b0edf
Artifacts retention and auto clean up ( #26131 )
...
Currently, Artifact does not have an expiration and automatic cleanup
mechanism, and this feature needs to be added. It contains the following
key points:
- [x] add global artifact retention days option in config file. Default
value is 90 days.
- [x] add cron task to clean up expired artifacts. It should run once a
day.
- [x] support custom retention period from `retention-days: 5` in
`upload-artifact@v3`.
- [x] artifacts link in actions view should be non-clickable text when
expired.
2023-09-06 07:41:06 +00:00
0850be6750
Fix the display of org level badges ( #26504 )
...
Follow #24654 #22705 #24232
In some pages we still have missing badges, for example:



2023-09-06 14:38:14 +08:00
540bf9fa6d
Move notification interface to services layer ( #26915 )
...
Extract from #22266
2023-09-05 18:37:47 +00:00
084eacb5d4
fetch emails of currently displayed user on admin page ( #26918 )
...
Currently, this fetches the emails from the user viewing the page. This
PR changes it to show the emails from the user whose page it is.
2023-09-05 17:56:21 +00:00
a99b96cbcd
Refactor secrets modification logic ( #26873 )
...
- Share code between web and api
- Add some tests
2023-09-05 15:21:02 +00:00
9881b8a4e2
Add more descriptive error on forgot password page ( #26848 )
...
## Changes
- Forces flashed error to render immediately when forgot password code
is incorrect or has expired.
- Adds a link back to the `forgot_password` page so that the user can
restart the process (in the event that their link has expired)
2023-09-01 16:15:39 +00:00
e8aae43f56
Move web/api context related testing function into a separate package ( #26859 )
...
Just like `models/unittest`, the testing helper functions should be in a
separate package: `contexttest`
And complete the TODO:
> // TODO: move this function to other packages, because it depends on
"models" package
2023-09-01 11:26:07 +00:00
c0ab7070e5
Update team invitation email link ( #26550 )
...
Co-authored-by: Kyle D <kdumontnu@gmail.com >
Co-authored-by: Jonathan Tran <jonnytran@gmail.com >
2023-08-31 16:26:13 +00:00
3cae50e841
Redirect from {repo}/issues/new
to {repo}/issues/new/choose
when blank issues are disabled ( #26813 )
...
You can currently visit `{repo}/issues/new` and create a blank issue,
even if it's disabled. This PR fixes this,
Fixes https://codeberg.org/forgejo/forgejo/issues/1356
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-31 15:36:25 +00:00
5b5bb8d354
User details page ( #26713 )
...
This PR implements a proposal to clean up the admin users table by
moving some information out to a separate user details page (which also
displays some additional information).
Other changes:
- move edit user page from `/admin/users/{id}` to
`/admin/users/{id}/edit` -> `/admin/users/{id}` now shows the user
details page
- show if user is instance administrator as a label instead of a
separate column
- separate explore users template into a page- and a shared one, to make
it possible to use it on the user details page
- fix issue where there was no margin between alert message and
following content on admin pages
<details>
<summary>Screenshots</summary>


</details>
Partially resolves #25939
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-31 11:21:18 +02:00
5315153059
Use Set[Type]
instead of map[Type]bool/struct{}
. ( #26804 )
2023-08-30 06:55:25 +00:00
915cabdb14
Fix context filter has no effect in dashboard ( #26695 )
...
Fix #26686
2023-08-29 12:46:52 +00:00
c576b50441
Fix being unable to use a repo that prohibits accepting PRs as a PR source. ( #26785 )
...
## Description
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183
Many thanks to @apnote for assisting me in reproducing this bug!
## ScreenShot
---
### Before
<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a "
width="400px">
<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312 "
width="400px">
### After
<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963 "
width="400px">
<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727 "
width="400px">
2023-08-29 12:07:15 +03:00
476b9d1589
Use docs.gitea.com instead of docs.gitea.io ( #26739 )
2023-08-27 11:59:12 +00:00
43652746f2
Move modules/mirror
to services
( #26737 )
...
To solve the cyclic imports in a better way
Closes #20261
2023-08-27 10:24:45 +08:00
412e5c0946
Make web context initialize correctly for different cases ( #26726 )
...
The web context (modules/context.Context) is quite complex, it's
difficult for the callers to initialize correctly.
This PR introduces a `NewWebContext` function, to make sure the web
context have the same behavior for different cases.
2023-08-25 19:07:42 +08:00
d2e4039def
Add member
, collaborator
, contributor
, and first-time contributor
roles and tooltips ( #26658 )
...
GitHub like role descriptor



---------
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-08-24 13:06:17 +08:00
7e30986667
Remove ref name in PR commits page ( #25876 )
...
The branch name display here is based on the repo's default branch which
is not correct.

For example, if I changed the default branch, the branch name here will
also be changed:


you can confirm this in :
https://try.gitea.io/yp05327/testrepo/pulls/1/commits
I think we do not need to display branch name here, as we already have
the branch info above.

2023-08-24 01:31:54 +00:00
e8b990999f
Make "link-action" backend code respond correct JSON content ( #26680 )
...
Otherwise the `link-action` JS code couldn't parse the response.
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-23 17:36:57 +08:00
5db21ce7e1
Fix counting and filtering on the dashboard page for issues ( #26657 )
...
This PR has multiple parts, and I didn't split them because
it's not easy to test them separately since they are all about the
dashboard page for issues.
1. Support counting issues via indexer to fix #26361
2. Fix repo selection so it also fixes #26653
3. Keep keywords in filter links.
The first two are regressions of #26012 .
After:
https://github.com/go-gitea/gitea/assets/9418365/71dfea7e-d9e2-42b6-851a-cc081435c946
Thanks to @CaiCandong for helping with some tests.
2023-08-23 02:29:17 +00:00
a4a567f29f
Check disabled workflow when rerun jobs ( #26535 )
...
In GitHub, we can not rerun jobs if the workflow is disabled.
---------
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-08-22 10:30:02 +08:00
f6e7798405
Add link to job details and tooltip to commit status in repo list in dashboard ( #26326 )
...
Tooltip:

Link to the target job:

2023-08-21 15:26:10 +08:00
f00fdd1abd
fix reopen logic for agit flow pull request ( #26399 )
...
the head branch is meaningless for a agit flow pull request, so should
not check it when reopen it.
related: #24231
fix #26334
Signed-off-by: a1012112796 <1012112796@qq.com >
2023-08-19 11:29:34 +02:00
b658f2c61b
Return empty when searching issues with no repos ( #26545 )
2023-08-17 12:42:17 -05:00
940f997512
Fix label filter between all
and no
( #26557 )
...
Regression of https://github.com/go-gitea/gitea/pull/25886 .
# Description
For `labelIDs`:
9afcb0e046/routers/web/repo/issue.go (L171-L174)
- `nil` mean no filter
- `[0]` mean `no label` filter
When `selectLabels == "0"`, labelIDs should be `[0]` rather than `nil`
# Before:
https://github.com/go-gitea/gitea/assets/50507092/3dac5075-6da0-4769-ba20-48a56f4063c0
# After:
https://github.com/go-gitea/gitea/assets/50507092/ff79fd4c-b02e-4dfb-9309-ae7851f4dcdb
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-17 13:19:24 +00:00
c179ab4236
Fix "issueReposQueryPattern does not match query" ( #26556 )
...
Fix
`https://github.com/go-gitea/gitea/pull/26545#discussion_r1295734340 `
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-17 12:38:02 +00:00
c6b92c84fe
Sync repo's IsEmpty status correctly ( #26517 )
...
Close #26509
2023-08-17 04:43:39 +00:00
bc930f332f
Fix typo of RunerOwnerID ( #26508 )
2023-08-15 23:10:40 +00:00
7f8028e5a1
Fix display problems of members and teams unit ( #26363 )
...
Fix:
- display member count and team count in the menu bar

- Also display member unit in the menu bar if there are no hidden
members in public org

- hidden member board when there's no seeable members.
In this org, we only have hidden members:

We will hidden the member board when doer is not the member of this org

Before:

If you click the number in the members board, you will access the
members page, which is not expected.

---------
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-15 16:00:35 +02:00
19872063a3
add disable workflow feature ( #26413 )
...
As title, that's simmilar with github.


---------
Signed-off-by: a1012112796 <1012112796@qq.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: Jason Song <i@wolfogre.com >
2023-08-14 15:14:30 +00:00
cafce3b4b5
Allow to archive labels ( #26478 )
...
## Archived labels
This adds the structure to allow for archived labels.
Archived labels are, just like closed milestones or projects, a medium to hide information without deleting it.
It is especially useful if there are outdated labels that should no longer be used without deleting the label entirely.
## Changes
1. UI and API have been equipped with the support to mark a label as archived
2. The time when a label has been archived will be stored in the DB
## Outsourced for the future
There's no special handling for archived labels at the moment.
This will be done in the future.
## Screenshots


Part of https://github.com/go-gitea/gitea/issues/25237
---------
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-08-14 11:56:14 +02:00
56b6b2b88e
Fix tooltip of commit select button ( #26472 )
...
Previously, the tooltip for this button was only shown after opening and
closing it once because it was only set after the server response, now
it shows before opening it.
2023-08-14 02:16:40 +00:00
50fc22eecf
Add ThreadID parameter for Telegram webhooks ( #25996 )
...
Telegram has recently implemented threads (channels) for group chats.
Co-authored-by: neveraskedtoexist <matikot415@gmail.com >
2023-08-13 14:00:06 +00:00
ab78c39e41
Refactor project templates ( #26448 )
...
This PR refactors a bunch of projects-related code, mostly the
templates.
The following things were done:
- rename boards to columns in frontend code
- use the new `ctx.Locale.Tr` method
- cleanup template, remove useless newlines, classes, comments
- merge org-/user and repo level project template together
- move "new column" button into project toolbar
- move issue card (shared by projects and pinned issues) to shared
template, remove useless duplicated styles
- add search function to projects (to make the layout more similar to
milestones list where it is inherited from 😆 )
- maybe more changes I forgot I've done 😆
Closes #24893
After:



---------
Co-authored-by: silverwind <me@silverwind.io >
2023-08-12 10:30:28 +00:00
9fc68b680f
Fix 404 error when remove self from an organization ( #26362 )
...
Same to #24322
Not only `leave` action but also `remove` action should check whether
user still belongs to the org.
2023-08-12 07:02:22 +00:00
46660f1614
remove unnecessary explore org template ( #26459 )
2023-08-11 16:07:04 -04:00
f3fbb7c67d
Count only visible repos on profile ( #25928 )
...
Fixes #25914
2023-08-11 13:08:05 -04:00
e7cbb0e7c9
Fix wrong middleware sequence ( #26428 )
2023-08-10 12:51:46 +02:00
a370efc13f
Use template context function for avatar rendering ( #26385 )
...
Introduce `AvatarUtils`, no need to pass `$.Context` to every
sub-template, and simplify the template helper functions.
2023-08-10 11:19:39 +08:00
36eb3c433a
Add transaction when creating pull request created dirty data ( #26259 )
...
Fix #26129
Replace #26258
This PR will introduce a transaction on creating pull request so that if
some step failed, it will rollback totally. And there will be no dirty
pull request exist.
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-10 02:39:21 +00:00
a85a862804
Fix admin queue page title ( #26409 )
...
Fix #26408
```
# locale_en-US.ini
[admin]
monitor.queues = Queues
```
---------
Co-authored-by: silverwind <me@silverwind.io >
2023-08-10 02:05:37 +00:00
63ab92d797
Pre-register OAuth2 applications for git credential helpers ( #26291 )
...
This PR is an extended implementation of #25189 and builds upon the
proposal by @hickford in #25653 , utilizing some ideas proposed
internally by @wxiaoguang.
Mainly, this PR consists of a mechanism to pre-register OAuth2
applications on startup, which can be enabled or disabled by modifying
the `[oauth2].DEFAULT_APPLICATIONS` parameter in app.ini. The OAuth2
applications registered this way are being marked as "locked" and
neither be deleted nor edited over UI to prevent confusing/unexpected
behavior. Instead, they're being removed if no longer enabled in config.

The implemented mechanism can also be used to pre-register other OAuth2
applications in the future, if wanted.
Co-authored-by: hickford <mirth.hickford@gmail.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
---------
Co-authored-by: M Hickford <mirth.hickford@gmail.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-08-09 14:24:07 +02:00
c2e0143bfe
Introduce ctx.PathParamRaw to avoid incorrect unescaping ( #26392 )
...
Fix #26389
And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`
2023-08-09 14:57:45 +08:00