can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r9977: LJSUP-7838: Deny anonymous gifting of fr...

Committer: dpetrov
LJSUP-7838: Deny anonymous gifting of free userheads (JS)
U   trunk/htdocs/js/pay.js
U   trunk/templates/Shop/UserHeads.tmpl
Modified: trunk/htdocs/js/pay.js
===================================================================
--- trunk/htdocs/js/pay.js	2011-02-01 08:53:35 UTC (rev 9976)
+++ trunk/htdocs/js/pay.js	2011-02-01 09:44:03 UTC (rev 9977)
@@ -262,11 +262,14 @@
 	pageUserheads: function()
 	{
 		jQuery('#shop_userheads .m-buy-types').tabsChanger();
+        var anonCheckbox = jQuery('#gift_anon');
 		
 		jQuery('.b-userheads-item input:radio')
 			.change(function(){
 				jQuery(this.form[this.name]).parents('li.b-userheads-item').removeClass('active');
 				jQuery(this).parents('li:first').addClass('active');
+
+				anonCheckbox.attr( 'disabled', jQuery(this).hasClass('uh-free') );
 			})
 			// recalc after refresh
 			.filter(':checked').change();

Modified: trunk/templates/Shop/UserHeads.tmpl
===================================================================
--- trunk/templates/Shop/UserHeads.tmpl	2011-02-01 08:53:35 UTC (rev 9976)
+++ trunk/templates/Shop/UserHeads.tmpl	2011-02-01 09:44:03 UTC (rev 9977)
@@ -81,7 +81,7 @@
 					</div>
 					<ul class="b-buy-form b-userheads-items"><TMPL_LOOP userheads><li class="b-userheads-item">
 							<label for="uh2-<TMPL_VAR uh_id>">
-								<input type="radio" name="uh" value="uh-<TMPL_VAR uh_id>" id="uh2-<TMPL_VAR uh_id>" />
+								<input type="radio" name="uh" class="<TMPL_IF expr="(int(price)==0) && (price!='0.99')">uh-free</tmpl_if>" value="uh-<TMPL_VAR uh_id>" id="uh2-<TMPL_VAR uh_id>" />
 								<i class="i-userheads-pic" style="background-image:url(<TMPL_VAR uh_img>);"  title="<TMPL_VAR uh_desc>"></i>
 								<TMPL_IF expr="(int(price)==0) && (price!='0.99')">
 									<strong class="free"><TMPL_VAR price_free></strong>

Tags: can3p, js, ljcom, 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