added plugin screen (#671)
This commit is contained in:
@@ -222,3 +222,25 @@
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro plugins(view) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% set actions = {'shop': {'url': constant('App\\Constants::HOMEPAGE') ~ '/store/', 'target': '_blank'}} %}
|
||||
|
||||
{% set event = trigger('actions.plugins', {'actions': actions, 'view': view}) %}
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro plugin(plugin, view) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% set actions = {'home': {'url': plugin.metadata.homepage, 'target': '_blank'}} %}
|
||||
|
||||
{% set event = trigger('actions.plugin', {'actions': actions, 'view': view}) %}
|
||||
{% if view == 'index' %}
|
||||
{{ widgets.button_group(event.payload.actions) }}
|
||||
{% else %}
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
{% set modal = null %}
|
||||
{% set toggle = null %}
|
||||
{% set url = null %}
|
||||
{% set target = null %}
|
||||
{% set class = "btn btn-default btn-" ~ icon ~ " " %}
|
||||
|
||||
{% if not values is iterable %}
|
||||
@@ -173,6 +174,7 @@
|
||||
{% set onclick = values.onclick ?? null %}
|
||||
{% set modal = values.modal ?? null %}
|
||||
{% set toggle = values.toggle ?? null %}
|
||||
{% set target = values.target ?? null %}
|
||||
{% set id = values.id ?? null %}
|
||||
{% set class = class ~ ( values.class | default("")) %}
|
||||
{% endif %}
|
||||
@@ -190,6 +192,9 @@
|
||||
{%- if onclick is not empty -%}
|
||||
onclick="{{ onclick }}"
|
||||
{%- endif -%}
|
||||
{%- if target is not empty -%}
|
||||
target="{{ target }}"
|
||||
{%- endif -%}
|
||||
>{{ macro.icon(icon) }}</a>
|
||||
{% endfor -%}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user