Less words: remove the unnecessary "Logout" header (since we have 
another "Log out?" header), don't show the logout button on /logout.bml

        Patch by fu. 

diffs (58 lines):

diff -r 038fab79a02a -r 71d61411cb47 cgi-bin/DW/Template/Plugin/SiteScheme.pm
--- a/cgi-bin/DW/Template/Plugin/SiteScheme.pm  Tue Apr 19 19:05:46 2011 +0800
+++ b/cgi-bin/DW/Template/Plugin/SiteScheme.pm  Tue Apr 19 19:40:49 2011 +0800
@@ -78,6 +78,10 @@ sub challenge_generate {
     return LJ::challenge_generate(@_);
 }
 
+sub show_logout_button {
+    return DW::Request->get->uri !~ m!^/logout!;
+}
+
 =head1 AUTHOR
 
 =over
diff -r 038fab79a02a -r 71d61411cb47 htdocs/logout.bml
--- a/htdocs/logout.bml Tue Apr 19 19:05:46 2011 +0800
+++ b/htdocs/logout.bml Tue Apr 19 19:40:49 2011 +0800
@@ -19,7 +19,6 @@ _c?>
 
     LJ::set_active_crumb('logout');
 
-    $title = $ML{'.title'};
     $body = "";
 
     my $u = LJ::get_remote();
@@ -121,6 +120,7 @@ _c?>
 
 _code?><?page
 title=><?_code return $title; _code?>
+windowtitle=><?_code return $ML{'.title'}; _code?>
 head<=
 <?_code LJ::need_res('stc/logout.css'); _code?>
 <style type='text/css'>
diff -r 038fab79a02a -r 71d61411cb47 schemes/common.tt
--- a/schemes/common.tt Tue Apr 19 19:05:46 2011 +0800
+++ b/schemes/common.tt Tue Apr 19 19:40:49 2011 +0800
@@ -72,12 +72,14 @@ the same terms as Perl itself.  For a co
     [%- unread = inbox.unread_count -%]
     [%- identity = remote.is_identity -%]
     [%- -%]<div id='account-links-text'>
+    [%- IF dw_scheme.show_logout_button -%]
     [%- -%]<form action='[% site.root %]/logout?ret=1' method='post'>
     [%- remote.ljuser_display -%]
     [%- -%]<input type='hidden' name='user' value='[% remote.user %]' />
     [%- -%]<input type='hidden' name='sessid' value='[% remote._session.sessid 
%]' />
     [%- -%]<input type='submit' value="[% 'sitescheme.accountlinks.btn.logout' 
| ml %]" />
     [%- -%]</form>
+    [%- END -%]
     [%- -%]<ul>
     [%- IF ! identity -%]<li><a href='[% site.root %]/update'>[% 
'sitescheme.accountlinks.post' | ml %]</a>  &bull; </li>[%- END -%]
     [%- -%]<li><a href='[% remote.journal_base %]/read'>[% 
'sitescheme.accountlinks.readinglist' | ml %]</a> &bull; </li>
@@ -149,4 +151,4 @@ the same terms as Perl itself.  For a co
         [% dw_scheme.final_body_html %]
     </body>
 </html>
-[%- END -%]
\ No newline at end of file
+[%- END -%]
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to