From b05d388c3ab58fdf27881cab68efb5386f6e4a71 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Mon, 20 Sep 2004 21:31:29 +0000 Subject: [PATCH] code factorization --- templates/listes/index.tpl | 69 +++-------------------------------------- templates/listes/listes.inc.tpl | 55 ++++++++++++++++++++++++++++++++ templates/listes/moderate.tpl | 11 ++++++- 3 files changed, 70 insertions(+), 65 deletions(-) create mode 100644 templates/listes/listes.inc.tpl diff --git a/templates/listes/index.tpl b/templates/listes/index.tpl index 3684c25..ed7cbd7 100644 --- a/templates/listes/index.tpl +++ b/templates/listes/index.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: index.tpl,v 1.3 2004-09-20 20:37:15 x2000habouzit Exp $ + $Id: index.tpl,v 1.4 2004-09-20 21:31:29 x2000habouzit Exp $ ***************************************************************************}
@@ -62,80 +62,21 @@ NB : les gestionnaires d'une liste sont aussi ses mod Listes de diffusion publiques
- - - - - - - - {foreach from=$listes item=liste} - {if $liste.priv eq 0} - - - - - - - {/if} - {/foreach} -
ListeDescriptionDiffusionInscription
- {$liste.list} - {if $liste.you>1}[mod]{/if} - {$liste.desc}{if $liste.diff}modérée{else}libre{/if}{if $liste.you is odd}désinscription{elseif $liste.ins}ins modérée{else}inscription{/if}
+{include file='listes/listes.inc.tpl' min=0}
Listes de diffusion privées
- - - - - - - - {foreach from=$listes item=liste} - {if $liste.priv eq 1} - - - - - - - {/if} - {/foreach} -
ListeDescriptionDiffusionInscription
- {$liste.list} - {if $liste.you>1}[mod]{/if} - {$liste.desc}{if $liste.diff}modérée{else}libre{/if}{if $liste.you is odd}désinscription{elseif $liste.ins}ins modérée{else}inscription{/if}
+{include file='listes/listes.inc.tpl' min=1} {perms level=admin}
Listes d'administration
- - - - - - - - {foreach from=$listes item=liste} - {if $liste.priv > 1} - - - - - - - {/if} - {/foreach} -
ListeDescriptionDiffusionInscription
- {$liste.list} - {if $liste.you>1}[mod]{/if} - {$liste.desc}{if $liste.diff}modérée{else}libre{/if}{if $liste.you is odd}désinscription{elseif $liste.ins}ins modérée{else}inscription{/if}
+{include file='listes/listes.inc.tpl' min=2 max=4} + {/perms} {/dynamic} diff --git a/templates/listes/listes.inc.tpl b/templates/listes/listes.inc.tpl new file mode 100644 index 0000000..a0fd164 --- /dev/null +++ b/templates/listes/listes.inc.tpl @@ -0,0 +1,55 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: listes.inc.tpl,v 1.1 2004-09-20 21:31:29 x2000habouzit Exp $ + ***************************************************************************} + +
+ + + + + + + + {foreach from=$listes item=liste} + {if $liste.priv >= $min && $liste.priv <= $max|default:$min} + + + + + + + {/if} + {/foreach} +
ListeDescriptionDiffusionInscription
+ {$liste.list} + {if $liste.you>1}[mod]{/if} + {$liste.desc}{if $liste.diff}modérée{else}libre{/if} + {if $liste.you is odd} + {if $liste.ins}inscrit{/if} + {elseif $liste.ins} + + {else} + + {/if} +
+
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/listes/moderate.tpl b/templates/listes/moderate.tpl index 5e18b43..771fa66 100644 --- a/templates/listes/moderate.tpl +++ b/templates/listes/moderate.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: moderate.tpl,v 1.1 2004-09-20 20:04:38 x2000habouzit Exp $ + $Id: moderate.tpl,v 1.2 2004-09-20 21:31:29 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -32,6 +32,12 @@ Inscriptions en attente de modération +{if $subs|@count} +{else} +

pas d'inscriptions en attente de modération

+{/if} + +{if $mails|@count}
Mails en attente de modération
@@ -56,6 +62,9 @@ {/foreach} +{else} +

pas de mails en attente de modération

+{/if} {/if} -- 2.1.4