Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #203

Open
wants to merge 121 commits into
base: master
Choose a base branch
from
Open

Dev #203

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
965ecd9
file type in catalog fields
noumo Oct 1, 2015
06868c7
add slug immutable setting
noumo Oct 9, 2015
76bbf2f
add fancybox asset
noumo Oct 9, 2015
4c2876d
image upload rework
noumo Oct 9, 2015
ee7850e
Settings refactoring
noumo Oct 9, 2015
264fc45
settings refactor
noumo Oct 9, 2015
066be79
add immutable
noumo Oct 9, 2015
37e242f
add tags
noumo Oct 9, 2015
3ea8f82
minor improves
noumo Oct 9, 2015
c1489d0
upload and image refactor
noumo Oct 9, 2015
a450529
images and behaviors refactor
noumo Oct 12, 2015
d287582
new redactor widget
noumo Oct 13, 2015
d7b2f35
change controller behavior to actions
noumo Oct 13, 2015
1df2b04
new module Entity
noumo Oct 13, 2015
3a6e6b7
Update composer.json
noumo Oct 13, 2015
7bc22b0
Update composer.json
noumo Oct 13, 2015
1e98159
Update composer.json
noumo Oct 13, 2015
e9b37c3
Update composer.json
noumo Oct 13, 2015
ac9bb1f
Update composer.json
noumo Oct 13, 2015
b83c941
new module Entity
noumo Oct 15, 2015
9aba462
new standalone frontend toolbar
noumo Oct 15, 2015
7ecbcf5
update changes
noumo Oct 15, 2015
3a19564
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Oct 15, 2015
1ad306b
install 0.91
noumo Oct 19, 2015
bef9616
move logs to system
noumo Oct 19, 2015
0667672
set datetimepicker to 4.7.14 version
noumo Oct 19, 2015
661142e
insert entity module
noumo Oct 19, 2015
5129310
debug
noumo Oct 19, 2015
5fd66e0
new welcome page
noumo Oct 23, 2015
984ca4e
make install form more simple
noumo Oct 23, 2015
17de746
install fix
noumo Oct 23, 2015
d1dac26
url fix
noumo Oct 23, 2015
b65af05
easyii typo fix
noumo Oct 23, 2015
6bbe6b4
hr move
noumo Oct 23, 2015
c16a22a
new module class fix
noumo Oct 23, 2015
f374555
get upload url fix
noumo Oct 23, 2015
efad94e
default robot email fix
noumo Oct 23, 2015
9d746dc
new settings visibility fix
noumo Oct 23, 2015
748218a
settings name fix
noumo Oct 23, 2015
b7bce75
google client namespace fix
noumo Oct 23, 2015
eb48296
cache filename fix
noumo Oct 23, 2015
1adc307
echo widget
noumo Oct 23, 2015
cb12c27
btn group remove uppercase
noumo Oct 23, 2015
5bd2727
locale fix
noumo Oct 23, 2015
b1ae809
notify sort
noumo Oct 23, 2015
54d3a66
Settings fix
noumo Oct 23, 2015
4679a86
getpathurl fix
noumo Nov 17, 2015
112e25f
set yii2 version to >=2.0.6
noumo Nov 17, 2015
6ca8164
api items and last rework
noumo Nov 17, 2015
d314307
add category select in add/edit item
noumo Nov 20, 2015
a2b816a
code refactoring
noumo Nov 20, 2015
61e0d71
guestbook fix
noumo Nov 20, 2015
997ec4f
allow to select 1 cat
noumo Nov 20, 2015
5739b44
create time fix
noumo Nov 20, 2015
64a71a4
robot_email install fix
noumo Nov 23, 2015
8e2bda5
Replace apostrophe with html entity. See #103
boehsermoe Dec 22, 2015
d5cd58f
Merge pull request #104 from boehsermoe/issue103
noumo Jan 22, 2016
6312c4e
fix easyii-shop/issues/5
noumo Jan 22, 2016
16d657d
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Jan 22, 2016
a75aeb6
undefined index fix
noumo Feb 4, 2016
c21a33b
ga widget fix
noumo Feb 10, 2016
3ff4d3c
fix getModuleName
noumo Feb 11, 2016
6f5b2ef
remove deprecated setting
noumo Feb 11, 2016
83fe9b0
empty cats fix
noumo Feb 11, 2016
9b3f0a0
redactor upload fix
noumo Feb 12, 2016
e600ae3
Change event does not work with jQuery 2.*
boehsermoe Feb 13, 2016
9b820bd
Merge branch 'dev' of https://github.com/noumo/easyii into switcher-fix
boehsermoe Feb 13, 2016
83f9b57
Merge pull request #117 from boehsermoe/switcher-fix
noumo Feb 13, 2016
3cb2d09
Update CHANGELOG.md
noumo Mar 6, 2016
b0987a6
category children
noumo Mar 11, 2016
3bafa3d
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Mar 11, 2016
7ed94b6
create new by slug api fix
noumo Mar 11, 2016
21b24fd
small refactor
noumo Mar 20, 2016
f1652b2
new faq settings - htmlEditors
noumo Mar 22, 2016
dd82433
add children to modules
noumo Mar 23, 2016
a92ded0
i18 minor fix
noumo Mar 23, 2016
47bd215
add decsription to category
noumo Mar 23, 2016
676422b
add description to category object
noumo Mar 23, 2016
172d7a0
add get to some methods
noumo Mar 23, 2016
e99bf45
get children fix
noumo Mar 23, 2016
2ee693e
i18n catalog item fix
noumo Mar 24, 2016
d9618c5
magic methods fix
noumo Mar 24, 2016
e48f16d
small fixes
noumo Mar 27, 2016
24e9e44
fields refactor
noumo Mar 27, 2016
7fe1ca6
remove action
noumo Mar 27, 2016
c910e06
new field type - address
noumo Mar 27, 2016
684f7bd
add gm_api_key setting
noumo Mar 27, 2016
0e5f3b0
refactor items with fields
noumo Mar 27, 2016
1e7d22e
big fckng id renaming
noumo Mar 29, 2016
82a4b4e
not ready change
noumo Mar 29, 2016
f9c3090
JsonColumns behavior
noumo Mar 30, 2016
7c7b6f0
fixes
noumo Mar 31, 2016
d023742
new SlugBehavior
noumo Apr 2, 2016
e770419
small refactor
noumo Apr 3, 2016
f2e5fef
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Apr 3, 2016
12e4891
almost ready
noumo Apr 3, 2016
c364055
fixes
noumo Apr 3, 2016
ea87380
fix migration
noumo Apr 3, 2016
08ec45d
fixes
noumo Apr 3, 2016
00c79d6
fixes
noumo Apr 4, 2016
c568bd8
rename file
noumo Apr 5, 2016
8dc7b42
fix find by slug
noumo Apr 12, 2016
96623e9
Merge pull request #131 from noumo/master
noumo Apr 19, 2016
0717b18
fixes
noumo Apr 21, 2016
b3ea0f3
Merge branch 'dev' of git://github.com/noumo/easyii into dev
noumo Apr 21, 2016
9a3d026
add children
noumo Apr 22, 2016
5206e5d
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Apr 22, 2016
0fbb81e
fix
noumo Apr 25, 2016
74a8800
Merge branch 'dev' of git://github.com/noumo/easyii into dev
noumo Apr 25, 2016
ed3ddeb
fix live edit for admins
noumo Apr 26, 2016
a67995e
Merge branch 'dev' of https://github.com/noumo/easyii into dev
noumo Apr 26, 2016
7a50515
i18 fix
noumo Apr 26, 2016
3d3c232
change category sort dir
noumo Apr 26, 2016
dc4fe16
allow empty text
noumo Apr 26, 2016
d434eaf
show ids for admin
noumo Apr 26, 2016
3d53bf0
refactoring
noumo Apr 26, 2016
f41c825
fix
noumo Apr 26, 2016
792dd2e
generate menu fix
noumo Apr 26, 2016
b12f847
show empty text on front
noumo Apr 26, 2016
bb434ca
filters refactor
noumo Apr 26, 2016
6bd677a
update conditions
noumo Apr 26, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AdminModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class AdminModule extends \yii\base\Module implements BootstrapInterface
{
const VERSION = 0.9;
const VERSION = 0.92;

public $settings;
public $activeModules;
Expand Down Expand Up @@ -41,7 +41,7 @@ public function init()

if (Yii::$app instanceof yii\web\Application) {
define('IS_ROOT', !Yii::$app->user->isGuest && Yii::$app->user->identity->isRoot());
define('LIVE_EDIT', !Yii::$app->user->isGuest && Yii::$app->session->get('easyii_live_edit'));
define('LIVE_EDIT_ENABLED', !Yii::$app->user->isGuest && Yii::$app->session->get('easyii_live_edit'));
}
}

Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#Changelog

###0.8.0
###0.9.1
* New module Entity
* File type in catalog fields added
* Tags added to FAQ
* Tags added to gallery albums
* Added immutable setting to all sluggable behaviors
* Now using vova07 redactor widget and now list of widgets editable in settings
* New additional field types: html, file, date
* Remove bootstrap dependency from eaysii frontend toolbar
* Logs moved to system page
* A lot of core refactoring

###0.9.0
* Articles module added
* FAQ module added
* SEO h1, title, description, keywords fields added
Expand All @@ -24,4 +36,4 @@
* GD support added (image scale quality improved)

###0.7.1
* Minor fixes
* Minor fixes
57 changes: 57 additions & 0 deletions actions/BaseSortAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
namespace yii\easyii\actions;

class BaseSortAction extends \yii\base\Action
{
public $model;
public $attribute;
public $direction;
public $addititonalEquality = [];

public function run($id)
{
$modelClass = $this->model ? $this->model : $this->controller->modelClass;
$attribute = $this->attribute;

if(!$this->direction){
$this->direction = $this->id;
}
$success = '';
if(($model = $modelClass::findOne($id))) {
if($this->direction === 'up') {
$eq = '>';
$orderDir = SORT_ASC;
} else {
$eq = '<';
$orderDir = SORT_DESC;
}

$query = $modelClass::find()->orderBy([$attribute => $orderDir])->limit(1);

$where = [$eq, $attribute, $model->{$attribute}];
if (count($this->addititonalEquality)) {
$where = ['and', $where];
foreach ($this->addititonalEquality as $item) {
$where[] = [$item => $model->{$item}];
}
}
$modelSwap = $query->where($where)->one();

if(!empty($modelSwap)) {
$newValue = $modelSwap->{$attribute};

$modelSwap->{$attribute} = $model->{$attribute};
$modelSwap->update();

$model->{$attribute} = $newValue;
$model->update();

$success = ['swap_id' => $modelSwap->primaryKey];
}
} else {
$this->controller->error = \Yii::t('easyii', 'Not found');
}

return $this->controller->formatResponse($success);
}
}
25 changes: 25 additions & 0 deletions actions/ChangeStatusAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
namespace yii\easyii\actions;

class ChangeStatusAction extends \yii\base\Action
{
public $model;
public $status;

public function run($id)
{
$modelClass = $this->model ? $this->model : $this->controller->modelClass;
if($this->status === null){
$this->status = $this->id == 'off' ? 0 : 1;
}

if(($model = $modelClass::findOne($id))){
$model->status = $this->status;
$model->update();
} else {
$this->controller->error = Yii::t('easyii', 'Not found');
}

return $this->controller->formatResponse(\Yii::t('easyii', 'Status successfully changed'));
}
}
28 changes: 28 additions & 0 deletions actions/ClearImageAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
namespace yii\easyii\actions;

use Yii;

class ClearImageAction extends \yii\base\Action
{
public $model;

public function run($id)
{
$modelClass = $this->model ? $this->model : $this->controller->modelClass;
$model = $modelClass::findOne($id);

if($model === null){
$this->controller->flash('error', Yii::t('easyii', 'Not found'));
}
elseif($model->image_file){
$model->image_file = '';
if($model->update()){
$this->controller->flash('success', Yii::t('easyii', 'Image cleared'));
} else {
$this->controller->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors()));
}
}
return $this->controller->back();
}
}
19 changes: 19 additions & 0 deletions actions/DeleteAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
namespace yii\easyii\actions;

class DeleteAction extends \yii\base\Action
{
public $model;
public $successMessage = 'Deleted';

public function run($id)
{
$modelClass = $this->model ? $this->model : $this->controller->modelClass;
if(($model = $modelClass::findOne($id))){
$model->delete();
} else {
$this->controller->error = \Yii::t('easyii', 'Not found');
}
return $this->controller->formatResponse($this->successMessage);
}
}
81 changes: 81 additions & 0 deletions actions/FieldsAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
namespace yii\easyii\actions;

use Yii;
use yii\easyii\components\CategoryWithFieldsModel;

class FieldsAction extends \yii\base\Action
{
public $model;

public function run($id)
{
$modelClass = $this->model ? $this->model : $this->controller->modelClass;

/** @var \yii\easyii\components\CategoryWithFieldsModel $model */
if(!($model = $modelClass::findOne($id))){
return $this->controller->redirect(['/admin/' . $this->controller->module->id]);
}

if (Yii::$app->request->post('save'))
{
$fields = Yii::$app->request->post('Field') ?: [];
$result = [];

foreach($fields as $field){
$temp = json_decode($field);

if( $temp === null && json_last_error() !== JSON_ERROR_NONE ||
empty($temp->name) ||
empty($temp->title) ||
empty($temp->type) ||
!($temp->name = trim($temp->name)) ||
!($temp->title = trim($temp->title)) ||
!array_key_exists($temp->type, CategoryWithFieldsModel::$FIELD_TYPES)
){
continue;
}
$options = trim($temp->options);
if($temp->type == CategoryWithFieldsModel::FIELD_TYPE_SELECT || $temp->type == CategoryWithFieldsModel::FIELD_TYPE_CHECKBOX){
if($options == ''){
continue;
}
$optionsArray = [];
foreach(explode(',', $options) as $option){
$optionsArray[] = trim($option);
}
$options = $optionsArray;
}

$result[] = [
'name' => \yii\helpers\Inflector::slug($temp->name),
'title' => $temp->title,
'type' => $temp->type,
'options' => $options
];
}

$model->fields = $result;

if($model->update(false, ['fields'])){
$ids = [];
foreach($model->children()->all() as $child){
$ids[] = $child->primaryKey;
}
if(count($ids)){
$modelClass::updateAll(['fields' => json_encode($model->fields)], ['in', 'id', $ids]);
}

$this->controller->flash('success', Yii::t('easyii', 'Category updated'));
} elseif($model->hasErrors()) {
$this->controller->flash('error', Yii::t('easyii','Update error. {0}', $model->formatErrors()));
}
return $this->controller->refresh();
}
else {
return $this->controller->render('@easyii/views/category/fields', [
'model' => $model
]);
}
}
}
7 changes: 7 additions & 0 deletions actions/SortByDateAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace yii\easyii\actions;

class SortByDateAction extends BaseSortAction
{
public $attribute = 'time';
}
7 changes: 7 additions & 0 deletions actions/SortByNumAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace yii\easyii\actions;

class SortByNumAction extends BaseSortAction
{
public $attribute = 'order_num';
}
1 change: 1 addition & 0 deletions assets/AdminAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AdminAsset extends \yii\web\AssetBundle
'yii\web\JqueryAsset',
'yii\bootstrap\BootstrapAsset',
'yii\easyii\assets\SwitcherAsset',
'yii\easyii\assets\FancyboxAsset',
];
public $jsOptions = array(
'position' => \yii\web\View::POS_HEAD
Expand Down
16 changes: 16 additions & 0 deletions assets/FieldsTableAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
namespace yii\easyii\assets;

class FieldsTableAsset extends \yii\web\AssetBundle
{
public $sourcePath = '@easyii/assets/fields_table';
public $css = [
'fields.css',
];
public $js = [
'fields.js'
];
public $depends = [
'yii\web\JqueryAsset',
];
}
1 change: 0 additions & 1 deletion assets/FrontendAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class FrontendAsset extends \yii\web\AssetBundle
];
public $depends = [
'yii\web\JqueryAsset',
'yii\bootstrap\BootstrapAsset',
'yii\easyii\assets\SwitcherAsset'
];
}
21 changes: 0 additions & 21 deletions assets/RedactorAsset.php

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ $(function(){

function optionsIsNeeded(type)
{
return type == 'select' || type == 'checkbox';
return fieldsWithOptions.indexOf(type) !== -1;
}
});
6 changes: 3 additions & 3 deletions assets/photos/photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(function(){
if(/^image\/(jpeg|png|gif)$/.test(file.type))
{
var formData = new FormData();
formData.append('Photo[image]', file);
formData.append('Photo[image_file]', file);

$.ajax({
url: $this.closest('form').attr('action'),
Expand All @@ -36,7 +36,7 @@ $(function(){
success: function(response){
if(response.result === 'success'){
var html = $(photoTemplate
.replace(/\{\{photo_id\}\}/g, response.photo.id)
.replace(/\{\{id\}\}/g, response.photo.id)
.replace(/\{\{photo_thumb\}\}/g, response.photo.thumb)
.replace(/\{\{photo_image\}\}/g, response.photo.image)
.replace(/\{\{photo_description\}\}/g, ''))
Expand Down Expand Up @@ -107,7 +107,7 @@ $(function(){
var fileData = $this.prop('files')[0];
var formData = new FormData();
var changeButton = $this.siblings('.change-image-button').addClass('disabled');
formData.append('Photo[image]', fileData);
formData.append('Photo[image_file]', fileData);
$.ajax({
url: $this.siblings('.change-image-button').attr('href'),
dataType: 'json',
Expand Down
Loading