[Bps-public-commit] r19799 - RT-BugTracker-Public/html/Elements
sartak at bestpractical.com
sartak at bestpractical.com
Thu May 28 16:34:42 EDT 2009
Author: sartak
Date: Thu May 28 16:34:41 2009
New Revision: 19799
Added:
RT-BugTracker-Public/html/Elements/PersonalQuickbar
Modified:
RT-BugTracker-Public/html/Elements/Header
Log:
Move the personal quickbar logic into a PersonalQuickbar template
Modified: RT-BugTracker-Public/html/Elements/Header
==============================================================================
--- RT-BugTracker-Public/html/Elements/Header (original)
+++ RT-BugTracker-Public/html/Elements/Header Thu May 28 16:34:41 2009
@@ -87,39 +87,7 @@
<& /Elements/Logo &>
<div id="quickbar">
- <div id="quick-personal">
- <span class="hide"><a href="#skipnav"><&|/l&>Skip Menu</&></a> | </span>
-% if ($session{'CurrentUser'}->Name
-% and $session{'CurrentUser'}->Name ne $RT::WebPublicUser)
-% {
- <&|/l, "<span>".$session{'CurrentUser'}->Name."</span>" &>Logged in as [_1]</&>
-% }
-% elsif ($session{'CurrentUser'}->Name eq $RT::WebPublicUser) {
- <&|/l&>You are currently an anonymous guest.</&>
- |
- <a href="<%$RT::WebPath%>/NoAuth/Logout.html?URL=<% $return_url %>"><&|/l&>Login</&></a>
- |
- <a href="<%$RT::WebPath%>/NoAuth/Logout.html"><&|/l&>Return to Main</&></a>
-% }
-% else {
- <&|/l&>Not logged in.</&>
-% }
-% if ( $session{'CurrentUser'}->Id
-% and $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
- | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a>
-% }
-% if ($session{'CurrentUser'}->Name ne $RT::WebPublicUser
-% and $m->request_comp->path =~ m|^/Public/|)
-% {
- | <a href="<%$RT::WebPath%>/"><&|/l&>Return to Main</&></a>
-% }
- <& /Elements/Callback, %ARGS &>
-% unless (!$session{'CurrentUser'}->Name
-% or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)
-% or $session{'CurrentUser'}->Name eq $RT::WebPublicUser) {
- | <a href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
-% }
- </div>
+ <& /Elements/PersonalQuickbar, %ARGS &>
% }
<%INIT>
@@ -133,18 +101,6 @@
$id =~ s|index$||g
if $id ne 'index';
$id =~ s|-$||g;
-
-use URI::Escape;
-
-my $return_url = $RT::WebPath
- . '/index.html?goto='
- . URI::Escape::uri_escape(
- URI::Escape::uri_escape(
- $m->request_comp->path
- . '?'
- . $m->comp('/Elements/QueryString', %{$r->args})
- )
- );
</%INIT>
<%ARGS>
Added: RT-BugTracker-Public/html/Elements/PersonalQuickbar
==============================================================================
--- (empty file)
+++ RT-BugTracker-Public/html/Elements/PersonalQuickbar Thu May 28 16:34:41 2009
@@ -0,0 +1,50 @@
+<%ARGS>
+$Prefs => '/User/Prefs.html'
+</%ARGS>
+<%INIT>
+use URI::Escape;
+
+my $return_url = $RT::WebPath
+ . '/index.html?goto='
+ . URI::Escape::uri_escape(
+ URI::Escape::uri_escape(
+ $m->request_comp->path
+ . '?'
+ . $m->comp('/Elements/QueryString', %{$r->args})
+ )
+ );
+</%INIT>
+ <div id="quick-personal">
+ <span class="hide"><a href="#skipnav"><&|/l&>Skip Menu</&></a> | </span>
+% if ($session{'CurrentUser'}->Name
+% and $session{'CurrentUser'}->Name ne $RT::WebPublicUser)
+% {
+ <&|/l, "<span>".$session{'CurrentUser'}->Name."</span>" &>Logged in as [_1]</&>
+% }
+% elsif ($session{'CurrentUser'}->Name eq $RT::WebPublicUser) {
+ <&|/l&>You are currently an anonymous guest.</&>
+ |
+ <a href="<%$RT::WebPath%>/NoAuth/Logout.html?URL=<% $return_url %>"><&|/l&>Login</&></a>
+ |
+ <a href="<%$RT::WebPath%>/NoAuth/Logout.html"><&|/l&>Return to Main</&></a>
+% }
+% else {
+ <&|/l&>Not logged in.</&>
+% }
+% if ( $session{'CurrentUser'}->Id
+% and $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
+ | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a>
+% }
+% if ($session{'CurrentUser'}->Name ne $RT::WebPublicUser
+% and $m->request_comp->path =~ m|^/Public/|)
+% {
+ | <a href="<%$RT::WebPath%>/"><&|/l&>Return to Main</&></a>
+% }
+ <& /Elements/Callback, %ARGS &>
+% unless (!$session{'CurrentUser'}->Name
+% or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)
+% or $session{'CurrentUser'}->Name eq $RT::WebPublicUser) {
+ | <a href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
+% }
+ </div>
+
More information about the Bps-public-commit
mailing list