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/modules
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 show workflow config error on file view also (#24267) 2 years ago
activitypub Add Chef package registry (#22554) 2 years ago
analyze
assetfs Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
auth Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
avatar Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2 years ago
base Use a general Eval function for expressions in templates. (#23927) 2 years ago
cache Update redis library to support redis v7 (#24114) 2 years ago
charset Update go tool dependencies, restructure lint targets (#24239) 2 years ago
container
context Fix install page context, make the install page tests really test (#24858) 2 years ago
csv Refactor locale number (#24134) 2 years ago
doctor Rewrite logger system (#24726) 2 years ago
emoji Fix unstable emoji sort (#22346) 2 years ago
eventsource
generate
git Merge different languages for language stats (#24900) 2 years ago
gitgraph Add context cache as a request level cache (#22294) 2 years ago
graceful Fix regression: access log template, gitea manager cli command (#24838) 2 years ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 2 years ago
highlight test_env: hardcode major go version in use (#23464) 2 years ago
hostmatcher
html
httpcache Use standard HTTP library to serve files (#24693) 2 years ago
httplib Use standard HTTP library to serve files (#24693) 2 years ago
indexer Allow skipping forks and mirrors from being indexed (#23187) 2 years ago
issue/template Allow issue templates to not render title (#22589) 2 years ago
json
label Make label templates have consistent behavior and priority (#23749) 2 years ago
lfs Rewrite logger system (#24726) 2 years ago
log Merge different languages for language stats (#24900) 2 years ago
markup Fix video width overflow in markdown, and other changes to match img (#24834) 2 years ago
mcaptcha
metrics include build info in Prometheus metrics (#22819) 2 years ago
migration Scoped labels (#22585) 2 years ago
mirror Rewrite queue (#24505) 2 years ago
nosql Update redis library to support redis v7 (#24114) 2 years ago
notification Rewrite queue (#24505) 2 years ago
options Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
packages Add CRAN package registry (#22331) 2 years ago
paginator Use more specific test methods (#24265) 2 years ago
pprof
private Add gitea manager reload-templates command (#24843) 2 years ago
process Improve trace logging for pulls and processes (#22633) 2 years ago
proxy Use proxy for pull mirror (#22771) 2 years ago
proxyprotocol
public Use standard HTTP library to serve files (#24693) 2 years ago
queue Do not call nil handler for a dummy queue (#24880) 2 years ago
recaptcha
references Use correct captured group range when parsing cross-reference (#22672) 2 years ago
regexplru
repository Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2 years ago
secret Improve decryption failure message (#24573) 2 years ago
session Update redis library to support redis v7 (#24114) 2 years ago
setting Add the ability to pin Issues (#24406) 2 years ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Rewrite logger system (#24726) 2 years ago
storage Implement actions artifacts (#22738) 2 years ago
structs Add the ability to pin Issues (#24406) 2 years ago
svg Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
sync
system
templates Improve RunMode / dev mode (#24886) 2 years ago
test Rewrite logger system (#24726) 2 years ago
testlogger Rewrite logger system (#24726) 2 years ago
timeutil Fix incorrect webhook time and use relative-time to display it (#24477) 2 years ago
translation Decouple the different contexts from each other (#24786) 2 years ago
turnstile Add new captcha: cloudflare turnstile (#22369) 2 years ago
typesniffer Do not recognize text files as audio (#23355) 2 years ago
updatechecker
upload
uri
user
util Rewrite logger system (#24726) 2 years ago
validation Map OIDC groups to Orgs/Teams (#21441) 2 years ago
web Fix install page context, make the install page tests really test (#24858) 2 years ago
webhook New webhook trigger for receiving Pull Request review requests (#24481) 2 years ago