diff --git a/pagure/flask_app.py b/pagure/flask_app.py index acf554f..7d8f484 100644 --- a/pagure/flask_app.py +++ b/pagure/flask_app.py @@ -227,6 +227,7 @@ def set_request(): flask.current_app.config['DB_URL']) flask.g.version = pagure.__version__ + flask.g.confirmationform = pagure.forms.ConfirmationForm() # The API namespace has its own way of getting repo and username and # of handling errors diff --git a/pagure/templates/comment_update.html b/pagure/templates/comment_update.html index 3380d56..3248ae4 100644 --- a/pagure/templates/comment_update.html +++ b/pagure/templates/comment_update.html @@ -53,7 +53,7 @@ type: 'POST', data: { content: _text, - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'html', success: function(res) { diff --git a/pagure/templates/commit.html b/pagure/templates/commit.html index ec07604..76bcdbb 100644 --- a/pagure/templates/commit.html +++ b/pagure/templates/commit.html @@ -205,7 +205,7 @@ repouser: "{{ repo.user.user if repo.is_fork else '' }}", namespace: "{{ repo.namespace if repo.namespace else '' }}", commit_id: "{{ commitid }}", - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'json', success: function(res) { diff --git a/pagure/templates/commits.html b/pagure/templates/commits.html index 17bc120..3fe0300 100644 --- a/pagure/templates/commits.html +++ b/pagure/templates/commits.html @@ -114,7 +114,7 @@ {{ diff_commit_full.author | author2avatar(20) | safe }} {{ diff_commit_full.author.name }} • + title="{{ diff_commit_full.commit_time|format_ts }}"> • {{ diff_commit_full.commit_time|humanize }}   @@ -144,7 +144,7 @@ {% for commit in last_commits %} -
{% if diff_commits and commit.oid.hex in diff_commits %} @@ -173,7 +173,7 @@ author=commit.author.email), cssclass="notblue")|safe}} • + title="{{ commit.commit_time|format_ts }}"> • {{ commit.commit_time|humanize }}  
@@ -223,7 +223,7 @@ repo: "{{ repo.name }}", repouser: "{{ repo.user.user if repo.is_fork else '' }}", namespace: "{{ repo.namespace if repo.namespace else '' }}", - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'json', success: function(res) { diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 35d2b37..c19fc39 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -961,7 +961,7 @@ $( document ).ready(function() { type: 'POST', data: { content: _text, - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'html', success: function(res) { diff --git a/pagure/templates/new_issue.html b/pagure/templates/new_issue.html index 3c3a2b5..b4fc51c 100644 --- a/pagure/templates/new_issue.html +++ b/pagure/templates/new_issue.html @@ -233,7 +233,7 @@ $(document).ready(function() { url: _url , type: 'POST', data: { - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'json', success: function(res) { @@ -287,7 +287,7 @@ $(function() { type: 'POST', data: { content: _text, - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'html', success: function(res) { diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 8dd1783..ebbac29 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -1268,7 +1268,7 @@ $(document).ready(function() { type: 'POST', dataType: 'json', data: { - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, success: function(res) { var _text = '' diff --git a/pagure/templates/pull_request_title.html b/pagure/templates/pull_request_title.html index a1d90f3..c520597 100644 --- a/pagure/templates/pull_request_title.html +++ b/pagure/templates/pull_request_title.html @@ -102,7 +102,7 @@ type: 'POST', data: { content: _text, - csrf_token: "{{ confirmationform.csrf_token.current_token }}", + csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", }, dataType: 'html', success: function(res) { diff --git a/pagure/templates/repo_branches.html b/pagure/templates/repo_branches.html index a7b0fe3..d50894b 100644 --- a/pagure/templates/repo_branches.html +++ b/pagure/templates/repo_branches.html @@ -50,7 +50,7 @@ identifier=branch, branchname=branch) }}" title="{{ branch }}" data-toggle="tooltip">{{ branch }} - +
@@ -86,7 +86,7 @@ branchname=branch) }}" method="post" class="inline icon del_icon" onsubmit="return confirm('Are you sure you want to remove the branch: {{ branch }}?\nThis cannot be un-done!');"> - {{ confirmationform.csrf_token }} + {{ g.confirmationform.csrf_token }} {{ repo.user.user }} /  + }}">{{ repo.user.user }} /  {%- endif -%} {%- if repo.namespace -%} {{ repo.namespace }} /  + }}">{{ repo.namespace }} /  {%- endif -%} - {{watch_button_text}} + {{watch_button_text}} {{repo.watchers|length}}