Remove my old and ugly hack to check permissions and set up a new flexible way to...
[platal.git] / templates / newsletter / show.tpl
index a24ef6a..3cf0ce9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 <p>
 [<a href='nl'>liste des lettres</a>]
 {if $smarty.get.text}
-[<a href='nl/show/{$nl->_id}'>version HTML</a>]
+[<a href='nl/show/{$nl->id()}'>version HTML</a>]
 {else}
-[<a href='nl/show/{$nl->_id}?text=1'>version Texte</a>]
+[<a href='nl/show/{$nl->id()}?text=1'>version Texte</a>]
+{/if}
+{if $smarty.session.perms->hasFlag('admin')}
+[<a href='admin/newsletter/edit/{$nl->id()}'>Editer</a>]
 {/if}
-{perms level='admin'}
-[<a href='admin/newsletter_edit.php?nid={$nl->_id}'>Editer</a>]
-{/perms}
 </p>
 
 <form method="post" action="{$platal->path}">
   </div>
 </form>
 
-<table class="bicol" cellpadding="3" cellspacing="0">
-  <tr>
-    <th>{$nl->title()}</th>
-  </tr>
-  <tr>
-    <td>
-      {if $smarty.get.text}
-      <pre>{$nl->toText($smarty.session.prenom,$smarty.session.nom,$smarty.session.femme)}</pre>
-      {else}
-      <div class='nl'>
-        {$nl->toHtml($smarty.session.prenom,$smarty.session.nom,$smarty.session.femme)|smarty:nodefaults}
-      </div>
-      {/if}
-    </td>
-  </tr>
-</table>
-
+<fieldset>
+<legend>{$nl->title(true)}</legend>
+  {include file="newsletter/nl.tpl"}
+</fieldset>
 
-{* vim:set et sw=2 sts=2 sws=2: *}
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}