Skip to content

Commit

Permalink
Admin 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Dec 29, 2020
1 parent 5b205f1 commit 400a10f
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 120 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
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
38 changes: 19 additions & 19 deletions templates/partials/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ registry.get('flextype.settings.locale') }}">
<html lang="{{ flextype.registry.get('flextype.settings.locale') }}">
<head>
{% block head %}
<meta charset="utf-8">
Expand All @@ -9,25 +9,25 @@
<meta name="robots" content="noindex,nofollow">

{% do
emitter.emit('onAdminThemeMeta') %}
flextype.emitter.emit('onAdminThemeMeta') %}

<title>FLEXTYPE</title>

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

{% for css in registry.get('assets.admin.css') %}
{% for css in flextype.registry.get('assets.admin.css') %}
{% if css %}
<link href="{{ url() }}/{{ css }}" rel="stylesheet">
{% endif %}
{% endfor %}

{% do
emitter.emit('onAdminThemeHeader') %}
flextype.emitter.emit('onAdminThemeHeader') %}
{% endblock %}
</head>
<body>
<main>
<nav class="navigation {% if not acl.isUserLoggedInRolesIn('admin') %}hidden{% endif %}">
<nav class="navigation {% if not flextype.acl.isUserLoggedInRolesIn('admin') %}hidden{% endif %}">
<ul>
<li class="navigation__item--logo-wrapper">
<a href="javascript:;" class="navigation__item navigation__item--logo navigation__item--flextype-logo relative">
Expand All @@ -37,8 +37,8 @@
<i class="icon icon--white">{{ icon('fas fa-bars') }}</i>
</a>
<div id="dropdown-flextype-menu" class="dropdown">
{% if(registry.has('plugins.admin.settings.flextype_menu')) %}
{% for flextype_menu in registry.get('plugins.admin.settings.flextype_menu') %}
{% if(flextype.registry.has('plugins.admin.settings.flextype_menu')) %}
{% for flextype_menu in flextype.registry.get('plugins.admin.settings.flextype_menu') %}
<a class="dropdown__item"
target="{% if (flextype_menu.link.is_external) %}_blank{% else %}_self{% endif %}"
href="{% if (flextype_menu.link.is_external) %}{{ flextype_menu.link.url }}{% else %}{{ path_for(flextype_menu.link.service) }}{% endif %}">
Expand All @@ -59,35 +59,35 @@
</form>
</div>
</li>
{% if registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in registry.get('plugins.admin.settings.navigation.content') %}
{% if flextype.registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in flextype.registry.get('plugins.admin.settings.navigation.content') %}
<li>
<a data-tippy-content="{{ item.title|raw }}" href="{{ url() }}{{ item.link|raw }}" class="js-nav navigation__item {% if key == menu_item %}navigation__item--active{% endif %}">
<i class="icon icon--white">{{ icon(item.icon) }}</i>
</a>
</li>
{% endfor %}
{% endif %}
{% if registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in registry.get('plugins.admin.settings.navigation.extends') %}
{% if flextype.registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in flextype.registry.get('plugins.admin.settings.navigation.extends') %}
<li>
<a data-tippy-content="{{ item.title|raw }}" href="{{ url() }}{{ item.link|raw }}" class="js-nav navigation__item {% if key == menu_item %}navigation__item--active{% endif %}">
<i class="icon icon--white">{{ icon(item.icon) }}</i>
</a>
</li>
{% endfor %}
{% endif %}
{% if registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in registry.get('plugins.admin.settings.navigation.system') %}
{% if flextype.registry.has('plugins.admin.settings.navigation.system') %}
{% for key, item in flextype.registry.get('plugins.admin.settings.navigation.system') %}
<li>
<a data-tippy-content="{{ item.title|raw }}" href="{{ url() }}{{ item.link|raw }}" class="js-nav navigation__item {% if key == menu_item %}navigation__item--active{% endif %}">
<i class="icon icon--white">{{ icon(item.icon) }}</i>
</a>
</li>
{% endfor %}
{% endif %}
{% if registry.has('plugins.admin.settings.navigation.information') %}
{% for key, item in registry.get('plugins.admin.settings.navigation.information') %}
{% if flextype.registry.has('plugins.admin.settings.navigation.information') %}
{% for key, item in flextype.registry.get('plugins.admin.settings.navigation.information') %}
<li>
<a data-tippy-content="{{ item.title|raw }}" href="{{ item.link|raw }}" class="js-nav navigation__item {% if key == menu_item %}navigation__item--active{% endif %}">
<i class="icon icon--white">{{ icon(item.icon) }}</i>
Expand All @@ -97,8 +97,8 @@
{% endif %}
</ul>
</nav>
<div class="content {% if not acl.isUserLoggedInRolesIn('admin') %}w-full max-w-full m-0{% endif %}">
<div class="bars clearfix {% if not acl.isUserLoggedInRolesIn('admin') %}hidden{% endif %}">
<div class="content {% if not flextype.acl.isUserLoggedInRolesIn('admin') %}w-full max-w-full m-0{% endif %}">
<div class="bars clearfix {% if not flextype.acl.isUserLoggedInRolesIn('admin') %}hidden{% endif %}">
<div class="navigation-top-primary">
{% if links %}
<div class="lg:w-auto block float-left">
Expand Down Expand Up @@ -307,7 +307,7 @@
</div>
</main>

{% for js in registry.get('assets.admin.js') %}
{% for js in flextype.registry.get('assets.admin.js') %}
{% if js %}
<script type="text/javascript" src="{{ url() }}/{{ js }}"></script>
{% endif %}
Expand All @@ -322,7 +322,7 @@
{% include "plugins/admin/templates/partials/modules/filepicker.html" %}

{% do
emitter.emit('onAdminThemeTail') %}
flextype.emitter.emit('onAdminThemeTail') %}

{% block tail %}{% endblock %}
</body>
Expand Down
Loading

0 comments on commit 400a10f

Please sign in to comment.