From: x2000habouzit Date: Fri, 10 Sep 2004 11:52:36 +0000 (+0000) Subject: first page of the mailing lists interface .... X-Git-Tag: xorg/old~1539 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9da45a03053a114f5258ff745e806ba0a93b13f3;p=platal.git first page of the mailing lists interface .... it's good to see my work work :) for mailman-rpc.py: use dictionnaries instead of tuples, it's a looooooooot better for later use in php --- diff --git a/configs/menu.conf.php b/configs/menu.conf.php index 022e77e..282f21c 100644 --- a/configs/menu.conf.php +++ b/configs/menu.conf.php @@ -13,7 +13,7 @@ if(logged()) { 'Services' => Array ( 'Envoyer un mail' => 'sendmail.php' , 'Forums & PA' => 'banana/' , - 'Listes de diffusion' => '###url###' , + 'Listes de diffusion' => 'listes/' , 'Micropaiements' => 'paiement/' , 'Patte cassée' => 'pattecassee.php' , ), diff --git a/htdocs/css/default.css b/htdocs/css/default.css index 9a2d5a8..fb53e8c 100644 --- a/htdocs/css/default.css +++ b/htdocs/css/default.css @@ -150,6 +150,7 @@ table.tinybicol td, table.bicol td { background: inherit; } +table.tinybicol td, table.bicol td { padding-left: 4px; padding-right: 4px; } td.half { width: 50%; padding: 4px; } td.titre { @@ -581,4 +582,4 @@ div.spacer { clear: both; } } /* vim: set et ts=4 sts=4 sw=4: */ -/* $Id: default.css,v 1.41 2004-09-06 06:25:07 x2000coic Exp $ */ +/* $Id: default.css,v 1.42 2004-09-10 11:52:36 x2000habouzit Exp $ */ diff --git a/htdocs/listes/index.php b/htdocs/listes/index.php new file mode 100644 index 0000000..b8bb818 --- /dev/null +++ b/htdocs/listes/index.php @@ -0,0 +1,36 @@ +db->query("SELECT password FROM auth_user_md5 WHERE user_id={$_SESSION['uid']}"); +list($pass) = mysql_fetch_row($res); +mysql_free_result($res); + +$client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949"); + +$listes = $client->get_lists(); +$page->assign_by_ref('listes',$listes); +$page->run(); +?> diff --git a/scripts/mailman/mailman-rpc.py b/scripts/mailman/mailman-rpc.py index 934f36e..5803521 100755 --- a/scripts/mailman/mailman-rpc.py +++ b/scripts/mailman/mailman-rpc.py @@ -18,7 +18,7 @@ #* Foundation, Inc., * #* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * #*************************************************************************** -# $Id: mailman-rpc.py,v 1.13 2004-09-10 07:02:02 x2000habouzit Exp $ +# $Id: mailman-rpc.py,v 1.14 2004-09-10 11:52:37 x2000habouzit Exp $ #*************************************************************************** import base64, MySQLdb @@ -126,7 +126,14 @@ def get_lists((userdesc,perms)): is_owner = userdesc.address in mlist.owner is_admin = mm_cfg.ADMIN_ML_OWNER in mlist.owner if ( mlist.advertised ) or ( perms == 'admin' and is_admin ) or is_member or is_owner: - result.append( (name,1-mlist.advertised+is_admin,is_member,is_owner) ) + result.append( { + 'list' : name, + 'desc' : mlist.description, + 'diff' : mlist.generic_nonmember_action, + 'ins' : mlist.subscribe_policy > 0, + 'priv' : (1-mlist.advertised)+2*is_admin, + 'you' : is_member + 2*is_owner + } ) return result def get_members((userdesc,perms),listname): diff --git a/templates/listes/index.tpl b/templates/listes/index.tpl new file mode 100644 index 0000000..b2ab516 --- /dev/null +++ b/templates/listes/index.tpl @@ -0,0 +1,96 @@ +{*************************************************************************** + * 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: index.tpl,v 1.1 2004-09-10 11:52:37 x2000habouzit Exp $ + ***************************************************************************} + + {dynamic} + +
+ Listes de diffusion publiques +
+ + + + + + + + + {foreach from=$listes item=liste} + {if $liste.priv eq 0} + + + + + + + {/if} + {/foreach} +
ListeDescriptionDiffusionInscription
{$liste.list}{if $liste.you>1}*{/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}
+ +
+ Listes de diffusion privées +
+ + + + + + + + + {foreach from=$listes item=liste} + {if $liste.priv eq 1} + + + + + + + {/if} + {/foreach} +
ListeDescriptionDiffusionInscription
{$liste.list}{if $liste.you>1}*{/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}
+ +
+ Listes d'administration +
+ + + + + + + + + {foreach from=$listes item=liste} + {if $liste.priv > 1} + + + + + + + {/if} + {/foreach} +
ListeDescriptionDiffusionInscription
{$liste.list}{if $liste.you>1}*{/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}
+ +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *}