mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-06-07 02:15 am

[dw-free] Site Map needs better link to Shop

[commit: http://hg.dwscoalition.org/dw-free/rev/351580853799]

http://bugs.dwscoalition.org/show_bug.cgi?id=2508

Only show shop links if that's enabled, and also add merchandise URL
support.

Patch by [personal profile] kareila.

Files modified:
  • htdocs/site/index.bml
--------------------------------------------------------------------------------
diff -r 1b271ebde64c -r 351580853799 htdocs/site/index.bml
--- a/htdocs/site/index.bml	Mon Jun 07 10:19:38 2010 +0800
+++ b/htdocs/site/index.bml	Mon Jun 07 02:15:21 2010 +0000
@@ -94,19 +94,32 @@ body<=
 <div id='maplinks-right'>
 
 <?_code
-if ( LJ::is_enabled( 'payments' ) ) {
+if ( LJ::is_enabled( 'payments' ) || $LJ::MERCH_URL ) {
     my $shop_title = BML::ml('.maplinks.shop-title', { sitename => $LJ::SITENAMESHORT } );
-    return qq{
+    my $merch = $LJ::MERCH_URL
+        ? "<li><a href='$LJ::MERCH_URL'><?_ml .maplinks.buy-merchandise _ml?></a></li>"
+        : '';
+    if ( LJ::is_enabled( 'payments' ) ) {
+        # display all shop links, plus merch link if defined
+        return qq{
  <dl><dt>$shop_title</dt>
   <dd><ul>
    <li><a href='/shop'><?_ml .maplinks.buy-points _ml?></a></li>
    <li><a href='/shop/gifts'><?_ml .maplinks.buy-circle _ml?></a></li>
    <li><a href='/shop/randomgift'><?_ml .maplinks.buy-random _ml?></a></li>
    <li><a href='/shop/transferpoints'><?_ml .maplinks.transfer-points _ml?></a></li>
-   <li><a href='http://www.zazzle.com/dreamwidth*'><?_ml .maplinks.buy-merchandise _ml?></a></li>
+   $merch
    <li><a href='/shop/history'><?_ml .maplinks.payment-history _ml?></a></li>
   </ul></dd></dl>
-    };
+        };
+    } else {  # only display merch link
+        return qq{
+ <dl><dt>$shop_title</dt>
+  <dd><ul>
+   $merch
+  </ul></dd></dl>
+        };
+    }
 }
 _code?>
 
--------------------------------------------------------------------------------