1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-19 11:21:30 +02:00

feat(admin-plugin): add ability for redirect to the editor after entries creating #339

This commit is contained in:
Awilum
2019-12-25 19:58:37 +03:00
parent 2b080ee455
commit 1d3d0cf27b
3 changed files with 17 additions and 2 deletions

View File

@@ -283,7 +283,12 @@ class EntriesController extends Controller
$this->flash->addMessage('error', __('admin_message_entry_was_not_created'));
}
return $response->withRedirect($this->router->pathFor('admin.entries.index') . '?id=' . $parent_entry_id);
if (isset($data['create-and-edit'])) {
return $response->withRedirect($this->router->pathFor('admin.entries.edit') . '?id=' . $data['id'] . '&type=editor');
} else {
return $response->withRedirect($this->router->pathFor('admin.entries.index') . '?id=' . $parent_entry_id);
}
}
/**

View File

@@ -306,3 +306,4 @@ admin_help_text_for_entry_label: "Entry title."
admin_help_text_for_entry_name: "Entry unique name in lowercase chars only."
admin_help_text_for_entry_type: "Entry type based on Fieldset."
admin_message_fieldset_not_found: "Fieldset not found"
admin_create_and_edit: "Create & Edit"

View File

@@ -39,7 +39,16 @@
</div>
</div>
<div class="form-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="btn btn-black">
<div class="btn-group custom-btn-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="btn btn-black">
<button type="button" class="btn dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown-item">
</div>
</div>
</div>
</div>
</div>