add validation of existing file

This commit is contained in:
2018-06-07 16:54:13 +02:00
parent 299491cb5b
commit fcc74c993d
11 changed files with 75 additions and 8 deletions

View File

@@ -1 +0,0 @@
{{ form_widget(form) }}

View File

@@ -17,14 +17,32 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
{% set activeRouteKey = '' %}
{% block title %}{{ 'Editing document for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName } )|capitalize }}{% endblock %}
{% block personcontent %}
<h1>{{ 'Edit Document' | trans }}</h1>
{{ form_errors(form) }}
{{ form_start(form) }}
{{ include('ChillDocStoreBundle:PersonDocument:_form.html.twig', {'button_label': 'Update'}) }}
{{ form_row(form.title) }}
{{ form_row(form.date) }}
{{ form_row(form.category) }}
{{ form_row(form.scope) }}
{{ form_row(form.description) }}
<div class="container">
<div class="grid-4 clear">
<label>{{ 'Existing document'|trans }}</label>
</div>
<div class="grid-8">
{{ m.download_button(document.object, document.title) }}
</div>
</div>
{{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }}
<ul class="record_actions">
<li class="cancel">
@@ -33,16 +51,20 @@
</a>
</li>
<li class="edit">
<button class="sc-button bt-edit">{{ 'Edit'|trans }}</button>
<button class="sc-button bt-edit">{{ 'Edit'|trans }}</button>
</li>
{% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
{# {% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
{{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }}
</li>
{% endif %}
{% endif %} #}
</ul>
{{ form_end(form) }}
{% endblock %}
{% block js %}
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script>
{% endblock %}

View File

@@ -22,9 +22,11 @@
{% block personcontent %}
<h1>{{ 'Create new Document' | trans }}</h1>
{{ form_errors(form) }}
{{ form_start(form) }}
{{ include('ChillDocStoreBundle:PersonDocument:_form.html.twig') }}
{{ form_widget(form) }}
<ul class="record_actions">
<li class="cancel">