103 lines
4.6 KiB
Twig
103 lines
4.6 KiB
Twig
{% extends 'data_entry.html.twig' %}
|
|
|
|
{% block title %}Vocab - Functional context | ArCOA{% endblock %}
|
|
|
|
{% block rightpanel %}
|
|
<div class="container" style="max-width: 50vw">
|
|
<h1 class="is-size-1 mt-0 has-text-centered">Vocabulary</h1>
|
|
<h2 class="is-size-3 mt-4 has-text-centered">Functional context</h2>
|
|
|
|
<div class="container mt-6">
|
|
<!-- For AJAX calls... TODO: not working from controller? -->
|
|
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %}
|
|
<form method="post" action="{{ path('app_vocab_func_context_add') }}">
|
|
<label class="label">Add new term</label>
|
|
<div class="field has-addons">
|
|
<div class="control">
|
|
<input class="input" name="_term" type="text" placeholder="Add new term">
|
|
</div>
|
|
<div class="control">
|
|
<button type="submit" class="button is-link">
|
|
Add
|
|
<span class="icon ml-3">
|
|
<i class="fa fa-plus"></i>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
|
|
<div class="notification is-success is-hidden mt-5"
|
|
data-controller="notification"
|
|
data-notification-target=""="notif">
|
|
<button class="delete" data-action="click->notification#close"></button>
|
|
</div>
|
|
{% for message in app.flashes('notice') %}
|
|
<div class="notification is-success mt-5" data-controller="notification"
|
|
data-notification-target="notif">
|
|
<button class="delete" data-action="click->notification#close"></button>
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
<h3 class="mt-6 mb-5 is-size-5"><strong>Terms in vocabulary</strong></h3>
|
|
<table class="table is-fullwidth" id="terms" data-controller="vocabs">
|
|
<tr><th>Term</th>{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %}<th>Actions</th>{% endif %}</tr>
|
|
{% for term in terms %}
|
|
<tr data-vocabs-target="row"
|
|
data-vocabs-id-value="{{ term.id }}">
|
|
<td>
|
|
<input class="input" type="text" value="{{ term.term }}" disabled
|
|
data-vocabs-id-value="{{ term.id }}" data-vocabs-target="input" />
|
|
</td>
|
|
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %}
|
|
<td>
|
|
<div class="buttons">
|
|
<button class="button is-primary is-hidden"
|
|
data-vocabs-target="save"
|
|
data-action="click->vocabs#save"
|
|
data-vocabs-saveUrl-value="{{ path('app_vocab_func_context_upd') }}"
|
|
data-vocabs-id-value="{{ term.id }}">
|
|
Save
|
|
<span class="icon ml-2">
|
|
<i class="fa fa-save"></i>
|
|
</span>
|
|
</button>
|
|
<button class="button is-hidden"
|
|
data-vocabs-id-value="{{ term.id }}"
|
|
data-vocabs-target="cancel"
|
|
data-action="click->vocabs#cancel">
|
|
Cancel
|
|
<span class="icon ml-2">
|
|
<i class="fa fa-times"></i>
|
|
</span>
|
|
</button>
|
|
<button class="button is-link"
|
|
data-vocabs-target="edit"
|
|
data-vocabs-id-value="{{ term.id }}"
|
|
data-action="click->vocabs#edit">
|
|
Edit
|
|
<span class="icon ml-2">
|
|
<i class="fa fa-edit"></i>
|
|
</span>
|
|
</button>
|
|
<button class="button is-danger"
|
|
data-vocabs-id-value="{{ term.id }}"
|
|
data-action="click->vocabs#delete"
|
|
data-vocabs-delUrl-value="{{ path('app_vocab_func_context_del') }}">
|
|
Delete
|
|
<span class="icon ml-2">
|
|
<i class="fa fa-trash"></i>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" defer></script>
|
|
{% endblock %} |