Add common "form poster" logic, to make CSRF token/header names configurable
also refactor the Feedback logic to use it
This commit is contained in:
parent
a801672821
commit
cc833c52b6
6 changed files with 66 additions and 29 deletions
|
@ -2,6 +2,7 @@
|
|||
<%namespace file="/grids/nav.mako" import="grid_index_nav" />
|
||||
<%namespace file="/autocomplete.mako" import="tailbone_autocomplete_template" />
|
||||
<%namespace name="base_meta" file="/base_meta.mako" />
|
||||
<%namespace file="/formposter.mako" import="declare_formposter_mixin" />
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -487,6 +488,7 @@
|
|||
</%def>
|
||||
|
||||
<%def name="declare_whole_page_vars()">
|
||||
${declare_formposter_mixin()}
|
||||
${h.javascript_link(request.static_url('tailbone:static/themes/falafel/js/tailbone.feedback.js') + '?ver={}'.format(tailbone.__version__))}
|
||||
<script type="text/javascript">
|
||||
|
||||
|
@ -523,7 +525,6 @@
|
|||
<%def name="modify_whole_page_vars()">
|
||||
<script type="text/javascript">
|
||||
|
||||
FeedbackFormData.csrftoken = ${json.dumps(request.session.get_csrf_token() or request.session.new_csrf_token())|n}
|
||||
FeedbackFormData.referrer = location.href
|
||||
|
||||
% if request.user:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue