[vhffs-dev] [1705] Group prefs does not use TT anymore.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1705
Author:   beuss
Date:     2011-05-12 22:10:41 +0200 (Thu, 12 May 2011)
Log Message:
-----------
Group prefs does not use TT anymore.

Fixed some nasty bugs that have been lurking around for several
versions?\226?\128?\166

Modified Paths:
--------------
    trunk/vhffs-panel/group/prefs.pl
    trunk/vhffs-panel/templates/Makefile.am

Added Paths:
-----------
    trunk/vhffs-panel/templates/admin/object/edit.tt
    trunk/vhffs-panel/templates/group/prefs.tt
    trunk/vhffs-panel/templates/group/tags.tt

Removed Paths:
-------------
    trunk/vhffs-panel/templates/group/list_user.tmpl
    trunk/vhffs-panel/templates/group/prefs.tmpl
    trunk/vhffs-panel/templates/group/tags.tmpl

Modified: trunk/vhffs-panel/group/prefs.pl
===================================================================
--- trunk/vhffs-panel/group/prefs.pl	2011-05-12 20:10:30 UTC (rev 1704)
+++ trunk/vhffs-panel/group/prefs.pl	2011-05-12 20:10:41 UTC (rev 1705)
@@ -65,15 +65,14 @@
 my $template;
 
 my $group = Vhffs::Group::get_by_groupname( $vhffs , $cgi->param('group') );
+my $vars = {};
 
+
 unless( defined $group ) {
-	$template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
-	$template->param( MESSAGE => gettext( "Error. This group doesn't exists") );
+    $panel->render('misc/message.tt', { message => gettext( "Error. This group doesn't exists") });
 } elsif( !$user->can_view( $group ) ) {
-	$template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
-	$template->param( MESSAGE => gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) );
+    $panel->render('misc/message.tt', { message => gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) } );
 } else {
-
 	$template = new Vhffs::Panel::Template( filename => $templatedir.'/panel/group/prefs.tmpl', global_vars => 1, 
 		die_on_bad_params => 0, loop_context_vars => 1  );
 
@@ -127,35 +126,26 @@
 			unless( defined $username ) {
 				$panel->add_error( gettext('CGI Error !') );
 			} elsif( $username =~ /^\s*$/ ) {
-				$template->param( ADD_USER_MSG_CLASS => 'error' );
-				$template->param( ADD_USER_MSG => gettext('You must enter an username') );
+                $vars->{add_user_error} = gettext('You must enter an username');
 			} else {
 				# First, we try to get an user with the *exact* name
 				my $new_user = Vhffs::User::get_by_username( $vhffs, $username);
 				if(defined $new_user) {
 					# Fine, user exists, let's add it
 					if( $group->add_user( $new_user->get_uid ) ) {
-						$template->param( ADD_USER_MSG_CLASS => 'info' );
-						$template->param( ADD_USER_MSG => gettext('User will be added as soon as possible') );
+                        $vars->{add_user_info} = gettext('User will be added as soon as possible');
 					} else {
-						$template->param( ADD_USER_MSG_CLASS => 'error' );
-						$template->param( ADD_USER_MSG => gettext('Unable to add user, he might already be in the group (waiting for addition or deletion)') );
+                        $vars->{add_user_error} = gettext('Unable to add user, he might already be in the group (waiting for addition or deletion)');
 					}
 				} else {
 					# User not found with exact match,let's search
 					my $users = Vhffs::Panel::User::search( $vhffs , $username );
 					unless( @{$users} ) {
-						$template->param( ADD_USER_MSG_CLASS => 'error' );
-						$template->param( ADD_USER_MSG => gettext('User not found') );
+                        $vars->{add_user_error} = gettext('User not found');
 					} else {
-						# Let's make a nice table
-						my $subtemplate = new HTML::Template( filename => $templatedir.'/panel/group/list_user.tmpl', global_vars => 1, die_on_bad_params => 0 );
-
-						$subtemplate->param( USERS => $users );
-						$subtemplate->param( TEXT_ADD => gettext('Add') );
-						$template->param( ADD_USER_MSG_CLASS => 'info' );
-						$template->param( ADD_USER_MSG => gettext('Many users matched your query. Please choose between them') );
-						$template->param( USERS_LIST => $subtemplate->output );
+                        $vars->{add_user_info} = gettext('Several users matched your query. Please choose between them.');
+                        use Data::Dumper; warn Dumper($users);
+                        $vars->{add_user_list} = $users;
 					}
 				}
 			}
@@ -169,11 +159,9 @@
 				$panel->add_error( gettext('CGI Error !') );
 			} else {
 				if( $group->add_user( $uid ) ) {
-					$template->param( ADD_USER_MSG_CLASS => 'info' );
-					$template->param( ADD_USER_MSG => gettext('User will be added as soon as possible') );
+					$vars->{add_user_info} = gettext('User will be added as soon as possible');
 				} else {
-					$template->param( ADD_USER_MSG_CLASS => 'error' );
-					$template->param( ADD_USER_MSG => gettext('Unable to add user, he might already be in the group (waiting for addition or deletion)') );
+                    $vars->{add_user_error} = gettext('Unable to add user, he might already be in the group (waiting for addition or deletion)');
 				} 
 			}
 		}
@@ -213,62 +201,11 @@
 
 	$panel->set_title( gettext('Project Preferences') );
 
-	$template->param( TEXT_QUOTA => gettext("If you want more disk space for your project, you must fill a form in the bug report section, in the menu. Don't forget to mention the name of the group.") );
-	$template->param( TEXT_PROJECTNAME => $group->get_groupname );
-	$template->param( TEXT_OWNER => gettext("Project Owner") );
-	$template->param( VALUE_OWNER => $group->get_owner_username );
-	$template->param( TEXT_DESCRIPTION => gettext("Project Description") );
-	$template->param( VALUE_DESCRIPTION => $group->get_description);
-	$template->param( TEXT_REALNAME => gettext('Project full name') );
-	$template->param( VALUE_REALNAME => $group->get_realname);
-	$template->param( TEXT_MODIFY => gettext("Modify") );
-	$template->param( TEXT_DELETE_PROJECT => gettext("Delete this project") );
-	$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. All services associated to this project will be DESTROYED.") );
-	$template->param( ASK_DELETE_PROJECT => gettext("Are you SURE you want DELETE this project ?") );
-	$template->param( YES => gettext("Yes I'm sure of what I do") );
-	$template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
-	$template->param( TEXT_DELETE => gettext("Delete") );
-	$template->param( VALUE_OID => $group->get_oid );
-	$template->param( TEXT_ACL_ADMIN => "Admin Rights on this object (ACL)" );
-	$template->param( EXPLAIN_ADMIN_ACL => "You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it." );
-	$template->param( ADMIN_ACL => "Ok, go to ACL admin" );
+    $vars->{group} = $group;
+    $vars->{mailgroup} = init Vhffs::Services::MailGroup( $vhffs , $group );
+    $vars->{use_avatar} = $panel->use_groups_avatars;
+    $vars->{group_users} = Vhffs::Panel::Group::getall_users( $vhffs , $group->get_gid );
 
-	my $mg = init Vhffs::Services::MailGroup( $vhffs , $group );
-	if( defined $mg )
-	{
-		$template->param( CONTACT_EMAIL_TITLE => gettext('Project contact') );
-		$template->param( CONTACT_EMAIL_TEXT => sprintf( gettext('We offer you the possibility to forward emails from %s@%s.') , $group->get_groupname , $mg->{config}->{domain} ) );
-		$template->param( CONTACT_EMAIL => $group->get_groupname.'@'.$mg->{config}->{domain} );
-		$template->param( CONTACT_EMAIL_MODIFY => gettext('Modify') );
-		$template->param( CONTACT_EMAIL_FORWARD => $mg->getforward );
-
-		if( defined ( my $url = $mg->{config}->{'url_doc'} ) )  {
-			$template->param( HELP_TEXT => gettext('Help') );
-			$template->param( HELP_URL => $url );
-		}
-	}
-	
-	$template->param( TEXT_USERNAME => gettext("Username") );
-	$template->param( TEXT_JOIN_GROUP => gettext("Add a user in this group") );
-	$template->param( TEXT_SEND => gettext('Add') );
-
-	if( $panel->use_groups_avatars )  {
-		my $tavatar = new HTML::Template( filename => $templatedir.'/panel/group/prefs_avatar.tmpl', global_vars => 1 );		
-		$tavatar->param( SEND_AVATAR => gettext('Update') );
-		$tavatar->param( TEXT_AVATAR => gettext('Logo') );
-		$tavatar->param( EXPLAIN_AVATAR => gettext('The avatar is an image to describe the group') );
-		$tavatar->param( CURRENT_AVATAR => gettext('Current avatar') );
-		$tavatar->param( UPDATE_AVATAR => gettext('Update avatar') );
-		$tavatar->param( VALUE_OID => $group->get_oid);
-		$template->param( AVATAR => $tavatar->output );
-	}
-	
-	$template->param( USERS => Vhffs::Panel::Group::getall_users( $vhffs , $group->get_gid ) );
-	$template->param( REMOVE_USER_TEXT => gettext( 'Remove' ) );
-	$template->param( NO_USER_TEXT => gettext( 'No user for this group' ) );
-	$template->param( USERS_TEXT => gettext( 'Users' ) );
-	$template->param( CURRENT_USERS => gettext( 'All users in this group' ) );
-
     if($user->is_admin) {
         $template->param( ADMIN => 1 );
         my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $group );
@@ -278,11 +215,9 @@
     }
     
     fill_tags();
+    $panel->render('group/prefs.tt', $vars);
 }
 
-$panel->build( $template );
-$panel->display;
-
 sub update_quota {
     my $quota = $cgi->param('new_quota');
     unless(defined $quota && $quota =~ /^\d+$/) {
@@ -313,11 +248,9 @@
 	foreach my $c (@{$categories}) {
 		$c->{tags} = Vhffs::Tag::get_by_category_id($vhffs, $c->{category_id});
 	}
-	$template->param( CATEGORIES => $categories );
-	
-	$template->param( CURRENT_TAGS => $group->get_tags($visibility) );
-	
-	$template->param( TAG_REQUESTS => $group->get_tag_requests() );
+    $vars->{tag_categories} = $categories;
+    $vars->{current_tag_categories} = $group->get_tags($visibility);
+    $vars->{tag_requests} = $group->get_tag_requests();
 }
 
 sub add_tag {

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2011-05-12 20:10:30 UTC (rev 1704)
+++ trunk/vhffs-panel/templates/Makefile.am	2011-05-12 20:10:41 UTC (rev 1705)
@@ -72,12 +72,9 @@
 	group/add_user.tmpl \
 	group/admin.tmpl \
 	group/info.tmpl \
-	group/list_user.tmpl \
-	group/prefs.tmpl \
 	group/prefs_avatar.tmpl \
 	group/history.tmpl \
 	group/history_part.tmpl \
-	group/tags.tmpl \
 	mail/create.tmpl \
 	mailinglist/create.tmpl \
 	mailinglist/list_part.tmpl \
@@ -130,6 +127,7 @@
 	web/prefs.tmpl \
 	cron/create.tmpl \
 	cron/prefs.tmpl \
+	admin/object/edit.tt \
 	anonymous/account_created.tt \
 	anonymous/login.tt \
 	anonymous/lost-password.tt \
@@ -137,6 +135,8 @@
 	anonymous/subscribe.tt \
 	group/create.tt \
 	group/index.tt \
+	group/prefs.tt \
+	group/tags.tt \
 	layouts/anonymous.tt \
 	layouts/panel.tt \
 	menu/admin.tt \

Added: trunk/vhffs-panel/templates/admin/object/edit.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/object/edit.tt	                        (rev 0)
+++ trunk/vhffs-panel/templates/admin/object/edit.tt	2011-05-12 20:10:41 UTC (rev 1705)
@@ -0,0 +1,67 @@
+[% USE date %]
+<h1>[% 'Object administration' | i18n | html %]</h1>
+	
+<form method="post" action="/admin/object/edit_submit.pl" accept-charset="utf-8">
+	<p>
+		<label>[% 'Object ID:' | i18n | html %]</label>
+		[% object.get_oid %]
+	</p>
+	<p>
+		<label for="UID">[% 'Owner UID:' | i18n | html %]</label>
+		<input type="text" name="UID" id="UID" value="[% object.get_owner_uid %]" />
+		([% object.get_owner_name | html %])
+	</p>
+	<p>
+		<label>[% 'Date of creation' | i18n | html %]</label>
+            [% object.get_date ? date.format(object.get_date, '%x %X') : 'N/A' %]
+	</p>
+	<p>
+		<label for="STATUS">[% 'Status:' | i18n | html %]</label>
+			<select name="STATUS" id="STATUS">
+				<option value="[% constants.object_statuses.WAITING_FOR_VALIDATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_VALIDATION %]>
+                    [% 'Waiting for validation' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.VALIDATION_REFUSED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.VALIDATION_REFUSED %]>
+                    [% 'Validation refused' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.WAITING_FOR_CREATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_CREATION %]>
+                    [% 'Waiting for creation' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.CREATING_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.CREATING_ERROR %]>
+                    [% 'Error while creating object' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.CREATED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.CREATED %]>
+                    [% 'Created' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.ACTIVATED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.ACTIVATED %]>
+                    [% 'Activated' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.SUSPEND_PENDING %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.SUSPEND_PENDING %]>
+                    [% 'Waiting for suspension' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.SUSPENDED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.SUSPENDED %]>
+                    [% 'Suspended' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.WAITING_FOR_MODIFICATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_MODIFICATION %]>
+                    [% 'Waiting for modification' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.MODIFICATION_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.MODIFICATION_ERROR %]>
+                    [% 'Error while modifying object' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.MODIFICATION_APPLIED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.MODIFICATION_APPLIED %]>
+                    [% 'Modification applied' | i18n | html %]</option>
+				<option value="[% constants.object_statuses.TO_DELETE %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.TO_DELETE %]>
+                    [% 'Will be deleted' | i18n | html %]</option>
+			</select>
+	</p>
+	<p>
+		<label>[% 'Description:' | i18n | html %]</label>
+		<textarea name="description" id="description" cols="45" rows="7">[% object.get_description | html %]</textarea>
+	</p>
+
+	<p class="button" id="buttonSend">
+		<input type="hidden" name="OID" value="[% object.get_oid %]" />
+		<input type="submit" value="[% 'Update' | i18n | html %]" />
+	</p>
+
+</form>
+
+<h2>[% 'Object history' | i18n | html %]</h2>
+[% INCLUDE 'misc/history.tt'
+    history = object.get_history %]
+
+[% IF use_avatar %]
+<h2>[% 'Avatar management' | i18n | html %]</h2>
+<p><a href="delete_avatar.pl?OID=[% object.get_oid %]">[% 'Delete avatar for this object' | i18n | html %]</a></p>
+[% END %]
+

Deleted: trunk/vhffs-panel/templates/group/list_user.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/list_user.tmpl	2011-05-12 20:10:30 UTC (rev 1704)
+++ trunk/vhffs-panel/templates/group/list_user.tmpl	2011-05-12 20:10:41 UTC (rev 1705)
@@ -1,7 +0,0 @@
-<TMPL_LOOP NAME="USERS">
-<form action="#" method="post" accept-charset="utf-8">
-<input type="hidden" name="uid" value="<TMPL_VAR ESCAPE=1 NAME="UID">"/>
-<p><label><TMPL_VAR ESCAPE=1 NAME="USERNAME"> (<TMPL_VAR ESCAPE=1 NAME="FIRSTNAME"> <TMPL_VAR ESCAPE=1 NAME="LASTNAME">)</label>
-<input type="submit" name="add_user_list_submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_ADD">"/></p>
-</form>
-</TMPL_LOOP>

Deleted: trunk/vhffs-panel/templates/group/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/prefs.tmpl	2011-05-12 20:10:30 UTC (rev 1704)
+++ trunk/vhffs-panel/templates/group/prefs.tmpl	2011-05-12 20:10:41 UTC (rev 1705)
@@ -1,124 +0,0 @@
-<p class="info"><TMPL_VAR ESCAPE=1 NAME="TEXT_QUOTA"></p>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME"></h2>
-
-<form method="post" action="#" accept-charset="utf-8">
-    <p>
-        <label><TMPL_VAR ESCAPE=1 NAME="TEXT_OWNER">:</label>
-        <TMPL_VAR ESCAPE=1 NAME="VALUE_OWNER">
-    </p>
-    <p><label for="realname" class="realname"><TMPL_VAR ESCAPE=1 NAME="TEXT_REALNAME">:</label><input type="text" size="30" maxlength="100" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_REALNAME">" name="realname" id="realname"/></p>
-    <p><label for="description" class="description"><TMPL_VAR ESCAPE=1 NAME="TEXT_DESCRIPTION">:</label></p>
-    <p><textarea name="description" id="description" class="description" cols="45" rows="7"><TMPL_VAR ESCAPE=1 NAME="VALUE_DESCRIPTION"></textarea></p>
-    <p class="button" id="buttonModify">
-        <input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">"/>
-        <input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_MODIFY">" name="update_desc_submit"/>
-    </p>
-</form>
-
-<TMPL_IF NAME="CONTACT_EMAIL_TITLE">
-<h2><TMPL_VAR ESCAPE=1 NAME="CONTACT_EMAIL_TITLE"></h2>
-<p>
-<TMPL_VAR ESCAPE=1 NAME="CONTACT_EMAIL_TEXT">
-<form action="#" method="post" accept-charset="utf-8">
-Forward emails from <TMPL_VAR ESCAPE=1 NAME="CONTACT_EMAIL"> to
-<input type="text" name="contact_email" id="contact_email" value="<TMPL_VAR ESCAPE=1 NAME="CONTACT_EMAIL_FORWARD">"/> 
-<input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">"/>
-<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="CONTACT_EMAIL_MODIFY">" name="contact_email_submit"/>
-</form>
-<TMPL_IF NAME="HELP_URL">
-<a href="<TMPL_VAR ESCAPE=1 NAME="HELP_URL">"><TMPL_VAR ESCAPE=1 NAME="HELP_TEXT"></a>
-</TMPL_IF>
-</p>
-</TMPL_IF>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="USERS_TEXT"></h2>
-<h3><TMPL_VAR ESCAPE=1 NAME="CURRENT_USERS"></h3>
-<tmpl_unless name="USERS">
-<p class="info"><TMPL_VAR ESCAPE=1 NAME="NO_USER_TEXT"></p>
-</tmpl_unless>
-<TMPL_LOOP NAME="USERS">
-<TMPL_IF NAME="ACTIVE">
-<form action="#" method="post" accept-charset="utf-8">
-<input type="hidden" name="uid" value="<TMPL_VAR ESCAPE=1 NAME="uid">"/>
-<input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">"/>
-<p><label><TMPL_VAR ESCAPE=1 NAME="username"> (<TMPL_VAR ESCAPE=1 NAME="FIRSTNAME"> <TMPL_VAR ESCAPE=1 NAME="LASTNAME">)</label><input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="REMOVE_USER_TEXT">" name="remove_user_submit"/></p>
-</form>
-<tmpl_else>
-<p><TMPL_VAR ESCAPE=1 NAME="USERNAME"> (<TMPL_VAR ESCAPE=1 NAME="FIRSTNAME"> <TMPL_VAR ESCAPE=1 NAME="LASTNAME">) &mdash; <TMPL_VAR ESCAPE=1 NAME="STATE"></p>
-</TMPL_IF>
-</TMPL_LOOP>
-<TMPL_IF NAME="ADMIN">
-<p>
-<TMPL_LOOP NAME="USERS">
-<TMPL_VAR ESCAPE=1 NAME="FIRSTNAME"> <TMPL_VAR ESCAPE=1 NAME="LASTNAME"> &lt;<TMPL_VAR ESCAPE=1 NAME="MAIL">&gt;, 
-</TMPL_LOOP>
-</p>
-</TMPL_IF>
-
-<a name="add_user"></a>
-<h3><TMPL_VAR ESCAPE=1 NAME="TEXT_JOIN_GROUP"></h3>
-
-<form method="post" action="prefs.pl#add_user" accept-charset="utf-8">
-	<p>
-		<label for="username_add">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_USERNAME">	
-		</label>
-		<input type="text" name="username" id="username_add" />
-                <input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">"/>
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_SEND">" name="add_user_submit"/>
-	</p>
-</form>
-
-<TMPL_IF NAME="ADD_USER_MSG"><p class="<TMPL_VAR ESCAPE=1 NAME="ADD_USER_MSG_CLASS">"><TMPL_VAR ESCAPE=1 NAME="ADD_USER_MSG"></p></TMPL_IF>
-<TMPL_VAR ESCAPE=0 NAME="USERS_LIST">
-
-<TMPL_INCLUDE NAME="tags.tmpl">
-
-<TMPL_VAR ESCAPE=0 name="AVATAR">
-
-<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_ACL_ADMIN"></h2>
-
-<form method="post" action="../acl/view.pl" accept-charset="utf-8">
-	<p><TMPL_VAR ESCAPE=1 NAME="EXPLAIN_ADMIN_ACL"></p>
-
-	<input type="hidden" name="target_oid" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_OID">" />
-	<p class="button" id="buttonAclAdmin">
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="ADMIN_ACL">" />
-	</p>
-</form>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_DELETE_PROJECT"></h2>
-
-<form method="post" action="delete.pl" accept-charset="utf-8">
-	<fieldset class="delete">
-		<legend>
-			<TMPL_VAR ESCAPE=1 NAME="ASK_DELETE_PROJECT">:
-		</legend>
-
-		<p class="warning"><TMPL_VAR ESCAPE=1 NAME="TEXT_BEFORE_DELETE"></p>
-		<p>
-			<input type="radio" name="DELETE" id="DELETE_NO"  value="0" checked="checked" />
-			<label for="DELETE_NO">
-				<TMPL_VAR ESCAPE=1 NAME="NO">
-			</label>
-		</p>
-		<p>
-			<input type="radio" name="DELETE" id="DELETE_YES" value="1" />
-			<label for="DELETE_YES">
-				<TMPL_VAR ESCAPE=1 NAME="YES">
-			</label>
-		</p>
-	</fieldset>
-	
-	<p class="button" id="buttonDelete">
-		<input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">" />
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_DELETE">" />
-	</p>
-
-</form>
-
-<TMPL_IF NAME="ADMIN">
-    <TMPL_VAR ESCAPE=0 NAME="ADMIN_PART">
-    <TMPL_INCLUDE NAME="admin.tmpl">
-</TMPL_IF>

Added: trunk/vhffs-panel/templates/group/prefs.tt
===================================================================
--- trunk/vhffs-panel/templates/group/prefs.tt	                        (rev 0)
+++ trunk/vhffs-panel/templates/group/prefs.tt	2011-05-12 20:10:41 UTC (rev 1705)
@@ -0,0 +1,154 @@
+<p class="info">[% 'If you want more disk space for your project, you must fill a form in the bug report section, in the menu. Don\'t forget to mention the name of the group.' | i18n | html %]</p>
+
+<h2>[% group.get_groupname | html %]</h2>
+
+<form method="post" action="#" accept-charset="utf-8">
+    <p>
+        <label>[% 'Project owner:' | i18n | html %]</label>
+        [% group.get_owner_username() | html %]
+    </p>
+    <p><label for="realname" class="realname">[% 'Project full name:' | i18n | html %]</label><input type="text" size="30" maxlength="100" value="[% group.get_realname | html %]" name="realname" id="realname"/></p>
+    <p><label for="description" class="description">[% 'Project description:' | i18n | html %]</label></p>
+    <p><textarea name="description" id="description" class="description" cols="45" rows="7">[% group.get_description %]</textarea></p>
+    <p class="button" id="buttonModify">
+        <input type="hidden" name="group" value="[% group.get_groupname | html %]"/>
+        <input type="submit" value="[% 'Modify' | i18n | html %]" name="update_desc_submit"/>
+    </p>
+</form>
+
+[% IF mailgroup.defined() %]
+<h2>[% 'Project contact' | i18n | html %]</h2>
+<p>
+[% 'We offer you the possibility to forward emails from %s@%s.' | i18n | pretty_print(group.get_groupname, mailgroup.config.domain) %]
+<form action="#" method="post" accept-charset="utf-8">
+[% 'Forward emails from %s@%s to ' | i18n | pretty_print(group.get_groupname, mailgroup.config.domain) %]
+<input type="text" name="contact_email" id="contact_email" value="[% mailgroup.getforward %]"/> 
+<input type="hidden" name="group" value="[% group.get_groupname %]"/>
+<input type="submit" value="[% 'Modify' | i18n %]" name="contact_email_submit"/>
+</form>
+[% IF mailgroup.config.url_doc.defined() %]
+<a href="[% mailgroup.config.url_doc | html %]">[% 'Help' | i18n | html %]</a>
+[% END %]
+</p>
+[% END %]
+
+<h2>[% 'Users' | i18n | html %]</h2>
+<h3>[% 'Users currently in this group' | i18n | html %]</h3>
+[% UNLESS group_users.size() > 0 %]
+<p class="info">[% 'No user for this group.' | i18n | html %]</p>
+[% END %]
+[% FOREACH u IN group_users %]
+[% IF u.active %]
+<form action="#" method="post" accept-charset="utf-8">
+<input type="hidden" name="uid" value="[% u.uid %]"/>
+<input type="hidden" name="group" value="[% g.get_groupname | html %]"/>
+<p><label>[% u.username | html %] ([% u.firstname | html %] [% u.lastname | html %])</label>
+    <input type="submit" value="[% 'Remove' | i18n | html %]" name="remove_user_submit"/></p>
+</form>
+[% ELSE %]
+<p>[% u.username | html %] ([% u.firstname | html %] [% u.lastname | html %]) &mdash; [% u.state %]</p>
+[% END # u.active %]
+[% END # u IN group_users %]
+
+[% IF current_user.is_admin() %]
+<p>
+[% FOREACH u IN group_users %]
+[% u.firstname | html %] [% u.lastname | html %] &lt;[% u.mail | html %]&gt;[% ', ' UNLESS loop.last() %]
+[% END %]
+</p>
+[% END # current_user.is_admin() %]
+
+<a name="add_user"></a>
+<h3>[% 'Add a user in this group' | i18n | html %]</h3>
+
+<form method="post" action="prefs.pl#add_user" accept-charset="utf-8">
+	<p>
+		<label for="username_add">
+            [% 'Username:' | i18n | html %]
+		</label>
+		<input type="text" name="username" id="username_add" />
+                <input type="hidden" name="group" value="[% group.get_groupname | html %]"/>
+		<input type="submit" value="[% 'Add' | i18n | html %]" name="add_user_submit"/>
+	</p>
+</form>
+
+[% IF add_user_error %]<p class="error">[% add_user_error | html %]</p>[% END %]
+[% IF add_user_info %]<p class="info">[% add_user_info | html %]</p>[% END %]
+
+[% FOREACH u IN add_user_list %]
+<form action="#" method="post" accept-charset="utf-8">
+<input type="hidden" name="uid" value="[% u.uid %]"/>
+<input type="hidden" name="group" value="[% group.get_groupname | html %]"/>
+<p><label>[% u.username | html %] ([% u.firstname | html %] [% u.lastname | html %])</label>
+<input type="submit" name="add_user_list_submit" value="[% 'Add' | i18n | html %]"/></p>
+</form>
+[% END %]
+
+[% INCLUDE 'group/tags.tt' %]
+
+[% IF use_avatar %]
+<h2>[% 'Logo' | i18n | html %]</h2>
+<h3>[% 'Current logo' | i18n | html %]</h3>
+    <p><img src="../getavatar.pl?oid=[% group.get_oid %]" alt="[% 'Group logo' | i18n | html %]"/></p>
+<h3>[% 'Update logo' | i18n | html %]</h3>
+<form method="post" action="../object/upavatar.pl" enctype="multipart/form-data" accept-charset="utf-8">
+    <p>[% 'You can upload a custom logo for your group.' | i18n | html %]</p>
+    <input type="hidden" name="OID" value="[% group.get_oid %]"/>
+    <p><input type="file" name="avatar"/></p>
+    <p><input type="submit" value="[% 'Update' %]" /></p>
+</form>
+[% END %]
+
+<h2>[% 'Access rights management for this object' | i18n | html %]</h2>
+
+<form method="post" action="../acl/view.pl" accept-charset="utf-8">
+	<p>[% 'You can adjust rights on this group for each user in the VHFFS database. Please read help before manage it.' | i18n | html %]</p>
+	<input type="hidden" name="target_oid" value="[% group.get_oid %]" />
+	<p class="button" id="buttonAclAdmin">
+		<input type="submit" value="[% 'OK, go to ACL management' | i18n | html %]" />
+	</p>
+</form>
+
+<h2>[% 'Delete this project' | i18n | html %]</h2>
+
+<form method="post" action="delete.pl" accept-charset="utf-8">
+	<fieldset class="delete">
+		<legend>
+			[% 'Are you SURE you want DELETE this project ?' | i18n | html %]
+		</legend>
+
+		<p class="warning">[% 'This action is non-reversible. All services associated to this project will be DESTROYED.' | i18n | html %]</p>
+		<p>
+			<input type="radio" name="DELETE" id="DELETE_NO"  value="0" checked="checked" />
+			<label for="DELETE_NO">
+				[% 'No, I\'m not sure, I prefer to keep this project.' | i18n | html %]
+			</label>
+		</p>
+		<p>
+			<input type="radio" name="DELETE" id="DELETE_YES" value="1" />
+			<label for="DELETE_YES">
+				[% 'Yes I\'m sure of what I do' | i18n | html %]
+			</label>
+		</p>
+	</fieldset>
+	
+	<p class="button" id="buttonDelete">
+		<input type="hidden" name="group" value="[% group.get_groupname %]" />
+		<input type="submit" value="[% 'Delete' | i18n | html %]" />
+	</p>
+
+</form>
+
+[% IF current_user.is_admin() %]
+    <TMPL_VAR ESCAPE=0 NAME="ADMIN_PART">
+    [% INCLUDE 'admin/object/edit.tt'
+        object = group %]
+    <h2>[% 'Group quota' | i18n | html %]</h2>
+    <form method="post" action="#">
+        <p><label>[% 'Space used:' | i18n | html %]</label>[% group.get_quota_used %]/[% group.get_quota %]&nbsp;[% 'MB' | i18n | html %]</p>
+        <p><label for="new_quota">[% 'New quota:' | i18n | html %]</label>
+           <input type="text" name="new_quota" id="new_quota" value="[% group.get_quota %]"/>&nbsp;[% 'MB' | i18n | html %]</p>
+           <input type="hidden" name="group" value="[% group.get_groupname | html %]"/>
+        <p><input type="submit" name="update_quota_submit" value="[% 'Update quota' | i18n | html %]"/></p>
+    </form>
+[% END %]

Deleted: trunk/vhffs-panel/templates/group/tags.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/tags.tmpl	2011-05-12 20:10:30 UTC (rev 1704)
+++ trunk/vhffs-panel/templates/group/tags.tmpl	2011-05-12 20:10:41 UTC (rev 1705)
@@ -1,45 +0,0 @@
-<a name="tags"></a><h2>Tags</h2>
-<TMPL_IF NAME="CURRENT_TAGS">
-<h3><TMPL_I18N KEY="Current tags for this project"></h3>
-<ul>
-<TMPL_LOOP NAME="CURRENT_TAGS">
-<li><TMPL_VAR NAME="LABEL">
-<TMPL_LOOP NAME="TAGS">
-<a href="?group=<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">&amp;delete_tag_submit=true&amp;tag_id=<TMPL_VAR NAME="TAG_ID">#tags"><TMPL_VAR NAME="LABEL"></a><TMPL_UNLESS NAME="__LAST__">, </TMPL_UNLESS>
-</TMPL_LOOP>
-;
-</TMPL_LOOP>
-</ul>
-</TMPL_IF>
-<h3><TMPL_I18N KEY="Add a tag"></h3>
-<ul>
-<TMPL_LOOP NAME="CATEGORIES">
-<li><TMPL_VAR NAME="LABEL">:
-<TMPL_LOOP NAME="TAGS">
-<a href="?group=<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">&amp;add_tag_submit=true&amp;tag_id=<TMPL_VAR NAME="TAG_ID">#tags"><TMPL_VAR NAME="LABEL"></a><TMPL_UNLESS NAME="__LAST__">, </TMPL_UNLESS>
-</TMPL_LOOP>
-;</li>
-</TMPL_LOOP>
-</ul>
-<h3><TMPL_I18N KEY="Request new tag"></h3>
-<form name="requestTagForm" action="#" method="post">
-<p><label for="requestTagCategory"><TMPL_I18N KEY="Category">:</label>
-<input type="text" name="category" id="requestTagCategory"/>
-</p>
-<p><label for="requestTagTag"><TMPL_I18N KEY="Label">:</label>
-<input type="text" name="tag" id="requestTagTag"/>
-</p>
-<input type="hidden" name="group" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">" />
-<p class="button"><input type="submit" name="request_tag_submit" value="<TMPL_I18N KEY="OK">"/></p>
-</form>
-<TMPL_IF NAME="TAG_REQUESTS">
-<h3><TMPL_I18N KEY="Pending tag requests"></h3>
-<ul>
-<TMPL_LOOP NAME="TAG_REQUESTS">
-<li>
-<TMPL_VAR NAME="CATEGORY_LABEL">::<TMPL_VAR NAME="TAG_LABEL">
-[<a href="?group=<TMPL_VAR ESCAPE=1 NAME="TEXT_PROJECTNAME">&amp;cancel_tag_request_submit=true&amp;request_id=<TMPL_VAR NAME="REQUEST_ID">"><TMPL_I18N KEY="Cancel"></a>]
-</li>
-</TMPL_LOOP>
-</ul>
-</TMPL_IF>

Added: trunk/vhffs-panel/templates/group/tags.tt
===================================================================
--- trunk/vhffs-panel/templates/group/tags.tt	                        (rev 0)
+++ trunk/vhffs-panel/templates/group/tags.tt	2011-05-12 20:10:41 UTC (rev 1705)
@@ -0,0 +1,45 @@
+<a name="tags"></a><h2>[% 'Tags' | i18n | html %]</h2>
+[% IF current_tag_categories.size() %]
+<h3>[% 'Current tags for this project' | i18n | html %]</h3>
+<ul>
+[% FOREACH c IN current_tag_categories %]
+<li>[% c.label | html %]:
+[% FOREACH t IN c.tags %]
+<a href="?group=[% group.get_groupname | html %]&amp;delete_tag_submit=true&amp;tag_id=[% t.tag_id %]#tags">[% t.label | html %]</a>[% ', ' UNLESS loop.last %]
+[% END # t IN c.tags %]
+[% ';' UNLESS loop.last() %]
+[% END # c IN current_tag_categories%]
+</ul>
+[% END %]
+<h3>[% 'Add a tag' | i18n | html %]</h3>
+<ul>
+[% FOREACH c IN tag_categories %]
+<li>[% c.label | html %]:
+[% FOREACH t IN c.tags %]
+<a href="?group=[% group.get_groupname | html %]&amp;add_tag_submit=true&amp;tag_id=[% t.tag_id %]#tags">[% t.label | html %]</a>[% ', ' UNLESS loop.last() %]
+[% END # t IN c.tags %]
+;</li>
+[% END # c IN tag_categories %]
+</ul>
+<h3>[% 'Request a new tag' | i18n | html %]</h3>
+<form name="requestTagForm" action="#" method="post">
+<p><label for="requestTagCategory">[% 'Category:' | i18n | html %]</label>
+<input type="text" name="category" id="requestTagCategory"/>
+</p>
+<p><label for="requestTagTag">[% 'Tag label:' | i18n | html %]</label>
+<input type="text" name="tag" id="requestTagTag"/>
+</p>
+<input type="hidden" name="group" value="[% group.get_groupname %]" />
+<p class="button"><input type="submit" name="request_tag_submit" value="[% 'OK' | i18n | html %]"/></p>
+</form>
+[% IF tag_requests.size() %]
+<h3>[% 'Pending tag requests' | i18n | html %]</h3>
+<ul>
+[% FOREACH r IN tag_requests %]
+<li>
+[% r.category_label | html %]::[% r.tag_label | html %]
+[<a href="?group=[% group.get_groupname | html %]&amp;cancel_tag_request_submit=true&amp;request_id=[% r.request_id %]">[% 'Cancel' | i18n | html %]</a>]
+</li>
+[% END # r IN tag_requests %]
+</ul>
+[% END # tag_requests.size() %]


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/