move templates at the right place for xnetlists
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 16 Jul 2006 11:59:46 +0000 (11:59 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 16 Jul 2006 11:59:46 +0000 (11:59 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@522 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/xnetlists.php
templates/xnetlists/create.tpl [new file with mode: 0644]
templates/xnetlists/index.tpl [new file with mode: 0644]
templates/xnetlists/sync.tpl [new file with mode: 0644]

index 278fa7d..b284fc9 100644 (file)
@@ -72,7 +72,7 @@ class XnetListsModule extends ListsModule
 
         $this->prepare_client($page);
 
-        $page->changeTpl('xnet/groupe/listes.tpl');
+        $page->changeTpl('xnetlists/index.tpl');
 
         if (Get::has('del')) {
             $this->client->unsubscribe(Get::get('del'));
@@ -115,7 +115,7 @@ class XnetListsModule extends ListsModule
 
         $this->prepare_client($page);
 
-        $page->changeTpl('xnet/groupe/listes-create.tpl');
+        $page->changeTpl('xnetlists/create.tpl');
         $page->assign('force_list_super', may_update());
 
         if (!Post::has('submit')) {
@@ -189,7 +189,7 @@ class XnetListsModule extends ListsModule
 
         $this->prepare_client($page);
 
-        $page->changeTpl('xnet/groupe/listes-sync.tpl');
+        $page->changeTpl('xnetlists/sync.tpl');
 
         if (Env::has('add')) {
             $this->client->mass_subscribe($liste, array_keys(Env::getMixed('add')));
diff --git a/templates/xnetlists/create.tpl b/templates/xnetlists/create.tpl
new file mode 100644 (file)
index 0000000..d717871
--- /dev/null
@@ -0,0 +1,102 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1>{$asso.nom} : Création d'une liste de diffusion</h1>
+
+<p class="descr">
+<strong>Note :</strong> Les listes de diffusion sont un outil particulièrement adapté pour des
+échanges entre 6 personnes, ou plus (newsletter, débat interne au groupe ...). En revanche, elles
+s'avèrent peu praticables pour des discussions plus restreintes.  Il est alors préférable
+d'utiliser <a href="{rel}/{$platal->ns}alias/create">un alias</a>, à la gestion beaucoup plus souple.
+</p>
+<p class="descr">
+D'autre part, il est impossible d'inscrire une liste de diffusion à une autre liste de diffusion.
+Si tu as besoin de cette fonctionnalité, il faut alors <strong>impérativement</strong> utiliser
+<a href="{rel}/{$platal->ns}alias/create">un alias</a> qui, lui, est capable de regrouper plusieurs listes.
+</p>
+<form action='{rel}/{$platal->ns}lists/create' method='post'>
+  <table class="large">
+    <tr>
+      <th colspan='2'>Caractéristiques de la Liste</th>
+    </tr>
+    <tr>
+      <td><strong>Addresse&nbsp;souhaitée&nbsp;:</strong></td>
+      <td>
+        <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso.mail_domain}
+      </td>
+    </tr>
+    <tr>
+      <td><strong>Sujet (bref) :</strong></td>
+      <td>
+        <input type='text' name='desc' size='40' value="{$smarty.post.desc}" />
+      </td>
+    </tr>
+    <tr>
+      <td><strong>Propriétés :</strong></td>
+      <td>
+        <table style='width: 100%' class="normal">
+          <tr>
+            <td>visibilité :</td>
+            <td>
+              <input type='radio' name='advertise' value='0'
+              {if $smarty.post.advertise && $smarty.post}checked='checked'{/if} />publique
+            </td>
+            <td>
+              <input type='radio' name='advertise' value='1'
+              {if !$smarty.post.advertise || !$smarty.post}checked='checked'{/if} />privée
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>diffusion :</td>
+            <td>
+              <input type='radio' name='modlevel' value='0'
+              {if !$smarty.post.modlevel}checked='checked'{/if} />libre
+            </td>
+            <td>
+              <input type='radio' name='modlevel' value='1'
+              {if $smarty.post.modlevel eq 1}checked='checked'{/if} />restreinte
+            </td>
+            <td><input type='radio' name='modlevel' value='2'
+              {if $smarty.post.modlevel eq 2}checked='checked'{/if} />modérée
+            </td>
+          </tr>
+          <tr>
+            <td>inscription :</td>
+            <td>
+              <input type='radio' name='inslevel' value='0'
+              {if !$smarty.post.inslevel && $smarty.post}checked='checked'{/if} />libre
+            </td>
+            <td>
+              <input type='radio' name='inslevel' value='1'
+              {if $smarty.post.inslevel || !$smarty.post}checked='checked'{/if} />modérée
+            </td>
+            <td></td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+  <p class="center"><input name='submit' type='submit' value="Créer !" /></p>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/xnetlists/index.tpl b/templates/xnetlists/index.tpl
new file mode 100644 (file)
index 0000000..bd7db7c
--- /dev/null
@@ -0,0 +1,119 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{if $smarty.get.del_alias}
+
+<p class="error">Est tu sur de supprimer l'alias {$smarty.get.del_alias} ?</p>
+<form action='{rel}/{$platal->ns}lists' method="post">
+  <div class="center">
+    <input type='submit' value="Oui, je suis sur" />
+    <input type='hidden' name='del_alias' value="{$smarty.get.del_alias}" />
+  </div>
+</form>
+<p>[<a href='{rel}/{$platal->ns}lists'>retour à la page des listes</a>]</p>
+
+{else}
+
+<h1>{$asso.nom} : Listes de diffusion</h1>
+
+<h2>Listes de diffusion du groupe {$asso.nom} :</h2>
+
+<p class="descr">
+Une liste dont <strong>la diffusion</strong> est modérée est une liste dont les mails sont validés
+par les administrateurs avant d'être transmis aux membres de la liste.  Une liste dont
+<strong>l'inscription</strong> est modérée est une liste pour laquelle l'abonnement est soumis à
+l'accord préalable des responsables du groupe.
+</p>
+<p class="descr">
+La dernière colonne du tableau t'indique si tu es inscrit{if $smarty.session.femme}e{/if} ou non à
+la liste. Dans le premier cas, une croix rouge te permet de te désabonner. Dans le second cas, une
+croix verte te permet de t'inscrire, après accord des responsables si l'inscription est modérée.
+</p>
+
+<table cellpadding="0" cellspacing="0" class='large'>
+  <tr>
+    <th>Liste</th>
+    <th>Description</th>
+    <th>Diffusion</th>
+    <th>Inscription</th>
+    <th>Nb</th>
+    <th>&nbsp;</th>
+  </tr>
+  {foreach from=$listes item=l}
+  <tr>
+    <td>
+      <a href="mailto:{$l.list}@{$asso.mail_domain}"><img src="{rel}/images/mail.png" alt='[mail]' /></a>
+      <a href='{rel}/{$platal->ns}lists/members/{$l.list}'>{$l.list} {if $l.priv}<sup>#</sup>{/if}{if $l.own}<sup>o</sup>{/if}</a>
+    </td>
+    <td>{$l.desc}</td>
+    <td class='center'>
+      {if $l.diff eq 2}modérée{elseif $l.diff eq 1}restreinte{else}libre{/if}
+    </td>
+    <td class='center'>{if $l.ins}modérée{else}libre{/if}</td>
+    <td align='right'>{$l.nbsub}</td>
+    <td align='right'>
+      {if $l.sub eq 2}
+      <a href="{rel}/{$platal->ns}lists?del={$l.list}"><img src="{rel}/images/del.png" alt="[désinscrire]" title="me désinscrire" /></a>
+      {elseif $l.sub eq 1}
+      <img src="{rel}/images/flag.png" alt="[en attente]" title="en attente de modération" />
+      {else}
+      <a href="{rel}/{$platal->ns}lists?add={$l.list}"><img src="{rel}/images/ajouter.gif" alt="[m'inscrire]" title="m'inscrire" /></a>
+      {/if}
+    </td>
+  </tr>
+  {foreachelse}
+  <tr><td colspan='6'>Pas de listes pour ce groupe</td></tr>
+  {/foreach}
+</table>
+
+<p class="descr">
+<sup>o</sup>: tu es {if $smarty.session.femme}modératrice{else}moderateur{/if} sur cette liste<br />
+<sup>#</sup>: cette liste est invisible aux non-membres de la liste. S'en désabonner
+t'empêcherait de t'y réabonner par la suite sans l'aide d'un administrateur.
+</p>
+        
+<h2>Voici les alias existants pour le groupe {$asso.nom} :</h2>
+
+{if $alias->total()}
+<table cellspacing="0" cellpadding="0" class='large'>
+  <tr>
+    <th{if $may_update} colspan='3'{/if}>Alias</th>
+  </tr>
+  {iterate from=$alias item=a}
+  <tr>
+    {if $may_update}
+    <td class="center"><a href='mailto:{$a.alias}'><img src='{rel}/images/mail.png' alt='[mail]' /></a></td>
+    <td><a href="{rel}/{$platal->ns}alias/admin/{$a.alias}">{$a.alias}</a></td>
+    <td class="center"><a href="{rel}/{$platal->ns}lists?del_alias={$a.alias}"><img src='{rel}/images/del.png' alt='[supprimer]' /></a></td>
+    {else}
+    <td><a href='mailto:{$a.alias}'><img src='{rel}/images/mail.png' alt='[mail]' /> {$a.alias}</a></td>
+    {/if}
+  </tr>
+  {/iterate}
+</table>
+{else}
+<p>Aucun alias pour ce groupe</p>
+{/if}
+
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/xnetlists/sync.tpl b/templates/xnetlists/sync.tpl
new file mode 100644 (file)
index 0000000..8244a22
--- /dev/null
@@ -0,0 +1,48 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{include file='listes/header_listes.tpl' on='sync'}
+<h1>Non abonnés à la liste {$platal->argv[1]}@{$asso.mail_domain}</h1>
+
+<form action="{rel}/{$platal->ns}lists/sync/{$platal->argv[1]}" method="post">
+
+  <table cellspacing="2" cellpadding="0" class="tiny">
+    <tr>
+      <th>Membre</th>
+      <th></th>
+    </tr>
+    {foreach from=$not_in_list item=u}
+    <tr>
+      <td>{$u.prenom} {$u.nom}</td>
+      <td><input type="checkbox" name="add[{$u.email}]" /></td>
+    </tr>
+    {/foreach}
+    <tr>
+      <td colspan='2' class="center">
+        <input type='submit' value='forcer inscription' />
+      </td>
+    </tr>
+  </table>
+
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}