forgejo/templates
wxiaoguang 5d77691d42
Improve template system and panic recovery (#24461)
Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>
2023-05-04 14:36:34 +08:00
..
admin Replace N/A with - everywhere (#24474) 2023-05-02 05:54:29 -04:00
api/packages/pypi Remove incorrect HTML self close tag (#23748) 2023-03-27 18:05:51 +02:00
base Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
code Use data-tooltip-content for tippy tooltip (#23649) 2023-03-24 18:35:38 +08:00
custom Add footer extra links template (#9576) 2020-01-03 20:41:56 +02:00
devtest Improve some modal action buttons (#24289) 2023-04-24 07:08:59 -04:00
explore Improve "new-menu" (#24465) 2023-05-01 12:08:37 -04:00
mail Remove incorrect HTML self close tag (#23748) 2023-03-27 18:05:51 +02:00
org Prevent a user with a different email from accepting the team invite (#24491) 2023-05-03 21:21:58 -04:00
package Clean up polluted styles and remove dead CSS code (#24497) 2023-05-03 14:32:10 -04:00
projects Make Issue/PR/projects more compact, misc CSS tweaks (#24459) 2023-05-03 17:58:59 -04:00
repo Fix incorrect webhook time and use relative-time to display it (#24477) 2023-05-03 19:53:43 -04:00
shared Improve template helper (#24417) 2023-04-29 08:02:29 -04:00
status Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
swagger Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
user Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
home.tmpl Improve home page template, fix Sort dropdown menu flash (#23856) 2023-04-01 13:47:54 +08:00
install.tmpl Remove incorrect HTML self close tag (#23748) 2023-03-27 18:05:51 +02:00
post-install.tmpl Remove incorrect HTML self close tag (#23748) 2023-03-27 18:05:51 +02:00