index.edge

46 lines | 1.341 kB Blame History Raw Download
@layout('layouts.main')

@section('content')

<section class="box is-full-width">
  <h3 class="is-size-3">Element Actions</h3>
  <ul>
    <li><a href="{{ APP_URL() + route('/elements/create') }}">Add Element</a></li>
  </ul>
</section>

<p>There are {{ elements.length }} total elements.</p>

<section class="box">
  <table class="table">
    <thead class="thead">
      <tr>
        <th>Element Name</th>
        <th>Theme</th>
        <th>Priority</th>
        <th>Refresh Rate</th>
        <th>Actions</th>
      </tr>
    </thead>
    <tbody class="tbody">
      @each(element in elements)
      <tr>
        <td>{{ element.name }}</td>
        <td>{{ element.theme.name }}</td>
        <td>{{ element.priority }}</td>
        <td>{{ element.refresh_rate }}</td>
        <td>
          <form action="{{ APP_URL() + route('/elements.destroy', { id: element.id }) + '?_method=DELETE'}}" method="post">
            {{ csrfField() }}
            <button type="submit" name="button" class="is-small button is-danger is-pulled-left" onclick="return confirm('Are you sure you want to delete this element?');">Delete</button>
            &nbsp;
            <a href="{{APP_URL() + route('/elements.edit', { id: element.id })}}" class="button is-small is-warning">Edit</a>
          </form>
        </td>
      </tr>
      @endeach
    </tbody>
  </table>
</section>

@endsection