aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
Commit message (Collapse)AuthorAgeFilesLines
* Localize activity heatmap (except tooltip) (#24131)Yarden Shoham2023-04-172-0/+2
| | | | | | | | | | | | | | | The calculation of the total sum is moved to the backend so a full HTML string could be sent. ![image](https://user-images.githubusercontent.com/20454870/232112381-c11d896b-ba47-40f8-b2a3-71cf4b3208de.png) - Closes #10669 - 2nd attempt (the first was in #21570) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix 2-dot direct compare to use the right base commit (#24133)Jonathan Tran2023-04-161-1/+5
| | | | | | For 2-dot direct compare, we should use the base commit in the title and templates, as is used elsewhere, not the common ancestor which is used for 3-dot compare. I believe that this change should have been included in #22949.
* Remove untranslatable `on_date` key (#24106)Yarden Shoham2023-04-151-0/+10
| | | | | | | | | | | | | | | | | | | | - Follows #23988 - Fixes: #24074 by removing this key GitHub's `relative-time` elements allow us to force their rendering to `auto`, `past`, or `future` tense. We will never show an absolute date `on ...` in `TimeSince` ## Before ![image](https://user-images.githubusercontent.com/20454870/231735872-048c7bf3-6aa1-4113-929d-75a985c9922c.png) ## After ![image](https://user-images.githubusercontent.com/20454870/231736116-6ad47b63-77f4-4d3f-82a2-ee9a46ba2bd1.png) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Sort repo topic labels by name (#24123)wxiaoguang2023-04-141-6/+1
| | | | Close #24077
* Add option to search for users is active join a team (#24093)Tyrone Yeh2023-04-141-0/+1
| | | | | | | | Adding a user in a team to enter a username gives a list of no active users --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Make more functions use ctx instead of db.DefaultContext (#24068)wxiaoguang2023-04-141-8/+8
| | | | | | Continue the "ctx refactoring" work. There are still a lot db.DefaultContext, incorrect context could cause database deadlock errors.
* Fix incorrect server error content in RunnersList (#24118)yp053272023-04-141-2/+2
|
* Refactor cookie (#24107)wxiaoguang2023-04-135-17/+16
| | | | | | | | | | | | Close #24062 At the beginning, I just wanted to fix the warning mentioned by #24062 But, the cookie code really doesn't look good to me, so clean up them. Complete the TODO on `SetCookie`: > TODO: Copied from gitea.com/macaron/macaron and should be improved after macaron removed.
* Fix admin team access mode value in team_unit table (#24012)yp053272023-04-131-43/+50
| | | | | Same as https://github.com/go-gitea/gitea/pull/23675 Feedback: https://github.com/go-gitea/gitea/pull/23879#issuecomment-1500923636
* Use a general approach to access custom/static/builtin assets (#24022)wxiaoguang2023-04-122-12/+9
| | | | | | | | | | | | | | | | | | | The idea is to use a Layered Asset File-system (modules/assetfs/layered.go) For example: when there are 2 layers: "custom", "builtin", when access to asset "my/page.tmpl", the Layered Asset File-system will first try to use "custom" assets, if not found, then use "builtin" assets. This approach will hugely simplify a lot of code, make them testable. Other changes: * Simplify the AssetsHandlerFunc code * Simplify the `gitea embedded` sub-command code --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make Release Download URLs predictable (#23891)JakobDev2023-04-123-4/+15
| | | | | | | | | | | | | | | | | | | | As promised in #23817, I have this made a PR to make Release Download URLs predictable. It currently follows the schema `<repo>/releases/download/<tag>/<filename>`. this already works, but it is nowhere shown in the UI or the API. The Problem is, that it is currently possible to have multiple files with the same name (why do we even allow this) for a release. I had written some Code to check, if a Release has 2 or more files with the same Name. If yes, it uses the old `attachments/<uuid>` URlL if no it uses the new fancy URL. I had also changed `<repo>/releases/download/<tag>/<filename>` to directly serve the File instead of redirecting, so people who who use automatic update checker don't end up with the `attachments/<uuid>` URL. Fixes #10919 --------- Co-authored-by: a1012112796 <1012112796@qq.com>
* Add cardtype to org/user level project on creation, edit and view (#24043)Hester Gong2023-04-111-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of #23318 The way to fix the missing cardtype for user/org level projects in this PR is to port the cardtype related part from #22112 to org/user level projects' template and router functions. Before: <img width="1135" alt="截屏2023-04-11 13 55 49" src="https://user-images.githubusercontent.com/17645053/231069068-ba897129-ae90-4aa0-9b0f-468bf5c65375.png"> <img width="1131" alt="截屏2023-04-11 13 55 59" src="https://user-images.githubusercontent.com/17645053/231069084-279f6681-5a10-42da-b5a8-2b0ba47c7078.png"> After: Create <img width="835" alt="截屏2023-04-11 13 27 16" src="https://user-images.githubusercontent.com/17645053/231064445-0d6e12bd-5725-48db-a102-80e7472757c2.png"> Edit <img width="852" alt="截屏2023-04-11 13 27 05" src="https://user-images.githubusercontent.com/17645053/231064503-c70525cd-1038-43ec-8d93-8b8d95d183d4.png"> View <img width="1329" alt="截屏2023-04-11 13 26 56" src="https://user-images.githubusercontent.com/17645053/231064529-26023c85-698b-4b2e-af02-45f9820c77ec.png"> Co-authored-by: Giteabot <teabot@gitea.io>
* Avoid recursing into sub-sub-sub-docs folders when looking for READMEs. (#23695)Nick2023-04-101-4/+4
| | | | | | | Fixes a bug introduced in https://github.com/go-gitea/gitea/pull/22177 which allows finding READMEs like docs/docs/docs/.gitea/.github/docs/README.md Fixes https://github.com/go-gitea/gitea/issues/23694
* Use auto-updating, natively hoverable, localized time elements (#23988)Yarden Shoham2023-04-111-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added [GitHub's `relative-time` element](https://github.com/github/relative-time-element) - Converted all formatted timestamps to use this element - No more flashes of unstyled content around time elements - These elements are localized using the `lang` property of the HTML file - Relative (e.g. the activities in the dashboard) and duration (e.g. server uptime in the admin page) time elements are auto-updated to keep up with the current time without refreshing the page - Code that is not needed anymore such as `formatting.js` and parts of `since.go` have been deleted Replaces #21440 Follows #22861 ## Screenshots ### Localized ![image](https://user-images.githubusercontent.com/20454870/230775041-f0af4fda-8f6b-46d3-b8e3-d340c791a50c.png) ![image](https://user-images.githubusercontent.com/20454870/230673393-931415a9-5729-4ac3-9a89-c0fb5fbeeeb7.png) ### Tooltips #### Native for dates ![image](https://user-images.githubusercontent.com/20454870/230797525-1fa0a854-83e3-484c-9da5-9425ab6528a3.png) #### Interactive for relative ![image](https://user-images.githubusercontent.com/115237/230796860-51e1d640-c820-4a34-ba2e-39087020626a.png) ### Auto-update ![rec](https://user-images.githubusercontent.com/20454870/230672159-37480d8f-435a-43e9-a2b0-44073351c805.gif) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de>
* Make label templates have consistent behavior and priority (#23749)wxiaoguang2023-04-104-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix https://github.com/go-gitea/gitea/issues/23715 Other related PRs: * #23717 * #23716 * #23719 This PR is different from others, it tries to resolve the problem fundamentally (and brings more benefits) Although it looks like some more lines are added, actually many new lines are for tests. ---- Before, the code was just "guessing" the file type and try to parse them. <details> ![image](https://user-images.githubusercontent.com/2114189/228002245-57d58e27-1078-4da9-bf42-5bc0b264c6ce.png) </details> This PR: * Always remember the original option file names, and always use correct parser for them. * Another benefit is that we can sort the Label Templates now (before there was a map, its key order is undefined) ![image](https://user-images.githubusercontent.com/2114189/228002432-931b9f18-3908-484b-a36b-04760c9ad132.png)
* Improve GetBoards and getDefaultBoard (#22981)yp053272023-04-092-2/+2
| | | | | | | | Change `GetBoards(ctx context.Context, projectID int64)` to `(p *Project) GetBoards(ctx context.Context) (BoardList, error)` `getDefaultBoard` is same.
* Group template helper functions, remove `Printf`, improve template error ↵wxiaoguang2023-04-082-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | messages (#23982) Follow #23328 Major changes: * Group the function in `templates/help.go` by their purposes. It could make future work easier. * Remove the `Printf` helper function, there is already a builtin `printf`. * Remove `DiffStatsWidth`, replace with `Eval` in template * Rename the `NewTextFuncMap` to `mailSubjectTextFuncMap`, it's for subject text template only, no need to make it support HTML functions. ---- And fine tune template error messages, to make it more friendly to developers and users. ![image](https://user-images.githubusercontent.com/2114189/230714245-4fd202d1-2b25-41b2-8be5-03c5fee45091.png) ![image](https://user-images.githubusercontent.com/2114189/230714277-66783577-2a03-49d5-8e8c-ceba5e07a2d4.png) --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix redirect bug when creating issue from a project (#23971)Lunny Xiao2023-04-081-2/+2
| | | Fix #23966
* Add job.duration in web ui (#23963)yp053272023-04-071-0/+2
| | | | | | | ![image](https://user-images.githubusercontent.com/18380374/230532947-271ac389-8134-4c5e-8f2f-ced4a4fd0ebe.png) ![image](https://user-images.githubusercontent.com/18380374/230532963-e76532c5-7ca1-4b01-ae77-cc1223350fe7.png) Maybe we can change the location of it.
* Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... ↵65432023-04-071-10/+42
| | | | | | | (#23874) - close #22301 workaround for https://github.com/go-chi/chi/issues/781
* Ensure RSS icon is present on all repo tabs (#23904)silverwind2023-04-071-3/+0
| | | | | | | | | | | | | | | | | | | Previously, not all repo tabs had shown the RSS icon in the repo header because the context data was not being set. Added this context data in a new function. Before: <img width="806" alt="image" src="https://user-images.githubusercontent.com/115237/229639615-9cc00e75-3a26-4ff4-a6f2-316c1fccc596.png"> After: <img width="815" alt="Screenshot 2023-04-04 at 00 16 17" src="https://user-images.githubusercontent.com/115237/229639201-2e1c015b-1f13-46d4-aa14-e7a82fab3982.png"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Clean template/helper.go (#23922)wxiaoguang2023-04-071-0/+1
| | | | | | | | | | | | | The first step of #23328 This PR cleans: 1. Dead function like `SubStr` 2. Unnecessary function like `UseHTTPS`, it should be provided by `window.origin` 3. Duplicate function like `IsShowFullName`, there was already a `DeafultShowFullName` I have searched these removed functions globally, no use in code.
* Title can be empty when creating tag only (#23917)Zettat1232023-04-061-0/+6
| | | | | | | | Fixes #23809 Make the title not required. If the title is empty when creating release (not tag), an error message will be displayed. ![image](https://user-images.githubusercontent.com/15528715/229761056-c52e338b-5f25-4d7d-bb44-2cb0304abcee.png)
* Refactor authors dropdown (send get request from frontend to avoid long wait ↵Hester Gong2023-04-076-19/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | time) (#23890) Right now the authors search dropdown might take a long time to load if amount of authors is huge. Example: (In the video below, there are about 10000 authors, and it takes about 10 seconds to open the author dropdown) https://user-images.githubusercontent.com/17645053/229422229-98aa9656-3439-4f8c-9f4e-83bd8e2a2557.mov Possible improvements can be made, which will take 2 steps (Thanks to @wolfogre for advice): Step 1: Backend: Add a new api, which returns a limit of 30 posters with matched prefix. Frontend: Change the search behavior from frontend search(fomantic search) to backend search(when input is changed, send a request to get authors matching the current search prefix) Step 2: Backend: Optimize the api in step 1 using indexer to support fuzzy search. This PR is implements the first step. The main changes: 1. Added api: `GET /{type:issues|pulls}/posters` , which return a limit of 30 users with matched prefix (prefix sent as query). If `DEFAULT_SHOW_FULL_NAME` in `custom/conf/app.ini` is set to true, will also include fullnames fuzzy search. 2. Added a tooltip saying "Shows a maximum of 30 users" to the author search dropdown 3. Change the search behavior from frontend search to backend search After: https://user-images.githubusercontent.com/17645053/229430960-f88fafd8-fd5d-4f84-9df2-2677539d5d08.mov Fixes: https://github.com/go-gitea/gitea/issues/22586 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Use graceful editorconfig loader to reduce errors when loading malformed ↵Yoan Blanc2023-04-063-5/+12
| | | | | | | | | | | | | editorconfigs (#21257) The _graceful_ should fail less when the `.editorconfig` file isn't properly written, e.g. boolean values from YAML or unparseable numbers (when a number is expected). As is... information is lost as the _warning_ (a go-multierror.Error) is ignored. If anybody knows how to send them to the UI as warning; any help is appreciated. Closes #20694 Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
* User/Org Feed render description as per web (#23887)65432023-04-041-1/+15
| | | | User descriptions should be rendered so that links and other markup appear correct in RSS feeds.
* Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823)wxiaoguang2023-04-041-2/+2
| | | | | | | | Thanks to @trwnh Close #23802 The ActivityPub id is an HTTPS URI that should remain constant, even if the user changes their name.
* Fix submit button won't refresh in New Repository Fork page (#22994)yp053272023-04-031-0/+1
| | | | | | | | | Fork a repo, and input an invalid repo name, you will get an error. Then rename the repo name to a valid one, the submit button is still disabled. In other pages, for example, in create repo page, the submit button will not be disabled. So I removed the codes to disable the submit button.
* Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876)wxiaoguang2023-04-0311-32/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first step of the plan * #23290 Thanks to @silverwind for the first try in #15394 . Close #10729 and a lot of related issues. The EasyMDE is not removed, now it works as a fallback, users can switch between these two editors. Editor list: * Issue / PR comment * Issue / PR comment edit * Issue / PR comment quote reply * PR diff view, inline comment * PR diff view, inline comment edit * PR diff view, inline comment quote reply * Release editor * Wiki editor Some editors have attached dropzone Screenshots: <details> ![image](https://user-images.githubusercontent.com/2114189/229363558-7e44dcd4-fb6d-48a0-92f8-bd12f57bb0a0.png) ![image](https://user-images.githubusercontent.com/2114189/229363566-781489c8-5306-4347-9714-d71af5d5b0b1.png) ![image](https://user-images.githubusercontent.com/2114189/229363771-1717bf5c-0f2a-4fc2-ba84-4f5b2a343a11.png) ![image](https://user-images.githubusercontent.com/2114189/229363793-ad362d0f-a045-47bd-8f9d-05a9a842bb39.png) </details> --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix 500 error if there is a name conflict when edit authentication source ↵yp053272023-03-311-2/+4
| | | | (#23832)
* Fix incorrect/Improve error handle in edit user page (#23805)yp053272023-03-301-3/+6
| | | | | | | Changes: - `RenderWithErr` should render `tplUserEdit` not `tplUserNew` in edit page - If error occurred in `HandleUsernameChange` redirect to original edit page instead of user list page
* Fix incorrect visibility dropdown list in add/edit user page (#23804)yp053272023-03-301-0/+2
| | | | Visibility dropdown list will not work in add/edit user page when error occurred
* Refactor commit status for Actions jobs (#23786)Jason Song2023-03-291-11/+4
| | | | | | | | | | | | | | | | | | | Before: <img width="353" alt="xnip_230329_163852" src="https://user-images.githubusercontent.com/9418365/228479807-424452df-10fa-45cf-ae4b-09939c0ed54c.png"> After: <img width="508" alt="xnip_230329_163358" src="https://user-images.githubusercontent.com/9418365/228479923-537b54fe-9564-4105-a068-bcc75fa2a7ea.png"> Highlights: - Treat `StatusSkipped` as `CommitStatusSuccess` instead of `CommitStatusFailure`, so it fixed #23599. - Use the bot user `gitea-actions` instead of the trigger as the creator of commit status. - New format `<run_name> / <job_name> / (<event>)` for the context of commit status to avoid conflicts. - Add descriptions for commit status. - Add the missing calls to `CreateCommitStatus`. - Refactor `CreateCommitStatus` to make it easier to use.
* Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more ↵wxiaoguang2023-03-291-3/+11
| | | | | | | | | | | | | | | | | | | strict (#23766) Follow #21962 After I eat my own dogfood, I would say that ONLY_SHOW_RELEVANT_REPOS=false is necessary for many private/enterprise instances, because many private repositories do not have "description/topic", users just want to search by their names. This PR also adds `PageIsExploreRepositories` check, to make code more strict, because the `search` template is shared for different purpose. And during the test, I found a bug that the "Search" button didn't respect the "relevant" parameter, so this PR fixes the bug by the way together. I think this PR needs to be backported.
* Implement Issue Config (#20956)JakobDev2023-03-282-5/+12
| | | | | | | | Closes #20955 This PR adds the possibility to disable blank Issues, when the Repo has templates. This can be done by creating the file `.gitea/issue_config.yaml` with the content `blank_issues_enabled` in the Repo.
* Add API to manage issue dependencies (#17935)qwerty2872023-03-282-5/+74
| | | | | | | | | | | | | | | | | | | | Adds API endpoints to manage issue/PR dependencies * `GET /repos/{owner}/{repo}/issues/{index}/blocks` List issues that are blocked by this issue * `POST /repos/{owner}/{repo}/issues/{index}/blocks` Block the issue given in the body by the issue in path * `DELETE /repos/{owner}/{repo}/issues/{index}/blocks` Unblock the issue given in the body by the issue in path * `GET /repos/{owner}/{repo}/issues/{index}/dependencies` List an issue's dependencies * `POST /repos/{owner}/{repo}/issues/{index}/dependencies` Create a new issue dependencies * `DELETE /repos/{owner}/{repo}/issues/{index}/dependencies` Remove an issue dependency Closes https://github.com/go-gitea/gitea/issues/15393 Closes #22115 Co-authored-by: Andrew Thornton <art27@cantab.net>
* Fix profile page email display, respect settings (#23747)wxiaoguang2023-03-271-1/+1
| | | | | | | | | | | | | Always respect the `setting.UI.ShowUserEmail` and `KeepEmailPrivate` setting. * It doesn't make sense to show user's own E-mail to themself. * Always hide the E-mail if KeepEmailPrivate=true, then the user could know how their profile page looks like for others. * Revert the `setting.UI.ShowUserEmail` change from #4981 . This setting is used to control the E-mail display, not only for the user list page. ps: the incorrect `<div .../>` tag on the profile page has been fixed by #23748 together, so this PR becomes simpler.
* Fix tags view (#23243)Wiktor Kwapisiewicz2023-03-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR fixes several issues reported in https://github.com/go-gitea/gitea/issues/23221. It does three things: 1. Fixes the `DefaultBranch` variable that has not been set. 2. Sets `Title` and `Message` for newly created tags from the Tag message. This makes it easier to create releases from tags that have messages and for those that don't it doesn't have any effect. 3. Makes UI changes so that tags look more like proper releases. Before: ![2023-03-02-12-31-19](https://user-images.githubusercontent.com/1718963/222416890-941a74d4-9cd0-4c45-a59e-199d2580cd8c.png) After: ![2023-03-02-12-31-31](https://user-images.githubusercontent.com/1718963/222416919-abce2009-8955-4cd0-9bed-1374582e04f7.png) I purposefully didn't reformat the template so that the diff is cleaner but can do so if that's welcome. Thanks for your time! --------- Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
* Add commit info in action page (#23210)yp053272023-03-271-0/+42
| | | | | Add more commit info in action detail page. ![image](https://user-images.githubusercontent.com/18380374/222069905-a5ab28b1-1cea-4eec-b3b9-f1c74145cb82.png)
* Fix cancel button in the page of project edit not work (#23655)sillyguodong2023-03-242-0/+3
| | | | | | | | | | | | | | | | Before, in project edit page, the cancel button is not work. https://user-images.githubusercontent.com/33891828/227182731-6478e29f-0e52-48c4-beb0-6a7d1dda6a1d.mov 1. The wrong classname `cancel` was added to the `<a>` tag. That classname caused the default click event of `<a>` tag to be cancelled. Because we have the following settings in the global. So I remove the classname `cancel`. https://github.com/go-gitea/gitea/blob/9be90a58754061171bbd5025d85d2b891364efd3/web_src/js/features/common-global.js#L325-L327 2. Another change is that page will redirect to the previous page. https://user-images.githubusercontent.com/33891828/227187326-c653c6d6-9715-440f-a732-ba0a6f012c81.mov
* Editor preview support for external renderers (#23333)Brecht Van Lommel2023-03-244-103/+48
| | | | | | | | | | | | | | | | | | | | | | | | Remove `[repository.editor] PREVIEWABLE_FILE_MODES` setting that seemed like it was intended to support this but did not work. Instead, whenever viewing a file shows a preview, also have a Preview tab in the file editor. Add new `/markup` web and API endpoints with `comment`, `gfm`, `markdown` and new `file` mode that uses a file path to determine the renderer. Remove `/markdown` web endpoint but keep the API for backwards and GitHub compatibility. ## ⚠️ BREAKING ⚠️ The `[repository.editor] PREVIEWABLE_FILE_MODES` setting was removed. This setting served no practical purpose and was not working correctly. Instead a preview tab is always shown in the file editor when supported. --------- Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Introduce path Clean/Join helper functions (#23495)wxiaoguang2023-03-213-5/+5
| | | | | | | | | | | | | | | Since #23493 has conflicts with latest commits, this PR is my proposal for fixing #23371 Details are in the comments And refactor the `modules/options` module, to make it always use "filepath" to access local files. Benefits: * No need to do `util.CleanPath(strings.ReplaceAll(p, "\\", "/"))), "/")` any more (not only one before) * The function behaviors are clearly defined
* Fix pagination on `/notifications/watching` (#23564)silverwind2023-03-201-1/+4
| | | | | The `q` parameter was not rendered in pagination links because `context.Pagination:AddParam` checks for existance of the parameter in `ctx.Data` where it was absent. Added the parameter there to fix it.
* Do not store user projects as organization projects (#23353)yp053272023-03-171-5/+18
| | | | | | | | | | | | A part of https://github.com/go-gitea/gitea/pull/22865 At first, I think we do not need 3 ProjectTypes, as we can check user type, but it seems that it is not database friendly. --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491)Hester Gong2023-03-161-5/+4
| | | | | | | | | | | | | | | | | | | | This PR fixes the tags sort issue mentioned in #23432 The tags on dropdown shoud be sorted in descending order of time but are not. Because when getting tags, it execeutes `git tag sort --sort=-taggerdate`. Git supports two types of tags: lightweight and annotated, and `git tag sort --sort=-taggerdate` dosen't work with lightweight tags, which will not give correct result. This PR add `GetTagNamesByRepoID ` to get tags from the database so the tags are sorted. Also adapt this change to the droplist when comparing branches. Dropdown places: <img width="369" alt="截屏2023-03-15 14 25 39" src="https://user-images.githubusercontent.com/17645053/225224506-65a72e50-4c11-41d7-8187-a7e9c7dab2cb.png"> <img width="675" alt="截屏2023-03-15 14 25 27" src="https://user-images.githubusercontent.com/17645053/225224526-65ce8008-340c-43f6-aa65-b6bd9e1a1bf1.png">
* Replace `repo.namedBlob` by `git.TreeEntry`. (#22898)Nick2023-03-151-44/+38
| | | | | | | | `namedBlob` turned out to be a poor imitation of a `TreeEntry`. Using the latter directly shortens this code. This partially undoes https://github.com/go-gitea/gitea/pull/23152/, which I found a merge conflict with, and also expands the test it added to cover the subtle README-in-a-subfolder case.
* add user rename endpoint to admin api (#22789)techknowlogick2023-03-142-38/+16
| | | | | | | | | | | | this is a simple endpoint that adds the ability to rename users to the admin API. Note: this is not in a mergeable state. It would be better if this was handled by a PATCH/POST to the /api/v1/admin/users/{username} endpoint and the username is modified. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Add workflow error notification in ui (#23404)yp053272023-03-141-3/+23
| | | | | | | | | | | ![image](https://user-images.githubusercontent.com/18380374/224237847-07a30029-32d4-4af7-a36e-e55f0ed899aa.png) ![image](https://user-images.githubusercontent.com/18380374/224239309-a96120e1-5eec-41c0-89aa-9cf63d1df30c.png) --------- Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make branches list page operations remember current page (#23420)wxiaoguang2023-03-141-10/+7
| | | | | | | | | | | | | Close #23411 Always pass "page" query parameter to backend, and make backend respect it. The `ctx.FormInt("limit")` is never used, so removed. --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Use context for `RepositoryList.LoadAttributes` (#23435)yp053272023-03-131-1/+1
|