OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 25-Nov-2005 19:17:38 Branch: HEAD Handle: 2005112518173800 Modified files: openpkg-registry registry-ui.pl Log: user interface cosmetics Summary: Revision Changes Path 1.19 +81 -38 openpkg-registry/registry-ui.pl ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-registry/registry-ui.pl ============================================================================ $ cvs diff -u -r1.18 -r1.19 registry-ui.pl --- openpkg-registry/registry-ui.pl 25 Nov 2005 18:15:49 -0000 1.18 +++ openpkg-registry/registry-ui.pl 25 Nov 2005 18:17:38 -0000 1.19 @@ -68,7 +68,7 @@ $cfg->{db}->{registry}->{tablespace}="registry"; $cfg->{db}->{registry}->{host}="127.0.0.1"; $cfg->{db}->{session}->{dbfile}="$PREFIX/var/openpkg-registry/ui/session.db"; -$cfg->{canvas}->{url}="http://meta.openpkg.org"; +$cfg->{canvas}->{url}="http://meta.openpkg.org/?path=project.registry.manage"; $cfg->{canvas}->{mark_head}="<!-- CANVAS: HEAD -->"; $cfg->{canvas}->{mark_body}="<!-- CANVAS: BODY -->"; @@ -231,12 +231,7 @@ my $out; $out = ''; $out .= &viewhttp(); - $out .= &viewhtmlhead(); - $out .= &viewmainform(); - $out .= &viewdropxmlform(); - $out .= &viewassociationform(); - $out .= &viewloginform(); - $out .= &viewlogoutform(); + $out .= &viewhtmlhead(-menu); $out .= &viewassociation(); $out .= &viewhtmltail(); print STDOUT &canvas($out); @@ -245,12 +240,7 @@ my $out; $out = ''; $out .= &viewhttp(); - $out .= &viewhtmlhead(); - $out .= &viewmainform(); - $out .= &viewdropxmlform(); - $out .= &viewassociationform(); - $out .= &viewloginform(); - $out .= &viewlogoutform(); + $out .= &viewhtmlhead(-menu); $out .= &viewdropxml(); $out .= &viewhtmltail(); print STDOUT &canvas($out); @@ -266,7 +256,7 @@ my $out; $out = ''; $out .= &viewhttp(); - $out .= &viewhtmlhead(); + $out .= &viewhtmlhead(-menu); $out .= &viewase(); $out .= &viewhtmltail(); print STDOUT &canvas($out); @@ -276,12 +266,7 @@ $out = ''; $cgi->delete_all(); $out .= &viewhttp(); - $out .= &viewhtmlhead(); - $out .= &viewmainform(); - $out .= &viewdropxmlform(); - $out .= &viewassociationform(); - $out .= &viewloginform(); - $out .= &viewlogoutform(); + $out .= &viewhtmlhead(-menu); $out .= &viewhtmltail(); print STDOUT &canvas($out); } @@ -325,8 +310,9 @@ return $cgi->header($header); } -sub viewhtmlhead () +sub viewhtmlhead (;$) { + my ($menu) = @_; my $head = ""; $head .= "<html>\n"; $head .= " <head>\n"; @@ -339,15 +325,40 @@ $head .= " <body class=\"registry\"><div class=\"registry\">\n"; $head .= " <img id=\"logo\" src=\"http://www.openpkg.org/openpkg.gif\" alt=\"\" width=\"148\" height=\"80\" align=\"right\">\n"; $head .= " <h1>OpenPKG Registry</h1>\n"; + if ($menu =~ m/-menu/) { + $head .= " <table id=\"menu\">\n"; + my $td = 0; + $head .= " <tr>\n"; + #$head .= " " . &viewmainform() . "\n"; $td++; + $head .= " " . &viewdropxmlform() . "\n"; $td++; + $head .= " " . &viewloginform() . "\n"; $td++; + $head .= " " . &viewassociationform() . "\n"; $td++; + $head .= " " . &viewlogoutform() . "\n"; $td++; + $head .= " </tr>\n"; + $head .= " <tr>\n"; + $head .= " <td colspan=\"" . $td . "\">\n"; + my $username; + $username = &identifyusername(); + if ($username ne "") { + $head .= "authenticated as <b>" . $username . "</b>"; + } + else { + $head .= "you are <b>not logged in</b><p>\n"; + } + $head .= " </td><tr>\n"; + $head .= " </table>\n"; + } return $head; } sub viewhtmltail () { - my $tail = ""; - $tail .= " </div></body>\n"; - $tail .= "</html>\n"; - return $tail; + my ($html); + + $html = ""; + $html .= " </div></body>\n"; + $html .= "</html>\n"; + return $html; } sub viewcss () { @@ -375,6 +386,21 @@ $css .= "BODY.registry img#logo {\n"; $css .= " display:block\n"; $css .= "}\n"; + $css .= ".registry table {\n"; + $css .= " padding: 0px 0px 0px 0px;\n"; + $css .= " font-family: tahoma, sans-serif, helvetica, arial;\n"; + $css .= " font-size: 100%;\n"; + $css .= "}\n"; + $css .= ".registry tr {\n"; + $css .= " padding: 0px 0px 0px 0px;\n"; + $css .= "}\n"; + $css .= ".registry td {\n"; + $css .= " vertical-align: top;\n"; + $css .= " padding: 0px 0px 0px 0px;\n"; + $css .= "}\n"; + $css .= ".registry input {\n"; + $css .= " width: 100%;\n"; + $css .= "}\n"; $css .= ".registry H1 {\n"; $css .= " font-family: tahoma, sans-serif, helvetica, arial;\n"; $css .= " font-weight: bold;\n"; @@ -856,25 +882,28 @@ sub viewmainform() { my $html; + $html = ''; + $html .= '<td>'; $html .= $cgi->start_form(); $html .= $cgi->delete(-name=>'page'); $html .= $cgi->hidden(-name=>'page', -value => "main"); $html .= $cgi->submit('submit','main'); $html .= $cgi->end_form; + $html .= '</td>'; return $html; } sub viewassociationform() { - my ($html, $username); - $username = &identifyusername(); + my ($html); $html = ''; + $html .= '<td>'; $html .= $cgi->start_form(); $html .= $cgi->delete(-name=>'page'); $html .= $cgi->hidden(-name=>'page', -value => "association"); $html .= $cgi->submit('submit','association'); - $html .= $username; $html .= $cgi->end_form; + $html .= '</td>'; return $html; } @@ -916,6 +945,7 @@ else { die "misconfigured identification mode=\"".$cfg->{identification}->{mode}."\""; } + $html .= '</td>'; return $html; } @@ -1060,6 +1090,7 @@ else { die "misconfigured identification mode=\"".$cfg->{identification}->{mode}."\""; } + $html .= '</td>'; return $html; } @@ -1088,11 +1119,13 @@ { my $html; $html = ''; + $html .= '<td>'; $html .= $cgi->start_form(); $html .= $cgi->delete(-name=>'page'); $html .= $cgi->hidden(-name=>'page', -value => "dropxml"); $html .= $cgi->submit('submit','dropxml'); $html .= $cgi->end_form; + $html .= '</td>'; return $html; } @@ -1105,7 +1138,7 @@ $username = &identifyusername(); if (not defined $username) { - $html .= "<blink>Please login first</blink>"; + $html .= "<h2>Please login first</h2>"; return $html; } @@ -1187,7 +1220,7 @@ $html = ''; $username = &identifyusername(); if (not defined $username) { - $html .= "<blink>Please login first</blink>"; + $html .= "<h2>Please login first</h2>"; return $html; } $html .= sprintf("<h2>Instances related to %s</h2>", $username); @@ -1209,7 +1242,7 @@ if ($mode eq "arrival") { $where = "associated = 'false'"; - $headline = "Arrival - queue of registered instances waiting to become associated"; + $headline = "Arrival - queue of registered instances waiting for association"; } elsif ($mode eq "active") { $where = "associated = 'true' AND registry_date >= (now() - interval '2 days')"; @@ -1291,17 +1324,19 @@ } $html .= "<tr>"; - $html .= "<td colspan=\"4\">"; + $html .= "<td colspan=\"2\">"; $html .= $cgi->delete(-name=>'username'); $html .= $cgi->hidden(-name=>'username', -value => $username); $html .= $cgi->delete(-name=>'page'); $html .= $cgi->hidden(-name=>'page', -value => "association"); - $html .= $cgi->submit("$mode/delete",'DEL'); + $html .= $cgi->submit("$mode/delete",'delete'); + $html .= "</td>"; + $html .= "<td colspan=\"2\">"; if ($mode eq "arrival") { - $html .= $cgi->submit("$mode/modify",'MODIFY and ASSOCIATE') + $html .= $cgi->submit("$mode/modify",'modify and associate') } else { - $html .= $cgi->submit("$mode/modify",'MODIFY and REFRESH') + $html .= $cgi->submit("$mode/modify",'modify and refresh') } $html .= "</td>"; $html .= "</tr>\n"; @@ -1548,16 +1583,17 @@ if (defined $cgi->param("data")) { $html .= "<h2>Correct registration data below</h2>"; - $html .= "<hr>\n"; } else { $html .= "<h2>Paste registration data below</h2>"; - $html .= "<hr>\n"; } $html .= $cgi->start_form(); $html .= $cgi->delete(-name=>'page'); $html .= $cgi->hidden(-name=>'page', -value => "dropxml"); + $html .= " <table id=\"menu\">\n"; + $html .= " <tr>\n"; + $html .= " <td>\n"; $html .= $cgi->textarea( -name => 'data', -columns => 80, @@ -1565,7 +1601,14 @@ -maxrows => 80, -default => '', ) . "\n"; - $html .= $cgi->submit('submit','DROPXML'); + $html .= " <tr>\n"; + $html .= " <td>\n"; + $html .= $cgi->submit('submit','register'); + $html .= " </td>\n"; + $html .= " <tr>\n"; + $html .= " </td>\n"; + $html .= " <tr>\n"; + $html .= " </table>\n"; $html .= $cgi->end_form; return $html; } @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org