mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-01-31 11:54:23 +01:00
Add teamId and teamName to base.html (#2106)
- Add `teamId` and `teamName` to the CTFd init object in `base.html` for easier integration with other JavaScript code
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
|
||||
- Create the `core-beta` theme and begin documenting the creation of themes using Vite
|
||||
- Add `userName` and `userEmail` to the CTFd init object in `base.html` for easier integration with other JavaScript code
|
||||
- Add `teamId` and `teamName` to the CTFd init object in `base.html` for easier integration with other JavaScript code
|
||||
- Adds the `Assets` constant to access front end assets from Jinja templates
|
||||
- Adds a `views.themes_beta` route to avoid the `.dev`/`.min` extension being added automatically to frontend asset urls
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
'userId': {{ Session.id }},
|
||||
'userName': "{{ User.name }}",
|
||||
'userEmail': "{{ User.email }}",
|
||||
'teamId': {{ Team.id | tojson }},
|
||||
'teamName': "{{ Team.name }}",
|
||||
'start': {{ Configs.start | tojson }},
|
||||
'end': {{ Configs.end | tojson }},
|
||||
'theme_settings': {{ Configs.theme_settings | tojson }}
|
||||
|
||||
@@ -69,6 +69,10 @@ def test_hidden_teams_visibility():
|
||||
|
||||
r = client.get("/teams")
|
||||
response = r.get_data(as_text=True)
|
||||
# Only search in body content
|
||||
body_start = response.find("<body>")
|
||||
body_end = response.find("</body>")
|
||||
response = response[body_start:body_end]
|
||||
assert team_name not in response
|
||||
|
||||
r = client.get("/api/v1/teams")
|
||||
@@ -79,6 +83,10 @@ def test_hidden_teams_visibility():
|
||||
|
||||
r = client.get("/scoreboard")
|
||||
response = r.get_data(as_text=True)
|
||||
# Only search in body content
|
||||
body_start = response.find("<body>")
|
||||
body_end = response.find("</body>")
|
||||
response = response[body_start:body_end]
|
||||
assert team_name not in response
|
||||
|
||||
r = client.get("/api/v1/scoreboard")
|
||||
|
||||
Reference in New Issue
Block a user