Подпись к какртинке - источник. Управление фоторамой с клавиатуры.

This commit is contained in:
Krivchikov Dmitry 2015-05-31 15:26:21 +03:00
parent 667d09305c
commit 035c442a8c
4 changed files with 15 additions and 3 deletions

View File

@ -18,5 +18,16 @@ class PhotoLinks extends Model
$parsedUrl = parse_url($url);
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
}
static function getCaption($photo)
{
$photolink = self::model()->getOne('photo', $photo);
if (!$photolink) {
return 'не определён';
}
return $photolink->host ? $photolink->host : $photolink->url;
}
}

View File

@ -6,7 +6,7 @@
<h4 class="modal-title" id="imageModalLabel"></h4>
</div>
<div class="modal-body" style="text-align: center;">
<div class="fotorama" data-loop="true" data-auto="false"></div>
<div class="fotorama" data-loop="true" data-auto="false" data-keyboard="true"></div>
</div>
</div>
</div>

View File

@ -39,13 +39,13 @@
<?php if ($photos || $point->img): ?>
<br/><br/>
<div style="text-align: center;">
<div class="dfotorama" data-loop="true" data-nav="thumbs" data-thumbwidth="100">
<div class="dfotorama" data-loop="true" data-nav="thumbs" data-thumbwidth="100" data-keyboard="true">
<?php if ($point->img): ?>
<img data-thumb="<?= $point->img ?>" src="<?= $point->img ?>">
<?php endif; ?>
<?php if ($photos): ?>
<?php foreach ($photos as $photo): ?>
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
<img data-thumb="/photos/small/<?= $photo->name ?>" data-caption="Источник: <?= PhotoLinks::getCaption($photo->name)?>" src="/photos/middle/<?= $photo->name ?>">
<?php endforeach; ?>
<?php endif; ?>
<span data-thumb="/img/mapThumb.png">

View File

@ -23,6 +23,7 @@ div.header img {height: 89px;}
div.add {cursor: pointer;}
.fotorama {display: inline-block;}
.fotorama .fotorama__caption{text-align: left; font-size: 9px; margin-bottom: 17px; opacity: 0.7;}
#addPointModal .extraImage .button {cursor: pointer; background-color: #eeeeee;}
#addPointModal .extraImage .remove:hover {background-color: #f4bfbf;}