Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3824 → Rev 3825

/trunk/widget/modules/photo/squelettes/css/popup.css
213,6 → 213,7
 
#volets-fct {
padding: 0 1rem;
width: calc(100% - 1rem);
}
 
#volets-fct h2 {
/trunk/widget/modules/photo/squelettes/photo.tpl.html
20,7 → 20,7
<meta property="og:site_name" content="Tela Botanica" />
<meta property="og:description" content="Mini-galerie photo des observations publiques du Carnet en Ligne" />
<?php if (isset($items[0])) : ?>
<meta property="og:image" content="<?php echo sprintf($items[0]['url_tpl'], 'CRS'); ?>" />';
<meta property="og:image" content="<?php echo sprintf($items[0]['url_tpl'], 'CRS'); ?>" />
<?php else : ?>
<meta property="og:image" content="https://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" />
<meta property="og:image:type" content="image/png" />
242,8 → 242,8
</a>
<div id="cel-info-<?php echo $item['id_photo_formate']; ?>" class="cel-infos">
<strong>
<?php if ($item['eflore_url'] != '#' && $item['eflore_url'] != '') : ?>
<a class="cel-img-titre" href="<?php echo $item['eflore_url']; ?>"
<?php if (!empty($item['lien'])) : ?>
<a class="cel-img-titre" href="<?php echo $item['lien']; ?>"
onclick="window.open(this.href);return false;"
title="Cliquez pour accéder à la fiche eFlore">
<?php echo $item['obs']['nom_sel']; ?>
/trunk/widget/modules/photo/squelettes/js/WidgetPhotoPopup.js
14,7 → 14,7
this.mettreAJourInfosImage();
}
 
WidgetPhotoPopup.prototype = new WidgetPhotoCommun();
WidgetPhotoPopup.prototype = new WidgetPhotoCommun();
 
WidgetPhotoPopup.prototype.initTpl = function() {
this.redimensionnerGalerie();
53,17 → 53,39
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
this.item = this.infos_images[this.urls[this.indexImage]];
this.titreImage = this.item['titre'];
this.lienEflore = this.item['lien'];
this.urlLienEflore = this.item['lien'];
this.idImage = this.item['id_photo'];
this.urlThisImage = this.item['url_photo']+'.jpg';
this.obs = this.item['obs'];
this.nn = '[nn' + this.obs['nom_sel_nn']+']';
this.urlIP = this.obs['url_ip'];
this.tagsImage = this.tagsToArray( this.item['tags_photo'] );
this.tagsObs = this.tagsToArray( this.obs['tags_obs'] );
this.auteur = this.item['utilisateur']['nom_utilisateur'];
this.urlProfil = '/profil-par-id/'+this.item['utilisateur']['id_utilisateur'];
this.date = this.item['date'];
};
 
WidgetPhotoPopup.prototype.tagsToArray = function( tags ) {
tags = tags.replace( new RegExp('\\.'), '' ).split( ',' );
 
let cleanTags = [],
nbTags = tags.length,
tag = '',
tagsSansEspaces = '',
cleanTagIndex = 0;
 
for(let i = 0; i < nbTags; i++) {
tag = tags[i];
tagsSansEspaces = tag.replace( ' ', '');
if( '' !== tagsSansEspaces ) {
cleanTags.push( tag.trim() );
}
}
 
return cleanTags;
};
 
WidgetPhotoPopup.prototype.initEvtsDefilerImage = function() {
const lthis = this;
 
78,7 → 100,7
case left:
return 'suivant';
case right:
return 'precedent'
return 'precedent';
default:
break;
}
226,7 → 248,7
}
 
$( '#bloc-infos-img' ).html(
'<a href="' + this.lienEflore + '">' + this.obs['nom_sel'] + '</a> '+
this.afficherLien( this.urlLienEflore, this.obs['nom_sel'] )+
' par '+
'<a class="lien_contact" href="' + lienContact + '">' + this.auteur + '</a> '+
' le ' + this.date + ' - ' + this.obs['localisation']
352,7 → 374,7
WidgetPhotoPopup.prototype.afficherMetas = function() {
const lthis = this;
const META_CONTENUS = {
'nom' : '<a href="' + this.lienEflore + '" target="_blank">' + this.obs['nom_sel'] + '</a> ',
'nom' : this.afficherLien( this.urlLienEflore, this.obs['nom_sel'] ),
'localisation' : this.obs['localisation'],
'auteur' : this.auteur,
'date-obs' : this.date,
378,7 → 400,7
break;
case 'nom' :
$( '.contenu', $metaContainer ).html( contenu );
$( '.bouton', $metaContainer ).attr( 'href', lthis.lienEflore );
$( '.bouton', $metaContainer ).attr( 'href', lthis.urlLienEflore );
break;
case 'auteur' :
$( '.bouton', $metaContainer ).attr( 'href', lthis.urlProfil );
414,6 → 436,7
const META_LABELS = {
'id_obs' : 'observation n°',
'projet' : 'projet',
'nom_referentiel' : 'réferentiel',
'date_obs' : 'date d´observation',
'nom_sel': 'nom scientifique',
'nom_sel_nn' : 'nom scientifique n°',
420,12 → 443,7
'nom_ret' : 'nom retenu',
'nom_ret_nn' : 'nom retenu n°',
'famille' : 'famille',
'nom_referentiel' : 'réferentiel',
'commentaire' : 'commentaire',
'certitude' : 'certitude',
'fiabilite' : 'fiabilite',
'tags_obs' : 'tags de l´observation',
'localisation' : 'localisation',
'lieudit' : 'lieu dit',
'station' : 'station',
'milieu' : 'milieu',
449,19 → 467,51
'observateur' : 'observateur',
'observateur_structure' : 'structure'
};
 
const $contenuPlusMeta = $( '#contenu-meta-plus' );
let degres = '0';
let degres = $contenuPlusMeta.is( ':visible' ) ? '180' : '0';
 
this.rotationFleche( degres );
$contenuPlusMeta.empty();
 
$.each( META_LABELS, function( cle, label ) {
let idAttr = cle.replace( '_', '-' ),
contenu = lthis.obs[cle];
 
if ( 0 <= $.inArray( cle, ['est_ip_valide', 'herbier'] ) && '0' === contenu ) {
contenu = 'non';
} else if ( 'date_obs' === cle ) {
contenu = lthis.formaterDate(contenu);
switch( cle ) {
case 'nom_sel':
contenu = lthis.afficherLien( lthis.urlLienEflore, contenu );
break;
 
case 'nom_ret':
let urlEfloreNomRetenu = lthis.urlLienEflore.replace( lthis.obs['nom_sel_nn'], lthis.obs['nom_ret_nn'] );
 
contenu = lthis.afficherLien( urlEfloreNomRetenu, contenu );
break;
 
case 'url_ip':
contenu = lthis.afficherLien( contenu, contenu );
break;
 
case 'est_ip_valide':
case 'herbier':
if( '0' === contenu ) {
contenu = 'non';
}
break;
 
case 'date_obs':
contenu = lthis.formaterDate( contenu );
console.log(contenu);
break;
 
case 'tags_obs':
let tagsObsLength = lthis.tagsObs.length;
contenu = lthis.tagsObs.join( '<br>' );
break;
 
default:
break;
}
 
if ( lthis.valOk( contenu ) ) {
474,12 → 524,18
}
});
 
$contenuPlusMeta.hide();
if( !$contenuPlusMeta.hasClass( 'actif' ) ) {
$contenuPlusMeta.hide();
}
 
let estVisible = false;
 
$( '#plus-meta' ).off( 'click' ).on( 'click', function( event ) {
event.preventDefault();
 
$contenuPlusMeta.toggle( 200, function() {
degres = $contenuPlusMeta.is( ':visible' ) ? '180' : '0';
estVisible = $contenuPlusMeta.is( ':visible' );
degres = estVisible ? '180' : '0';
$( this ).toggleClass( 'actif', estVisible );
lthis.rotationFleche( degres );
});
});
596,6 → 652,13
return dateFormatee;
};
 
WidgetPhotoPopup.prototype.afficherLien = function( url, nom ) {
if( !/https?:\/\//.test( url ) ) {
url = 'https://' + url;
}
return '<a href="' + url + '" target="_blank">' + nom + '</a> ';
};
 
WidgetPhotoPopup.prototype.fournirLienIdentiplante = function() {
const lthis = this;
$( '.signaler-erreur-obs' ).each( function() {
/trunk/widget/modules/photo/squelettes/popup.tpl.html
145,7 → 145,7
<div class="col-5 contenu"></div>
</li>
<li id="fiabilite" class="row">
<div class="col-5 label">Fiabilité</div>
<div class="col-5 label">Grade</div>
<div class="col-5 contenu"></div>
<a class="bouton btn btn-sm btn-outline-secondary"><i class="fas fa-question-circle"></i></a>
</li>
196,11 → 196,10
</div>
</li>
</ul>
<a href="" data-url-base-telechargement="<?php echo $url_base_telechargement; ?>" id="telecharger" class="btn btn-success"><i class="fas fa-upload"></i>&nbsp;Télécharger</a>
<ul id="contenu-telechargement-suite">
<ul id="contenu-telechargement-suite" class="mb-0">
<li id="autres-formats" class="row">
<div class="col-5 label">Autres formats</div>
<div class="col-7 contenu">
<div class="col-12 label">Autres formats</div>
<div class="col-12 contenu">
<select name="formats" id="formats" class="form-control custom-select">
<?php foreach ($formats_description as $format => $description):?>
<option value="<?php echo $format; ?>" <?php echo $format === 'O' ? 'selected' : ''; ?>><?php echo $description; ?></option>
209,6 → 208,7
</div>
</li>
</ul>
<a href="" data-url-base-telechargement="<?php echo $url_base_telechargement; ?>" id="telecharger" class="btn btn-success mt-0"><i class="fas fa-upload"></i>&nbsp;Télécharger</a>
<h2>Partagez !</h2>
<p class="message">
Partagez cette photo sur les réseaux sociaux