Committer: anazarov
LJSUP-10156: Need to create Flag for self promoU 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-10-31 08:56:14 UTC (rev 11128) +++ trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm 2011-10-31 11:19:01 UTC (rev 11129) @@ -83,6 +83,11 @@ my $action = LJ::Request->post_param('action'); + unless ( LJ::Request->post_param('confirm') ) { + $self->ml_error('error.unconfirmed'); + return; + } + if ( $action eq 'promote' ) { return $self->process_promote_request; } @@ -112,6 +117,10 @@ return LJ::JSON->to_json( { 'result' => $result, 'html' => $html } ); }; + unless ( LJ::Request->post_param('confirm') ) { + return $format_result->( 'error', LJ::Lang::ml('error.unconfirmed') ); + } + my $entry_url = LJ::Request->post_param('entry_link'); unless ( $entry_url =~ m{^https?://} ) { $entry_url = 'http://' . $entry_url; Modified: trunk/htdocs/shop/selfpromo.bml.text.local =================================================================== --- trunk/htdocs/shop/selfpromo.bml.text.local 2011-10-31 08:56:14 UTC (rev 11128) +++ trunk/htdocs/shop/selfpromo.bml.text.local 2011-10-31 11:19:01 UTC (rev 11129) @@ -5,6 +5,8 @@ .btn.submit|staleness=1 .btn.submit=Promote! +.confirm.label=I confirm that my entry meets <a href="[[confirm_url]]">the requirements of LiveJournal to entries in Self Promo</a> + .confirm.delete.promoted=Your promo will be cancelled without a refund. Are you sure? .current_price|staleness=1 Modified: trunk/templates/Shop/SelfPromo.tmpl =================================================================== --- trunk/templates/Shop/SelfPromo.tmpl 2011-10-31 08:56:14 UTC (rev 11128) +++ trunk/templates/Shop/SelfPromo.tmpl 2011-10-31 11:19:01 UTC (rev 11129) @@ -63,6 +63,10 @@ <h3><TMPL_VAR expr="ml('/shop/selfpromo.bml.info.title.entrie')"></h3> <div id="selfpromo-preview"></div> </div> + <fieldset class="confirm"> + <input type="checkbox" id="selfpromo-confirm" name="confirm"> + <label for="selfpromo-confirm"><TMPL_VAR expr="ml('/shop/selfpromo.bml.confirm.label', 'confirm_link', 'http://www.livejournal.com/support/faqbrowse.bml?faqid=350')"></label> + </fieldset> <fieldset class="submit-options"> <button type="button" id="selfpromo-preview-button" disabled="disabled"><TMPL_VAR expr="ml('/shop/selfpromo.bml.btn.preview')"></button> <button type="submit" id="selfpromo-promote-button" disabled="disabled"><TMPL_VAR expr="ml('/shop/selfpromo.bml.btn.submit')"></button> @@ -98,7 +102,8 @@ '/shop/selfpromo.bml', { 'action': 'preview', - 'entry_link': $("#entry_link").val() + 'entry_link': $("#entry_link").val(), + 'confirm': $('#selfpromo-confirm').attr('checked') }, function(data) { var errorBlock;