forked from bestpractical/rt-bugtracker-public
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
338 additions
and
449 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
html/Callbacks/BugTracker-Public/Elements/Tabs/Privileged
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<%init> | ||
# Only show the Public nav to the public user | ||
return unless RT::BugTracker::Public->IsPublicUser; | ||
|
||
# Save the About menu, if any (provided by RT::Extension::rt_cpan_org, for | ||
# example) | ||
my $about = Menu->child("about"); | ||
|
||
# Save the Preferences menu ("Logged in as..") for Bitcard/OpenID users | ||
my $preferences = Menu->child("preferences"); | ||
|
||
# Clear the decks | ||
RT::Interface::Web::InitializeMenu(); | ||
|
||
PageWidgets()->child( simple_search => raw_html => $m->scomp( | ||
'/Elements/SimpleSearch', SendTo => '/Public/Search/Simple.html' )); | ||
|
||
PageWidgets()->child( create_ticket => raw_html => $m->scomp( | ||
'/Elements/CreateTicket', SendTo => '/Public/Bug/Report.html' )); | ||
|
||
Menu()->child( | ||
search_dist => title => loc('Search Distributions'), | ||
path => '/Public/', | ||
); | ||
|
||
Menu()->child( | ||
browse_dist => title => loc('Browse Distributions'), | ||
path => '/Public/Dist/Browse.html', | ||
); | ||
|
||
Menu->child( "about", menu => $about ); | ||
|
||
if ($session{CurrentUser}->Name eq RT->Config->Get("WebPublicUser")) { | ||
Menu->child( | ||
'preferences' => title => loc( 'Welcome [_1]anonymous guest[_2].', '<span class="current-user">', '</span>' ), | ||
escape_title => 0, | ||
sort_order => 1000, | ||
); | ||
|
||
# Public user must logout to login | ||
Menu->child( | ||
"login", | ||
title => loc('Login as another user'), | ||
path => '/NoAuth/Logout.html', | ||
sort_order => 1001, | ||
); | ||
} else { | ||
# Preserve core RT generated "Logged in as" menu for other authenticated | ||
# users from Bitcard and OpenID which also get the Public view | ||
Menu->child("preferences", menu => $preferences); | ||
} | ||
|
||
my ($queue, $ticket); | ||
my $request_path = $HTML::Mason::Commands::r->path_info; | ||
$request_path =~ s!^/{2,}!/!; | ||
|
||
if ( $request_path =~ m{^/Public/Bug/(?:Display|Update)\.html} | ||
and my $id = $DECODED_ARGS->{id} ) | ||
{ | ||
$ticket = RT::Ticket->new( $session{CurrentUser} ); | ||
$ticket->Load($id); | ||
$queue = $ticket->QueueObj if $ticket->id; | ||
} | ||
elsif ( $request_path =~ m{^/Public/(?:Bug/Report|Dist/Display)\.html} | ||
and my $name = ($DECODED_ARGS->{Name} || $DECODED_ARGS->{Queue}) ) | ||
{ | ||
$queue = RT::Queue->new( $session{CurrentUser} ); | ||
$queue->Load($name); | ||
} | ||
|
||
if ( $queue and $queue->id ) { | ||
my $escaped = $m->interp->apply_escapes($queue->Name, 'u'); | ||
PageMenu()->child( | ||
active_bugs => title => loc("Active bugs"), | ||
path => "/Public/Dist/Display.html?Status=Active;Name=" . $escaped, | ||
); | ||
|
||
PageMenu()->child( resolved_bugs => | ||
title => loc("Resolved bugs"), | ||
path => "/Public/Dist/Display.html?Status=Resolved;Name=". $escaped, | ||
); | ||
|
||
PageMenu()->child( rejected_bugs => | ||
title => loc("Rejected bugs"), | ||
path => "/Public/Dist/Display.html?Status=Rejected;Name=". $escaped, | ||
); | ||
|
||
PageMenu()->child( report => | ||
title => loc("Report a new bug"), | ||
path => '/Public/Bug/Report.html?Queue='. $escaped, | ||
); | ||
|
||
if ($ticket and $ticket->id | ||
and $queue->Lifecycle->IsInactive($ticket->Status) | ||
and $ticket->CurrentUserHasRight("OpenTicket")) { | ||
|
||
PageMenu->child( | ||
"reopen", | ||
title => loc("Re-open this bug"), | ||
path => "/Public/Bug/Display.html?Status=open;id=".$ticket->id, | ||
sort_order => -2, | ||
); | ||
PageMenu->child( | ||
"ticket-queue-separator", | ||
raw_html => "<span style='display: block; padding: 0.75em 1em'>—</span>", | ||
sort_order => -1, | ||
); | ||
} | ||
} | ||
</%init> |
7 changes: 7 additions & 0 deletions
7
html/Callbacks/BugTracker-Public/NoAuth/Logout.html/AfterSessionDelete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%init> | ||
return unless $m->notes->{NextHash} and $m->notes->{NextPage}; | ||
|
||
# Resurrect the next page data we're about to pass to the login page via the | ||
# logout's meta-refresh. | ||
$session{NextPage}->{ $m->notes->{NextHash} } = $m->notes->{NextPage}; | ||
</%init> |
17 changes: 17 additions & 0 deletions
17
html/Callbacks/BugTracker-Public/NoAuth/Logout.html/Default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%args> | ||
$URL => undef | ||
</%args> | ||
<%init> | ||
return unless $URL and RT::BugTracker::Public->IsPublicUser | ||
and $session{"LastPublicPage"}; | ||
|
||
# Because we don't have a callback that is both after the session delete and | ||
# can modify the login URL, we need to stash the next page data pre-delete, set | ||
# the next page hash, and then resurrect it after the session is deleted. | ||
$m->notes->{NextHash} = RT::Interface::Web::SetNextPage($DECODED_ARGS, $session{"LastPublicPage"}); | ||
$m->notes->{NextPage} = RT::Interface::Web::FetchNextPage($m->notes->{NextHash}); | ||
|
||
$$URL = RT->Config->Get("WebPath") | ||
. "/NoAuth/Login.html?next=" | ||
. $m->notes->{NextHash}; | ||
</%init> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<%args> | ||
$ARGSRef => {} | ||
</%args> | ||
<%init> | ||
return unless RT::BugTracker::Public->IsPublicUser; | ||
$m->comp("/Public/Search/Results.html", %$ARGSRef); | ||
$m->comp("/Elements/Footer"); | ||
$m->abort; | ||
</%init> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%init> | ||
# Rather than rely on the HTTP referer and then have to sanitize it, just keep | ||
# track of the referring page ourselves. | ||
$session{'LastPublicPage'} = RT::Interface::Web::IntuitNextPage() | ||
if RT::BugTracker::Public->IsPublicUser; | ||
</%init> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Similar to core RT's "sidebyside" styles */ | ||
|
||
#reporting-a-bug { | ||
float: right; | ||
width: 58%; | ||
clear: right; | ||
} | ||
|
||
.reporting-a-bug-instructions { | ||
float: left; | ||
width: 40%; | ||
clear: left; | ||
} | ||
|
||
@media (max-width: 950px) { | ||
/* Revert to a single column when we're less than 1000px wide */ | ||
#reporting-a-bug, .reporting-a-bug-instructions { | ||
float: none; | ||
width: auto; | ||
clear: both; | ||
} | ||
} | ||
|
||
#reporting-a-bug .edit-custom-field { | ||
/* we're in a thinner column most of the time, make room for the default margin */ | ||
width: 45%; | ||
} | ||
|
||
#reporting-a-bug .edit-custom-field:first-child { | ||
display: block; | ||
float: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
jQuery(function() { | ||
jQuery("a[data-bug-email]").each(function() { | ||
var a = jQuery(this); | ||
a.attr("href", "mailto:bug-" | ||
+ encodeURIComponent(a.attr("data-bug-email")) | ||
+ "@rt.cpan.org"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.