Refactor RA creation stuff, again

This commit is contained in:
2020-06-03 15:15:02 +01:00
parent 3768f4a613
commit d31900c5c3
9 changed files with 74 additions and 41 deletions

View File

@@ -3,7 +3,7 @@
{% load static %}
{% load help_text from filters %}
{% block title %}{% if object.pk %}Edit{% else %}Create{% endif %} Risk Assessment for Event N{{ event.pk|stringformat:"05d" }}{% endblock %}
{% block title %}{% if edit %}Edit{% else %}Create{% endif %} Risk Assessment for Event N{{ event.pk|stringformat:"05d" }}{% endblock %}
{% block css %}
{{ block.super }}
@@ -29,8 +29,12 @@
{% block content %}
<div class="col-sm-offset-1 col-sm-10">
<h3>{% if object.pk %}Edit{% else %}Create{% endif %} Risk Assessment for Event N{{ event.pk|stringformat:"05d" }}</h3>
<form role="form" method="POST">
<h3>{% if edit %}Edit{% else %}Create{% endif %} Risk Assessment for Event N{{ event.pk|stringformat:"05d" }}</h3>
{% if edit %}
<form method="POST" action="{% url 'ra_edit' pk=object.pk %}">
{% else %}
<form role="form" method="POST" action="{% url 'event_ra' pk=event.pk %}">
{% endif %}
{% csrf_token %}
<div class="row">
<div class="col-12">