Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Dec 29, 2020
2 parents 295a941 + 400a10f commit 0d1de9e
Show file tree
Hide file tree
Showing 21 changed files with 77 additions and 121 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<a name="1.6.0"></a>
# [1.6.0](https://github.com/flextype-plugins/admin) (2020-12-29)

### Features

* **core** update code base for new Flextype 0.9.14
* **core** Moving to PHP 7.4
* **core** use new TWIG Plugin 1.7.0

<a name="1.5.0"></a>
# [1.5.0](https://github.com/flextype-plugins/admin) (2020-12-20)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![preview](https://github.com/flextype-plugins/admin/raw/dev/preview.png)

<p align="center">
<a href="https://github.com/flextype-plugins/admin/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-plugins/admin.svg?label=version&color=black"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/github/downloads/flextype-plugins/admin/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype/flextype"><img src="https://img.shields.io/badge/Flextype-0.9.13-green.svg?color=black" alt="Flextype"></a> <a href="https://crowdin.com/project/flextype-plugin-admin"><img src="https://d322cqt584bo4o.cloudfront.net/flextype-plugin-admin/localized.svg?color=black" alt="Crowdin"></a> <a href="https://scrutinizer-ci.com/g/flextype-plugins/admin?branch=dev&color=black"><img src="https://img.shields.io/scrutinizer/g/flextype-plugins/admin.svg?branch=dev&color=black" alt="Quality Score"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&colorB=728ADA&label=Discord%20Chat" alt="Discord"></a>
<a href="https://github.com/flextype-plugins/admin/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-plugins/admin.svg?label=version&color=black"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-plugins/admin"><img src="https://img.shields.io/github/downloads/flextype-plugins/admin/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype/flextype"><img src="https://img.shields.io/badge/Flextype-0.9.14-green.svg?color=black" alt="Flextype"></a> <a href="https://crowdin.com/project/flextype-plugin-admin"><img src="https://d322cqt584bo4o.cloudfront.net/flextype-plugin-admin/localized.svg?color=black" alt="Crowdin"></a> <a href="https://scrutinizer-ci.com/g/flextype-plugins/admin?branch=dev&color=black"><img src="https://img.shields.io/scrutinizer/g/flextype-plugins/admin.svg?branch=dev&color=black" alt="Quality Score"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&colorB=728ADA&label=Discord%20Chat" alt="Discord"></a>
</p>

Admin Panel plugin for Flextype.
Expand All @@ -14,7 +14,7 @@ The following dependencies need to be installed for Form Admin Plugin.

| Item | Version | Download |
|---|---|---|
| [flextype](https://github.com/flextype/flextype) | 0.9.13 | [download](https://github.com/flextype/flextype/releases) |
| [flextype](https://github.com/flextype/flextype) | 0.9.14 | [download](https://github.com/flextype/flextype/releases) |
| [twig](https://github.com/flextype-plugins/twig) | >=1.0.0 | [download](https://github.com/flextype-plugins/twig/releases) |
| [form](https://github.com/flextype-plugins/form) | >=1.0.0 | [download](https://github.com/flextype-plugins/form/releases) |
| [form-admin](https://github.com/flextype-plugins/form-admin) | >=1.0.0 | [download](https://github.com/flextype-plugins/form-admin/releases) |
Expand Down
8 changes: 0 additions & 8 deletions app/Controllers/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@

class EntriesController
{
/**
* __construct
*/
public function __construct()
{

}

/**
* Get Entry ID
*
Expand Down
9 changes: 0 additions & 9 deletions app/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@

class SettingsController
{

/**
* __construct
*/
public function __construct()
{

}

/**
* Index page
*
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"issues": "https://github.com/flextype/issues"
},
"require": {
"php": ">=7.3.0",
"php": ">=7.4.0",
"flextype-components/number" : "*",
"flextype-components/arrays" : "3.0.1",
"flextype-components/filesystem": "2.0.8"
Expand All @@ -25,7 +25,7 @@
"apcu-autoloader": true,
"optimize-autoloader": true,
"platform": {
"php": "7.3.0"
"php": "7.4.0"
}
},
"autoload": {
Expand Down
59 changes: 12 additions & 47 deletions dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,50 +50,15 @@
array_merge($_admin_js,
['project/plugins/admin/assets/dist/js/admin-vendor-build.min.js']));

flextype()->container()['DashboardController'] = static function () {
return new DashboardController();
};

flextype()->container()['SettingsController'] = static function () {
return new SettingsController();
};

flextype()->container()['PluginsController'] = static function () {
return new PluginsController();
};

flextype()->container()['EntriesController'] = static function () {
return new EntriesController();
};

flextype()->container()['ToolsController'] = static function () {
return new ToolsController();
};

flextype()->container()['ApiController'] = static function () {
return new ApiController();
};

flextype()->container()['ApiEntriesController'] = static function () {
return new ApiEntriesController();
};

flextype()->container()['ApiFilesController'] = static function () {
return new ApiFilesController();
};

flextype()->container()['ApiFoldersController'] = static function () {
return new ApiFoldersController();
};

flextype()->container()['ApiImagesController'] = static function () {
return new ApiImagesController();
};

flextype()->container()['ApiAccessController'] = static function () {
return new ApiAccessController();
};

flextype()->container()['ApiRegistryController'] = static function () {
return new ApiRegistryController();
};
flextype()->container()['DashboardController'] = fn() => new DashboardController();
flextype()->container()['SettingsController'] = fn() => new SettingsController();
flextype()->container()['PluginsController'] = fn() => new PluginsController();
flextype()->container()['EntriesController'] = fn() => new EntriesController();
flextype()->container()['ToolsController'] = fn() => new ToolsController();
flextype()->container()['ApiController'] = fn() => new ApiController();
flextype()->container()['ApiEntriesController'] = fn() => new ApiEntriesController();
flextype()->container()['ApiFilesController'] = fn() => new ApiFilesController();
flextype()->container()['ApiFoldersController'] = fn() => new ApiFoldersController();
flextype()->container()['ApiImagesController'] = fn() => new ApiImagesController();
flextype()->container()['ApiAccessController'] = fn() => new ApiAccessController();
flextype()->container()['ApiRegistryController'] = fn() => new ApiRegistryController();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Admin",
"version": "1.5.0",
"description": "Admin theme for Flextype",
"homepage": "http://flextype.org",
"homepage": "https://flextype.org",
"author": "Sergey Romanenko",
"license": "MIT",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Admin
version: 1.5.0
version: 1.6.0
description: Admin Panel plugin for Flextype.
icon: fab fa-fort-awesome
author:
Expand All @@ -14,7 +14,7 @@ keywords: admin, panel, manager
license: MIT

dependencies:
flextype: 0.9.13
flextype: 0.9.14
twig: '>=1.0.0'
icon: '>=1.0.0'
form: '>=1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ entries:
accept_file_types: gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg

# Admin plugin priority
priority: 90
priority: 50

# Admin flextype menu
flextype_menu: []
6 changes: 3 additions & 3 deletions templates/content/entries/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<td class="w-1 text-center {% if entry.visibility == 'hidden' or entry.visibility == 'draft' or entry.routable == false %}opacity-50{% endif %}">
{% if entry.fieldset %}
{% set fieldset_path = PATH_PROJECT ~ '/fieldsets' ~ '/' ~ entry.fieldset ~ '.yaml' %}
{% if filesystem_has(fieldset_path) %}
{% set fieldset = yaml_decode(filesystem_read(fieldset_path)) %}
{% if filesystem().file(fieldset_path).exists() %}
{% set fieldset = flextype.serializers.yaml.decode(filesystem().file(fieldset_path).get()) %}
{% if fieldset.icon %}
<i class="icon">{{ icon(fieldset.icon) }}</i>
{% else %}
Expand All @@ -42,7 +42,7 @@
<td class="pl-0 {% if entry.visibility == 'hidden' or entry.visibility == 'draft' or entry.routable == false %}opacity-50{% endif %}">
<a href="{% if entry.has_children %}{{ path_for('admin.entries.index') }}?id={{ entry.id }}{% else %}{{ path_for('admin.entries.edit') }}?id={{ entry.id }}&type=editor{% endif %}">
{% if entry.fieldset %}
{% if filesystem_has(fieldset_path) %}
{% if filesystem().file(fieldset_path).exists() %}
{% if fieldset.default_field %}
{% if entry[fieldset.default_field] != '' %}
{{ entry[fieldset.default_field] }}
Expand Down
16 changes: 8 additions & 8 deletions templates/content/entries/media.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
{% set index = loop.index0 %}
<tr
id="file_{{ index }}"
data-direct-link="{{ url() }}/project/media/entries/{{ id }}/{{ filesystem_basename(file) }}"
{% if (filesystem_ext(file) in allowed_image_files) %}
data-direct-link="{{ url() }}/project/media/entries/{{ id }}/{{ filesystem().file(file).basename() }}"
{% if (filesystem().file(file).extension() in allowed_image_files) %}
data-images-api-link-state="true"
data-images-api-link="{{ url() }}/api/images/entries/{{ id }}/{{ filesystem_basename(file) }}?token={{ registry.get('flextype.settings.api.images.default_token') }}"
data-images-api-link="{{ url() }}/api/images/entries/{{ id }}/{{ filesystem().file(file).basename() }}?token={{ flextype.registry.get('flextype.settings.api.images.default_token') }}"
{% endif %}>
<td style="height: 64px;">
{{ filesystem_basename(file) }}
{{ filesystem().file(file).basename() }}
</td>
<td class="text-center flex justify-center" style="height: 64px;">
{% if (filesystem_ext(file) in allowed_image_files) %}
<img src="{{ url() }}/api/images/entries/{{ id }}/{{ filesystem_basename(file) }}?w=64&q=70&dpr=2&token={{ registry.get('flextype.settings.api.images.default_token') }}" alt="" class="border-2 rounded border-gray-200" style="height: 50px;">
{% if (filesystem().file(file).extension() in allowed_image_files) %}
<img src="{{ url() }}/api/images/entries/{{ id }}/{{ filesystem().file(file).basename() }}?w=64&q=70&dpr=2&token={{ flextype.registry.get('flextype.settings.api.images.default_token') }}" alt="" class="border-2 rounded border-gray-200" style="height: 50px;">
{% endif %}
</td>
<td class="text-right" style="height: 64px;">
Expand All @@ -60,7 +60,7 @@
</button>
<div id="dropdown-{{ index }}" class="dropdown">
<a class="dropdown__item js-snippets-info" href="javascript:;" onclick="event.preventDefault();
embededCode('{{ filesystem_basename(file) }}', {{ index }});">
embededCode('{{ filesystem().file(file).basename() }}', {{ index }});">
<i class="icon icon--white mr-3">{{ icon('fas fa-code') }}</i>
{{ tr('admin_embeded_code') }}</a>
<div class="dropdown__divider"></div>
Expand All @@ -71,7 +71,7 @@
<form id="delete-media-file-{{ index }}" action="{{ path_for('admin.entries.deleteMediaFileProcess') }}" method="POST" style="display: none;">
{{ csrf() }}
<input type="hidden" name="entry-id" value="{{ id }}">
<input type="hidden" name="media-id" value="{{ filesystem_basename(file) }}">
<input type="hidden" name="media-id" value="{{ filesystem().file(file).basename() }}">
</form>
</div>
</td>
Expand Down
Loading

0 comments on commit 0d1de9e

Please sign in to comment.