fix new service + show plugin page

*now new service working with draft
*now show button to redirect to core plugin custom page
This commit is contained in:
Jordan Blasenhauer 2024-01-30 14:51:41 +01:00
parent 137b5ed4bb
commit 983355bcea
4 changed files with 32 additions and 9 deletions

View file

@ -228,7 +228,7 @@ include "plugins_modal.html" %}
{% if plugin['page']%}
<a
aria-label="plugin page link"
class="hover:-translate-y-px"
class="hover:-translate-y-px mx-1"
href="{{request.url_root}}plugins?plugin_id={{plugin['id']}}"
>
<svg

View file

@ -1,8 +1,9 @@
{% extends "base.html" %} {% block content %}
<!-- actions -->
<div
<div data-services-service
class="col-span-12 relative flex justify-center min-w-0 break-words rounded-2xl bg-clip-border"
>
<div data-is-draft class="hidden" data-value="no"></div>
<button
data-services-action="new"
data-services-name="service"

View file

@ -9,10 +9,10 @@
class="overflow-y-auto mx-0 sm:mx-6 lg:mx-8 my-3 px-4 pt-4 pb-8 w-full sm:min-w-[500px] h-[90vh] flex flex-col break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border"
>
<div class="w-full flex justify-between mb-2">
<div class="flex justify-start items-end">
<div class="flex justify-start items-start">
<p
data-services-modal-title
class="transition duration-300 ease-in-out dark:opacity-90 dark:text-gray-200 mb-2 font-sans font-semibold leading-normal uppercase text-md"
class="transition duration-300 ease-in-out dark:opacity-90 dark:text-gray-200 mb-1 font-sans font-semibold leading-normal uppercase text-md"
>
SERVICE MODAL
</p>

View file

@ -3,6 +3,7 @@
{% set global_config = config["CONFIG"].get_config() %}
{% set plugins = config["CONFIG"].get_plugins() %}
<!-- plugin item -->
{% for plugin in plugins %}
<div
@ -12,11 +13,31 @@ data-plugin-item="{{plugin['id']}}"
>
<!-- title and desc -->
<div class="col-span-12" data-setting-header>
<h5
class="transition duration-300 ease-in-out ml-2 font-bold text-md uppercase dark:text-white/90 mb-0"
>
{{plugin['name']}} <span>{{plugin['version']}}</span>
</h5>
<div class="flex justify-start items-center">
<h5
class="transition duration-300 ease-in-out ml-2 font-bold text-md uppercase dark:text-white/90 mb-0"
>
{{plugin['name']}} <span>{{plugin['version']}}</span>
</h5>
{% if plugin['page']%}
<a
target="_blank"
aria-label="plugin page link"
class="hover:-translate-y-px mx-2"
href="{{request.url_root}}plugins?plugin_id={{plugin['id']}}"
>
<svg
class="h-5 w-5 fill-sky-500 dark dark:brightness-90"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
>
<path
d="M288 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h50.7L169.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 141.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H288zM80 64C35.8 64 0 99.8 0 144V400c0 44.2 35.8 80 80 80H336c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v80c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16h80c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"
></path>
</svg>
</a>
{%endif%}
</div>
<div
class="transition duration-300 ease-in-out dark:opacity-90 ml-2 text-sm mb-2 dark:text-gray-400"
>
@ -29,6 +50,7 @@ data-plugin-item="{{plugin['id']}}"
{% for setting, value in plugin["settings"].items() %}{% if setting != "IS_LOADING" and current_endpoint
== "global-config" and value['context'] == "global" and not value['multiple'] or current_endpoint ==
"services" and value['context'] == "multisite" and not value['multiple'] %}
<div data-setting-container
class="mx-0 sm:mx-4 my-2 col-span-12 md:mx-6 md:my-3 md:col-span-6 2xl:mx-6 2xl:my-3 2xl:col-span-4"
id="form-edit-{{current_endpoint}}-{{ value["id"] }}">