{{#restrict section="config" level="admin" block=true}}{{/restrict}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}}

{{* barre de navigation *}}
{{:include file="/%s/_nav.html"|args:$module.name current="entrees"}}

{{if $_GET.ok}}
	<p class="block confirm">Entrée enregistrée.</p>
{{/if}}

<form method="post" action="">
  <fieldset class="entree">
    <legend>Ajouter une entrée pour du </legend>
    {{:linkbutton label="Matériel répertorié" shape="plus" href="repertorie.html?caller=%s"|args:$request_url"}}
    {{:linkbutton label="Matériel non répertorié" shape="plus" href="non_repertorie.html?caller=%s"|args:$request_url}}
  </fieldset>
</form>

{{* lister les entrées *}}
  <table class="list">
    <thead>
      <tr>
        <th>Date</th>
        <th>Type</th>
        <th>Nombre</th>
        <th>Matériel</th>
        <th>Remarques</th>
        <th>Action(s)</th>
      </tr>
    </thead>
    <tbody>
        {{#load type="movement" direction="entrée" assign="entrees"}}
                {{#load type="equipment" key=$entrees.equipment assign="equipment"}}
        <tr>
          <td>{{$entrees.date}}</td>
          <td>{{$entrees.inputNature}}</td>
          <td>{{$entrees.amount}}</td>
          <td>{{$designation}}</td>
          <td>{{$entrees.comment}}</td>
          <td class="actions">
              {{:linkbutton label="Supprimer" href="delete.html?id=%s"|args:$key shape="delete" target="_dialog"}}
          </td>
        </tr>
        {{/load}}
    </tbody>
    {{/load}}
  </table>

{{:admin_footer}}