Use a template to format the newsletter and use the power of PlMailer
[platal.git] / templates / newsletter / show.tpl
index 0e46938..159c68a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2004 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 </h1>
 
 <p>
-[<a href='index.php'>liste des lettres</a>]
+[<a href='nl'>liste des lettres</a>]
 {if $smarty.get.text}
-[<a href='?nid={$nl->_id}'>version HTML</a>]
+[<a href='nl/show/{$nl->id()}'>version HTML</a>]
 {else}
-[<a href='?nid={$nl->_id}&amp;text=1'>version Texte</a>]
+[<a href='nl/show/{$nl->id()}?text=1'>version Texte</a>]
+{/if}
+{if $smarty.session.perms eq admin}
+[<a href='admin/newsletter/edit/{$nl->id()}'>Editer</a>]
 {/if}
-{perms level='admin'}
-[<a href='{"admin/newsletter_edit.php"|url}?nid={$nl->_id}'>Editer</a>]
-{/perms}
 </p>
 
-<form method="post" action="{$smarty.server.PHP_SELF}?nid={$nl->_id}">
+<form method="post" action="{$platal->path}">
   <div class='center'>
     <input type='submit' value="me l'envoyer" name='send' />
   </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: *}