mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 07:43:18 -05:00
c0d105609f
I guess many contributors might agree that it's really difficult to write Golang template. The dot syntax `.` confuses everyone: what variable it is .... So, we can use a `{{DumpVar .ContextUser}}` to look into every variable now. ![image](https://user-images.githubusercontent.com/2114189/233692383-f3c8f24d-4465-45f8-839b-b63e00731559.png) And it can even dump the whole `ctx.Data` by `{{DumpVar .}}`: ``` dumpVar: templates.Vars { "AllLangs": [ { "Lang": "id-ID", "Name": "Bahasa Indonesia" }, ... "Context": "[dumped]", "ContextUser": { "AllowCreateOrganization": true, "AllowGitHook": false, "AllowImportLocal": false, ... "TemplateLoadTimes": "[func() string]", "TemplateName": "user/profile", "Title": "Full'\u003cspan\u003e Name", "Total": 7, "UnitActionsGlobalDisabled": false, "UnitIssuesGlobalDisabled": false, "UnitProjectsGlobalDisabled": false, "UnitPullsGlobalDisabled": false, "UnitWikiGlobalDisabled": false, "locale": { "Lang": "en-US", "LangName": "English", "Locale": {} } ... --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: silverwind <me@silverwind.io> |
||
---|---|---|
.. | ||
actions | ||
activitypub | ||
analyze | ||
assetfs | ||
auth | ||
avatar | ||
base | ||
cache | ||
charset | ||
container | ||
context | ||
csv | ||
doctor | ||
emoji | ||
eventsource | ||
generate | ||
git | ||
gitgraph | ||
graceful | ||
hcaptcha | ||
highlight | ||
hostmatcher | ||
html | ||
httpcache | ||
httplib | ||
indexer | ||
issue/template | ||
json | ||
label | ||
lfs | ||
log | ||
markup | ||
mcaptcha | ||
metrics | ||
migration | ||
mirror | ||
nosql | ||
notification | ||
options | ||
packages | ||
paginator | ||
pprof | ||
private | ||
process | ||
proxy | ||
proxyprotocol | ||
public | ||
queue | ||
recaptcha | ||
references | ||
regexplru | ||
repository | ||
secret | ||
session | ||
setting | ||
sitemap | ||
ssh | ||
storage | ||
structs | ||
svg | ||
sync | ||
system | ||
templates | ||
test | ||
timeutil | ||
translation | ||
turnstile | ||
typesniffer | ||
updatechecker | ||
upload | ||
uri | ||
user | ||
util | ||
validation | ||
web | ||
webhook |