@extends('layouts.master')

@section('navigation')
    @if ($role == 1)
        @include('local.managers.admins._navigation')
    @elseif($role == 2)
        @include('local.managers.sCoords._navigation')
    @elseif($role == 3)
        @include('local.managers.pCoords._navigation')
    @elseif($role == 4)
        @include('local.professors._navigation')
    @endif

@stop

@section('main')

    <div class="row">

        <table class="table table-striped datatable">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>School</th>
                </tr>
            </thead>
            <tfoot>
                <tr class="column-search">
                    <td><input class="column-search-bar form-control" type="text" placeholder="Buscar"
                            aria-label="search rubric name" /></td>
                    <td><select class="column-search-select form-control" aria-label="select associated school">
                            <option value=""></option>
                        </select></td>
                </tr>
            </tfoot>
            <tbody>
                @foreach ($templates as $template)
                    <tr>
                        <td>{{ HTML::linkAction('TemplatesController@show', $template->name, [$template->id]) }}</td>
                        <td>
                            @if ($template->school)
                                {{ $template->school->name }}
                            @else
                                All (global)
                            @endif
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
@stop

@section('included-js')

    <!-- Datatables -->
    @include('global._datatables_js')

@stop