Issue #449: Display and change order locale (#459)

* Add more security headers (#458)

* Include some missing security headers

This change adds the following security headers:
* X-Content-Type-Options to prevent content type sniffing
* Referrer-Policy to prevent leaking referrer information when navigating away from the instance

* Migrate from Docker sample to manual configuration

Migrate the additional security headers from the Docker configuration sample to the manual configuration guide.

Add DS_Store to gitingore

* Show order locale in order details

* Add OrderLocaleChange view and OrderLocaleForm

Refactor OrderLocaleForm. Add test
This commit is contained in:
Jahongir
2017-04-11 13:45:46 +05:00
committed by Raphael Michel
parent 984d5c716b
commit ccb981e6ce
7 changed files with 114 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}
{% trans "Change locale information" %}
{% endblock %}
{% block content %}
<h1>
{% trans "Change locale information" %}
</h1>
<p>
This language will be used whenever emails are sent to the users.
</p>
<form method="post" class="form-horizontal" href="">
{% csrf_token %}
<input type="hidden" name="status" value="c" />
{% bootstrap_form form layout='horizontal' %}
<div class="form-group submit-group">
<a class="btn btn-default btn-lg"
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
{% trans "Cancel" %}
</a>
<button class="btn btn-primary btn-save btn-lg" type="submit">
{% trans "Save" %}
</button>
<div class="clearfix"></div>
</div>
</form>
{% endblock %}

View File

@@ -71,6 +71,13 @@
<dl class="dl-horizontal">
<dt>{% trans "Order code" %}</dt>
<dd>{{ order.code }}</dd>
<dt>{% trans "Order locale" %}</dt>
<dd>
{{ order.locale }}
<a href="{% url "control:event.order.locale" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}" class="btn btn-default btn-xs">
<span class="fa fa-edit"></span>
</a>
</dd>
<dt>{% trans "Order date" %}</dt>
<dd>{{ order.datetime }}</dd>
{% if order.status == "p" %}