wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r9436: LJSUP-6652. images should have alt text

Committer: gprochaev
LJSUP-6652. images should have alt text

U   trunk/bin/upgrading/update-db-local.pl
U   trunk/cgi-bin/LJ/UserHead.pm
U   trunk/htdocs/admin/userheads/manage.bml
Modified: trunk/bin/upgrading/update-db-local.pl
===================================================================
--- trunk/bin/upgrading/update-db-local.pl	2010-08-30 03:17:50 UTC (rev 9435)
+++ trunk/bin/upgrading/update-db-local.pl	2010-08-30 03:38:43 UTC (rev 9436)
@@ -1977,6 +1977,12 @@
         });
     }
 
+    unless (column_type("shop_userheads", "uh_desc")) {
+        do_alter("shop_userheads",
+                 "ALTER TABLE shop_userheads ADD uh_desc VARCHAR(20) DEFAULT '' AFTER uh_author");
+    }
+
+
 });
 
 1;  # true

Modified: trunk/cgi-bin/LJ/UserHead.pm
===================================================================
--- trunk/cgi-bin/LJ/UserHead.pm	2010-08-30 03:17:50 UTC (rev 9435)
+++ trunk/cgi-bin/LJ/UserHead.pm	2010-08-30 03:38:43 UTC (rev 9436)
@@ -4,7 +4,7 @@
 
 use base qw(Class::Accessor);
 __PACKAGE__->follow_best_practice;
-__PACKAGE__->mk_accessors( qw( uh_id uh_author price ) );
+__PACKAGE__->mk_accessors( qw( uh_id uh_author uh_desc price ) );
 
 sub new {
     my $class = shift;

Modified: trunk/htdocs/admin/userheads/manage.bml
===================================================================
--- trunk/htdocs/admin/userheads/manage.bml	2010-08-30 03:17:50 UTC (rev 9435)
+++ trunk/htdocs/admin/userheads/manage.bml	2010-08-30 03:38:43 UTC (rev 9436)
@@ -35,17 +35,18 @@
     }
 }
 
-use Data::Dumper;
 if ($FORM{'save'}) {
     foreach my $id (keys %FORM) {
         next unless $id =~ m#(\d+)-uh_id#;
         $id = $1;
         my $is_enabled = $FORM{"$id-is_enabled"} eq 'on' ? 1 : 0;
         my $author = $FORM{"$id-author"};
+        my $desc = $FORM{"$id-desc"};
         my $price = $FORM{"$id-price"};
         my $uh = LJ::UserHead->get_userhead ($FORM{"$id-uh_id"});
         $uh->set_uh_author ($author);
         $uh->set_price ($price);
+        $uh->set_uh_desc ($desc);
         $uh->set_enabled ($is_enabled);
         $uh->save;
     }
@@ -84,6 +85,7 @@
 
 $ret .= "<form method='POST'>";
 $ret .= "<table border=0 cellspacing=1 cellpadding=4>";
+$ret .= "<tr><td>Id</td><td>Img</td><td>Cost</td><td>&nbsp;</td><td>Author</td><td>Description</td></tr>";
 foreach my $uh (@$uhs) {
     $ret .= "<tr>";
     $ret .= "<td><input type='hidden' name='".$uh->get_uh_id."-uh_id' value='".$uh->get_uh_id."'>".$uh->get_uh_id."</td>";
@@ -91,6 +93,7 @@
     $ret .= "<td><input type='text' name='".$uh->get_uh_id."-price' size='5' value='".$uh->get_price."'></td>";
     $ret .= "<td><input type='checkbox' name='".$uh->get_uh_id."-is_enabled' ". ($uh->is_enabled ? "checked='checked'" : "") ."> available </td>";
     $ret .= "<td><input type='text' name='".$uh->get_uh_id."-author' value='".$uh->get_uh_author."'></td>";
+    $ret .= "<td><input type='text' name='".$uh->get_uh_id."-desc' value='".$uh->get_uh_desc."'></td>";
     $ret .= "</tr>";
 }
 $ret .= "<tr><td colspan='5'><input type='submit' name='save' value='Save'></td></tr>";

Tags: bml, ljcom, pl, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments