Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r10977: LJSUP-9728 (SelfPromo for non-logged-in ...

Committer: ailyin
LJSUP-9728 (SelfPromo for non-logged-in visitors)
U   trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
U   trunk/htdocs/shop/selfpromo.bml.text.local
U   trunk/templates/Shop/SelfPromo.tmpl
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2011-09-08 03:30:59 UTC (rev 10976)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2011-09-08 03:49:37 UTC (rev 10977)
@@ -8,7 +8,7 @@
 
 use LJ::Pay::SelfPromo qw(:codes);
 
-sub require_remote {1}
+sub require_remote {0}
 sub require_cart   {0}
 
 sub get_subpage       {'selfpromo'}
@@ -22,6 +22,10 @@
     $self->ml_error('/shop/selfpromo.bml.error.remote_non_sup')
         unless LJ::SUP->is_remote_sup;
 
+    unless ($remote) {
+        $self->ml_warning('/shop/selfpromo.bml.warning.log_in');
+    }
+
     my $buyout_cost      = LJ::Pay::SelfPromo->buyout_cost;
     my $ml_current_price = LJ::Lang::ml( '/shop/selfpromo.bml.current_price',
         { 'price' => $buyout_cost } );
@@ -56,7 +60,7 @@
     my $hide_buyout = 0;
 
     if ( my $entry = LJ::Pay::SelfPromo->current_entry ) {
-        $hide_buyout = ( $entry->posterid == $remote->userid );
+        $hide_buyout = ( $entry->poster->equals($remote) );
     }
 
     LJ::need_string('/shop/selfpromo.bml.confirm.delete.promoted');
@@ -66,6 +70,7 @@
         'buyout_cost'    => LJ::Request->post_param('price') || $buyout_cost,
         'data_selfpromo' => $data_selfpromo,
         'hide_buyout'    => $hide_buyout,
+        'form_disabled'  => !$remote ? 1 : 0,
     };
 }
 

Modified: trunk/htdocs/shop/selfpromo.bml.text.local
===================================================================
--- trunk/htdocs/shop/selfpromo.bml.text.local	2011-09-08 03:30:59 UTC (rev 10976)
+++ trunk/htdocs/shop/selfpromo.bml.text.local	2011-09-08 03:49:37 UTC (rev 10977)
@@ -61,3 +61,5 @@
 .title=Self Promo
 
 .your.ad.could.be.here=Your ad could be here
+
+.warning.log_in=This service is available for logged in users only. Please <a href="http://www.livejournal.com/login.bml">sign in</a> or <a href="https://www.livejournal.com/create.bml">sign up</a>.

Modified: trunk/templates/Shop/SelfPromo.tmpl
===================================================================
--- trunk/templates/Shop/SelfPromo.tmpl	2011-09-08 03:30:59 UTC (rev 10976)
+++ trunk/templates/Shop/SelfPromo.tmpl	2011-09-08 03:49:37 UTC (rev 10977)
@@ -46,7 +46,7 @@
 		<div class="b-selfpromo-price">
 			<fieldset class="entry-link">
 				<label for="entry_link"><TMPL_VAR expr="ml('/shop/selfpromo.bml.label.entry_link')"></label>
-				<input type="text" name="entry_link" id="entry_link" value="<TMPL_VAR form:entry_link ESCAPE=HTML>" placeholder="<TMPL_VAR expr="ml('/shop/selfpromo.bml.placeholder.entry_link')">" class="input-text" />
+				<input type="text" name="entry_link" id="entry_link" value="<TMPL_UNLESS form_disabled><TMPL_VAR form:entry_link ESCAPE=HTML></TMPL_UNLESS>" placeholder="<TMPL_VAR expr="ml('/shop/selfpromo.bml.placeholder.entry_link')">" class="input-text" <TMPL_IF form_disabled>disabled="disabled"</TMPL_IF> />
 			</fieldset>
 			<fieldset class="current-price">
 				<label><TMPL_VAR expr="ml('/shop/selfpromo.bml.label.current_price')"></label>
@@ -54,7 +54,7 @@
 			</fieldset>
 			<fieldset class="your-price">
 				<label for="price"><TMPL_VAR expr="ml('/shop/selfpromo.bml.label.price')"></label>
-				<input type="text" name="price" id="price" value="<TMPL_VAR buyout_cost ESCAPE=HTML>" placeholder="<TMPL_VAR expr="ml('/shop/selfpromo.bml.placeholder.price')">" class="input-text" />
+				<input type="text" name="price" id="price" value="<TMPL_VAR buyout_cost ESCAPE=HTML>" placeholder="<TMPL_VAR expr="ml('/shop/selfpromo.bml.placeholder.price')">" class="input-text" <TMPL_IF form_disabled>disabled="disabled"</TMPL_IF> />
 			</fieldset>
 			<fieldset class="price-description">
 				<p id="price_description"><TMPL_VAR expr="ml('/shop/selfpromo.bml.price_description')"></p>

Tags: andy, ljcom, local, pm, tmpl
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