[ljcom] r12185: LJSUP-12699: Notification promo should b...
Committer: akanashin
LJSUP-12699: Notification promo should be hidden in shop for some countriesU trunk/bin/upgrading/en_LJ.dat U trunk/cgi-bin/LJ/Hooks/ESN.pm U trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat 2012-06-27 09:13:01 UTC (rev 12184)
+++ trunk/bin/upgrading/en_LJ.dat 2012-06-27 11:23:40 UTC (rev 12185)
@@ -4162,6 +4162,12 @@
ljcom.userinfo.ua_account_rating=[[rating_place]] in place <a href=[[url_rating]]> Ukraine user ratings</a>
ljcom.userinfo.ua_community_rating=[[rating_place]] in place <a href=[[url_rating]]> Ukraine community ratings</a>
+ljcom.userinfo.rating_place=in place
+ljcom.userinfo.account_rating_url=User ratings
+ljcom.userinfo.community_rating_url=Community ratings
+ljcom.userinfo.ua_account_rating_url=Ukraine user ratings
+ljcom.userinfo.ua_community_rating_url=Ukraine community ratings
+
ljcom.userinfo.comms.partner|staleness=1
ljcom.userinfo.comms.partner=Partner
@@ -9088,6 +9094,11 @@
shop.view.notificationpromo.view.sg.description|staleness=1
shop.view.notificationpromo.view.sg.description=Switch to singapore notification promo
+shop.view.notificationpromo.view.th|staleness=1
+shop.view.notificationpromo.view.th=Thailand
+shop.view.notificationpromo.view.th.description|staleness=1
+shop.view.notificationpromo.view.th.description=Switch to thailand notification promo
+
shop.view.notificationpromo.view.ua|staleness=1
shop.view.notificationpromo.view.ua=Ukraine
shop.view.notificationpromo.view.ua.description|staleness=1
Modified: trunk/cgi-bin/LJ/Hooks/ESN.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/ESN.pm 2012-06-27 09:13:01 UTC (rev 12184)
+++ trunk/cgi-bin/LJ/Hooks/ESN.pm 2012-06-27 11:23:40 UTC (rev 12185)
@@ -90,8 +90,9 @@
eval {
return if $LJ::DISABLED{notificationpromo};
+ return unless LJ::Pay::Promotion::Notifications->is_avialable_region($u);
+
my $active_region = lc($u->prop('country') || LJ::GeoLocation->get_country_info_by_ip());
- return unless LJ::Pay::Promotion::Notifications->is_avialable_region($active_region);
my $slot = LJ::Pay::PromotionSlot->find_slot(class => LJ::Pay::PromotionSlot::PROMO_NOTIFICATIONS(), type => LJ::Pay::PromotionSlot::PROMO_OBJECT_TYPE_ENTRY(), region => $active_region);
return unless $slot;
@@ -104,11 +105,13 @@
$params = $object->get_template_params();
+ $params->{country_style_ua} = $active_region eq 'ua';
+
my $tmpl_file = $type eq 'html' ? 'NotificationPromoHTML.tmpl' : 'NotificationPromoPlainText.tmpl';
my $tmpl = LJ::HTML::Template->new({use_expr => 1}, filename => "$ENV{LJHOME}/templates/Shop/$tmpl_file");
$tmpl->param( 'data_notificationpromo' => [$params] );
- $str = $tmpl->output();
+ $str .= $tmpl->output();
};
if ($@) {
Modified: trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm 2012-06-27 09:13:01 UTC (rev 12184)
+++ trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm 2012-06-27 11:23:40 UTC (rev 12185)
@@ -66,11 +66,13 @@
} unless $LJ::DISABLED{'commercial_promo'};
}
- push @$promos, {
- name => LJ::Lang::ml('/shop/index.bml.storefront.notificationpromo'),
- url => '/shop/notificationpromo.bml',
- is_selected => $subpage eq 'notificationpromo' ? 1 : 0,
- } unless $LJ::DISABLED{'notificationpromo'};
+ if ($remote && LJ::Pay::Promotion::Notifications->is_avialable_region($remote) && !$LJ::DISABLED{'notificationpromo'}) {
+ push @$promos, {
+ name => LJ::Lang::ml('/shop/index.bml.storefront.notificationpromo'),
+ url => '/shop/notificationpromo.bml',
+ is_selected => $subpage eq 'notificationpromo' ? 1 : 0,
+ };
+ }
my %top_map = (
paidaccount => 0,
@@ -101,17 +103,22 @@
level1 => $paid_services,
is_expanded => 1,
},
+ ];
+ if ($promos) {
+ push @$top_level,
{
name => BML::ml('.storefront.promo.name'),
level1 => $promos,
is_expanded => 1,
- },
+ };
+ }
+ push @$top_level,
{
name => BML::ml('.storefront.gifts.vgifts'),
level1 => [],
is_expanded => 1,
- },
- ];
+ };
+ my $num_vgift = @$top_level-1;
if (LJ::SUP->is_remote_sup() && $LJ::SHOP_LEFTMENU_STORE_LJ_RU) {
push @$top_level, {
@@ -195,12 +202,13 @@
}
}
next if !$vgifts_cat{$cat_value}[3] && !@subcat;
- push @{$top_level->[3]{level1}} => {
+
+ push @{$top_level->[$num_vgift]{level1}} => {
url => "/shop/vgift.bml?cat=$cat_value",
name => BML::ml("vgiftcat.$cat_value"),
is_selected => $subpage eq $cat_value ? 1 : 0,
};
- push @{$top_level->[3]{level1}} => $_ foreach @subcat;
+ push @{$top_level->[$num_vgift]{level1}} => $_ foreach @subcat;
# Show subcategories only if it is not empty
}
