zxbodya / yii2-gallery-manager

93 stars 61 forks source link

Is there an estimated time? #1

Closed amismailz closed 9 years ago

amismailz commented 9 years ago

I hope you work more harder :) i really need it.

zxbodya commented 9 years ago

I have no estimates...

Because of a lack of free time, I am not actively working on it right now.

But something was already done:

  1. Widget * migration to bootstrap3(js, and styles ) * yii part (new assets system, translations)
  2. Partially server-side

Remaining part(almost entire server side part):

  1. Change db structure (at least i want, to remove gallery table)
  2. AR behaviour
  3. Gallery image versions.

Probably I will do something on next weekend, but no guarantee...


If you need it, urgent, or you just want to help - you are welcome.

To install current extension version, you will need following steps:

  1. Add dev repository to composer(replace url by your fork if needed):
"repositories": [
        {
            "url": "https://github.com/zxbodya/yii2-gallery-manager.git",
            "type": "git"
        }
    ],
  1. Require for extension
"zxbodya/yii2-gallery-manager": "*@dev"

Run composer update

  1. Add migration for gallery tables:
class m140930_003227_gallery_manager extends zxbodya\yii2\galleryManager\migrations\m140930_003227_gallery_manager
{
}

And run it.

  1. Test controller, and view for gallery widget:
namespace backend\controllers;

use zxbodya\yii2\galleryManager\GalleryManagerAction;
use zxbodya\yii2\galleryManager\models\Gallery;
class TestController extends \yii\web\Controller
{
    public function actions()
    {
        return [
            'galleryApi' => [
                'class' => GalleryManagerAction::className(),
            ],
        ];
    }

    public function actionGallery()
    {
        $gallery = Gallery::findOne(['id' => 1]);
        if (empty($gallery)) {
            $gallery = new Gallery();
            $gallery->id = 1;
        }

        $gallery->name = true;
        $gallery->description = true;
        $gallery->setVersions(
            [
                'small' => [
                    'resize' => [200, null],
                ],
                'medium' => [
                    'resize' => [800, null],
                ]
            ]
        );

        $gallery->save(false);

        return $this->render('gallery', ['gallery' => $gallery]);
    }
}

View

<?php
/* @var $this yii\web\View */
use zxbodya\yii2\galleryManager\GalleryManager;
use zxbodya\yii2\galleryManager\models\Gallery;

/** @var Gallery $gallery */
?>
<h1>test/gallery</h1>

<?=
GalleryManager::widget(
    [
        'gallery' => $gallery,
        'apiRoute' => 'test/galleryApi'
    ]
); ?>

About how to implement AR Behavior, and image versions - see this project https://github.com/zxbodya/yii2-image-attachment

I am planning to do something similar, in this extensions too.

amismailz commented 9 years ago

OK, very good work man. I can dispense AR behavior now because its urgent for me, i'll test it. At all, go ahead with the remaining, with my best regards.

zxbodya commented 9 years ago

Just published, updated version.

It is fully working. But probably I will do some code cleanup soon.

amismailz commented 9 years ago

Strong thanks for you Bogdan, hoping more achievements for you.