Added:
- settings form - manga upload directory - ContentSource export/import
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
{# Modal panel #}
|
||||
<div class="inline-block align-bottom bg-white rounded-sm text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle {{ modalClass|default('sm:max-w-lg') }} sm:w-full">
|
||||
<div {% if stimulus is defined %} data-controller="{{ stimulus }}" {% endif %} class="inline-block align-bottom bg-white rounded-sm text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle {{ modalClass|default('sm:max-w-lg') }} sm:w-full">
|
||||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title">
|
||||
{{ title }}
|
||||
|
||||
62
templates/settings/folders.html.twig
Normal file
62
templates/settings/folders.html.twig
Normal file
@@ -0,0 +1,62 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Application Settings{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-4">
|
||||
<div class="bg-white shadow-lg rounded-sm overflow-hidden">
|
||||
<div class="bg-gray-800 text-white p-4">
|
||||
<h1 class="text-2xl font-bold">
|
||||
<i class="fas fa-cog mr-2"></i>Application Settings
|
||||
</h1>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
{{ form_start(form, {'attr': {'class': 'space-y-6'}}) }}
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.mangaDirectory, 'Manga Directory', {'label_attr': {'class': 'block text-sm font-medium text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(form.mangaDirectory, {'attr': {
|
||||
'class': 'mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
|
||||
'placeholder': '/path/to/manga/directory'
|
||||
}}) }}
|
||||
{{ form_errors(form.mangaDirectory) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.imageDirectory, 'Image Directory', {'label_attr': {'class': 'block text-sm font-medium text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(form.imageDirectory, {'attr': {
|
||||
'class': 'mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
|
||||
'placeholder': '/path/to/image/directory'
|
||||
}}) }}
|
||||
{{ form_errors(form.imageDirectory) }}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between mt-6">
|
||||
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
|
||||
Save Settings
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 bg-white shadow-lg rounded-sm overflow-hidden">
|
||||
<div class="bg-gray-800 text-white p-4">
|
||||
<h2 class="text-xl font-bold">
|
||||
<i class="fas fa-info-circle mr-2"></i>Current Settings
|
||||
</h2>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Manga Directory</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ form.mangaDirectory.vars.value }}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Image Directory</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ form.imageDirectory.vars.value }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,9 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block toolbar %}
|
||||
{% if toolbar is defined %}
|
||||
<twig:Toolbar toolbar="{{ toolbar }}"/>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block title %}Scrapper Configurations{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
@@ -8,13 +12,15 @@
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{% for contentSource in contentSources %}
|
||||
<div class="relative flex flex-col justify-between bg-white rounded-sm border border-gray-200 shadow-md hover:shadow-lg transition-shadow duration-300 h-full group">
|
||||
<div
|
||||
class="relative flex flex-col justify-between bg-white rounded-sm border border-gray-200 shadow-md hover:shadow-lg transition-shadow duration-300 h-full group">
|
||||
<div class="p-4">
|
||||
<div class="flex flex-row items-center justify-between mb-2">
|
||||
<h5 class="text-xl tracking-tight text-gray-900 truncate flex-grow">
|
||||
{{ contentSource.baseUrl|replace({'http://': '', 'https://': ''})|trim('/', 'right') }}
|
||||
</h5>
|
||||
<a href="{{ contentSource.baseUrl }}" target="_blank" rel="noopener noreferrer" class="text-gray-400 hover:text-green-600 ml-2 z-10">
|
||||
<a href="{{ contentSource.baseUrl }}" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-green-600 ml-2 z-10">
|
||||
<i class="fas fa-external-link-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -29,13 +35,15 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ path('app_settings_scrappers', {'id': contentSource.id}) }}" class="absolute inset-0 z-0">
|
||||
<a href="{{ path('app_settings_scrappers', {'id': contentSource.id}) }}"
|
||||
class="absolute inset-0 z-0">
|
||||
<span class="sr-only">Edit configuration</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<a href="{{ path('app_settings_scrappers') }}" class="block p-6 bg-white rounded-sm border border-gray-200 shadow-md hover:bg-gray-100 flex items-center justify-center h-full">
|
||||
<a href="{{ path('app_settings_scrappers') }}"
|
||||
class="block p-6 bg-white rounded-sm border border-gray-200 shadow-md hover:bg-gray-100 flex items-center justify-center h-full">
|
||||
<div class="text-center">
|
||||
<i class="fas fa-plus text-4xl text-gray-400 mb-2"></i>
|
||||
<p class="text-gray-600">Add New Configuration</p>
|
||||
@@ -43,4 +51,31 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<twig:Modal
|
||||
openTrigger="openScrapperModal"
|
||||
closeTrigger="closeScrapperModal"
|
||||
title="Import/Export Scrapper Configurations"
|
||||
modalClass="w-full max-w-4xl"
|
||||
stimulus="scrapper_import"
|
||||
>
|
||||
{% block content %}
|
||||
<div {{ stimulus_controller('scrapper_import') }}>
|
||||
<div class="space-y-4 overflow-y-auto px-4">
|
||||
<textarea data-scrapper-import-target="textarea" rows="15"
|
||||
class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-green-500"></textarea>
|
||||
</div>
|
||||
<button type="button" data-action="modal#close"
|
||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
<button data-scrapper-import-target="submitButton" type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
</twig:Modal>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user