You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers/web/repo
JakobDev aaa1094663
Add the ability to pin Issues (#24406)
This adds the ability to pin important Issues and Pull Requests. You can
also move pinned Issues around to change their Position. Resolves #2175.

## Screenshots

![grafik](https://user-images.githubusercontent.com/15185051/235123207-0aa39869-bb48-45c3-abe2-ba1e836046ec.png)

![grafik](https://user-images.githubusercontent.com/15185051/235123297-152a16ea-a857-451d-9a42-61f2cd54dd75.png)

![grafik](https://user-images.githubusercontent.com/15185051/235640782-cbfe25ec-6254-479a-a3de-133e585d7a2d.png)

The Design was mostly copied from the Projects Board.

## Implementation
This uses a new `pin_order` Column in the `issue` table. If the value is
set to 0, the Issue is not pinned. If it's set to a bigger value, the
value is the Position. 1 means it's the first pinned Issue, 2 means it's
the second one etc. This is dived into Issues and Pull requests for each
Repo.

## TODO
- [x] You can currently pin as many Issues as you want. Maybe we should
add a Limit, which is configurable. GitHub uses 3, but I prefer 6, as
this is better for bigger Projects, but I'm open for suggestions.
- [x] Pin and Unpin events need to be added to the Issue history.
- [x] Tests
- [x] Migration

**The feature itself is currently fully working, so tester who may find
weird edge cases are very welcome!**

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
..
actions Implement actions artifacts (#22738) 2 years ago
setting Move secrets and runners settings to actions settings (#24200) 2 years ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Decouple the different contexts from each other (#24786) 2 years ago
blame.go Sort repo topic labels by name (#24123) 2 years ago
branch.go Improve RSS (#24335) 2 years ago
cherry_pick.go Rename almost all Ctx functions (#22071) 2 years ago
commit.go Pass 'not' to commit count (#24473) 2 years ago
compare.go Don't list root repository on compare page if pulls not allowed (#24183) 2 years ago
download.go Decouple the different contexts from each other (#24786) 2 years ago
editor.go Create pull request for base after editing file, if not enabled on fork (#24841) 2 years ago
editor_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
helper.go Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2 years ago
helper_test.go Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2 years ago
http.go Decouple the different contexts from each other (#24786) 2 years ago
http_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue.go Add the ability to pin Issues (#24406) 2 years ago
issue_content_history.go Move helpers to be prefixed with `gt-` (#22879) 2 years ago
issue_dependency.go Add API to manage issue dependencies (#17935) 2 years ago
issue_label.go Make label templates have consistent behavior and priority (#23749) 2 years ago
issue_label_test.go Make label templates have consistent behavior and priority (#23749) 2 years ago
issue_lock.go Fix improper HTMLURL usages in Go code (#22839) 2 years ago
issue_pin.go Add the ability to pin Issues (#24406) 2 years ago
issue_stopwatch.go Speed up HasUserStopwatch & GetActiveStopwatch (#23051) 2 years ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Fix improper HTMLURL usages in Go code (#22839) 2 years ago
issue_watch.go Rewrite logger system (#24726) 2 years ago
lfs.go Introduce path Clean/Join helper functions (#23495) 2 years ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Use graceful editorconfig loader to reduce errors when loading malformed editorconfigs (#21257) 2 years ago
migrate.go Make repo migration cancelable and fix various bugs (#24605) 2 years ago
milestone.go Improve Gitea's web context, decouple "issue template" code into service package (#24590) 2 years ago
packages.go Use dynamic package type list (#22263) 2 years ago
patch.go Redirect to the commit page after applying patch (#23056) 2 years ago
projects.go Add unset default project column (#23531) 2 years ago
projects_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
pull.go Add IsErrRepoFilesAlreadyExist check when fork repo (#24678) 2 years ago
pull_review.go Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245) 2 years ago
release.go fix: release page for empty or non-existing target (#24470) 2 years ago
release_test.go fix: release page for empty or non-existing target (#24470) 2 years ago
render.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Remove the parallelizing when loading repo for dashboard (#24705) 2 years ago
search.go Fix improper HTMLURL usages in Go code (#22839) 2 years ago
setting.go Refactor Pull Mirror and fix out-of-sync bugs (#24732) 2 years ago
setting_protected_branch.go Support for status check pattern (#24633) 2 years ago
settings_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag.go Add main landmark to templates and adjust titles (#22670) 2 years ago
topic.go Implement FSFE REUSE for golang files (#21840) 2 years ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Improve Gitea's web context, decouple "issue template" code into service package (#24590) 2 years ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
webhook.go New webhook trigger for receiving Pull Request review requests (#24481) 2 years ago
wiki.go Decouple the different contexts from each other (#24786) 2 years ago
wiki_test.go Make wiki title supports dashes and improve wiki name related features (#24143) 2 years ago