diff --git a/composer.json b/composer.json index 417d38c..bd8eb05 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "yiisoft/yii2-bootstrap": "*", "fxp/composer-asset-plugin": "*", "kartik-v/yii2-widgets": "^3.4", - "cebe/markdown": "~1.0.1" + "cebe/markdown": "~1.0.1", + "bigpaulie/yii2-fancybox": "^1.0" }, "require-dev": { "yiisoft/yii2-debug": "*", diff --git a/composer.lock b/composer.lock index acd879c..2c33047 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,52 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "2932f0af4cf2332e252af0e542d43751", + "hash": "3a3de782ca636438cd027ce7814594b5", "packages": [ + { + "name": "bigpaulie/yii2-fancybox", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/bigpaulie/yii2-fancybox.git", + "reference": "1b02ef28822697e7f73e627f0a8fc3bff0ee6398" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bigpaulie/yii2-fancybox/zipball/1b02ef28822697e7f73e627f0a8fc3bff0ee6398", + "reference": "1b02ef28822697e7f73e627f0a8fc3bff0ee6398", + "shasum": "" + }, + "require": { + "bower-asset/fancybox": "~2.1", + "php": ">=5.4.0", + "yiisoft/yii2": "2.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "bigpaulie\\fancybox\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul P", + "email": "bigpaulie25ro@yahoo.com" + } + ], + "description": "Yii2 FancyBox extension", + "keywords": [ + "extension", + "fancybox", + "widget", + "yii2" + ], + "time": "2015-05-01 15:50:39" + }, { "name": "bower-asset/bootstrap", "version": "v3.3.5", @@ -55,6 +99,22 @@ "web" ] }, + { + "name": "bower-asset/fancybox", + "version": "v2.1.5", + "source": { + "type": "git", + "url": "https://github.com/fancyapps/fancyBox.git", + "reference": "e2248f468dc4b45f5b1ef1776bde958b2b52775d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fancyapps/fancyBox/zipball/e2248f468dc4b45f5b1ef1776bde958b2b52775d", + "reference": "e2248f468dc4b45f5b1ef1776bde958b2b52775d", + "shasum": "" + }, + "type": "bower-asset-library" + }, { "name": "bower-asset/jquery", "version": "2.1.4", diff --git a/src/models/Package.php b/src/models/Package.php index 86aa0d6..d9dd132 100644 --- a/src/models/Package.php +++ b/src/models/Package.php @@ -4,6 +4,7 @@ namespace app\models; use app\components\Git; use app\models\query\PackageQuery; +use bigpaulie\fancybox\FancyBox; use cebe\markdown\GithubMarkdown; use Yii; use yii\behaviors\TimestampBehavior; @@ -182,8 +183,18 @@ class Package extends ActiveRecord $screenshots = []; if (isset($this->bowerData['screenshots'])) { foreach ($this->bowerData['screenshots'] as $screenshot) { - $screenshots[] = Html::img($screenshot, [ - 'style' => 'max-width:100%', + $screenshots[] = FancyBox::widget([ + 'type' => 'image', + 'item' => [ + 'href' => $screenshot, + 'src' => $screenshot, + ], + 'htmlOptions' => [ + 'imageOptions' => [ + 'class' => 'thumbnail', + 'style' => 'max-width:200px', + ], + ], ]); } } diff --git a/src/views/mod/_view.php b/src/views/mod/_view.php index 5130891..4e0d1d4 100644 --- a/src/views/mod/_view.php +++ b/src/views/mod/_view.php @@ -12,36 +12,14 @@ use yii\widgets\DetailView;

name), ['view', 'name' => $model->name]) ?>

- - $model->id], ['class' => 'btn btn-primary']); ?> - $model->id], [ - // 'class' => 'btn btn-danger', - // 'data' => [ - // 'confirm' => 'Are you sure you want to delete this item?', - // 'method' => 'post', - // ], - //]); - ?> -
$model, 'attributes' => [ - //'name', 'description', 'keywords', 'homepage:url', - //[ - // 'attribute' => 'url', - // 'value' => Git::getUrl($model->url), - // 'format' => 'url', - //], - //'hits', - //'bower:ntext', - //'created_at', - //'updated_at', ], ]) ?>
@@ -49,7 +27,7 @@ use yii\widgets\DetailView; screenshot, [ 'class' => 'thumbnail', 'style' => 'max-width:100%', - ]), $model->screenshot) ?> + ]), ['view', 'name' => $model->name]) ?>
diff --git a/src/views/mod/index.php b/src/views/mod/index.php index 81b5dfc..b3456ba 100644 --- a/src/views/mod/index.php +++ b/src/views/mod/index.php @@ -15,10 +15,6 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

render('_search', ['model' => $searchModel]); ?> -

- 'btn btn-success']) ?> -

- $dataProvider, 'itemOptions' => ['class' => 'item'], diff --git a/src/views/mod/view.php b/src/views/mod/view.php index ac9398a..c187540 100644 --- a/src/views/mod/view.php +++ b/src/views/mod/view.php @@ -47,11 +47,6 @@ $this->params['breadcrumbs'][] = $this->title; // 'value' => Git::getUrl($model->url), // 'format' => 'url', //], - [ - 'label' => 'Screenshots', - 'value' => $model->getScreenshotsHtml(), - 'format' => 'raw', - ], [ 'label' => 'Authors', 'value' => $model->getAuthorsHtml(), @@ -74,6 +69,7 @@ $this->params['breadcrumbs'][] = $this->title; ]) ?> getScreenshotsHtml(); echo $model->getReadmeHtml(); ?>