aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/org
Commit message (Collapse)AuthorAgeFilesLines
* Add label/author/assignee filters to the user/org home issue list (#32779)wxiaoguang13 days1-15/+6
| | | | | | | | | | Replace #26661, fix #25979 Not perfect, but usable and much better than before. Since it is quite complex, I am not quite sure whether there would be any regression, if any, I will fix in first time. I have tested the related pages many times: issue list, milestone issue list, project view, user issue list, org issue list.
* Refactor issue filter (labels, poster, assignee) (#32771)wxiaoguang2024-12-101-6/+1
| | | | | | | | | | | | Rewrite a lot of legacy strange code, remove duplicate code, remove jquery, and make these filters reusable. Let's forget the old code, new code affects: * issue list open/close switch * issue list filter (label, author, assignee) * milestone list open/close switch * milestone issue list filter (label, author, assignee) * project view (label, assignee)
* Move team related functions to service layer (#32537)Lunny Xiao2024-11-272-15/+14
| | | | | There are still some functions under `models` after last big refactor about `models`. This change will move all team related functions to service layer with no code change.
* Refactor markup render system (#32612)wxiaoguang2024-11-241-11/+5
| | | | | | | | | | This PR removes (almost) all path tricks, and introduces "renderhelper" package. Now we can clearly see the rendering behaviors for comment/file/wiki, more details are in "renderhelper" tests. Fix #31411 , fix #18592, fix #25632 and maybe more problems. (ps: fix #32608 by the way)
* Refactor markup render system (#32589)wxiaoguang2024-11-221-7/+6
| | | | This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
* Fix and refactor markdown rendering (#32522)wxiaoguang2024-11-161-1/+1
|
* Calculate `PublicOnly` for org membership only once (#32234)65432024-11-112-7/+9
| | | | | | | | | | Refactoring of #32211 this move the PublicOnly() filter calcuation next to the DB querys and let it be decided by the Doer --- *Sponsored by Kithara Software GmbH*
* Refactor template ctx and render utils (#32422)wxiaoguang2024-11-051-3/+3
| | | Clean up the templates
* Add option to filter board cards by labels and assignees (#31999)Lauris BH2024-09-121-1/+64
| | | | | | | | | | | | | | | Works in both organization and repository project boards Fixes #21846 Replaces #21963 Replaces #27117 ![image](https://github.com/user-attachments/assets/1837ace8-3de2-444f-a153-e166bd0da2c0) **Note** that implementation was made intentionally to work same as in issue list so that URL can be bookmarked for quick access with predefined filters in URL
* Fix sort order for organization home and user profile page (#31921)yp053272024-09-011-25/+5
| | | | | | | | | | | | | | | | | | | | | | Fix #31916 In #30876, `sortOrder` has been changed into a map, but it is only implemented in explore. ~~But it seems that size sort order has no effect from long long ago,~~ not directly caused by the PR above. I think it is still caused by #29231. In #29231, it merged the sort orders from `templates/explore/repo_search.tmpl` and `templates/admin/repo/search.tmpl`. In `templates/admin/repo/search.tmpl`, it contains size sort orders, but not in `templates/explore/repo_search.tmpl`, which is used in non-admin pages. So `order by size` is added from #29231, but the handler was not added. --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Split org Propfile README to a new tab `overview` (#31373)a10121127962024-08-273-36/+47
| | | | | | | | | | | | | | | | | like user profile, add a new overviw tab to show profile READEME when it is exist. replace #31349 (another solution option) example view: ![屏幕截图 2024-06-14 094116](https://github.com/go-gitea/gitea/assets/25342410/3303a1f2-ae02-48e0-9519-7fa11e65657f) ![屏幕截图 2024-06-14 094101](https://github.com/go-gitea/gitea/assets/25342410/7a4a5a48-dc2b-4ad4-b2a2-9ea4ab5d5808) --------- Signed-off-by: a1012112796 <1012112796@qq.com>
* Add missing repository type filter parameters to pager (#31832)yp053272024-08-151-0/+16
| | | | | | | | | Fix #31807 ps: the newly added params's value will be changed. When the first time you selected the filter, the values of params will be `0` or `1` But in pager it will be `true` or `false`. So do we have `boolToInt` function?
* Add issue comment when moving issues from one column to another of the ↵Lunny Xiao2024-08-091-1/+2
| | | | | | | | | | | | | | | | | project (#29311) Fix #27278 Replace #27816 This PR adds a meta-comment for an issue when dragging an issue from one column to another of a project. <img width="600" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/5fc1d954-430e-4db0-aaee-a00006fa91f5"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: yp05327 <576951401@qq.com>
* Refactor names (#31405)wxiaoguang2024-06-195-31/+31
| | | | | | | This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
* Add missed return after `ctx.ServerError` (#31130)Lunny Xiao2024-05-281-0/+1
|
* Rename project board -> column to make the UI less confusing (#30170)Lunny Xiao2024-05-272-62/+60
| | | | | | | | | | | | | This PR split the `Board` into two parts. One is the struct has been renamed to `Column` and the second we have a `Template Type`. But to make it easier to review, this PR will not change the database schemas, they are just renames. The database schema changes could be in future PRs. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: yp05327 <576951401@qq.com>
* Fix various problems around projects board view (#30696)Lunny Xiao2024-05-081-69/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | # The problem The previous implementation will start multiple POST requests from the frontend when moving a column and another bug is moving the default column will never be remembered in fact. # What's changed - [x] This PR will allow the default column to move to a non-first position - [x] And it also uses one request instead of multiple requests when moving the columns - [x] Use a star instead of a pin as the icon for setting the default column action - [x] Inserted new column will be append to the end - [x] Fix #30701 the newly added issue will be append to the end of the default column - [x] Fix when deleting a column, all issues in it will be displayed from UI but database records exist. - [x] Add a limitation for columns in a project to 20. So the sorting will not be overflow because it's int8. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix project description rendering for org (#30587)wxiaoguang2024-04-191-2/+2
| | | | | | | | Fix #30263 ![image](https://github.com/go-gitea/gitea/assets/2114189/41cabe6c-f94a-4874-a26f-d01bb89bb28c) Co-authored-by: Giteabot <teabot@gitea.io>
* Fix network error when open/close organization/individual projects and ↵yp053272024-04-131-4/+4
| | | | | | | | | | | redirect to project page (#30387) Follow #27734 ![image](https://github.com/go-gitea/gitea/assets/18380374/02ed6b9a-cbb6-4f49-a54a-ca76a0d052a9) Updated: Redirect to project page instead of project list page.
* Add default board to new projects, remove uncategorized pseudo-board (#29874)Denys Konovalov2024-03-271-90/+18
| | | | | | | | | | | | | | | | | | On creation of an empty project (no template) a default board will be created instead of falling back to the uneditable pseudo-board. Every project now has to have exactly one default boards. As a consequence, you cannot unset a board as default, instead you have to set another board as default. Existing projects will be modified using a cron job, additionally this check will run every midnight by default. Deleting the default board is not allowed, you have to set another board as default to do it. Fixes #29873 Fixes #14679 along the way Fixes #29853 Co-authored-by: delvh <dev.lh@web.de>
* Remove AddParamIfExist(AddParam) (#29841)wxiaoguang2024-03-162-2/+2
| | | | | | Follow #29834 Remove AddParamIfExist, use "AddParamString" instead, it should clearly know what is being added into the parameters.
* Refactor AddParam to AddParamIfExist (#29834)wxiaoguang2024-03-162-2/+2
| | | | | | | When read the code: `pager.AddParam(ctx, "search", "search")`, the question always comes: What is it doing? Where is the value from? Why "search" / "search" ? Now it is clear: `pager.AddParamIfExist("search", ctx.Data["search"])`
* Add user blocking (#29028)KN4CK3R2024-03-043-16/+61
| | | | | | | | | | | | | | | | | | | | | | Fixes #17453 This PR adds the abbility to block a user from a personal account or organization to restrict how the blocked user can interact with the blocker. The docs explain what's the consequence of blocking a user. Screenshots: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/4ed884f3-e06a-4862-afd3-3b8aa2488dc6) ![grafik](https://github.com/go-gitea/gitea/assets/1666336/ae6d4981-f252-4f50-a429-04f0f9f1cdf1) ![grafik](https://github.com/go-gitea/gitea/assets/1666336/ca153599-5b0f-4b4a-90fe-18bdfd6f0b6b) --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Filter Repositories by type (#29231)Tim-Niclas Oelschläger2024-03-031-0/+20
| | | | | | | | | | | | | Filter Repositories by type (resolves #1170, #1318) before: ![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb) after: ![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f)
* remove util.OptionalBool and related functions (#29513)65432024-03-021-4/+4
| | | | | | and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
* Rename Str2html to SanitizeHTML and clarify its behavior (#29516)wxiaoguang2024-03-011-2/+2
| | | | | Str2html was abused a lot. So use a proper name for it: SanitizeHTML And add some tests to show its behavior.
* Refactor some Str2html code (#29397)wxiaoguang2024-03-011-2/+3
| | | | | | | | | | | | | | | 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.
* Move context from modules to services (#29440)Lunny Xiao2024-02-2711-11/+11
| | | | | | | | | | | | | | | 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
* Unify organizations header (#29248)Tim-Nicas Oelschläger2024-02-231-18/+0
| | | | | | | | | | | | | | | 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>
* Refactor locale&string&template related code (#29165)wxiaoguang2024-02-142-4/+4
| | | | | | Clarify when "string" should be used (and be escaped), and when "template.HTML" should be used (no need to escape) And help PRs like #29059 , to render the error messages correctly.
* bump to use go 1.22 (#29119)techknowlogick2024-02-141-4/+4
|
* Unify user update methods (#28733)KN4CK3R2024-02-041-38/+35
| | | | | | | | | | | Fixes #28660 Fixes an admin api bug related to `user.LoginSource` Fixed `/user/emails` response not identical to GitHub api This PR unifies the user update methods. The goal is to keep the logic only at one place (having audit logs in mind). For example, do the password checks only in one method not everywhere a password is updated. After that PR is merged, the user creation should be next.
* Improve user search display name (#29002)KN4CK3R2024-02-011-2/+1
| | | | | | | | | | | | | | | | | I tripped over this strange method and I don't think we need that workaround to fix the value. old: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/c8b6797b-eb45-4dec-99db-1b0649a34ec5) new: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/ab1a65ae-de5b-4ce4-9813-3b8b39c7922e) --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Rework markup link rendering (#26745)KN4CK3R2024-01-151-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #26548 This PR refactors the rendering of markup links. The old code uses `strings.Replace` to change some urls while the new code uses more context to decide which link should be generated. The added tests should ensure the same output for the old and new behaviour (besides the bug). We may need to refactor the rendering a bit more to make it clear how the different helper methods render the input string. There are lots of options (resolve links / images / mentions / git hashes / emojis / ...) but you don't really know what helper uses which options. For example, we currently support images in the user description which should not be allowed I think: <details> <summary>Profile</summary> https://try.gitea.io/KN4CK3R ![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5) </details> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix wrong link in user and organization profile when using relative url (#28617)katsu2023-12-271-6/+11
| | | | | | | | | | fix #28436. the doc https://docs.gitea.com/usage/profile-readme maybe also need to be updated to tell that the main branch is necessary,which means the following three conditions should be satisfied: - repo: **.profile** - branch: **[default branch]** - markdown: **README.md**
* Use db.Find instead of writing methods for every object (#28084)Lunny Xiao2023-11-243-5/+12
| | | | For those simple objects, it's unnecessary to write the find and count methods again and again.
* Improve profile for Organizations (#27982)yp053272023-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes some problems in #27955: - autofocus of the search box before: if access the home page will jump to the search box ![image](https://github.com/go-gitea/gitea/assets/18380374/7f100e8d-2bd6-4563-85ba-d6008ffc71d7) after: will not jump to the search box ![image](https://github.com/go-gitea/gitea/assets/18380374/9aab382c-8ebe-4d18-b990-4adbb6c341ad) - incorrect display of overview tab before: ![image](https://github.com/go-gitea/gitea/assets/18380374/b24c79e8-9b79-4576-9276-43bd19172043) after: ![image](https://github.com/go-gitea/gitea/assets/18380374/7aab5827-f086-4874-bd84-39bd81b872f3) - improve the permission check to the private profile repo In #26295, we simply added access control to the private profile. But if user have access to the private profile repo , we should also display the profile. - add a button which can jump to the repo list? I agree @wxiaoguang 's opinion here: https://github.com/go-gitea/gitea/pull/27955#issuecomment-1803178239 But it seems that this feature is sponsored. So can we add a button which can quickly jump to the repo list or just move profile to the `overview` page? --------- Co-authored-by: silverwind <me@silverwind.io>
* Add Profile Readme for Organisations (#27955)65432023-11-091-0/+26
| | | | | | | | | | | | | | | | | https://blog.gitea.com/release-of-1.20.0/#-user-profile-readme-23260 (#23260) did introduce Profile Readme for Users. This makes it usable for Organisations: ![image](https://github.com/go-gitea/gitea/assets/24977596/464ab58b-a952-414b-8a34-6deaeb4f7d35) --- *Sponsored by Kithara Software GmbH* --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix the missing repo count in new team page and edit team page (#27743)8532023-10-251-0/+8
| | | | | | | | | | | | | | | | | Follow #26942 Before: ![image](https://github.com/go-gitea/gitea/assets/8389962/ffe3e914-c71c-493f-965b-369f27c70b4b) ![image](https://github.com/go-gitea/gitea/assets/8389962/eaad4f07-b8ce-4564-b883-97938de5ed79) After: ![image](https://github.com/go-gitea/gitea/assets/8389962/353aeabe-caf4-4449-8330-d3a29f9bd326) ![image](https://github.com/go-gitea/gitea/assets/8389962/baf59bb6-2c74-4a56-a28c-1519bc3d2594)
* Delete repos of org when purge delete user (#27273)JakobDev2023-10-191-2/+2
| | | | | | | Fixes https://codeberg.org/forgejo/forgejo/issues/1514 I had to remove `RenameOrganization` to avoid circular import. We should really add some foreign keys to the database.
* Replace more db.DefaultContext (#27628)Lunny Xiao2023-10-152-4/+4
| | | Target #27065
* Final round of `db.DefaultContext` refactor (#27587)JakobDev2023-10-141-1/+1
| | | Last part of #27065
* Penultimate round of `db.DefaultContext` refactor (#27414)JakobDev2023-10-113-3/+3
| | | | | | | Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Even more `db.DefaultContext` refactor (#27352)JakobDev2023-10-033-7/+7
| | | | | | | | Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* More `db.DefaultContext` refactor (#27265)JakobDev2023-09-291-8/+8
| | | | | | | Part of #27065 This PR touches functions used in templates. As templates are not static typed, errors are harder to find, but I hope I catch it all. I think some tests from other persons do not hurt.
* make writing main test easier (#27270)Lunny Xiao2023-09-281-4/+1
| | | | | | | | | This PR removed `unittest.MainTest` the second parameter `TestOptions.GiteaRoot`. Now it detects the root directory by current working directory. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Another round of `db.DefaultContext` refactor (#27103)JakobDev2023-09-251-1/+1
| | | | | | | Part of #27065 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Next round of `db.DefaultContext` refactor (#27089)JakobDev2023-09-162-3/+3
| | | Part of #27065
* More refactoring of `db.DefaultContext` (#27083)JakobDev2023-09-151-1/+1
| | | Next step of #27065
* Reduce usage of `db.DefaultContext` (#27073)JakobDev2023-09-143-13/+13
| | | | | | | | | | | | | | Part of #27065 This reduces the usage of `db.DefaultContext`. I think I've got enough files for the first PR. When this is merged, I will continue working on this. Considering how many files this PR affect, I hope it won't take to long to merge, so I don't end up in the merge conflict hell. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>