some ui improvements
This commit is contained in:
parent
902c18b52c
commit
4f96d670b9
3 changed files with 6 additions and 9 deletions
|
|
@ -150,13 +150,11 @@ sub page {
|
|||
my $session = shift;
|
||||
my $assetUrl = shift;
|
||||
my $output = processOperations($session);
|
||||
$session->errorHandler->warn("a");
|
||||
if ($output eq "") {
|
||||
my $asset = eval{WebGUI::Asset->newByUrl($session,$assetUrl,$session->form->process("revision"))};
|
||||
if ($@) {
|
||||
$session->errorHandler->warn("Couldn't instantiate asset for url: ".$session->url->getRequestedUrl." Root cause: ".$@);
|
||||
}
|
||||
$session->errorHandler->warn("d");
|
||||
if (defined $asset) {
|
||||
my $method = "view";
|
||||
if ($session->form->process("func")) {
|
||||
|
|
@ -166,13 +164,10 @@ $session->errorHandler->warn("d");
|
|||
$method = "view";
|
||||
}
|
||||
}
|
||||
$session->errorHandler->warn("e");
|
||||
$output = tryAssetMethod($session,$asset,$method);
|
||||
$session->errorHandler->warn("f");
|
||||
$output = tryAssetMethod($session,$asset,"view") unless ($output || ($method eq "view"));
|
||||
}
|
||||
}
|
||||
$session->errorHandler->warn("b");
|
||||
if (defined($output) and $output eq "") {
|
||||
$session->http->setStatus("404","Page Not Found");
|
||||
my $notFound = WebGUI::Asset->getNotFound($session);
|
||||
|
|
@ -184,7 +179,6 @@ $session->errorHandler->warn("b");
|
|||
}
|
||||
$output = "An error was encountered while processing your request." if $output eq '';
|
||||
}
|
||||
$session->errorHandler->warn("c");
|
||||
if ($session->errorHandler->canShowDebug()) {
|
||||
$output .= $session->errorHandler->showDebug();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ sub prepareView {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->{_viewVars}{showAdmin}) {
|
||||
if ($self->{_viewVars}{showAdmin} && (($self->canEditIfLocked && $self->session->scratch->get("versionTag") eq $self->get("tagId")) || !$self->isLocked)) {
|
||||
# under normal circumstances we don't put HTML stuff in our code, but this will make it much easier
|
||||
# for end users to work with our templates
|
||||
$self->{_viewVars}{"dragger.icon"} = $self->session->icon->drag();
|
||||
|
|
|
|||
|
|
@ -243,8 +243,11 @@ sub www_manageRevisions {
|
|||
left join assetVersionTag on assetData.tagId=assetVersionTag.tagId left join users on assetData.revisedBy=users.userId
|
||||
where assetData.assetId=".$self->session->db->quote($self->getId));
|
||||
while (my ($date,$by,$tag,$tagId) = $sth->array) {
|
||||
$output .= '<tr><td>'.$self->session->icon->delete("func=purgeRevision;revisionDate=".$date,$self->get("url"),$i18n->get("purge revision prompt")).'</td>
|
||||
<td><a href="'.$self->getUrl("func=viewRevision;revisionDate=".$date).'">'.$self->session->datetime->epochToHuman($date).'</a></td>
|
||||
$output .= '<tr><td>'
|
||||
.$self->session->icon->delete("func=purgeRevision;revisionDate=".$date,$self->get("url"),$i18n->get("purge revision prompt"))
|
||||
.$self->session->icon->view("func=viewRevision;revisionDate=".$date)
|
||||
.'</td>
|
||||
<td>'.$self->session->datetime->epochToHuman($date).'</td>
|
||||
<td>'.$by.'</td>
|
||||
<td><a href="'.$self->getUrl("op=manageRevisionsInTag;tagId=".$tagId).'">'.$tag.'</a></td>
|
||||
</tr>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue