{% extends './layout/default' %}

{% block breadcrumbs %}
    {{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">{{ 'journal_link_configuration'|_ }}</h3>
                </div>
                <div class="box-body no-padding">
                    <table class="table table-hover sortable">
                        <thead>
                        <tr>
                            <th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
                            <th data-defaultsign="az">{{ trans('list.name') }}</th>
                            <th class="hidden-sm hidden-xs" data-defaultsign="az">{{ trans('list.inward') }}</th>
                            <th class="hidden-sm hidden-xs" data-defaultsign="az">{{ trans('list.outward') }}</th>
                            <th data-defaultsign="_19">{{ trans('list.number_of_transactions') }}</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for linkType in linkTypes %}
                            <tr>
                                <td>
                                    {% if linkType.editable %}
                                        <div class="btn-group btn-group-xs">
                                            <a class="btn btn-default btn-xs" href="{{ route('settings.links.edit',linkType.id) }}"><span
                                                    class="fa fa-fw fa-pencil"></span></a>
                                            <a class="btn btn-danger btn-xs" href="{{ route('settings.links.delete',linkType.id) }}"><span
                                                    class="fa fa-fw fa-trash-o"></span></a>
                                        </div>
                                    {% endif %}
                                </td>
                                <td>
                                    <strong>{{ journalLinkTranslation('name', linkType.name) }}</strong>
                                </td>
                                <td>
                                    {{ journalLinkTranslation('inward', linkType.inward) }}
                                </td>
                                <td>
                                    {{ journalLinkTranslation('outward', linkType.outward) }}
                                </td>
                                <td data-value="{{ linkType.journalCount }}">
                                    <a href="{{ route('settings.links.show', [linkType.id]) }}">{{ linkType.journalCount }}</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                <div class="box-footer">
                    <a href="{{ route('settings.links.create') }}" class="btn btn-success">{{ 'create_new_link_type'|_ }}</a>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block scripts %}
    <script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

{% block styles %}
    <link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_BUILD_TIME }}" type="text/css" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}
