[dw-free] Clean up of Edit Profile page
[commit: http://hg.dwscoalition.org/dw-free/rev/743bb30f33b8]
http://bugs.dwscoalition.org/show_bug.cgi?id=787
Zebra-stripe alternate rows on the edit profile page.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=787
Zebra-stripe alternate rows on the edit profile page.
Patch by
Files modified:
- htdocs/manage/profile/index.bml
- htdocs/stc/celerity/celerity.css
- htdocs/stc/gradation/gradation.css
--------------------------------------------------------------------------------
diff -r de39c23f4f39 -r 743bb30f33b8 htdocs/manage/profile/index.bml
--- a/htdocs/manage/profile/index.bml Tue Sep 14 11:26:21 2010 +0800
+++ b/htdocs/manage/profile/index.bml Tue Sep 14 11:32:00 2010 +0800
@@ -129,9 +129,15 @@ body<=
};
+ my $stripe = 0; # two columns
+ my $zebra_row1 = sub { return $stripe % 2 ? ' zebra_row' : '' };
+ my $zebra_row2 = sub { return $stripe++ % 2 ? ' zebra_row' : '' };
+
+
### Picture Settings
$ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.userpic2'}</td>\n";
- $ret .= "<td><div style='width: 100px; height: 100px; float: left; text-align: center; border: 1px solid #ddd'>";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
+ $ret .= "<div style='width: 100px; height: 100px; float: left; text-align: center; border: 1px solid #ddd'>";
if ( $u->{'defaultpicid'} ) {
my $icon = $u->userpic;
$ret .= $icon->imgtag;
@@ -144,12 +150,13 @@ body<=
$ret .= "<?p <a href='$LJ::SITEROOT/editicons$getextra'>$ML{'.userpic.change'}</a> p?>\n";
$ret .= "</td>";
- $ret .= "<td class='selectvis'>";
+ $ret .= "<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= "<?p <i> $ML{'.security.visibility.everybody2'} </i> p?>";
$ret .= "</td></tr>\n";
# name
- $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.name2'}</td>\n<td>";
+ $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.name2'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
if (LJ::text_in($saved{'name'})) {
$ret .= "<div style='float: left'>";
$ret .= LJ::html_text( { name => 'name', value => $u->name_orig,
@@ -161,26 +168,28 @@ body<=
$ret .= "<?inerr " . BML::ml( '.error.invalidname2', {'aopts' => "href='$LJ::SITEROOT/utf8convert'"} ) . " inerr?>";
}
- $ret .= "</td>\n<td class='selectvis'>";
+ $ret .= "</td>\n<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= "<?p <i> $ML{'.security.visibility.everybody2'} </i> p?>";
$ret .= "</td></tr>\n";
if ( $u->is_individual ) {
# gender
- $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.gender'}</td><td>";
+ $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.gender'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
$ret .= LJ::html_select( { name => 'gender', title => $ML{'.fn.gender'},
selected => $u->prop( 'gender' ) || 'U' },
F => $ML{'.gender.female'},
M => $ML{'.gender.male'},
O => $ML{'.gender.other'},
U => $ML{'.gender.unspecified'}, );
- $ret .= "</td>\n<td class='selectvis'>";
+ $ret .= "</td>\n<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= "<?p <i> $ML{'.security.visibility.nobody'} </i> p?>";
$ret .= "</td></tr>\n";
}
# birthday
- $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.birthday'}</td><td>";
+ $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.birthday'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
my %bdpart;
if ($u->{'bdate'} =~ /^(\d\d\d\d)-(\d\d)-(\d\d)$/) {
($bdpart{'year'}, $bdpart{'month'}, $bdpart{'day'}) = ($1, $2, $3);
@@ -212,7 +221,7 @@ body<=
F => $ML{'.show.birthday.full2'} );
$ret .= "</div>\n";
- $ret .= "</td>\n<td class='selectvis'>";
+ $ret .= "</td>\n<td class='selectvis" . $zebra_row2->() . "'>";
my $opt_sharebday = ( $u->opt_sharebday =~ m/^(A|F|N|R)$/ ) ? $u->opt_sharebday : 'F';
$ret .= LJ::html_select( { name => 'opt_sharebday',
title => BML::ml( '.privacy.title',
@@ -225,10 +234,11 @@ body<=
$ret .= "</td></tr>\n";
#location
- $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.location'}</td><td>\n";
+ $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.fn.location'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
$ret .= LJ::Widget::Location->render( skip_timezone => 1, minimal_display => 1 );
- $ret .= "</td><td class='selectvis'>";
+ $ret .= "</td><td class='selectvis" . $zebra_row2->() . "'>";
$ret .= LJ::html_select( { name => 'opt_showlocation',
title => BML::ml( '.privacy.title',
{ name => $ML{'.fn.location'} } ),
@@ -283,14 +293,16 @@ body<=
};
my $u_email_raw = $u->email_raw;
+ $stripe = 0; # reset for next block
$ret .= qq {
<tr class='field_block'><td class='field_name'>
- $ML{'.fn.email.system'}</td><td style='vertical-align: middle'>
+ $ML{'.fn.email.system'}</td><td };
+ $ret .= $zebra_row1->();
+ $ret .= qq {style='vertical-align: middle'>
<b>$u_email_raw</b> <a href='$LJ::SITEROOT/changeemail$getextra'>
- $ML{'.email.change.system'}</a></td><td class='selectvis'>
-
- };
+ $ML{'.email.change.system'}</a></td><td class='selectvis};
+ $ret .= $zebra_row2->() . "'>\n";
# opt_whatemailshow
my $cur = $u->opt_whatemailshow;
@@ -304,12 +316,13 @@ body<=
N => $ML{'.security.visibility.noshow'} );
$ret .= "</td></tr>\n";
- $ret .= "<tr class='field_block'><td class='field_name'> $ML{'.fn.email.display'}</td><td>\n";
+ $ret .= "<tr class='field_block'><td class='field_name'> $ML{'.fn.email.display'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
$ret .= DW::Setting::ProfileEmail->option( $u );
$ret .= "<br /><span class='helper'>$ML{'.email.profile'}</span>";
- $ret .= "</td><td class='selectvis'>";
+ $ret .= "</td><td class='selectvis" . $zebra_row2->() . "'>";
# $ret .= "<?p <i> $ML{'.security.visibility.same'} </i> p?>";
$ret .= "</td></tr>\n";
@@ -317,9 +330,9 @@ body<=
if ( $LJ::USER_EMAIL && $u->can_have_email_alias && ! $u->prop( "no_mail_alias" ) ) {
$ret .= "<tr class='field_block'><td class='field_name'>";
$ret .= BML::ml( '.fn.email.site', { siteabbrev => $LJ::SITENAMEABBREV } );
- $ret .= "</td><td style='vertical-align: middle'>\n";
+ $ret .= "</td><td class='" . $zebra_row1->() . "' style='vertical-align: middle'>\n";
$ret .= $u->username . "\@$LJ::USER_DOMAIN";
- $ret .= "</td><td class='selectvis'>";
+ $ret .= "</td><td class='selectvis" . $zebra_row2->() . "'>";
# this is where we get BVL back
my $checked = ( $u->opt_whatemailshow =~ /[BVL]/ ) ? 'Y' : 'N';
$ret .= LJ::html_select( { name => 'opt_usesite',
@@ -336,9 +349,9 @@ body<=
if ( LJ::is_enabled( 'ljtalk' ) ) {
$ret .= "<tr class='field_block'><td class='field_name'>";
$ret .= BML::ml( '.fn.ljtalk.address', { siteabbrev => $LJ::SITENAMEABBREV } );
- $ret .= "</td><td style='vertical-align: middle'>" . $u->ljtalk_id;
+ $ret .= "</td><td class='" . $zebra_row1->() . "' style='vertical-align: middle'>" . $u->ljtalk_id;
# Don't show LJ Talk field? (opt_showljtalk)
- $ret .= "</td><td class='selectvis'>";
+ $ret .= "</td><td class='selectvis" . $zebra_row2->() . "'>";
$ret .= LJ::html_select( { name => 'opt_showljtalk',
id => 'opt_showljtalk',
title => BML::ml( '.display.title',
@@ -351,10 +364,10 @@ body<=
my $jabber_title = LJ::Hooks::run_hook("jabber_title") || $ML{'/manage/settings/index.bml.jabber.title'};
$ret .= "<tr class='field_block'><td class='field_name'>";
$ret .= BML::ml( '.fn.ljtalk.status', { siteabbrev => $LJ::SITENAMEABBREV } );
- $ret .= "</td><td>$ML{'.fn.showljtalk'}<br />";
+ $ret .= "</td><td class='" . $zebra_row1->() . "'>$ML{'.fn.showljtalk'}<br />";
$ret .= "<span class='helper'>" . BML::ml('/manage/settings/index.bml.jabber.text', {'jabbertitle' => $jabber_title}) . "</span>";
# Jabber Online Status
- $ret .= "</td><td class='selectvis'>";
+ $ret .= "</td><td class='selectvis" . $zebra_row2->() . "'>";
$ret .= LJ::html_select( { name => 'opt_showonlinestatus',
id => 'opt_showonlinestatus',
title => BML::ml( '.privacy.title',
@@ -369,11 +382,12 @@ body<=
# opt_findbyemail
if ( LJ::is_enabled( 'opt_findbyemail' ) ) {
$ret .= "<tr class='field_block'><td class='field_name'>";
- $ret .= LJ::Setting::FindByEmail->label . "</td><td><span class='helper'>";
+ $ret .= LJ::Setting::FindByEmail->label . "</td>";
+ $ret .= "<td class='" . $zebra_row1->() . "'><span class='helper'>";
$ret .= BML::ml( 'settings.findbyemail.helper', {
sitename => $LJ::SITENAMESHORT,
siteabbrev => $LJ::SITENAMEABBREV } );
- $ret .= "</span></td>\n<td class='selectvis'>";
+ $ret .= "</span></td>\n<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= LJ::Setting::FindByEmail->as_html( $u, undef, { minimal_display => 1, helper => 0 } );
$ret .= "</td></tr>\n";
}
@@ -382,9 +396,9 @@ body<=
if ( LJ::is_enabled( 'user_messaging' ) ) {
$ret .= "<tr class='field_block'><td class='field_name'>";
$ret .= LJ::Setting::UserMessaging->label;
- $ret .= "</td><td><span class='helper'>";
+ $ret .= "</td><td class='" . $zebra_row1->() . "'><span class='helper'>";
$ret .= BML::ml( 'settings.usermessaging.helper', { sitename => $LJ::SITENAMESHORT } );
- $ret .= "</span></td>\n<td class='selectvis'>";
+ $ret .= "</span></td>\n<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= LJ::Setting::UserMessaging->option( $u, undef, { minimal_display => 1, helper => 0 } );
$ret .= "</td></tr>\n";
}
@@ -393,10 +407,11 @@ body<=
if ( $u->can_use_textmessaging ) {
- $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.section.textmsg'}</td><td>\n";
+ $ret .= "<tr class='field_block'><td class='field_name'>$ML{'.section.textmsg'}</td>\n";
+ $ret .= "<td class='" . $zebra_row1->() . "'>";
$ret .= DW::Setting::TxtMsgSetup->option( $u, undef, { info_only => 1 } );
- $ret .= "</td>\n<td class='selectvis'>";
+ $ret .= "</td>\n<td class='selectvis" . $zebra_row2->() . "'>";
$ret .= DW::Setting::TxtMsgSetup->option( $u, undef, { vis_only => 1 } );
$ret .= "</td></tr>\n";
diff -r de39c23f4f39 -r 743bb30f33b8 htdocs/stc/celerity/celerity.css
--- a/htdocs/stc/celerity/celerity.css Tue Sep 14 11:26:21 2010 +0800
+++ b/htdocs/stc/celerity/celerity.css Tue Sep 14 11:32:00 2010 +0800
@@ -676,6 +676,9 @@ h2.widget-header, .theme-item.current, .
.view_options {
}
+.zebra_row {
+ background-color: #ffd;
+}
/* comm_promo.css */
diff -r de39c23f4f39 -r 743bb30f33b8 htdocs/stc/gradation/gradation.css
--- a/htdocs/stc/gradation/gradation.css Tue Sep 14 11:26:21 2010 +0800
+++ b/htdocs/stc/gradation/gradation.css Tue Sep 14 11:32:00 2010 +0800
@@ -777,6 +777,10 @@ h2.widget-header, .theme-item.current, .
.field_name { background: #333333; }
+.zebra_row {
+ background-color: #1a1a1a;
+}
+
/* comm_promo.css */
div.CommunityPromoBox {
--------------------------------------------------------------------------------
