журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22753: LJSUP-13430: Add error message on update...

Committer: nnikulochkina
LJSUP-13430: Add error message on update.bml
U   trunk/cgi-bin/LJ/Entry/Repost.pm
U   trunk/cgi-bin/LJ/Widget/EntryForm.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-28 12:01:07 UTC (rev 22752)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-28 12:32:57 UTC (rev 22753)
@@ -338,12 +338,19 @@
         }
     }
 
-    return  { 'count'    =>  __get_count($entry_obj->journal, $entry_obj->jitemid), 
-              'reposted' => $reposted,
-              'paid'     => $paid,
-              'cost'     => $cost,
-              $is_owner ? ('budget' => $entry_obj->repost_budget) : (),
-            };
+    my $result = { 'count'    =>  __get_count($entry_obj->journal, $entry_obj->jitemid), 
+                   'reposted' => $reposted,
+                   'paid'     => $paid,
+                   'cost'     => $cost,
+                 };
+
+    if ($is_owner && $paid) {
+        my $budget = $entry_obj->repost_budget;
+        $budget =~ s/(\d{1,3})(?=(\d{3})+$)/$1 /g;
+        $result->{budget} = $budget;
+    }
+
+    return $result;    
 }
 
 sub get_budget {

Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm	2012-08-28 12:01:07 UTC (rev 22752)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm	2012-08-28 12:32:57 UTC (rev 22753)
@@ -904,8 +904,11 @@
             });
             my $checkbox_text = LJ::Lang::ml('entryform.paid_repost.checkbox');
             
+            my $qty = $budget;
+            $qty =~ s/(\d{1,3})(?=(\d{3})+$)/$1 /g;
+
             my $current_budget = $offer && $budget ? 
-                LJ::Lang::ml('entryform.paid_repost.current_budget', {qty => $budget}) : 
+                LJ::Lang::ml('entryform.paid_repost.current_budget', {qty => $qty}) : 
                 '' ;
 
             my $help = LJ::help_icon_html('paid_repost');

Tags: livejournal, nikulochkina, nnikulochkina, pm
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