Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3896 → Rev 3897

/branches/v3.01-serpe/widget/modules/manager/squelettes/creation.tpl.html
55,12 → 55,9
</p>
 
<form action="<?php echo $url_base;?>manager?mode=<?php echo $mode.$params;?>" id="basic-widget-form" method="post" enctype="multipart/form-data">
 
<div class="register-section row" id="basic-details-section">
<h2>Meta-données</h2>
 
<input type="text" name="email" id="email" placeholder="Your email" title="laisser ce champ vide" autocomplete="off" tabindex="-1" />
 
<div class="col-sm-12 mb-3">
<label for="projet">Projet&nbsp;*</label>
<input type="text" name="projet" id="projet" class="form-control" pattern="^[a-z][a-z0-9-]{2,24}" <?php echo ( $mode === 'modification' ) ? 'value="' . $widget['projet'] . '" readonly' : 'required';?> title="Champ obligatoire : Pas d'espaces, de majuscules, de caractères spéciaux, ou d'accents. Caractères acceptés : 1er une lettre de a à z, ensuite : lettres, chiffres, tirets &quot; - &quot;.">
76,19 → 73,18
<select id="type" name="type" class="form-control custom-select">
<option value=""> ----</option>
<?php foreach ( $type as $id => $projet ) : ?>
<option <?php echo ( isset( $widget['projet'] ) && $projet['projet'] === $widget['projet'] ) ? 'selected="selected"' : '';?> value="<?php echo $projet['projet'];?>"><?php echo $projet['projet'];?></option>
<option <?php echo ( isset( $widget['type'] ) && $projet['projet'] === $widget['type'] ) ? 'selected="selected"' : '';?> value="<?php echo $projet['projet'];?>"><?php echo $projet['projet'];?></option>
<?php endforeach;?>
</select>
</div>
 
<div class="col-sm-12 radio mb-3">
<label for="est_type" class="radio-label">
<input type="checkbox" name="est_type" id="est_type" <?php echo ( isset( $widget['est_type'] ) && $projet['est_type'] === '1' ) ? 'checked="checked"' : '';?>>
Ce widget est un widget type
</label>
</div>
 
<div class="col-sm-12 radio mb-3">
<label for="est_type" class="radio-label">
<input type="checkbox" name="est_type" id="est_type" <?php echo ( isset( $widget['est_type'] ) && $projet['est_type'] === '1' ) ? 'checked="checked"' : '';?>>
Ce widget est un widget type
</label>
</div>
 
<div class="col-sm-12 mb-3">
<label for="langue">Langue</label>
<?php if ( $mode === 'modification' ) : ?>
115,16 → 111,16
<div class="input-file-container col-sm-10">
 
<?php
$info_file_name = [];
$info_src = '';
$info_img = '';
$info_hidden = '';
if( isset( $widget['info'] ) ) :
$info_file_name = 'info.' . preg_replace( '/(?:imag)?e\/?/','',$widget['info']);
$info_src = $chemin_images . $widget['projet'] . '/' . $info_file_name;
$info_img =
'<img id="pre-existent-info" src="' . $info_src . '" width="50%"><br>Pour changer, télécharger un nouveau fichier.';
$info_hidden = '';
else :
$info_file_name = [];
$info_src = '';
$info_img = '';
$info_hidden = ' hidden';
endif;
?>
148,16 → 144,16
<div class="input-file-container col-sm-10">
 
<?php
$logo_file_name = [];
$logo_src = '';
$logo_img = '';
$logo_hidden = '';
if( isset( $widget['logo'] ) ) :
$logo_file_name = 'logo.' . preg_replace( '/(?:imag)?e\/?/','',$widget['logo']);
$logo_src = $chemin_images . $widget['projet'] . '/' . $logo_file_name;
$logo_img =
'<img id="pre-existent-logo" src="' . $logo_src . '" width="50%"><br>Pour changer, télécharger un nouveau fichier.';
$logo_hidden = '';
else :
$logo_file_name = [];
$logo_src = '';
$logo_img = '';
$logo_hidden = ' hidden';
endif;
?>
178,16 → 174,16
<div class="input-file-container col-sm-10">
 
<?php
$image_fond_file_name = [];
$image_fond_src = '';
$image_fond_img = '';
$image_fond_hidden = '';
if( isset( $widget['image_fond'] ) ) :
$image_fond_file_name = 'image_fond.' . preg_replace( '/(?:imag)?e\/?/','',$widget['image_fond']);
$image_fond_src = $chemin_images . $widget['projet'] . '/' . $image_fond_file_name;
$image_fond_img =
'<img id="pre-existent-image_fond" src="' . $image_fond_src . '" width="50%"><br>Pour changer, télécharger un nouveau fichier.';
$image_fond_hidden = '';
else :
$image_fond_file_name = [];
$image_fond_src = '';
$image_fond_img = '';
$image_fond_hidden = ' hidden';
endif;
?>
205,17 → 201,8
</div><!-- end #profile-details-description-section -->
 
<div class="register-section row" id="profile-details-fields-section">
<h2>Champs</h2>
 
<h2>Milieux et taxonomie</h2>
<div class="col-sm-12 mb-3">
<label for="type_localisation">Type de localisation</label>
<select id="type_localisation" name="type_localisation" class="form-control custom-select">
<option value="<?php echo ( isset( $widget['type_localisation'] ) ) ? $widget['type_localisation'] : 'point';?>"><?php echo ( isset( $widget['type_localisation'] ) ) ? $widget['type_localisation'] : 'point';?></option>
<option value="<?php echo ( isset( $widget['type_localisation'] ) && $widget['type_localisation'] === 'rue' ) ? 'point' : 'rue';?>"><?php echo ( isset( $widget['type_localisation'] ) && $widget['type_localisation'] === 'rue') ? 'point' : 'rue';?></option>
</select>
</div>
 
<div class="col-sm-12 mb-3">
<label for="milieux">Milieux</label>
<p class="message">
Liste de milieux séparés par un ";".
276,6 → 263,45
<div class="col-sm-12 mb-3">
<a href="<?php echo $url_base;?>modules/manager/squelettes/img/fichier_type/especes.csv" class="button fichier-type" download><i class="fas fa-file-alt" aria-hidden="true"></i> Fichier type</a>
</div>
<h2>Champs Imposés</h2>
<div class="col-sm-12 mb-3">
<label for="adresse">Adresse obligatoire</label>
<select id="adresse" name="adresse" class="form-control custom-select">
<option value="0" <?php echo ( isset( $widget['adresse'] ) && $widget['adresse'] === '0' ) ? 'selected' : '';?>>Non</option>
<option value="1" <?php echo ( isset( $widget['adresse'] ) && $widget['adresse'] === '1' ) ? 'selected' : '';?>>Oui</option>
</select>
</div>
<div class="col-sm-12 mb-3">
<label for="photo_obligatoire">Photo obligatoire</label>
<select id="photo_obligatoire" name="photo_obligatoire" class="form-control custom-select">
<option value="0" <?php echo ( isset( $widget['photo_obligatoire'] ) && $widget['photo_obligatoire'] === '0' ) ? 'selected' : '';?>>Non</option>
<option value="1" <?php echo ( isset( $widget['photo_obligatoire'] ) && $widget['photo_obligatoire'] === '1' ) ? 'selected' : '';?>>Oui</option>
</select>
</div>
<h2>Localisation</h2>
<div class="col-sm-12 mb-3">
<label for="type_localisation">Type de localisation</label>
<select id="type_localisation" name="type_localisation" class="form-control custom-select">
<option value="<?php echo ( isset( $widget['type_localisation'] ) ) ? $widget['type_localisation'] : 'point';?>"><?php echo ( isset( $widget['type_localisation'] ) ) ? $widget['type_localisation'] : 'point';?></option>
<option value="<?php echo ( isset( $widget['type_localisation'] ) && $widget['type_localisation'] === 'rue' ) ? 'point' : 'rue';?>"><?php echo ( isset( $widget['type_localisation'] ) && $widget['type_localisation'] === 'rue') ? 'point' : 'rue';?></option>
</select>
</div>
<div class="col-sm-12">
<label for="fond_carte">Fond de carte</label>
<select id="fond_carte" name="fond_carte" class="form-control custom-select">
<?php
$affichage_fonds_carte = [
'osm' => 'OSM (carte par défaut)',
'googleHybrid' => 'Photos aériennes',
];
$fond_carte = isset($widget['fond_carte']) && isset($affichage_fonds_carte[$widget['fond_carte']]) ? $widget['fond_carte'] : 'osm';
?>
<?php foreach($affichage_fonds_carte as $nom_base => $nom_affiche) :?>
<option value="<?php echo $nom_base;?>"<?php echo $nom_base === $fond_carte ? ' selected="selected"' : '';?>><?php echo $nom_affiche;?></option>
<?php endforeach;?>
 
</select>
</div>
</div><!-- end #profile-details-fields-section -->
 
<!--localisation-->
289,7 → 315,7
</form><!-- end #new-widget-form -->
 
<form id="form-geolocalisation" autocomplete="off">
<div class="row mb-3">
<div class="row">
<label for="geolocalisation" class="obligatoire has-tooltip col-sm-12" data-toggle="tooltip" title="">
Geolocalisation&nbsp: Déterminer un point gps (facultatif)
</label>
298,9 → 324,9
<tb-geolocation-element
id="tb-geolocation"
layer='osm'
zoom_init="4"
lat_init="46.5"
lng_init="2.9"
zoom_init="<?php echo $widget['tableau-localisation']['zoom'] ?? '4' ;?>"
lat_init="<?php echo $widget['tableau-localisation']['latitude'] ?? '46.5' ;?>"
lng_init="<?php echo $widget['tableau-localisation']['longitude'] ?? '2.9' ;?>"
marker="true"
polyline="false"
polygon="false"
318,11 → 344,11
<div id="geoloc-datas" class="col-sm-12 row">
<div class="col-sm-6 mb-3">
<label for="latitude">Latitude</label>
<input type="text" class="form-control latitude" id="latitude" name="latitude" pattern="-?(8[0-5]|[1-7]?[0-9])(,|.)[0-9]{5}" title="Nombre décimal de 6 à 8 chiffres au total, dont exactement 5 chiffres après la virgule" placeholder="+/- 0.00000 à 90.00000" value="">
<input type="text" class="form-control latitude" id="latitude" name="latitude" pattern="-?(8[0-5]|[1-7]?[0-9])(,|.)[0-9]{5}" title="Nombre décimal de 6 à 8 chiffres au total, dont exactement 5 chiffres après la virgule" placeholder="+/- 0.00000 à 90.00000" value="<?php echo $widget['tableau-localisation']['latitude'] ?? '' ;?>">
</div>
<div class="col-sm-6 mb-3">
<label for="longitude">Longitude</label>
<input type="text" class="form-control longitude" id="longitude" name="longitude" pattern="-?(1(80|[0-7][0-9])|([1-9]?[0-9]))(,|.)[0-9]{5}" title="Nombre décimal de 6 à 8 chiffres au total, dont exactement 5 chiffres après la virgule" placeholder="+/- 0.00000 à 180.00000" value="">
<input type="text" class="form-control longitude" id="longitude" name="longitude" pattern="-?(1(80|[0-7][0-9])|([1-9]?[0-9]))(,|.)[0-9]{5}" title="Nombre décimal de 6 à 8 chiffres au total, dont exactement 5 chiffres après la virgule" placeholder="+/- 0.00000 à 180.00000" value="<?php echo $widget['tableau-localisation']['longitude'] ?? '' ;?>">
</div>
<div class="col-sm-12 mb-3">
<label for="zoom">Zoom (indépendant des coordonnées)</label>
330,72 → 356,54
Quelques exemples de précision zoom&nbsp;:<br>
Europe&nbsp;:&nbsp;4, France&nbsp;:&nbsp;5, région&nbsp;:&nbsp;7, département&nbsp;:&nbsp;9, ville&nbsp;:&nbsp;12, lieu-dit/quartier&nbsp;:&nbsp;15, rue&nbsp;:&nbsp;18 (=&nbsp;max).
</p>
<input type="text" name="zoom" id="zoom" class="form-control" pattern="(0?[1-9]|(1[0-8]))" title="Nombre de 1 à 18" placeholder="1 à 18" value="" />
<input type="text" name="zoom" id="zoom" class="form-control" pattern="(0?[1-9]|(1[0-8]))" title="Nombre de 1 à 18" placeholder="1 à 18" value="<?php echo $widget['tableau-localisation']['zoom'] ?? '' ;?>" />
</div>
<div class="col-sm-12 mb-3">
<label for="fond_carte">Fond de carte</label>
<select id="fond_carte" name="fond_carte" class="form-control custom-select">
<?php
$affichage_fonds_carte = [
'osm' => 'OSM (carte par défaut)',
'googleHybrid' => 'Photos aériennes',
];
$fond_carte = isset($widget['fond_carte']) && isset($affichage_fonds_carte[$widget['fond_carte']]) ? $widget['fond_carte'] : 'osm';
?>
<?php foreach($affichage_fonds_carte as $nom_base => $nom_affiche) :?>
<option value="<?php echo $nom_base;?>"<?php echo $nom_base === $fond_carte ? ' selected="selected"' : '';?>><?php echo $nom_affiche;?></option>
<?php endforeach;?>
 
</select>
</div>
<div class="col-sm-12 mb-3">
<label for="adresse">Adresse obligatoire</label>
<select id="adresse" name="adresse" class="form-control custom-select">
<option value="0" <?php echo ( isset( $widget['adresse'] ) && $widget['adresse'] === '0' ) ? 'selected' : '';?>>Non</option>
<option value="1" <?php echo ( isset( $widget['adresse'] ) && $widget['adresse'] === '1' ) ? 'selected' : '';?>>Oui</option>
</select>
</div>
<div class="col-sm-12 mb-3">
<label for="photo_obligatoire">Photo obligatoire</label>
<select id="photo_obligatoire" name="photo_obligatoire" class="form-control custom-select">
<option value="0" <?php echo ( isset( $widget['photo_obligatoire'] ) && $widget['photo_obligatoire'] === '0' ) ? 'selected' : '';?>>Non</option>
<option value="1" <?php echo ( isset( $widget['photo_obligatoire'] ) && $widget['photo_obligatoire'] === '1' ) ? 'selected' : '';?>>Oui</option>
</select>
</div>
</div>
</div>
</div>
</form><!-- end #form-geolocalisation -->
 
<form id="new-fields" autocomplete="off">
<h2>Ajouter des champs</h2>
<?php if ( !isset( $widget['type'] ) ):?>
<form id="new-fields" autocomplete="off">
<h2>Ajouter des champs</h2>
<p id="infos-validation-boutons" class="message">
<i class="fa fa-exclamation-triangle" aria-hidden="true" style="color:#ff5d55"></i>
&nbsp;Attention&nbsp;:
<br>
<i class="fa fa-bolt" aria-hidden="true" style="color:#B3C954"></i>
&nbsp;Le bouton "Valider" sert à valider les champs supplémentaires uniquement
<br>
<i class="fas fa-trophy" aria-hidden="true" style="color:#B3C954"></i>
&nbsp;Le bouton "Terminer" sert à envoyer la totalité du nouveau widget
</p>
</form><!-- #new-fields = fomulaire oû viennent s'insérer les champs supplémentaires -->
 
<div id="new-fields-buttons" class="row">
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label class="add-fields">Ajouter</label>
<div class="button" id="add-fields" title="Ajouter un champ"><i class="fa fa-plus" aria-hidden="true"></i></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label for="preview-field">Prévisualiser</label>
<div class="button" id="preview-field" name="preview-field" title="prévisualiser"><i class="fa fa-magic" aria-hidden="true"></i></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label class="validate-new-fields">Valider</label>
<div class="button" id="validate-new-fields" title="Valider les champs supplémentaires"><i class="fa fa-bolt" aria-hidden="true"></i></div>
</div>
</div>
<?php else:?>
<p class="message">
<i class="fa fa-exclamation-triangle" aria-hidden="true" style="color:#ff5d55"></i>
&nbsp;Attention&nbsp;:
&nbsp;Ce widget est de type "<?php echo ( $widget['type'] );?>"&nbsp;:
<br>
<i class="fa fa-bolt" aria-hidden="true" style="color:#B3C954"></i>
&nbsp;Le bouton "Valider" sert à valider les champs supplémentaires uniquement
&nbsp;si vous souhaitez ajouter ou modifier des champs supplémentaires, vous devez le faire sur <a href="<?php echo $url_base ;?>manager?mode=modification&projet=<?php echo $widget['type'];?>&langue=fr">le widget type</a> lui même.
<br>
<i class="fas fa-trophy" aria-hidden="true" style="color:#B3C954"></i>
&nbsp;Le bouton "Terminer" sert à envoyer la totalité du nouveau widget
<i class="fa fa-exclamation-triangle" aria-hidden="true" style="color:#ff5d55"></i>
&nbsp;cela modifiera les champs supplémentaires de tous les tous les autres widgets du même type.
</p>
</form><!-- #new-fields = fomulaire oû viennent s'insérer les champs supplémentaires -->
<?php endif;?>
 
<div id="new-fields-buttons" class="row">
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label class="add-fields">Ajouter</label>
<div class="button" id="add-fields" title="Ajouter un champ"><i class="fa fa-plus" aria-hidden="true"></i></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label for="preview-field">Prévisualiser</label>
<div class="button" id="preview-field" name="preview-field" title="prévisualiser"><i class="fa fa-magic" aria-hidden="true"></i></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-4 buttons">
<label class="validate-new-fields">Valider</label>
<div class="button" id="validate-new-fields" title="Valider les champs supplémentaires"><i class="fa fa-bolt" aria-hidden="true"></i></div>
</div>
</div>
 
</div><!-- end .widget-blocks = tout le bloc de gauche-->
 
<div id="right-block" class="widget-blocks">
598,7 → 606,12
<!-- Bootstrap -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script type="text/javascript" src="<?php echo $url_base;?>modules/manager/squelettes/js/manager.js"></script>
<!-- <script type="text/javascript" src="<?php echo $url_base;?>modules/manager/squelettes/js/manager.js"></script> -->
<script type="module" src="<?php echo $url_base; ?>modules/manager/squelettes/js/manager.js"></script>
<script type="text/javascript">
const CHAMPS_SUPP_JSON = <?php echo $widget['chpSupp'][$widget['projet']]['champs-supp-json'] ?? '""';?>;
const URLS_IMAGES = "<?php echo $url_base;?>modules/manager/squelettes/img/images_projets/<?php echo $widget['projet'];?>/";
</script>
<!-- Barre de navigation -->
<?php if ( $bar !== false ) : ?>
<script src="<?php echo $url_script_navigation;?>"></script>