Emit more theme init data using tojson (#2182)

* Emit more theme init data using tojson
* Add `teamId` and `teamName` into admin `base.html`
This commit is contained in:
Kevin Chung
2022-09-07 14:40:42 -04:00
committed by GitHub
parent 328b523b24
commit 4793d95338
2 changed files with 11 additions and 9 deletions

View File

@@ -15,12 +15,14 @@
var init = {
'urlRoot': "{{ request.script_root }}",
'csrfNonce': "{{ Session.nonce }}",
'userMode': "{{ get_config('user_mode') }}",
'userId': {{ id if (id is defined) else 0 }},
'userName': "{{ User.name }}",
'userEmail': "{{ User.email }}",
'start': {{ get_config("start") | tojson }},
'end': {{ get_config("end") | tojson }},
'userMode': "{{ Configs.user_mode }}",
'userId': {{ Session.id }},
'userName': {{ User.name | tojson }},
'userEmail': {{ User.email | tojson }},
'teamId': {{ Team.id | tojson }},
'teamName': {{ Team.name | tojson }},
'start': {{ Configs.start | tojson }},
'end': {{ Configs.end | tojson }}
}
</script>
{% block stylesheets %} {% endblock %}

View File

@@ -18,10 +18,10 @@
'csrfNonce': "{{ Session.nonce }}",
'userMode': "{{ Configs.user_mode }}",
'userId': {{ Session.id }},
'userName': "{{ User.name }}",
'userEmail': "{{ User.email }}",
'userName': {{ User.name | tojson }},
'userEmail': {{ User.email | tojson }},
'teamId': {{ Team.id | tojson }},
'teamName': "{{ Team.name }}",
'teamName': {{ Team.name | tojson }},
'start': {{ Configs.start | tojson }},
'end': {{ Configs.end | tojson }},
'theme_settings': {{ Configs.theme_settings | tojson }}