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/repo/issue
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
..
fields Fix nil context in RenderMarkdownToHtml (#23092) 2 years ago
labels Refactor `ctx` in templates (#23105) 2 years ago
view_content Refactor `ctx` in templates (#23105) 2 years ago
branch_selector_field.tmpl Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 2 years ago
choose.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
comment_tab.tmpl Fix nil context in RenderMarkdownToHtml (#23092) 2 years ago
label_precolors.tmpl Fix purple color in suggested label colors (#18241) 3 years ago
labels.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
list.tmpl Add "Reviewed by you" filter for pull requests (#22927) 2 years ago
milestone_issues.tmpl Add "Reviewed by you" filter for pull requests (#22927) 2 years ago
milestone_new.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
milestones.tmpl Move helpers to be prefixed with `gt-` (#22879) 2 years ago
navbar.tmpl Add some headings to repo views (#22869) 2 years ago
new.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
new_form.tmpl Refactor `ctx` in templates (#23105) 2 years ago
openclose.tmpl Move helpers to be prefixed with `gt-` (#22879) 2 years ago
search.tmpl Issues: add Project filter to issues list and search (#22544) 2 years ago
view.tmpl Add main landmark to templates and adjust titles (#22670) 2 years ago
view_content.tmpl Refactor `ctx` in templates (#23105) 2 years ago
view_title.tmpl Fix pull request branch selector visible without clicking Edit (#23012) 2 years ago