Skip to content

Commit

Permalink
[Backoffice] Redirect to dashboard after deleting.
Browse files Browse the repository at this point in the history
Closes #93
  • Loading branch information
NoUseFreak committed Apr 6, 2015
1 parent ff16377 commit 4ba3443
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,13 @@ public function deleteAction($id, Request $request)
->add('success', sprintf('You deleted "%s"!', $title));
}

return $this->redirect($this->getListUrl());
if ($request->query->has('_return')) {
$redirectUrl = $this->generateUrl($request->query->get('_return'));
} else {
$redirectUrl = $this->getListUrl();
}

return $this->redirect($redirectUrl);
}

$module = $this->getModule($this->getType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li role="presentation"><a href="#mycontent" aria-controls="mycontent" role="tab" data-toggle="tab">{{ 'dashboard.my_content'|trans }}</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="recent">
<div role="tabpanel" class="tab-pane active" id="recent">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
Expand All @@ -30,7 +30,7 @@
<tr>
<td>
<a class="btn btn-success btn-xs" href="{{ path('clastic_node_form', {type: node.type, id: node.id}) }}"><i class="fa fa-pencil"></i></a>
<a class="btn btn-danger btn-xs" href="{{ path('clastic_node_delete', {type: node.type, id: node.id}) }}"><i class="fa fa-trash"></i></a>
<a class="btn btn-danger btn-xs" href="{{ path('clastic_node_delete', {type: node.type, id: node.id, _return: 'clastic_backoffice_dashboard'}) }}"><i class="fa fa-trash"></i></a>
</td>
<td>{{ node.title }} <span class="label label-default pull-right">{{ moduleManager.getModule(node.type).name }}</span></td>
<td>{{ node.user.username }}</td>
Expand All @@ -53,7 +53,7 @@
</table>
</div>
</div>
<div role="tabpanel" class="tab-pane active" id="mycontent">
<div role="tabpanel" class="tab-pane" id="mycontent">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
Expand All @@ -70,7 +70,7 @@
<tr>
<td>
<a class="btn btn-success btn-xs" href="{{ path('clastic_node_form', {type: node.type, id: node.id}) }}"><i class="fa fa-pencil"></i></a>
<a class="btn btn-danger btn-xs" href="{{ path('clastic_node_delete', {type: node.type, id: node.id}) }}"><i class="fa fa-trash"></i></a>
<a class="btn btn-danger btn-xs" href="{{ path('clastic_node_delete', {type: node.type, id: node.id, _return: 'clastic_backoffice_dashboard'}) }}"><i class="fa fa-trash"></i></a>
</td>
<td>{{ node.title }} <span class="label label-default pull-right">{{ moduleManager.getModule(node.type).name }}</span></td>
<td>{{ node.user.username }}</td>
Expand Down

0 comments on commit 4ba3443

Please sign in to comment.