Simplified matrix for non admin users on index

The balance table on the index page is smaller for non admin users and
only displays necessary lines.
This commit is contained in:
Phyks 2013-10-04 13:38:24 +02:00
parent 82a469404c
commit 1bf71e0f53
3 changed files with 88 additions and 39 deletions

1
TODO
View File

@ -1,4 +1,3 @@
* Don't display the whole balance table if not admin
* Notifications by e-mail for users * Notifications by e-mail for users
Improvements : Improvements :

View File

@ -6,6 +6,7 @@
<div id="quick_summary"> <div id="quick_summary">
<h2>Balance</h2> <h2>Balance</h2>
{if condition="$current_user->getAdmin()"}
<p class="center">Read <em>line</em> owes <em>case</em> {$currency} to <em>column</em>. You can click on links to confirm the payback. <p class="center">Read <em>line</em> owes <em>case</em> {$currency} to <em>column</em>. You can click on links to confirm the payback.
<table id="balance_table"> <table id="balance_table">
<tr> <tr>
@ -29,6 +30,30 @@
</tr> </tr>
{/loop} {/loop}
</table> </table>
{else}
<table>
<tr>
<th>Users</th>
<th>You owe him</th>
<th>He owes you</th>
</tr>
{loop="$users"}
{if condition="$balances[$value->getId()][$current_user->getId()] !== 'X' && $balances[$value->getId()][$current_user->getId()] !== '-'"}
</tr>
<td>{$value->getDisplayName()}</td>
<td>-</td>
<td>{$balances[$value->getId()][$current_user->getId()]}{$currency}</td>
</tr>
{elseif condition="$balances[$current_user->getId()][$value->getId()] !== 'X' && $balances[$current_user->getId()][$value->getId()] !== '-'"}
</tr>
<td>{$value->getDisplayName()}</td>
<td>{$balances[$current_user->getId()][$value->getId()]}{$currency}</td>
<td>-</td>
</tr>
{/if}
{/loop}
</table>
{/if}
</div> </div>
<div id="detailed_summary"> <div id="detailed_summary">
<h2>Detailed list of bills{if condition="$all == 0"} for last month{/if}</h2> <h2>Detailed list of bills{if condition="$all == 0"} for last month{/if}</h2>

View File

@ -6,6 +6,7 @@
<div id="quick_summary"> <div id="quick_summary">
<h2>Bilan</h2> <h2>Bilan</h2>
{if condition="$current_user->getAdmin()"}
<p class="center">Lire <em>ligne</em> doit <em>case</em> {$currency} à <em>colonne</em>. Vous pouvez cliquer sur les liens pour confirmer les remboursements. <p class="center">Lire <em>ligne</em> doit <em>case</em> {$currency} à <em>colonne</em>. Vous pouvez cliquer sur les liens pour confirmer les remboursements.
<table id="balance_table"> <table id="balance_table">
<tr> <tr>
@ -29,6 +30,30 @@
</tr> </tr>
{/loop} {/loop}
</table> </table>
{else}
<table>
<tr>
<th>Utilisateurs</th>
<th>Vous devez</th>
<th>Il vous doit</th>
</tr>
{loop="$users"}
{if condition="$balances[$value->getId()][$current_user->getId()] !== 'X' && $balances[$value->getId()][$current_user->getId()] !== '-'"}
</tr>
<td>{$value->getDisplayName()}</td>
<td>-</td>
<td>{$balances[$value->getId()][$current_user->getId()]}{$currency}</td>
</tr>
{elseif condition="$balances[$current_user->getId()][$value->getId()] !== 'X' && $balances[$current_user->getId()][$value->getId()] !== '-'"}
</tr>
<td>{$value->getDisplayName()}</td>
<td>{$balances[$current_user->getId()][$value->getId()]}{$currency}</td>
<td>-</td>
</tr>
{/if}
{/loop}
</table>
{/if}
</div> </div>
<div id="detailed_summary"> <div id="detailed_summary">
<h2>Liste détaillée des dépenses{if condition="$all == 0"} du dernier mois{/if}</h2> <h2>Liste détaillée des dépenses{if condition="$all == 0"} du dernier mois{/if}</h2>