sparkles: Correctifs divers :
- Renommage "rôle de dossier" - Ajout illustation homepage - Ajout footer - Francisation Cloud et Uploader - Ajout "S" manquant Action - Ajout lien utiles homepage - Fix title bouton permission - Fix redirection admin - Fix Rename Parent Directory - Remplacement Dropzone par Input file standard
This commit is contained in:
parent
e5f7d5a721
commit
f3dcd7b37c
7
.env
7
.env
@ -40,5 +40,10 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
|||||||
MAILER_DSN=null://null
|
MAILER_DSN=null://null
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
|
||||||
BASE_PREFIX=kumora
|
BASE_PREFIX=
|
||||||
DEFAULT_IMAGE=https://camelia-studio.org/v5/images/camelia_studio.png
|
DEFAULT_IMAGE=https://camelia-studio.org/v5/images/camelia_studio.png
|
||||||
|
APP_VERSION=1.0.0
|
||||||
|
GIT_URL=https://git.crystalyx.net/camelia-studio/Kumora
|
||||||
|
CAMELIA_URL=https://camelia-studio.org/
|
||||||
|
TSUBAKIMONO_URL=https://tsubakimono.camelia-studio.org/
|
||||||
|
DISCORD_URL=https://discord.gg/nBuZ9vJ
|
||||||
|
@ -360,7 +360,6 @@ class FilesController extends AbstractController
|
|||||||
public function renameDirectory(#[MapQueryParameter('path')] string $filepath, Request $request, Filesystem $defaultAdapter): Response
|
public function renameDirectory(#[MapQueryParameter('path')] string $filepath, Request $request, Filesystem $defaultAdapter): Response
|
||||||
{
|
{
|
||||||
$filepath = $this->normalizePath($filepath);
|
$filepath = $this->normalizePath($filepath);
|
||||||
$this->getUser();
|
|
||||||
|
|
||||||
$realPath = explode('/', $filepath);
|
$realPath = explode('/', $filepath);
|
||||||
$parentDir = $this->parentDirectoryRepository->findOneBy(['name' => $realPath[0]]);
|
$parentDir = $this->parentDirectoryRepository->findOneBy(['name' => $realPath[0]]);
|
||||||
@ -387,6 +386,13 @@ class FilesController extends AbstractController
|
|||||||
|
|
||||||
$newPath = dirname($filepath) . '/' . $newName;
|
$newPath = dirname($filepath) . '/' . $newName;
|
||||||
|
|
||||||
|
// Si c'est un parent directory, on renomme le parent directory dans la base de données
|
||||||
|
if ($parentDir->getName() === $filepath) {
|
||||||
|
$parentDir->setName($newName);
|
||||||
|
$this->entityManager->persist($parentDir);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
$defaultAdapter->move($filepath, $newPath);
|
$defaultAdapter->move($filepath, $newPath);
|
||||||
|
|
||||||
$this->addFlash('success', 'Le dossier a bien été renommé.');
|
$this->addFlash('success', 'Le dossier a bien été renommé.');
|
||||||
@ -415,14 +421,14 @@ class FilesController extends AbstractController
|
|||||||
$this->getUser();
|
$this->getUser();
|
||||||
|
|
||||||
if ('' === $path) {
|
if ('' === $path) {
|
||||||
throw $this->createNotFoundException("Vous ne pouvez pas uploader de fichier à la racine !");
|
throw $this->createNotFoundException("Vous ne pouvez pas téléverser de fichier à la racine !");
|
||||||
}
|
}
|
||||||
|
|
||||||
$realPath = explode('/', $path);
|
$realPath = explode('/', $path);
|
||||||
$parentDir = $this->parentDirectoryRepository->findOneBy(['name' => $realPath[0]]);
|
$parentDir = $this->parentDirectoryRepository->findOneBy(['name' => $realPath[0]]);
|
||||||
|
|
||||||
if (null === $parentDir || !$this->isGranted('file_write', $parentDir)) {
|
if (null === $parentDir || !$this->isGranted('file_write', $parentDir)) {
|
||||||
throw $this->createNotFoundException("Vous n'avez pas le droit d'uploader des fichiers dans ce dossier !");
|
throw $this->createNotFoundException("Vous n'avez pas le droit de téléverser des fichiers dans ce dossier !");
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->createForm(UploadType::class);
|
$form = $this->createForm(UploadType::class);
|
||||||
|
@ -16,7 +16,7 @@ class UploadType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('files', DropzoneType::class, [
|
->add('files', FileType::class, [
|
||||||
'label' => 'Fichiers à envoyer',
|
'label' => 'Fichiers à envoyer',
|
||||||
'attr' => [
|
'attr' => [
|
||||||
'placeholder' => 'Déposez vos fichiers ici',
|
'placeholder' => 'Déposez vos fichiers ici',
|
||||||
@ -24,7 +24,7 @@ class UploadType extends AbstractType
|
|||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
])
|
])
|
||||||
->add('submit', SubmitType::class, [
|
->add('submit', SubmitType::class, [
|
||||||
'label' => 'Uploader',
|
'label' => 'Téléverser',
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
20
src/Twig/Extension/EnvironmentExtension.php
Normal file
20
src/Twig/Extension/EnvironmentExtension.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Twig\Extension;
|
||||||
|
|
||||||
|
use App\Twig\Runtime\EnvironmentExtensionRuntime;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFilter;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
|
class EnvironmentExtension extends AbstractExtension
|
||||||
|
{
|
||||||
|
public function getFunctions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
new TwigFunction('get_env', [EnvironmentExtensionRuntime::class, 'getEnv']),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
15
src/Twig/Runtime/EnvironmentExtensionRuntime.php
Normal file
15
src/Twig/Runtime/EnvironmentExtensionRuntime.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Twig\Runtime;
|
||||||
|
|
||||||
|
use Twig\Extension\RuntimeExtensionInterface;
|
||||||
|
|
||||||
|
class EnvironmentExtensionRuntime implements RuntimeExtensionInterface
|
||||||
|
{
|
||||||
|
public function getEnv(string $value, string $default = ''): string
|
||||||
|
{
|
||||||
|
return $_ENV[$value] ?? $default;
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
{% extends 'base-admin.html.twig' %}
|
{% extends 'base-admin.html.twig' %}
|
||||||
|
|
||||||
{% block title %}Le cloud de Camélia-Studio{% endblock %}
|
{% block title %}Le disque nuagique de Camélia-Studio{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="min-h-96 flex items-center flex-col justify-center">
|
<div class="min-h-96 flex items-center flex-col justify-center">
|
||||||
<h1 class="text-4xl font-bold mb-2 text-gray-900 dark:text-white">Bienvenue sur l'administration</h1>
|
<h1 class="text-4xl font-bold mb-2 text-gray-900 dark:text-white">Bienvenue sur l'administration</h1>
|
||||||
<p class="text-xl text-gray-600 dark:text-gray-300 mb-8">Gérez facilement les accès des membres de Camélia-Studio à l'espace de stockage partagé Kumora. Ajoutez, modifiez ou retirez les utilisateurs en quelques clics.</p>
|
<p class="text-xl text-gray-600 dark:text-gray-300 mb-8">Gérez facilement les accès des membres de Camélia-Studio à l'espace de stockage partagé Kumora. Ajoutez, modifiez ou retirez les utilisateurs en quelques clics.</p>
|
||||||
<div class="mb-16">
|
<div class="mb-16">
|
||||||
<a href="{{ path('app_files_index') }}" class="text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 dark:bg-gray-800 dark:text-white dark:border-gray-600 font-medium rounded-lg px-8 py-3">
|
<a href="{{ path('app_admin_user_index') }}" class="text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 dark:bg-gray-800 dark:text-white dark:border-gray-600 font-medium rounded-lg px-8 py-3">
|
||||||
Gérer les utilisateurs
|
Gérer les utilisateurs
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
Rôle
|
Rôle
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
Action
|
Actions
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -11,9 +11,12 @@
|
|||||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body data-turbo="false">
|
<body data-turbo="false" class="flex flex-col min-h-screen">
|
||||||
{% include "partials/navbar.html.twig" %}
|
{% include "partials/navbar.html.twig" %}
|
||||||
|
<div class="flex-1">
|
||||||
{% include "partials/alerts.html.twig" %}
|
{% include "partials/alerts.html.twig" %}
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
{% include "partials/footer.html.twig" %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
Modifié le
|
Modifié le
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
Action
|
Actions
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
{% if parentDir == null and (parentDirectory.userCreated == app.user or (parentDirectory.isPublic and app.user.folderRole == enum('App\\Enum\\RoleEnum').CONSEIL_ADMINISTRATION)) %}
|
{% if parentDir == null and (parentDirectory.userCreated == app.user or (parentDirectory.isPublic and app.user.folderRole == enum('App\\Enum\\RoleEnum').CONSEIL_ADMINISTRATION)) %}
|
||||||
<a href="{{ path('app_files_file_edit_permission', {
|
<a href="{{ path('app_files_file_edit_permission', {
|
||||||
parentDir: parentDirectory.name,
|
parentDir: parentDirectory.name,
|
||||||
}) }}" class="hover:text-blue-700 duration-300" title="Permet de renommer le dossier"><twig:ux:icon class="w-6 h-6" name="fa6-solid:shield" /></a>
|
}) }}" class="hover:text-blue-700 duration-300" title="Permet de modifier les permissions du dossier"><twig:ux:icon class="w-6 h-6" name="fa6-solid:shield" /></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_granted('file_write', parentDirectory) %}
|
{% if is_granted('file_write', parentDirectory) %}
|
||||||
<a href="{{ path('app_files_rename-directory', {
|
<a href="{{ path('app_files_rename-directory', {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
{% block title %}Le cloud de Camélia-Studio{% endblock %}
|
{% block title %}Le disque nuagique de Camélia-Studio{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="min-h-96 flex items-center flex-col justify-center">
|
<div class="min-h-96 flex items-center flex-col justify-center">
|
||||||
|
<img src="{{ get_env('DEFAULT_IMAGE') }}" alt="Mascotte Camélia Studio" class="max-w-96">
|
||||||
<h1 class="text-4xl font-bold mb-2 text-gray-900 dark:text-white">Bienvenue sur Kumora</h1>
|
<h1 class="text-4xl font-bold mb-2 text-gray-900 dark:text-white">Bienvenue sur Kumora</h1>
|
||||||
<p class="text-xl text-gray-600 dark:text-gray-300 mb-8">Notre espace de stockage en ligne, dédié aux membres de Camélia Studio, pour faciliter le partage de tous les fichiers et ressources de l'association.</p>
|
<p class="text-xl text-gray-600 dark:text-gray-300 mb-8">Notre espace de stockage en ligne, dédié aux membres de Camélia Studio, pour faciliter le partage de tous les fichiers et ressources de l'association.</p>
|
||||||
<div class="mb-16">
|
<div class="mb-16">
|
||||||
@ -11,5 +12,10 @@
|
|||||||
Accéder à mon espace
|
Accéder à mon espace
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-16 flex items-center justify-center gap-8">
|
||||||
|
<a target="_blank" href="{{ get_env('CAMELIA_URL') }}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Camélia Studio</a>
|
||||||
|
<a target="_blank" href="{{ get_env('TSUBAKIMONO_URL') }}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Tsubakimono</a>
|
||||||
|
<a target="_blank" href="{{ get_env('DISCORD_URL') }}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Discord</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
9
templates/partials/footer.html.twig
Normal file
9
templates/partials/footer.html.twig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
<footer class="bg-white border-gray-200 dark:bg-gray-900 p-4">
|
||||||
|
<div class="w-full flex justify-center gap-4">
|
||||||
|
<span class="text-gray-700 sm:text-center dark:text-gray-200">Site propulsé grâce à <a href="{{ get_env('GIT_URL') }}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Kumora</a></span>
|
||||||
|
<span class="text-gray-500 sm:text-center dark:text-gray-400">
|
||||||
|
Version {{ get_env('APP_VERSION', '0.0.1') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
{% block title %}Le cloud de Camélia-Studio{% endblock %}
|
{% block title %}Le disque nuagique de Camélia-Studio{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container mx-auto px-16">
|
<div class="container mx-auto px-16">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user