--- gnatsweb.pl.orig Fri Apr 11 13:59:07 2003
+++ gnatswebcss.pl Sun Apr 13 15:21:19 2003
@@ -31,11 +31,9 @@ use vars qw($site_gnats_host $site_gnats
$site_gnatsweb_server_auth $site_no_gnats_passwords
$no_create_without_access $site_mail_domain $site_post_max
$description_in_view $help_page_path $site_banner_text
-$site_banner_background $site_banner_foreground
-$site_button_foreground $site_button_background $site_stylesheet
+$site_stylesheet
$include_audit_trail $popup_menu_becomes_obnoxious
-$scrolling_menu_default_size $site_background
-$site_required_field_color $use_temp_db_prefs_cookie
+$scrolling_menu_default_size $use_temp_db_prefs_cookie
$global_cookie_expires $global_cookie_path $textwidth
$site_allow_remote_debug $attachment_delimiter %mark_urls
$gnats_info_top %site_pr_submission_address $VERSION);
@@ -149,10 +147,6 @@ $help_page_path = './gnatsweb.html';
# Name you want in the page banner and banner colors.
$site_banner_text = 'GNU Gnatsweb';
-$site_banner_background = '#000000';
-$site_banner_foreground = '#ffffff';
-$site_button_background = '#000000';
-$site_button_foreground = '#ffffff';
# Uncomment the following line and insert stylesheet URL in order to
# link all generated pages to an external stylesheet. Both absolute
@@ -173,14 +167,6 @@ $popup_menu_becomes_obnoxious = 20;
# default size for scrolling lists. overridden for some fields
$scrolling_menu_default_size = 3;
-# Page background color -- not used unless defined.
-#$site_background = '#c0c0c0';
-$site_background = undef;
-
-# Color to use for marking the names of required fields on the Create
-# PR page.
-$site_required_field_color = '#ff0000';
-
# control the mark_urls routine, which "htmlifies" PRs for view_pr.
# it adds a lot of usability, but can be slow for huge (100K+) fields.
# urls = make links clickable
@@ -522,17 +508,29 @@ sub print_stacktrace {
sub multiselect_menu
{
my $size = @{$_[1]} < 4 ? @{$_[1]} : 4;
+ my $style = $_[3];
+ $style = '' if not defined $style;
+
return $q->scrolling_list(-name=>$_[0], -values=>$_[1], -size=>$size,
- -multiple=>'true', -default=>$_[2]);
+ -multiple=>'true', -default=>$_[2],
+ -class=>$style);
}
sub popup_or_scrolling_menu
{
my $size=$_[3];
+ my $style=$_[4];
+
if (!(defined $size))
{
$size = $scrolling_menu_default_size;
- }
+ }
+
+ if (!(defined $style))
+ {
+ $style = '';
+ }
+
# a hack to make responsible field easier to deal with when
# there are many names in the responsible file
@@ -559,14 +557,16 @@ sub popup_or_scrolling_menu
-size=>$size,
-values=>$_[1],
-labels=>$labels,
- -default=>$_[2]);
+ -default=>$_[2],
+ -class=>$style);
}
else
{
return $q->popup_menu (-name=>$_[0],
-values=>$_[1],
-labels=>$labels,
- -default=>$_[2]);
+ -default=>$_[2],
+ -class=>$style);
}
}
@@ -919,13 +919,14 @@ sub print_attachments
return unless can_do_mime();
- print "
File Attachments:
\n
";
+ print "
File Attachments:
\n
";
# Add file upload button for adding new attachment.
if ($mode eq 'sendpr' || $mode eq 'edit') {
print "Add a file attachment: ",
$q->filefield(-name=>'attached_file',
- -size=>50);
+ -size=>50,
+ -class=>'attachments_add');
# that's all we need to do if this is the sendpr page
return if $mode eq 'sendpr';
}
@@ -1041,12 +1042,13 @@ sub sendpr
$q->reset(-name=>'reset')),
$q->hidden(-name=>'return_url'),
"\n",
- "
";
+ "
";
my $def_email = $global_prefs{'email'} || '';
- print "
\n";
+ -size=>$textwidth,
+ -class=>'createpr_input'), "\n\n";
# keep count of field number, so that javascript hooks can
# have a way to access fields with dashes in their names
# they'll need to use PrForm.elements[fieldNumber].value
@@ -1073,12 +1075,12 @@ sub sendpr
# at the top of a given field.
my $intro = cb("sendpr_intro_$_", $field_number) || '';
- print "
\n";
# keep count of field number, so that javascript hooks can
@@ -1570,9 +1575,9 @@ sub edit
# The "intro" provides a way for the site callback to print something
# at the top of a given field.
my $intro = cb("edit_intro_$_", $field_number) || '';
- print "
\n";
}
}
@@ -2021,9 +2035,9 @@ sub advanced_query_page
### Field queries
- print "
\n",
+ print "
\n",
"
Search Individual Fields
\n",
- "
\n",
+ "
\n",
"
Search this field
\n",
"
using regular expression, or
\n",
"
using multi-selection
\n",
@@ -2033,12 +2047,13 @@ sub advanced_query_page
print "
\n";
# 1st column is field name
- print "
$_:
\n";
+ print "
$_:
\n";
# 2nd column is regexp search field
- print "
",
+ print "
",
$q->textfield(-name=>$_,
- -size=>$width);
+ -size=>$width,
+ -class=>'query_input');
print "\n";
# XXX ??? !!! FIXME
# This should be fixed by allowing a 'not' in front of the fields, so
@@ -2048,12 +2063,13 @@ sub advanced_query_page
print " ",
$q->checkbox_group(-name=>'ignoreclosed',
-values=>['Ignore Closed'],
- -defaults=>['Ignore Closed']),
+ -defaults=>['Ignore Closed'],
+ -class=>'query_input'),
}
print "
\n";
# 3rd column is blank or scrolling multi-select list
- print "
";
+ print "
";
if (fieldinfo($_, 'fieldtype') =~ 'enum')
{
my $ary_ref = fieldinfo($_, 'values');
@@ -2062,7 +2078,8 @@ sub advanced_query_page
print $q->scrolling_list(-name=>$_,
-values=>$ary_ref,
-multiple=>1,
- -size=>$size);
+ -size=>$size,
+ -class=>'query_input');
}
else
{
@@ -2073,9 +2090,9 @@ sub advanced_query_page
print "
';
my $top_buttons_html = cb('main_page_top_buttons') || '';
print $top_buttons_html;
@@ -2922,13 +2947,15 @@ sub main_page
$q->hidden(-name=>'cmd', -value=>'edit', -override=>1),
$q->submit('cmd', 'edit'),
'#',
- $q->textfield(-size=>6, -name=>'pr'))
+ $q->textfield(-size=>6, -name=>'pr',
+ -class=>'mainpage_input'))
if can_edit();
print one_line_form('View Problem Report:',
$q->hidden(-name=>'cmd', -value=>$viewcmd, -override=>1),
$q->submit('cmd', 'view'),
'#',
- $q->textfield(-size=>6, -name=>'pr'));
+ $q->textfield(-size=>6, -name=>'pr',
+ -class=>'mainpage_input'));
print one_line_form('Query Problem Reports:',
$q->submit('cmd', 'query'),
' ', $q->submit('cmd', 'advanced query'));
@@ -2936,10 +2963,11 @@ sub main_page
{
print one_line_form('Change Database:',
$q->scrolling_list(-name=>'new_db',
- -values=>$global_list_of_dbs,
- -default=>$global_prefs{'database'},
- -multiple=>0,
- -size=>1),
+ -values=>$global_list_of_dbs,
+ -default=>$global_prefs{'database'},
+ -multiple=>0,
+ -size=>1,
+ -class=>'mainpage_input'),
$q->submit('cmd', 'change database') );
}
else
@@ -3036,10 +3064,8 @@ sub page_start_html
return;
}
- # Call start_html, with -bgcolor if we need to override that.
+ # Call start_html
my @args = (-title=>"$title - $site_banner_text");
- push(@args, -bgcolor=>$site_background)
- if defined($site_background);
push(@args, -style=>{-src=>$site_stylesheet})
if defined($site_stylesheet);
push(@args, @extra_head_args);
@@ -3047,29 +3073,6 @@ sub page_start_html
# Add the page banner. The $site_banner_text is linked back to the
# main page.
- #
- # Note that the banner uses inline style, rather than a GIF; this
- # makes installation easier by eliminating the need to install GIFs
- # into a separate directory. At least for Apache, you can't serve
- # GIFs out of your CGI directory.
- #
- my $bannerstyle = <\n
\n";
if ($site_no_gnats_passwords) {
# we're not using gnats passwords, so the password input
@@ -3908,17 +3912,19 @@ sub login_page
# just so other parts of the program don't get confused
print qq**;
} else {
- print "