[vhffs-dev] [1565] Fixed couple of css issues...

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


Revision: 1565
Author:   beuss
Date:     2010-03-18 15:44:24 +0100 (Thu, 18 Mar 2010)
Log Message:
-----------
Fixed couple of css issues... First panel page is now in light-grey theme... Fixed issues on user prefs (ISE). Added hack to allow forward (need to work on this, hacks are bad)

Modified Paths:
--------------
    branches/vhffs-design/vhffs-api/src/Vhffs/Makefile.am
    branches/vhffs-design/vhffs-api/src/Vhffs/Panel.pm
    branches/vhffs-design/vhffs-panel/lost.pl
    branches/vhffs-design/vhffs-panel/panel.pl
    branches/vhffs-design/vhffs-panel/subscribe.pl
    branches/vhffs-design/vhffs-panel/templates/Makefile.am
    branches/vhffs-design/vhffs-panel/templates/content/anonymous/login.tt
    branches/vhffs-design/vhffs-panel/templates/layouts/anonymous.tt
    branches/vhffs-design/vhffs-panel/user/prefs.pl
    branches/vhffs-design/vhffs-public/templates/parts/header.tt
    branches/vhffs-design/vhffs-themes/light-grey/main.css

Added Paths:
-----------
    branches/vhffs-design/vhffs-panel/templates/content/member/
    branches/vhffs-design/vhffs-panel/templates/parts/
    branches/vhffs-design/vhffs-panel/templates/parts/member/

Modified: branches/vhffs-design/vhffs-api/src/Vhffs/Makefile.am
===================================================================
--- branches/vhffs-design/vhffs-api/src/Vhffs/Makefile.am	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-api/src/Vhffs/Makefile.am	2010-03-18 14:44:24 UTC (rev 1565)
@@ -31,6 +31,7 @@
 	Panel/Mail.pm \
 	Panel/MailingList.pm \
 	Panel/Main.pm \
+	Panel/Member.pm \
 	Panel/Menu.pm \
 	Panel/Mysql.pm \
 	Panel/Object.pm \

Modified: branches/vhffs-design/vhffs-api/src/Vhffs/Panel.pm
===================================================================
--- branches/vhffs-design/vhffs-api/src/Vhffs/Panel.pm	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-api/src/Vhffs/Panel.pm	2010-03-18 14:44:24 UTC (rev 1565)
@@ -94,6 +94,7 @@
     my $panel = shift;
     my $vhffs = $panel->{vhffs};
     my $templatedir = $vhffs->get_config->get_templatedir;
+# TODO Use new templates
     if( $vhffs->get_config->get_panel->{'use_public'} ne 'yes' ) {
         my $template = new HTML::Template( filename => $templatedir.'/panel/main/close.tmpl' );
         $template->param( TEXT_CLOSE    => gettext('Public area not available') );
@@ -289,6 +290,8 @@
 }
 
 
+my $cgi;
+
 sub new
 {
 	my $class = ref($_[0]) || $_[0];
@@ -298,8 +301,15 @@
 	$this->{cookies} = [];
 	bless( $this, $class );
 
-	my $cgi = new CGI;
-	$cgi->charset('UTF-8');
+    unless ( defined $cgi ) {
+    	$cgi = new CGI;
+    	$cgi->charset('UTF-8');
+    }
+
+    if(defined $cgi->param('error')) {
+        $this->add_error($cgi->param('error'));
+    }
+
 	$this->{cgi} = $cgi;
 	$this->{url} = CGI::url();
 
@@ -323,7 +333,6 @@
 	$lang = 'en_US' unless defined $lang;
 	$this->{lang} = $lang;
 
-	setlocale(LC_ALL, $lang);
 	bindtextdomain('vhffs', '%localedir%');
 	textdomain('vhffs');
 
@@ -367,48 +376,64 @@
 }
 
 
+sub get_session {
+	my $self = shift;
+	if(!defined $self->{session}) {
+		$self->check_member();
+	}
+	return $self->{session};
+}
 
-sub get_session
+
+sub check_member
 {
 	my $panel = shift;
 	my $vhffs = $panel->{vhffs};
 	my $cgi = $panel->{cgi};
 
+# TODO Use new templates
 	my $sid = $cgi->cookie( CGI::Session::name() );
 	unless( defined $sid )  {
-		$panel->add_error( gettext('No cookie found, please accept the cookie and then please login again !') );
-		Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+        $cgi->delete_all();
+        # We cannot use add_error since auth.pl instanciate a
+        # Vhffs::Panel::Anonymous instance...
+        $cgi->param('error', gettext('No cookie found, please accept the cookie and then please login again !') );
+        require 'auth.pl';
 		exit 0;
 	}
 
 	my $session = new CGI::Session( undef, $sid, {Directory=>'/tmp'} );
 	unless( defined $session )  {
-		$panel->add_error( gettext('Cannot create or fetch session file, please check that /tmp is readable and writeable') );
-		Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+        $cgi->delete_all();
+        $cgi->param('error', gettext('Cannot create or fetch session file, please check that /tmp is readable and writeable') );
+        require 'auth.pl';
 		exit 0;
 	}
 
 	my $username = $session->param('username');
 	my $uid = $session->param('uid');
 	unless(  defined $username  &&  defined $uid  &&  !$session->is_new()  )  {
-		$panel->add_error( gettext('Expired session ! Please login again') );
+        $cgi->delete_all();
+		$cgi->param('error', gettext('Expired session ! Please login again') );
 		$session->delete();
-		Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+        require 'auth.pl';
 		exit 0;
 	}
 
 	my $user = Vhffs::User::get_by_uid($vhffs, $uid);
 	unless ( defined $user )  {
-		$panel->add_error( gettext('User does not exist') );
+        $cgi->delete_all();
+        $cgi->param('error', gettext('User does not exist') );
 		$session->delete();
-		Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+        require 'auth.pl';
 		exit 0;
 	}
 
 	unless( $user->get_status == Vhffs::Constants::ACTIVATED )  {
-		$panel->add_error( gettext('You\'re are not allowed to browse panel') );
+        $cgi->delete_all();
+        $cgi->param('error', gettext('You\'re are not allowed to browse panel') );
 		$session->delete();
-		Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+        require 'auth.pl';
 		exit 0;
 	}
 

Modified: branches/vhffs-design/vhffs-panel/lost.pl
===================================================================
--- branches/vhffs-design/vhffs-panel/lost.pl	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/lost.pl	2010-03-18 14:44:24 UTC (rev 1565)
@@ -72,6 +72,7 @@
     	my $content = sprintf(gettext("Hello %s %s,\n\nYou asked for a new password, here are your new login information:\nUser: %s\nPassword: %s\n\n%s Administrators\n"), $user->get_firstname, $user->get_lastname, $user->get_username, $password , $vhffs->get_config->get_host_name );
     	$user->send_mail_user( $subject, $content );
     	
+        $cgi->delete_all();
     	$panel->add_info( gettext('Password successfully reset') );
     	require 'auth.pl';
     	exit 0;	

Modified: branches/vhffs-design/vhffs-panel/panel.pl
===================================================================
--- branches/vhffs-design/vhffs-panel/panel.pl	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/panel.pl	2010-03-18 14:44:24 UTC (rev 1565)
@@ -40,13 +40,11 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
+use Vhffs::Panel::Member;
 
-my $panel = new Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Member();
 exit 0 unless $panel;
 my $session = $panel->get_session;
 exit 0 unless $session;
 
-$panel->build( $panel->welcome );
-$panel->display;
+$panel->render('content/member/home.tt', {});

Modified: branches/vhffs-design/vhffs-panel/subscribe.pl
===================================================================
--- branches/vhffs-design/vhffs-panel/subscribe.pl	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/subscribe.pl	2010-03-18 14:44:24 UTC (rev 1565)
@@ -117,7 +117,7 @@
 					$newsletter->add;
 				}
 			}
-			$cgi->delete('username'); # Avoid "login failed" error message...
+			$cgi->delete_all(); # Avoid "login failed" error message...
 			$panel->add_info( gettext( 'User successfully created. '.
 					'Please wait while we are creating the account, it could take several minutes' ) );
 			require 'auth.pl'; # Redirect to login

Modified: branches/vhffs-design/vhffs-panel/templates/Makefile.am
===================================================================
--- branches/vhffs-design/vhffs-panel/templates/Makefile.am	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/templates/Makefile.am	2010-03-18 14:44:24 UTC (rev 1565)
@@ -126,7 +126,12 @@
 	web/prefs.tmpl \
 	cron/create.tmpl \
 	cron/prefs.tmpl \
-	layouts/anonymous.tt \
 	content/anonymous/login.tt \
 	content/anonymous/lost-password.tt \
-	content/anonymous/subscribe.tt
+	content/anonymous/subscribe.tt \
+    content/member/home.tt \
+	layouts/anonymous.tt \
+	layouts/member.tt \
+	parts/member/header.tt \
+	parts/member/group-menu.tt \
+    parts/member/top-menu.tt

Modified: branches/vhffs-design/vhffs-panel/templates/content/anonymous/login.tt
===================================================================
--- branches/vhffs-design/vhffs-panel/templates/content/anonymous/login.tt	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/templates/content/anonymous/login.tt	2010-03-18 14:44:24 UTC (rev 1565)
@@ -1,16 +1,16 @@
 [% hosterlink = '<a href="' _ hostersite _ '">' _ hostername _ '</a>' %]
 <h1>[% 'Welcome on %s' | i18n | pretty_print(hosterlink) %]</h1>
 [% FOREACH e IN errors.global %]
-<p class="info">[% e.msg %]</p>
+<p class="error">[% e.msg %]</p>
 [% END %]
 [% FOREACH i IN infos %]
 <p class="info">[% i.msg %]</p>
 [% END %]
-<form name="loginForm" id="loginForm" method="post" action="auth.pl">
+<form id="loginForm" method="post" action="auth.pl">
 <p><label for="loginUsername">[% 'Username' | i18n %]</label><input type="text" name="username" id="loginUsername" maxlength="50"/></p>
 <p><label for="loginPassword">[% 'Password' | i18n %]</label><input type="password" name="password" id="loginPassword"/></p>
 <p class="submit"><input type="submit" id="loginSubmit" value="Connexion"/></p>
 </form>
 [% IF showstats %]
 <p id="pinfo">[% 'Woah, %s users and %s groups already trust %s' | i18n | pretty_print(users_count, groups_count, hostername) %]</p>
-[% END %]
\ No newline at end of file
+[% END %]

Modified: branches/vhffs-design/vhffs-panel/templates/layouts/anonymous.tt
===================================================================
--- branches/vhffs-design/vhffs-panel/templates/layouts/anonymous.tt	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/templates/layouts/anonymous.tt	2010-03-18 14:44:24 UTC (rev 1565)
@@ -4,7 +4,6 @@
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <meta name="author" content="VHFFS Team, based on G. Wolfgang original design" />
   <link rel="stylesheet" type="text/css" media="screen,projection" href="/themes/[% theme %]/main.css" />
-  <link rel="stylesheet" type="text/css" media="screen,projection" href="/js/dijit/dijit.css" />
   <script type="text/javascript" src="/js/dojo/dojo.js"></script>
   <script type="text/javascript" src="/js/dijit/dijit.js"></script>
   <script type="text/javascript" src="/js/anonymous.js"></script>
@@ -15,7 +14,7 @@
 <div id="background-container">
   <div class="page-container-panel-anonymous">
     <div id="loading" style="display:none">
-      <img src="/themes/[% theme %]/img/loading.gif">
+      <img src="/themes/[% theme %]/img/loading.gif" alt="Loading..."/>
     </div>
     <div class="navflag">
       <a href="/?lang=fr_FR"><img class="img-navflag" src="/themes/[% theme %]/img/flag_fr.png" alt="[% 'French' | i18n %]" /></a>
@@ -23,7 +22,7 @@
       <a href="/?lang=en_EN"><img class="img-navflag" src="/themes/[% theme %]/img/flag_en.png" alt="[% 'English' | i18n %]" /></a>
     </div>
     <div class="logo">
-      <img src="/themes/[% theme %]/img/vhffs-big.png" alt="Virtual hosting for free software"/>
+      <a href="/"><img src="/themes/[% theme %]/img/vhffs-big.png" alt="Virtual hosting for free software"/></a>
     </div>
     <div id="top-menu">
   			<ul>

Modified: branches/vhffs-design/vhffs-panel/user/prefs.pl
===================================================================
--- branches/vhffs-design/vhffs-panel/user/prefs.pl	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-panel/user/prefs.pl	2010-03-18 14:44:24 UTC (rev 1565)
@@ -360,7 +360,7 @@
 	}
 
 	# themes
-	my @themes = Vhffs::Panel::Main::list_themes( $vhffs );
+	my @themes = Vhffs::Panel::list_themes( $vhffs );
 	my $curtheme = Vhffs::Panel::User::get_theme( $userp );
 	my $themelist;
 	foreach( @themes )
@@ -377,7 +377,7 @@
 	$template->param( THEME_LIST => $themelist );
 
 	# languages
-	my @langs = Vhffs::Panel::Main::list_languages( $vhffs );
+	my @langs = Vhffs::Panel::list_languages( $vhffs );
 	my $curlang = Vhffs::Panel::User::get_lang( $userp );
 	my $langlist = '';
 	foreach( @langs ) {

Modified: branches/vhffs-design/vhffs-public/templates/parts/header.tt
===================================================================
--- branches/vhffs-design/vhffs-public/templates/parts/header.tt	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-public/templates/parts/header.tt	2010-03-18 14:44:24 UTC (rev 1565)
@@ -1,11 +1,13 @@
 <!-- HEADER -->
-
+<div class="header-left">
     <!-- Sitename -->
 	<div class="site-name">
 
         <img src="/themes/[% theme %]/img/vhffs.png" alt="Virtual Hosting For Free Software"/>
     </div>
+</div>
 
+<div class="header-right">
  	<!-- Flag navigations -->
     <div class="navflag">
           <a href="/?lang=fr_FR"><img class="img-navflag" src="/themes/[% theme %]/img/flag_fr.png" alt="[% 'French' | i18n %]" /></a>
@@ -20,4 +22,5 @@
         <a href="[% help_url %]">[% 'Help' | i18n %]</a>
         <a href="[% panel_url %]">[% 'Log in' | i18n %]</a>
     </div>			
-
+    <div style="clear:both"></div>
+</div>

Modified: branches/vhffs-design/vhffs-themes/light-grey/main.css
===================================================================
--- branches/vhffs-design/vhffs-themes/light-grey/main.css	2010-03-17 19:01:48 UTC (rev 1564)
+++ branches/vhffs-design/vhffs-themes/light-grey/main.css	2010-03-18 14:44:24 UTC (rev 1565)
@@ -1445,11 +1445,23 @@
 	background: white;
 }
 
+.header-left {
+	height:65px;
+	width: 380px;
+	float:left;
+}
+
+.header-right {
+	padding-top: 17px;
+	height: 31px;
+	width: 360px;
+	float: left;
+}
+
 	/*-----------------------------------*/
 	/* 2.1 - Sitename, slogan and banner */
 	/*-----------------------------------*/
 .site-name {
-	width: 300px;
 	height: 50px;
 	padding-top: 12px;
 	float: left;
@@ -1463,15 +1475,17 @@
 	/* 2.2 - Navigation - Flags */
 	/*--------------------------*/
 .navflag {
-	width: 750px;
-	top: 14px;
-	position: absolute;
-	z-index: 2;
 	background-color: transparent;;
 	text-align: right;;
-	padding: 0px 20px 0px 0px;
 }
 
+/* Layout is slightly different on login page */
+
+.page-container-panel-anonymous .navflag {
+    padding-top: 10px;
+    padding-right:10px;
+}
+
 .navflag a {
 	margin: 0px;
 	padding: 0px 0px 0px 1px;
@@ -1493,10 +1507,6 @@
 	/* 2.3 - Navigation - Level 1 */
 	/*----------------------------*/
 .nav1 {
-	width: 750px;
-	top: 35px;
-	position: absolute;
-	z-index: 3;
 	background: transparent;;
 	font-family: verdana, arial, sans serif;;
 	font-size: 10px;;
@@ -3169,3 +3179,16 @@
 	display:inline;
 	margin-right:5px;
 }
+
+
+a img {
+	border: 0;
+}
+
+.error {
+    font-weight: bold;
+}
+
+.info {
+    font-style: italic;
+}


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