1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-20 20:01:37 +02:00

feat(admin-plugin): update dropdowns #211

This commit is contained in:
Awilum
2020-01-30 12:14:16 +03:00
parent d5d2253aae
commit 2d74defecd
8 changed files with 25 additions and 25 deletions

View File

@@ -10,14 +10,14 @@
{% 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">
<button type="button" class="js-dropdown-btn" style="top: 16px; right: 16px; position: absolute; z-index: 10; width: 34px; height: 34px;">
<button type="button" class="js-dropdown-btn" style="top: 16px; right: 16px; position: absolute; z-index: 10; width: 34px; height: 34px;" data-dropdown="dropdown-{{ entry.slug }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ entry.slug }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.entries.edit') }}?id={{ entry.slug }}&type=editor">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
@@ -149,7 +149,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 %}">
@@ -186,10 +186,10 @@
{{ entry.published_at }}
</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn relative">
<button type="button" class="js-dropdown-btn relative" data-dropdown="dropdown-{{ entry.slug }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ entry.slug }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.entries.edit') }}?id={{ entry.slug }}&type=editor">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
@@ -277,4 +277,4 @@
</div>
</div>
</div>
{% endblock %}
{% endblock %}

View File

@@ -21,10 +21,10 @@
<a href="{{ path_for('admin.fieldsets.edit') }}?id={{ id }}">{{ title }}</a>
</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ id }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ id }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.fieldsets.edit') }}?id={{ id }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
@@ -61,4 +61,4 @@
<a href="{{ path_for('admin.fieldsets.add') }}" class="btn">{{ tr('admin_create_new_fieldset') }}</a>
</div>
{% endif %}
{% endblock %}
{% endblock %}

View File

@@ -34,10 +34,10 @@
<td class="{% if plugin.enabled == false %}opacity-50{% endif %}">{{ plugin.description }}</td>
<td class="{% if plugin.enabled == false %}opacity-50{% endif %}">{{ plugin.version }}</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ key }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ key }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.plugins.information') }}?id={{ key }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-info-circle') }}</i>
{{ tr('admin_information') }}</a>

View File

@@ -13,10 +13,10 @@
<a href="{{ path_for('admin.snippets.edit') }}?id={{ id }}">{{ id }}</a>
</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ id }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ id }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.snippets.edit') }}?id={{ id }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
@@ -97,4 +97,4 @@
$('.js-snippets-php-placeholder').html($(this).attr('data-name'));
});
</script>
{% endblock %}
{% endblock %}

View File

@@ -13,10 +13,10 @@
<a href="{{ path_for('admin.templates.index') }}?theme={{ key }}">{{ theme.name }}</a>
</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ key }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ key }}" class="dropdown">
{% if key == registry.settings.theme %}
{% else %}
<a class="dropdown__item" href="javascript:;" onclick="event.preventDefault();

View File

@@ -16,10 +16,10 @@
</td>
<td>{{ tr('admin_template') }}</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ template.basename }}-{{ theme }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ template.basename }}-{{ theme }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.templates.edit') }}?id={{ template.basename }}&type=template&theme={{ theme }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
@@ -56,17 +56,17 @@
{% for partial in partials_list %}
<tr>
<td class="w-1 text-center">
<i class="far fa-file-code"></i>
<i class="icon">{{ icon('far fa-file-code') }}</i>
</td>
<td class="pl-0">
<a href="{{ path_for('admin.templates.edit') }}?id={{ partial.basename }}&type=partial&theme={{ theme }}">{{ partial.basename }}</a>
</td>
<td>{{ tr('admin_partial') }}</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ template.basename }}-{{ theme }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ template.basename }}-{{ theme }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.templates.edit') }}?id={{ partial.basename }}&type=partial&theme={{ theme }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>

View File

@@ -49,4 +49,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}

View File

@@ -37,10 +37,10 @@
{% else %}&infin;{% endif %}
</td>
<td class="text-right">
<button type="button" class="js-dropdown-btn">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ api }}-{{ token.dirname }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div class="js-dropdown dropdown">
<div id="dropdown-{{ api }}-{{ token.dirname }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.api_tokens.edit') }}?api={{ api }}&api_token={{ token.dirname }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}