File "admin-users.tmpl"
Full Path: /srv/www/www.cadoro.it/src/templates/admin-users.tmpl
File size: 4.31 KB
MIME-type: text/html
Charset: utf-8
{extends file='layout-admin.tmpl'}
<html>
<body>
{block name="breadcrumbs"}
<div class="breadcrumbs">
<strong>Utenti registrati</strong>
</div>
{/block}
{block name="content"}
<div class="sheet">
<div class="sheet-header">
<h1>
Utenti registrati
<small>Gestione degli utenti di registrati</small>
</h1>
</div>
<div class="sheet-body">
{if _get('add')}
<div class="alert alert-success">
<strong>L'utente è stato aggiunto con successo.</strong>
</div>
{elseif $delete}
<div class="alert alert-success">
<strong>L'utente è stato eliminato con successo.</strong>
</div>
{/if}
<form method="get" action="{$base_url}/admin/users" class="form-search well">
<div class="row">
<div class="col-sm-6 mb10">
<input type="text" name="q" class="form-control" value="{_fr('q')}" datahaviour="autofocus" autocomplete="off">
</div>
{if $principal.role eq 1}
<div class="col-sm-6 mb10">
<select name="filter" class="form-control">
<option value="">Tutti gli utenti</option>
<option value="app"{if _request('filter') eq 'app'} selected="selected"{/if}>Utenti con app mobile</option>
</select>
</div>
{/if}
</div>
<button type="submit" class="btn btn-default">Cerca</button>
{if $principal.role eq 1}
<a href="{$base_url}/admin/users/add" class="btn btn-primary pull-right">
<i class="glyphicon glyphicon-plus"></i> Aggiungi utente registrato…
</a>
{/if}
</form>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Cognome</th>
<th>Nome</th>
<th>Email</th>
<th>Tessera</th>
{if $principal.role eq 1}<th>App</th>{/if}
<th>Stato</th>
<th style="width: 200px;">Azioni</th>
</tr>
</thead>
<tbody>
{foreach $users as $user}
<tr>
<td>#{$user.id}</td>
<td>{$user.lastname}</td>
<td>{$user.firstname}</td>
<td>{$user.email}</td>
<td>{$user.card}</td>
{if $principal.role eq 1}
<td>
{if $user.app_details}
<span class="label label-warning">{_a($user.app_details, 'platform', 'mobile')}</span>
{else}
-
{/if}
</td>
{/if}
<td>
{if $user.deleted_at}
<span class="label label-danger">eliminato</span>
{elseif $user.active and $user.card}
<span class="label label-success">attivo</span>
{elseif $user.active and not $user.card}
<span class="label label-warning">attesa punto vendita</span>
{else}
<span class="label label-default">attesa double opt-in</span>
{/if}
</td>
<td>
{if $principal.role eq 1 or ($user.active and $user.card)}
<a href="{$base_url}/admin/users/{$user.id}?pdf=1" class="btn btn-info btn-xs">PDF</a>
{/if}
{if $principal.role eq 1 or ($user.active and not $user.card)}
<a href="{$base_url}/admin/users/{$user.id}" class="btn btn-default btn-xs">Modifica</a>
{if $principal.role eq 1}
{if $user.deleted_at}
<a href="{$base_url}/admin/users?q={_fr('q')}&undelete={$user.id}" class="btn btn-warning btn-xs" datahaviour="link_confirm">Ripristina</a>
{else}
<a href="{$base_url}/admin/users?q={_fr('q')}&delete={$user.id}" class="btn btn-danger btn-xs" datahaviour="link_confirm">Elimina</a>
{/if}
{/if}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{include "admin-pagination.tmpl"}
</div>
</div>
{/block}
</body>
</html>