fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-01-04 10:56 am

[dw-free] Clean up constant namespaces in DW::Template

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

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

Collapse the constants into site.*. See DW::Template for a complete list.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Template.pm
  • views/admin/themes/category.tt
  • views/admin/themes/theme.tt
  • views/interests/add.tt
  • views/interests/index.tt
  • views/interests/int.tt
  • views/interests/popular.tt
  • views/latest/mood.tt
  • views/legal/privacy.tt
  • views/legal/tos.tt
  • views/login.tt
  • views/misc/pubkey.tt
  • views/misc/whereami.tt
  • views/protected.tt
  • views/rename.tt
  • views/shop/cartdisplay.tt
  • views/shop/index.tt
  • views/shop/transferpoints.tt
--------------------------------------------------------------------------------
diff -r b66e5e17b3a3 -r e76d6f8b1e9d cgi-bin/DW/Template.pm
--- a/cgi-bin/DW/Template.pm	Tue Jan 04 18:53:16 2011 +0800
+++ b/cgi-bin/DW/Template.pm	Tue Jan 04 18:55:46 2011 +0800
@@ -34,26 +34,25 @@ DW::Template - Template Toolkit helpers 
 $Template::Plugins::PLUGIN_BASE = '';
 
 my $site_constants = Template::Namespace::Constants->new({
-    name => $LJ::SITENAME,
-    nameshort => $LJ::SITENAMESHORT,
-    nameabbrev => $LJ::SITENAMEABBREV,
+    name        => $LJ::SITENAME,
+    nameshort   => $LJ::SITENAMESHORT,
+    nameabbrev  => $LJ::SITENAMEABBREV,
+
     company => $LJ::SITECOMPANY,
-});
 
-my $roots_constants = Template::Namespace::Constants->new({
-    site => $LJ::SITEROOT,
-    img => $LJ::IMGPREFIX,
-    ssl => $LJ::SSLROOT,
-});
+    domain      => $LJ::DOMAIN,
+    domainweb   => $LJ::DOMAIN_WEB,
 
-my $domain_constants = Template::Namespace::Constants->new({
-    site => $LJ::DOMAIN,
-    web => $LJ::DOMAIN_WEB,
-});
+    root    => $LJ::SITEROOT,
+    imgroot => $LJ::IMGPREFIX,
+    sslroot => $LJ::SSLROOT,
 
-my $email_constants = Template::Namespace::Constants->new({
-    coppa => $LJ::COPPA_EMAIL,
-    privacy => $LJ::PRIVACY_EMAIL,
+    help => \%LJ::HELPURL,
+
+    email => {
+        coppa => $LJ::COPPA_EMAIL,
+        privacy => $LJ::PRIVACY_EMAIL,
+    },
 });
 
 # precreating this
@@ -61,9 +60,6 @@ my $view_engine = Template->new({
     INCLUDE_PATH => "$LJ::HOME/views/",
     NAMESPACE => {
         site => $site_constants,
-        roots => $roots_constants,
-        domain => $domain_constants,
-        email => $email_constants,
         help => Template::Namespace::Constants->new( \%LJ::HELPURL ),
     },
     CACHE_SIZE => $LJ::TEMPLATE_CACHE_SIZE, # this can be undef, and that means cache everything.
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/admin/themes/category.tt
--- a/views/admin/themes/category.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/admin/themes/category.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -8,7 +8,7 @@ td, th { padding: 4px; }
 [%- END -%]
 
 </tr>
-<p><a href="[% roots.site %]/admin/themes/">[% '.back.link' | ml %]</a></p>
+<p><a href="[% site.root %]/admin/themes/">[% '.back.link' | ml %]</a></p>
 <strong>[% '.filter.label' | ml %]</strong>
 <select id="filter_act">
     <option value="all">[% '.filter.act.all' | ml %]</option>
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/admin/themes/theme.tt
--- a/views/admin/themes/theme.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/admin/themes/theme.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -6,14 +6,14 @@ td, th { padding: 4px; }
 </style>
 [%- END -%]
 
-<form method="post" action="[% roots.site %]/admin/themes/theme">
+<form method="post" action="[% site.root %]/admin/themes/theme">
 [% dw.form_auth %]
 <input type="hidden" name="theme" value="[% theme_arg %]" />
 <p class="action_links">
-<a href="[% roots.site %]/admin/themes/">[% '.back.link' | ml %]</a> ||  
-<a href="[% roots.site %]/customize/preview_redirect?themeid=[% theme.s2lid %]" target="_blank">[% '.preview.link' | ml %]</a> || [% '.source' | ml %] (
-<a href="[% roots.site %]/customize/advanced/layersource?id=[% theme.b2lid %]&fmt=html" target="_blank">[% '.source.theme' | ml %]</a> ||
-<a href="[% roots.site %]/customize/advanced/layersource?id=[% theme.s2lid %]&fmt=html" target="_blank">[% '.source.layer' | ml %]</a> )
+<a href="[% site.root %]/admin/themes/">[% '.back.link' | ml %]</a> ||  
+<a href="[% site.root %]/customize/preview_redirect?themeid=[% theme.s2lid %]" target="_blank">[% '.preview.link' | ml %]</a> || [% '.source' | ml %] (
+<a href="[% site.root %]/customize/advanced/layersource?id=[% theme.b2lid %]&fmt=html" target="_blank">[% '.source.theme' | ml %]</a> ||
+<a href="[% site.root %]/customize/advanced/layersource?id=[% theme.s2lid %]&fmt=html" target="_blank">[% '.source.layer' | ml %]</a> )
 </p>
 <p><strong>[% '.designer' | ml %]</strong> [% theme.designer %]</p>
 
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/interests/add.tt
--- a/views/interests/add.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/interests/add.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -35,13 +35,13 @@
     <h1>[% '.add.added.head' | ml %]</h1>
     <p>[% '.add.added.text' | ml %]</p>
     <ul>
-      <li><a href='[% roots.site %]/interests'>
+      <li><a href='[% site.root %]/interests'>
           [%- '.add.added.interestspage' | ml %]</a></li>
-      <li><a href='[% roots.site %]/manage/profile/#interests'>
+      <li><a href='[% site.root %]/manage/profile/#interests'>
           [%- '.add.added.editinterests' | ml %]</a></li>
       <li><a href='[% remote.profile_url %]'>
           [%- '.add.added.viewprofile' | ml %]</a></li>
-      <li><a href='[% roots.site %]/manage/profile'>
+      <li><a href='[% site.root %]/manage/profile'>
           [%- '.add.added.editprofile' | ml %]</a></li>
     </ul>
 [%- END -%]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/interests/index.tt
--- a/views/interests/index.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/interests/index.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -54,4 +54,4 @@
 </form></td></tr>
 
 </table>
-[% '.nointerests.text2' | ml(aopts = "href='$roots.site/manage/profile/'") %]
+[% '.nointerests.text2' | ml(aopts = "href='$site.root/manage/profile/'") %]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/interests/int.tt
--- a/views/interests/int.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/interests/int.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -56,25 +56,25 @@
         </ul></p>
     [%- ELSE -%]
         <h1>[% '.nocomms.header' | ml %]</h1><p>
-        [%- '.nocomms.text' | ml(aopts = "href='$roots.site/community/create'",
+        [%- '.nocomms.text' | ml(aopts = "href='$site.root/community/create'",
                                 int = interest) %]</p>
     [%- END -%]
     <h1>[% ".users.header" | ml(interest = e_int) %]</h1>
     <p class='interestinfo'>
     [%- IF not_interested -%]
-        [%- '.addint2' | ml(aopts = "href='$roots.site/interests?mode=add&amp;intid=$intid'") -%]
+        [%- '.addint2' | ml(aopts = "href='$site.root/interests?mode=add&amp;intid=$intid'") -%]
     [%- END -%]
-    [% '.morestuff2' | ml(aopts = "href='$roots.site/interests'") %]</p>
+    [% '.morestuff2' | ml(aopts = "href='$site.root/interests'") %]</p>
     <p class='matches'><b>[% '.matches2' | ml(num = int_users.count) %]</b></p>
     <div style='text-align: center'>[% int_users.navbar %]</div><br />
     [% int_users.results %]
     <div style='text-align: center; clear: both'>[% int_users.navbar %]</div><br />
 [%- ELSE -%]
     <h1>[% '.nocomms.header' | ml %]</h1><p>
-    [%- '.nocomms.text' | ml(aopts = "href='$roots.site/community/create'",
+    [%- '.nocomms.text' | ml(aopts = "href='$site.root/community/create'",
                             int = e_int) %]</p>
     <h1>[% '.nousers.header' | ml %]</h1><p>
     [%- '.nousers.text2' | ml(int = e_int,
-        aopts_add = "href='$roots.site/interests?mode=addnew&amp;keyword=$e_int'",
-        aopts_int = "href='$roots.site/interests'") %]</p>
+        aopts_add = "href='$site.root/interests?mode=addnew&amp;keyword=$e_int'",
+        aopts_int = "href='$site.root/interests'") %]</p>
 [%- END -%]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/interests/popular.tt
--- a/views/interests/popular.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/interests/popular.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -25,7 +25,7 @@
 <h1>[% '.popular.head' | ml %]</h1><p>[% '.popular.text' | ml %]
 [%- IF no_text_mode -%]
     [% '.popular.textmode'
-     | ml(aopts = "href='$roots.site/interests?view=popular&mode=text'") %]
+     | ml(aopts = "href='$site.root/interests?view=popular&mode=text'") %]
 [%- END -%]
 </p>
 [%- IF pop_ints -%]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/latest/mood.tt
--- a/views/latest/mood.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/latest/mood.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -13,7 +13,7 @@ the same terms as Perl itself.  For a co
 'perldoc perlartistic' or 'perldoc perlgpl'.
 %]
 [%- sections.title = '.title' | ml -%]
-<p>[% '.info' | ml( aopts = "href=\"$roots.site/latest\"", sitename = site.name ) %]</p>
+<p>[% '.info' | ml( aopts = "href=\"$site.root/latest\"", sitename = site.name ) %]</p>
 [%- IF no_data -%]
 <p>[% '.no_data' | ml %]</p>
 [%- ELSE -%]
@@ -23,10 +23,10 @@ the same terms as Perl itself.  For a co
 
 <h1>[% '.emotional_weather' | ml %]</h1>
 <div id="moodhold">
-<div class="sadface"> <img src="[% roots.img %]/mood/dwsad.png" alt="[% '.alt.sad' | ml %]" /></div>
-<div class="moodgradient"> <img src="[% roots.img %]/silk/24x24/user.png" alt="[% '.alt.indicator' | ml(score = score, top = 100) %]" style="margin-left: [% (score / 100) * 650 - 12 | format("%ipx") %]" /></div>
+<div class="sadface"> <img src="[% site.imgroot %]/mood/dwsad.png" alt="[% '.alt.sad' | ml %]" /></div>
+<div class="moodgradient"> <img src="[% site.imgroot %]/silk/24x24/user.png" alt="[% '.alt.indicator' | ml(score = score, top = 100) %]" style="margin-left: [% (score / 100) * 650 - 12 | format("%ipx") %]" /></div>
 [%# The above formula in the inline style is derived from the width and margin of the moodgradient class in the CSS file.
    ( score / 100 ) * <width> - <margin (left or right)> %]
-<div class="happyface"> <img src="[% roots.img %]/mood/dwhappy.png" alt="[% '.alt.happy' | ml %]" /></div>
+<div class="happyface"> <img src="[% site.imgroot %]/mood/dwhappy.png" alt="[% '.alt.happy' | ml %]" /></div>
 </div>
-[%- END -%]
\ No newline at end of file
+[%- END -%]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/legal/privacy.tt
--- a/views/legal/privacy.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/legal/privacy.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -15,9 +15,9 @@
 
 [%- sections.title='Privacy Policy' -%]
 
-<p>We hate legalese, so we've tried to make ours readable. If you've got any questions, feel free to <a href='[% roots.site %]/support/submit'>ask us</a>, and we'll do our best to answer.</p>
+<p>We hate legalese, so we've tried to make ours readable. If you've got any questions, feel free to <a href='[% site.root %]/support/submit'>ask us</a>, and we'll do our best to answer.</p>
 
-<p>This privacy statement ("Privacy Policy") covers all websites (such as [% domain.web %]) owned and operated by [% site.company %] ("we", "us", "our") and all associated services.</p>
+<p>This privacy statement ("Privacy Policy") covers all websites (such as [% site.domainweb %]) owned and operated by [% site.company %] ("we", "us", "our") and all associated services.</p>
 
 <p>We use information you share with us for our internal business purposes. We do not sell your information. This notice tells you what information we collect, how we use it, and steps we take to protect and secure it.</p>
 
@@ -104,7 +104,7 @@
 
 <p>The Children's Online Privacy Protection Act ('COPPA') requires that we inform parents on how we collect and disclose the personal information of children under the age of 13.</p>
 
-<p>We do not permit children under the age of 13 to use our service. To prevent this, we collect date of birth at the time of account creation. If your child under the age of 13 has mis-represented their age at account creation, please contact us at [% email.coppa %]. After confirming your identity, we will remove the account.</p>
+<p>We do not permit children under the age of 13 to use our service. To prevent this, we collect date of birth at the time of account creation. If your child under the age of 13 has mis-represented their age at account creation, please contact us at [% site.email.coppa %]. After confirming your identity, we will remove the account.</p>
 
 
 <h2>Cookies</h2>
@@ -121,7 +121,7 @@
 
 <p>Your account information is password-protected. We recommend that you choose a strong and secure password. We use industry-standard encryption to safeguard any transmission between your computer and ours.</p>
 
-<p>If we learn of a system security breach, we will notify you electronically so you can take appropriate steps to protect yourself. Depending on where you live, you may have a legal right to receive notice of a security breach in writing. To receive free written notice, you should contact us at [% email.privacy %].</p>
+<p>If we learn of a system security breach, we will notify you electronically so you can take appropriate steps to protect yourself. Depending on where you live, you may have a legal right to receive notice of a security breach in writing. To receive free written notice, you should contact us at [% site.email.privacy %].</p>
 
 
 <h2>Deleting your information</h2>
@@ -161,7 +161,7 @@
 
 <h2>Contacting us</h2>
 
-<p>If you have questions about this policy, you can contact us at [% email.privacy %].</p>
+<p>If you have questions about this policy, you can contact us at [% site.email.privacy %].</p>
 
 
 
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/legal/tos.tt
--- a/views/legal/tos.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/legal/tos.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -16,7 +16,7 @@
 [%- sections.title='Terms of Service' -%]
 
 <p>We hate legalese, so we've tried to make ours readable. If you've got 
-any questions, feel free to <a href='[% roots.site %]/support/submit'>ask us</a>,
+any questions, feel free to <a href='[% site.root %]/support/submit'>ask us</a>,
 and we'll do our best to answer.</p>
 
 <h2>Terms of Service</h2>
@@ -25,12 +25,12 @@ following terms and conditions, which go
 following terms and conditions, which govern your use of the [% site.nameshort %]
 site (Website), and all content, services and products available at or 
 through the Website, including but not limited to 
-[% roots.site %]. </p>
+[% site.root %]. </p>
 
 <p>The Website is offered subject to your acceptance, without 
 modification, of all of the terms and conditions contained within, along with all 
 other operating rules, policies (including, without limitation, 
-[% site.nameshort %]'s <a href="[% roots.site %]/legal/privacy">Privacy
+[% site.nameshort %]'s <a href="[% site.root %]/legal/privacy">Privacy
 Policy</a>) and procedures that may be published from time to time on 
 this Website by us (collectively, the Agreement).</p>
 
@@ -94,7 +94,7 @@ of account or the features available to 
 <h2>III. Privacy Policy</h2>
 
 <p>Your use of the Website is governed by the Privacy Policy, currently 
-located at [% roots.site %]/legal/privacy. </p>
+located at [% site.root %]/legal/privacy. </p>
 
 
 <h2>IV. Indemnity</h2>
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/login.tt
--- a/views/login.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/login.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -11,7 +11,7 @@ reference 'perldoc perlartistic' or 'per
 %]
 <div class="login-container">
   <div class="appwidget appwidget-login" id="protected_login"> 
-    <form action="[% IF usessl %][% roots.ssl %][% ELSE %][% roots.site %][% END %]/login" method="post" class="lj_login_form pkg"> 
+    <form action="[% IF usessl %][% site.sslroot %][% ELSE %][% site.root %][% END %]/login" method="post" class="lj_login_form pkg"> 
     <h4>[% '.login.header' | ml( sitename = site.name ) %]</h4> 
       [% dw.form_auth() %]
       <input type="hidden" name="chal" class="lj_login_chal" value="[% chal %]" /> 
@@ -30,17 +30,17 @@ reference 'perldoc perlartistic' or 'per
       </fieldset> 
       <p><input name="action:login" type="submit" value="[% '.login.btn.login' | ml %]" tabindex="14" />
       [% IF usessl %]
-      <img src="[% roots.img %]/padlocked.gif" width="20" height="16" class="secure-image" alt="[% '.login.secure' | ml %]" />
+      <img src="[% site.imgroot %]/padlocked.gif" width="20" height="16" class="secure-image" alt="[% '.login.secure' | ml %]" />
       [% ELSE %]
-      <img src="[% roots.img %]/unpadlocked.gif" width="20" height="16" class="secure-image" alt="[% '.login.standard' | ml %]" />
+      <img src="[% site.imgroot %]/unpadlocked.gif" width="20" height="16" class="secure-image" alt="[% '.login.standard' | ml %]" />
       [% END %]
-      <p><a href="[% roots.site %]/lostinfo" class="small-link" tabindex="15">[% '.login.forget' | ml %]</a> </p>
+      <p><a href="[% site.root %]/lostinfo" class="small-link" tabindex="15">[% '.login.forget' | ml %]</a> </p>
     </form> 
   </div><!-- end .appwidget-login --> 
 
    <div class="appwidget-login-openid">
    <h4>[% '.login.openid.header' | ml %]</h4> 
-     <form method='post' action='[% roots.site %]/openid/login' style='display:inline; width:auto'>
+     <form method='post' action='[% site.root %]/openid/login' style='display:inline; width:auto'>
        <b>[% '.login.openid.url' | ml %]</b><br/>
        <input class="sexy" id="openid_url" name="openid_url" size="30" aria-required="true" tabindex="16" /><br/>
        <input type="hidden" name="continue_to" value="[% returnto %]"/>
@@ -53,7 +53,7 @@ reference 'perldoc perlartistic' or 'per
   <div class="login-create-account"> 
     <hr class="hr" /> 
     <h4>[% '.createaccount.header' | ml( sitename = site.name ) %]</h4> 
-    <form action="[% roots.site %]/create" method="get"><input type="submit" value="[% '.createaccount.button' | ml %]" class="submit" tabindex="18" /></form> 
+    <form action="[% site.root %]/create" method="get"><input type="submit" value="[% '.createaccount.button' | ml %]" class="submit" tabindex="18" /></form> 
       <ul> 
         <li>[% '.createaccount.whylogin.benefit1' | ml %]</li>
         <li>[% '.createaccount.whylogin.benefit2' | ml %]</li>
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/misc/pubkey.tt
--- a/views/misc/pubkey.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/misc/pubkey.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -15,5 +15,5 @@
 <p>[% '.info.desc' | ml(aoptspgp = "href='http://www.pgp.com/'", aoptsgpg = "href='http://www.gnupg.org/'") %]</p>
 
 [% IF remote %]
-    <p>[% '.info.upload' | ml(aopts = "href='$roots.site/manage/pubkey'") %]</p>
+    <p>[% '.info.upload' | ml(aopts = "href='$site.root/manage/pubkey'") %]</p>
 [% END %]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/misc/whereami.tt
--- a/views/misc/whereami.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/misc/whereami.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -1,7 +1,7 @@
 [%- sections.title = '.title' | ml -%]
 <p>[% '.intro' | ml %]</p>
 
-<form action='[% roots.site %]/misc/whereami'>
+<form action='[% site.root %]/misc/whereami'>
     [% authas_html %]
 </form><br />
 
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/protected.tt
--- a/views/protected.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/protected.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -17,10 +17,10 @@ reference 'perldoc perlartistic' or 'per
     <p>[% message | ml %]</p>
 [% END %]
 
-<div class="errorbar" style="background-image: URL('[%- roots.img -%]/message-error.gif');">
+<div class="errorbar" style="background-image: URL('[%- site.imgroot -%]/message-error.gif');">
 <strong>
 [% IF remote %]
-  [% error_key | ml( user = remote.ljuser_display, siteroot = roots.site, journalname= journalname ) %]
+  [% error_key | ml( user = remote.ljuser_display, siteroot = site.root, journalname= journalname ) %]
 [% ELSE %]  
   [% '.protected.message.nouser' | ml ( sitename = site.name ) %]
 [% END %]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/rename.tt
--- a/views/rename.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/rename.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -119,7 +119,7 @@ the same terms as Perl itself.  For a co
         <p>[% '.token.list.header' | ml %]</p>
         <ul>
         [% FOREACH token = unused_tokens %]
-            <li>[% token.token | html %] - <a href="[%- dw.site | url %]/rename/[% token.token | url %]
+            <li>[% token.token | html %] - <a href="[%- site.root | url %]/rename/[% token.token | url %]
             [%~ IF checkusername.user AND checkusername.status == 'available' ~%]
                 ?to=[%~ checkusername.user | url ~%]
                 ">[%~ '.token.list.item.withname' | ml( username = checkusername.user ) ~%]
@@ -127,7 +127,7 @@ the same terms as Perl itself.  For a co
                 ">[%~ '.token.list.item' | ml ~%]
             [%~ END ~%]
             </a>
-            <a href="[%- dw.site | url %]/rename/[% token.token | url %]?type=C
+            <a href="[%- site.root | url %]/rename/[% token.token | url %]?type=C
             [%~ IF checkusername.user AND checkusername.status == 'available' ~%]
                 &to=[%~ checkusername.user | url ~%]
                 ">[%~ '.token.list.item.comm.withname' | ml( username = checkusername.user ) ~%]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/shop/cartdisplay.tt
--- a/views/shop/cartdisplay.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/shop/cartdisplay.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -3,8 +3,8 @@
         [% IF remote %]
             [% IF remote.is_person %]
                 You have <strong>[% remote.shop_points %] points</strong>.<br />
-                [% IF help.shoppoints %]<a href="[% help.shoppoints %]">What is this?</a> |[% END %]
-                <a href="[% roots.site %]/shop/points">Buy More</a>
+                [% IF site.help.shoppoints %]<a href="[% site.help.shoppoints %]">What is this?</a> |[% END %]
+                <a href="[% site.root %]/shop/points">Buy More</a>
             [% ELSE %]
                 Only personal accounts can carry a point balance.
             [% END %]
@@ -14,17 +14,17 @@
     </div>
     <div class='shop-status-middle'>
         [% IF cart AND cart.has_items %]
-            <img src="[% roots.img %]/silk/site/cart.png" /> Order Cost: <strong>[% cart.display_total %]</strong><br />
-            <a href='[% roots.site %]/shop/cart'>View/Check Out Order</a> | 
-            <a href='[% roots.site %]/shop?newcart=1'>Cancel Order</a>
+            <img src="[% site.imgroot %]/silk/site/cart.png" /> Order Cost: <strong>[% cart.display_total %]</strong><br />
+            <a href='[% site.root %]/shop/cart'>View/Check Out Order</a> | 
+            <a href='[% site.root %]/shop?newcart=1'>Cancel Order</a>
         [% ELSE %]
-            <img src="[% roots.img %]/silk/site/cart.png" /> Your shopping cart is empty.
+            <img src="[% site.imgroot %]/silk/site/cart.png" /> Your shopping cart is empty.
         [% END %]
     </div>
     <div class='shop-status-right'>
         [%# Also use this section for sales links and stuff. %]
-        [% IF help.paidaccountinfo %]<a href="[% help.paidaccountinfo %]">About the Shop</a><br />[% END %]
-        <a href="[% roots.site %]/shop/history">Order History</a>
+        [% IF site.help.paidaccountinfo %]<a href="[% site.help.paidaccountinfo %]">About the Shop</a><br />[% END %]
+        <a href="[% site.root %]/shop/history">Order History</a>
     </div>
     <div style='clear: both;'></div>
 </div>
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/shop/index.tt
--- a/views/shop/index.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/shop/index.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -8,16 +8,16 @@
     <div class='shop-category-title'>[% '.title.paidacc' | ml %]</div>
     <div class='shop-category-items'>
 [% IF remote AND remote.is_personal AND NOT remote.is_perm %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/account?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/account?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
 [% END %]
 [% IF remote AND remote.is_personal %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/gifts?type=account">[% '.for.circle' | ml %]</a></span>
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/account?for=gift">[% '.for.different' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/gifts?type=account">[% '.for.circle' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/account?for=gift">[% '.for.different' | ml %]</a></span>
 [% ELSE %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/account?for=gift">[% '.for.existing' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/account?for=gift">[% '.for.existing' | ml %]</a></span>
 [% END %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/account?for=new">[% '.for.new' | ml %]</a></span>
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/randomgift">[% '.for.random' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/account?for=new">[% '.for.new' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/randomgift">[% '.for.random' | ml %]</a></span>
     </div>
 </div>
 
@@ -25,8 +25,8 @@
     <div class='shop-category-title'>[% '.title.points' | ml(site=site.nameshort) %]</div>
     <div class='shop-category-items'>
 [% IF remote AND remote.is_personal %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/points?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/points?for=gift">[% '.for.different' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/points?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/points?for=gift">[% '.for.different' | ml %]</a></span>
 [% ELSE %]
         <span class='shop-category-item'>[% '.points.login' | ml %]</span>
 [% END %]
@@ -37,8 +37,8 @@
     <div class='shop-category-title'>[% '.title.renames' | ml %]</div>
     <div class='shop-category-items'>
 [% IF remote AND remote.is_personal %]
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/renames?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
-        <span class='shop-category-item'><a href="[% roots.site %]/shop/renames?for=gift">[% '.for.different' | ml %]</a></span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/renames?for=self">[% '.for.self' | ml %]</a> ([% remote.ljuser_display %])</span>
+        <span class='shop-category-item'><a href="[% site.root %]/shop/renames?for=gift">[% '.for.different' | ml %]</a></span>
 [% ELSE %]
         <span class='shop-category-item'>[% '.renames.login' | ml %]</span>
 [% END %]
diff -r b66e5e17b3a3 -r e76d6f8b1e9d views/shop/transferpoints.tt
--- a/views/shop/transferpoints.tt	Tue Jan 04 18:53:16 2011 +0800
+++ b/views/shop/transferpoints.tt	Tue Jan 04 18:55:46 2011 +0800
@@ -24,7 +24,7 @@
     <p>[% '.about' | ml(sitename = site.nameshort) %]</p>
 
     [% IF ! has_points %]
-        [% '.about.nopoints' | ml(sitename = site.nameshort, aopts = "href='$roots.site/shop/points'") %]
+        [% '.about.nopoints' | ml(sitename = site.nameshort, aopts = "href='$site.root/shop/points'") %]
     [% ELSE %]
 
         <p>[% '.about.points' | ml(points = has_points) %]</p>
--------------------------------------------------------------------------------