Browse Source

ajoute quelques détails esthétiques

master
vince vince 3 years ago
parent
commit
ff5646ef77
1 changed files with 17 additions and 4 deletions
  1. +17
    -4
      index.php

+ 17
- 4
index.php View File

@ -20,7 +20,7 @@ if ($hasSupplier) {
$config[$supplier] = array_merge( $config[$supplier] = array_merge(
[ [
'title' => '%supplier% <small>%event%</small>',
'title' => '%supplier% <small>%date%</small>',
'description' => '', 'description' => '',
'choices' => [], 'choices' => [],
'start' => 'now 00:00:00', 'start' => 'now 00:00:00',
@ -163,6 +163,8 @@ if (!$isConfig and $hasSupplier) {
} }
} }
$date = (new \IntlDateFormatter('fr_FR.UTF8', \IntlDateFormatter::FULL, \IntlDateFormatter::NONE, 'Europe/Paris'))->format(new \DateTime($event));
while (preg_match('/%([^%]+)%/i', $config[$supplier]['title'], $match)) while (preg_match('/%([^%]+)%/i', $config[$supplier]['title'], $match))
$config[$supplier]['title'] = str_replace( $config[$supplier]['title'] = str_replace(
$match[0], $match[0],
@ -189,7 +191,7 @@ if (!$isConfig and $hasSupplier) {
<header> <header>
<nav class="navbar navbar-dark bg-dark"> <nav class="navbar navbar-dark bg-dark">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="<?php echo $requestUrl; ?>">
<a class="navbar-brand" href="<?php echo $hasSupplier ? sprintf('%s?supplier=%s', $requestUrl, $supplier) : $requestUrl; ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-basket d-inline-block align-text-top" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-basket d-inline-block align-text-top" viewBox="0 0 16 16">
<path d="M5.757 1.071a.5.5 0 0 1 .172.686L3.383 6h9.234L10.07 1.757a.5.5 0 1 1 .858-.514L13.783 6H15a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v4.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 13.5V9a1 1 0 0 1-1-1V7a1 1 0 0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if ($isConfig) : ?>
<a class="text-reset" href="<?php printf('%s?supplier=%s', $requestUrl, $supplier); ?>">Retour</a> <a class="text-reset" href="<?php printf('%s?supplier=%s', $requestUrl, $supplier); ?>">Retour</a>
<?php else : ?> <?php else : ?>
<?php if ($hasPassword) : ?>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock" viewBox="0 0 16 16">
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z"/>
</svg>
<?php else : ?>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-unlock" viewBox="0 0 16 16">
<path d="M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2zM3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H3z"/>
</svg>
<?php endif; ?>
<a tabindex="-1" class="text-reset" href="<?php printf('%s?supplier=%s&action=config', $requestUrl, $supplier); ?>">Configuration</a> <a tabindex="-1" class="text-reset" href="<?php printf('%s?supplier=%s&action=config', $requestUrl, $supplier); ?>">Configuration</a>
<?php endif; ?> <?php endif; ?>
</span> </span>
@ -297,14 +308,14 @@ if (!$isConfig and $hasSupplier) {
<div class="row mb-3"> <div class="row mb-3">
<label for="title" class="col-sm-2 col-form-label">Nom</label> <label for="title" class="col-sm-2 col-form-label">Nom</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" type="text" name="name" required placeholder="Camille Martin" />
<input class="form-control" type="text" name="name" required placeholder="Nom" />
</div> </div>
</div> </div>
<?php if (!empty($config[$supplier]['choices'])) : ?> <?php if (!empty($config[$supplier]['choices'])) : ?>
<div class="row mb-3"> <div class="row mb-3">
<label for="title" class="col-sm-2 col-form-label">Choix</label> <label for="title" class="col-sm-2 col-form-label">Choix</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-select" name="choice" required placeholder="choix">
<select class="form-select" name="choice" required>
<option/> <option/>
<?php foreach ($config[$supplier]['choices'] as $choice) : ?> <?php foreach ($config[$supplier]['choices'] as $choice) : ?>
<option><?php echo $choice; ?></option> <option><?php echo $choice; ?></option>
@ -387,11 +398,13 @@ if (!$isConfig and $hasSupplier) {
<?php endif; ?> <?php endif; ?>
</main> </main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<?php if ($isConfig) : ?>
<script src="https://cdn.ckeditor.com/ckeditor5/31.0.0/classic/ckeditor.js"></script> <script src="https://cdn.ckeditor.com/ckeditor5/31.0.0/classic/ckeditor.js"></script>
<script> <script>
document.querySelectorAll('.js-ckeditor').forEach(function (element) { document.querySelectorAll('.js-ckeditor').forEach(function (element) {
ClassicEditor.create(element).catch(error => { console.error(error); }); ClassicEditor.create(element).catch(error => { console.error(error); });
}); });
</script> </script>
<?php endif; ?>
</body> </body>
</html> </html>

Loading…
Cancel
Save