1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-23 08:47:42 -05:00
forgejo/templates/repo/issue/labels
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
2023-03-02 11:44:06 -06:00
..
edit_delete_label.tmpl Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
label.tmpl Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
label_list.tmpl Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
label_load_template.tmpl Refactor i18n to locale (#20153) 2022-06-27 15:58:46 -05:00
label_new.tmpl Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
labels_sidebar.tmpl Refactor ctx in templates (#23105) 2023-03-02 11:44:06 -06:00