Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Taiko Web
Commits
841e9d37
Commit
841e9d37
authored
Mar 17, 2020
by
Bui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add csrftoken api route
parent
96b1ba4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
app.py
app.py
+5
-1
templates/admin_songs.html
templates/admin_songs.html
+5
-1
No files found.
app.py
View file @
841e9d37
...
@@ -112,7 +112,6 @@ def get_config():
...
@@ -112,7 +112,6 @@ def get_config():
config_out
[
'assets_baseurl'
]
=
''
.
join
([
request
.
host_url
,
'assets'
])
+
'/'
config_out
[
'assets_baseurl'
]
=
''
.
join
([
request
.
host_url
,
'assets'
])
+
'/'
config_out
[
'_version'
]
=
get_version
()
config_out
[
'_version'
]
=
get_version
()
config_out
[
'_csrf_token'
]
=
generate_csrf
()
return
config_out
return
config_out
...
@@ -138,6 +137,11 @@ def route_index():
...
@@ -138,6 +137,11 @@ def route_index():
return
render_template
(
'index.html'
,
version
=
version
,
config
=
get_config
())
return
render_template
(
'index.html'
,
version
=
version
,
config
=
get_config
())
@
app
.
route
(
'/api/csrftoken'
)
def
route_csrftoken
():
return
jsonify
({
'status'
:
'ok'
,
'token'
:
generate_csrf
()})
@
app
.
route
(
'/admin'
)
@
app
.
route
(
'/admin'
)
@
admin_required
(
level
=
50
)
@
admin_required
(
level
=
50
)
def
route_admin
():
def
route_admin
():
...
...
templates/admin_songs.html
View file @
841e9d37
...
@@ -10,7 +10,11 @@
...
@@ -10,7 +10,11 @@
{% for song in songs %}
{% for song in songs %}
<a
href=
"/admin/songs/{{ song.id }}"
class=
"song-link"
>
<a
href=
"/admin/songs/{{ song.id }}"
class=
"song-link"
>
<div
class=
"song"
>
<div
class=
"song"
>
<p>
{{ song.title }}
</p>
{% if song.title_lang.en %}
<p>
{{ song.title_lang.en }}
<small>
({{ song.title }})
</small></p>
{% else %}
<p>
{{ song.title }}
</p>
{% endif %}
</div>
</div>
</a>
</a>
{% endfor %}
{% endfor %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment