1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 02:41:27 +02:00

feat(admin-plugin): add ability to continue editing after saving in the editor #344

This commit is contained in:
Awilum
2020-02-15 12:48:12 +03:00
parent 5cf3d29178
commit a89f84b21b
8 changed files with 54 additions and 34 deletions

View File

@@ -208,7 +208,11 @@ class ApiController extends Controller
$this->flash->addMessage('error', __('admin_message_delvery_entries_api_token_was_not_created2'));
}
return $response->withRedirect($this->router->pathFor('admin.api_delivery_entries.index'));
if (isset($post_data['create-and-edit'])) {
return $response->withRedirect($this->router->pathFor('admin.api_delivery_entries.edit') . '?token=' . $api_token);
} else {
return $response->withRedirect($this->router->pathFor('admin.api_delivery_entries.index'));
}
}
/**

View File

@@ -41,13 +41,15 @@
</div>
</div>
</div>
<div class="btn-group custom-btn-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<button type="button" class="buttondropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown-item">
<div class="button-group">
<div class="button-dropdown">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<a href="javascript:;" class="button js-dropdown-btn" data-dropdown="dropdown-list-create-new-entry">
<i class="icon icon--white">{{ icon('fas fa-sort-down') }}</i>
</a>
<div id="dropdown-list-create-new-entry" class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown__item">
</div>
</div>
</div>
</form>

View File

@@ -10,7 +10,7 @@
{% else %}
{% set _entries = entries.fetch(entry.slug, {}) %}
{% set _entries_length = _entries | length %}
{% do
{% do
cache.save(entry.slug ~ '_counter', _entries_length) %}
{% endif %}
<div class="w-full md:w-3/12 lg:w-2/12 text-center p-4 relative">
@@ -145,7 +145,7 @@
{% else %}
{% set _entries = entries.fetch(entry.slug, {}) %}
{% set _entries_length = _entries | length %}
{% do
{% do
cache.save(entry.slug ~ '_counter', _entries_length) %}
{% endif %}
<a href="{% if _entries_length > 0 %}{{ path_for('admin.entries.index') }}?id={{ entry.slug }}{% else %}{{ path_for('admin.entries.edit') }}?id={{ entry.slug }}&type=editor{% endif %}">
@@ -290,4 +290,4 @@
});
}
</script>
{% endblock %}
{% endblock %}

View File

@@ -35,15 +35,17 @@
</div>
</div>
<div class="button-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<button type="button" class="buttondropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown-item">
<div class="button-dropdown">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<a href="javascript:;" class="button js-dropdown-btn" data-dropdown="dropdown-list-create-new-fieldset">
<i class="icon icon--white">{{ icon('fas fa-sort-down') }}</i>
</a>
<div id="dropdown-list-create-new-fieldset" class="dropdown">
<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>
</form>
{% endblock %}
{% endblock %}

View File

@@ -11,12 +11,14 @@
<small>{{ tr('admin_help_text_for_snippets_name') }}</small>
</div>
<div class="button-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<button type="button" class="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown-item">
<div class="button-dropdown">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<a href="javascript:;" class="button js-dropdown-btn" data-dropdown="dropdown-list-create-new-snippet">
<i class="icon icon--white">{{ icon('fas fa-sort-down') }}</i>
</a>
<div id="dropdown-list-create-new-snippet" class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown__item">
</div>
</div>
</div>
</div>

View File

@@ -80,8 +80,8 @@
<br>
<label for="template_code">{{ tr('admin_template_code') }}</label>
<div id="template_code" class="form-control text-left">
<span id="html">&lcub;&lcub; snippets.exec('<span class="js-snippets-snippet-placeholder"></span>') &rcub;&rcub;</span>
<button class="js-clipboard-btn button" data-clipboard-target="#html">
<span id="template_code_html">&lcub;&lcub; snippets.exec('<span class="js-snippets-snippet-placeholder"></span>') &rcub;&rcub;</span>
<button class="js-clipboard-btn button" data-clipboard-text="">
{{ tr('admin_copy') }}
</button>
</div>

View File

@@ -5,7 +5,7 @@
{{ csrf() }}
<input type="hidden" name="theme" value="{{ theme }}">
<div class="flex row">
<div class="w-full lg:w-4/12">
<div class="col w-full lg:w-4/12">
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
@@ -19,12 +19,14 @@
</select>
</div>
<div class="button-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<button type="button" class="buttondropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown-item">
<div class="button-dropdown">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<a href="javascript:;" class="button js-dropdown-btn" data-dropdown="dropdown-list-create-new-template">
<i class="icon icon--white">{{ icon('fas fa-sort-down') }}</i>
</a>
<div id="dropdown-list-create-new-template" class="dropdown">
<input type="submit" id="create-and-edit" name="create-and-edit" value="{{ tr('admin_create_and_edit') }}" class="dropdown__item">
</div>
</div>
</div>
</div>

View File

@@ -39,7 +39,15 @@
</select>
</div>
<div class="button-group">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button mr-3">
<div class="button-dropdown">
<input type="submit" id="create" name="create" value="{{ tr('admin_create') }}" class="button">
<a href="javascript:;" class="button js-dropdown-btn" data-dropdown="dropdown-list-create-new-token">
<i class="icon icon--white">{{ icon('fas fa-sort-down') }}</i>
</a>
<div id="dropdown-list-create-new-token" class="dropdown">
<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>