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/templates
wxiaoguang ce73492d6f
Refactor `ctx` in templates (#23105)
Before, the `dict "ctx" ...` map is used to pass data between templates.

Now, more and more templates need to use real Go context:

* #22962
* #23092


`ctx` is a Go concept for `Context`, misusing it may cause problems, and
it makes it difficult to review or refactor.

This PR contains 2 major changes:

* In the top scope of a template, the `$` is the same as the `.`, so the
old labels_sidebar's `root` is the `ctx`. So this `ctx` could just be
removed.
bd7f218dce
* Rename all other `ctx` to `ctxData`, and it perfectly matches how it
comes from backend: `"ctxData": ctx.Data`.
7c01260e1d



From now on, there is no `ctx` in templates. There are only:

* `ctxData` for passing data
* `Context` for Go context
2 years ago
..
admin Fix missed `.hide` class (#23208) 2 years ago
api/packages/pypi Add Package Registry (#16510) 3 years ago
base Add accessibility to the menu on the navbar (#23059) 2 years ago
code Remove Fomantic-UI's `.hidden` CSS class for menu elements (#22895) 2 years ago
custom Add footer extra links template (#9576) 5 years ago
explore Add context cache as a request level cache (#22294) 2 years ago
mail Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2 years ago
org Hide 2FA status from other members in organization members list (#22999) 2 years ago
package Fix nil context in RenderMarkdownToHtml (#23092) 2 years ago
projects Projects: rename Board to Column in interface and improve consistency (#22767) 2 years ago
repo Refactor `ctx` in templates (#23105) 2 years ago
shared Fix no user listed in org teams page (#22979) 2 years ago
status Move helpers to be prefixed with `gt-` (#22879) 2 years ago
swagger Add "Reviewed by you" filter for pull requests (#22927) 2 years ago
user Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) 2 years ago
home.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
install.tmpl Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 2 years ago
post-install.tmpl Introduce customized HTML elements, fix incorrect AppUrl usages in templates (#22861) 2 years ago