index.edge

44 lines | 1.16 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="{{ 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>Action</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="{{ route('/elements.destroy', { id: element.id }) + '?_method=DELETE'}}" method="post">
            {{ csrfField() }}
            <button type="submit" name="button" class="is-small button is-danger" onclick="return confirm('Are you sure you want to delete this element?');">Delete</button>
          </form>
        </td>
      </tr>
      @endeach
    </tbody>
  </table>
</section>

@endsection