Files
Phraseanet/templates/web/admin/statusbit.html.twig
Romain Neutron e7421e1fdd Fix twig tags
2013-12-03 20:02:39 +01:00

87 lines
3.6 KiB
Twig

{% set status = databox.get_statusbits() %}
{% set databox_id = databox.get_sbas_id() %}
<h1>
{{ 'phraseanet::status bit' | trans }}
</h1>
<table class="table table-striped table-condensed">
<thead>
<th style="width:30px;">{{ 'status:: numero de bit' | trans }}</th>
<th style="width:60px;" colspan='2'></th>
<th>{{ 'status:: nom' | trans }}</th>
<th>{{ 'status:: cherchable par tous' | trans }}</th>
<th>{{ 'status:: Affichable pour tous' | trans }}</th>
</thead>
<tbody>
{% for bit in range(4, 31) %}
<tr>
<td>
{{ bit }}
</td>
{% if attribute(status, bit) is defined %}
<td>
<a target="right" href="{{ path('database_display_statusbit_form', { 'databox_id' : databox_id, 'bit' : bit }) }}" class="ajax">
<img class="editer" src="/skins/icons/edit_0.gif" />
</a>
</td>
<td>
<form method="post" action="{{ path('admin_statusbit_delete', { 'databox_id' : databox_id, 'bit' : bit }) }}">
<img class="deleter submiter" src="/skins/icons/delete_0.gif" />
</form>
</td>
{% else %}
<td colspan="2">
<a target="right" href="{{ path('database_display_statusbit_form', { 'databox_id' : databox_id, 'bit' : bit }) }}" class="ajax">
<img class="adder" src="/skins/icons/light_new.gif" />
</a>
</td>
{% endif %}
{% if attribute(status, bit) is defined %}
{% set statusbit = attribute(status, bit) %}
<td>
{% if statusbit['img_off'] %}
<img title='{{ statusbit['labels_off_i18n'][app['locale.I18n']] }}' src='{{ statusbit['img_off'] }}' />
{% endif %}
{{ statusbit['labels_off_i18n'][app['locale.I18n']] }}
/
{% if statusbit['img_on'] %}
<img title='{{ statusbit['labels_on_i18n'][app['locale.I18n']] }}' src='{{ statusbit['img_on'] }}' />
{% endif %}
{{ statusbit['labels_on_i18n'][app['locale.I18n']] }}
</td>
<td>{{ statusbit['searchable'] is defined and statusbit['searchable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
<td>{{ statusbit['printable'] is defined and statusbit['printable'] == '1' ? 'oui'| trans : 'non'| trans }}</td>
{% else %}
<td></td>
<td></td>
<td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$(".submiter").click(function(){
var $this = $(this);
var form = $this.closest('form');
$.ajax({
dataType: 'JSON',
type: form.attr('method'),
url: form.attr('action'),
datas: {},
success: function(data){
if (data.success) {
$(".treeview li.selected a").trigger("click");
} else {
alert('{{ 'An error occurred' | trans }}');
}
}
});
});
});
</script>