forgejo/templates/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>
2023-05-25 15:17:19 +02:00
..
actions Improvements for action detail page (#24718) 2023-05-22 12:17:24 +08:00
branch Rework notifications list (#24812) 2023-05-25 02:31:26 +00:00
cite
diff Change --font-weight-bold to --font-weight-semibold and 600 value, introduce new font weight variables (#24827) 2023-05-21 23:37:32 +00:00
editor Create pull request for base after editing file, if not enabled on fork (#24841) 2023-05-24 21:36:02 +00:00
find
graph
issue Add the ability to pin Issues (#24406) 2023-05-25 15:17:19 +02:00
migrate Rework Oauth login buttons, swap github logo to monocolor (#24740) 2023-05-15 22:46:51 +00:00
projects Use shared/issueicon template in projects (#24922) 2023-05-25 14:25:31 +02:00
pulls Make diff view full width again (#24598) 2023-05-09 05:21:03 +00:00
release RSS icon fixes (#24476) 2023-05-10 22:27:02 +00:00
settings New webhook trigger for receiving Pull Request review requests (#24481) 2023-05-24 22:06:27 -04:00
tag RSS icon fixes (#24476) 2023-05-10 22:27:02 +00:00
wiki
activity.tmpl
blame.tmpl Improve accessibility when (re-)viewing files (#24817) 2023-05-21 20:47:41 +00:00
branch_dropdown.tmpl
clone_buttons.tmpl
clone_script.tmpl
commit_page.tmpl
commit_status.tmpl
commit_statuses.tmpl
commits.tmpl
commits_list.tmpl
commits_list_small.tmpl Clean up various avatar dimensions (#24701) 2023-05-14 14:15:59 +00:00
commits_table.tmpl
create.tmpl
create_helper.tmpl
empty.tmpl
file_info.tmpl
forks.tmpl
graph.tmpl
header.tmpl Refactor Pull Mirror and fix out-of-sync bugs (#24732) 2023-05-15 19:02:10 +00:00
home.tmpl Show new pull request button also on subdirectories and files (#24842) 2023-05-22 07:57:00 +00:00
icon.tmpl
packages.tmpl
release_tag_header.tmpl Remove svg.svg class, restore .rss-icon (#24667) 2023-05-12 10:23:53 +00:00
search.tmpl
search_name.tmpl
shabox_badge.tmpl
sub_menu.tmpl Change --font-weight-bold to --font-weight-semibold and 600 value, introduce new font weight variables (#24827) 2023-05-21 23:37:32 +00:00
unicode_escape_prompt.tmpl
upload.tmpl
user_cards.tmpl
view_file.tmpl Improve accessibility when (re-)viewing files (#24817) 2023-05-21 20:47:41 +00:00
view_list.tmpl Rework notifications list (#24812) 2023-05-25 02:31:26 +00:00
watchers.tmpl