diff --git a/common/config/main.php b/common/config/main.php index 9c93fe5..5264dff 100755 --- a/common/config/main.php +++ b/common/config/main.php @@ -2,7 +2,11 @@ return [ 'language' => 'ru', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', - + 'controllerMap' => [ + 'artbox-comment' => [ + 'class' => \common\modules\comment\Controller::className(), + ], + ], 'components' => [ 'assetManager' => [ 'bundles' => [ @@ -349,46 +353,46 @@ return [ ]*/ ] ], -// 'comment' => [ -// 'class' => 'common\modules\comment\Module', -// 'useRbac' => true, -// 'rbac' => [ -// 'rules' => [ -// \common\modules\comment\rbac\ArtboxCommentCreateRule::className(), -// \common\modules\comment\rbac\ArtboxCommentDeleteRule::className(), -// \common\modules\comment\rbac\ArtboxCommentUpdateRule::className(), -// \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule::className(), -// \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule::className(), -// ], -// 'permissions' => [ -// [ -// 'name' => common\modules\comment\Permissions::CREATE, -// 'description' => 'Can create comments', -// 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentCreateRule())->name, -// ], -// [ -// 'name' => common\modules\comment\Permissions::UPDATE, -// 'description' => 'Can update comments', -// 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateRule())->name, -// ], -// [ -// 'name' => common\modules\comment\Permissions::DELETE, -// 'description' => 'Can delete comments', -// 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteRule())->name, -// ], -// [ -// 'name' => common\modules\comment\Permissions::UPDATE_OWN, -// 'description' => 'Can update own comments', -// 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule())->name, -// ], -// [ -// 'name' => common\modules\comment\Permissions::DELETE_OWN, -// 'description' => 'Can delete own comments', -// 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule())->name, -// ], -// ], -// ], -// -// ], + 'comment' => [ + 'class' => 'common\modules\comment\Module', + 'useRbac' => false, + 'rbac' => [ + 'rules' => [ + \common\modules\comment\rbac\ArtboxCommentCreateRule::className(), + \common\modules\comment\rbac\ArtboxCommentDeleteRule::className(), + \common\modules\comment\rbac\ArtboxCommentUpdateRule::className(), + \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule::className(), + \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule::className(), + ], + 'permissions' => [ + [ + 'name' => common\modules\comment\Permissions::CREATE, + 'description' => 'Can create comments', + 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentCreateRule())->name, + ], + [ + 'name' => common\modules\comment\Permissions::UPDATE, + 'description' => 'Can update comments', + 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateRule())->name, + ], + [ + 'name' => common\modules\comment\Permissions::DELETE, + 'description' => 'Can delete comments', + 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteRule())->name, + ], + [ + 'name' => common\modules\comment\Permissions::UPDATE_OWN, + 'description' => 'Can update own comments', + 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule())->name, + ], + [ + 'name' => common\modules\comment\Permissions::DELETE_OWN, + 'description' => 'Can delete own comments', + 'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule())->name, + ], + ], + ], + + ], ], ]; diff --git a/common/models/ProductToRating.php b/common/models/ProductToRating.php new file mode 100644 index 0000000..ad5755e --- /dev/null +++ b/common/models/ProductToRating.php @@ -0,0 +1,59 @@ + 0], + [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'product_to_rating_id' => 'Product To Rating ID', + 'product_id' => 'Product ID', + 'value' => 'Value', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getProduct() + { + return $this->hasOne(Product::className(), ['product_id' => 'product_id']); + } +} diff --git a/common/modules/comment/Controller.php b/common/modules/comment/Controller.php index 4d28192..1d7e87b 100755 --- a/common/modules/comment/Controller.php +++ b/common/modules/comment/Controller.php @@ -1,97 +1,237 @@ - [ - 'class' => \yii\filters\VerbFilter::className(), - 'actions' => [ - '*' => ['post'], - ], - ], - ]; - } - - public function actionDelete() - { - \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; - $post = \Yii::$app->request->post('Comment'); - if(!empty($post['comment_id'])) { - if($model = \common\modules\comment\models\Comment::findOne($post['comment_id'])) { - /** - * @var \common\modules\comment\models\Comment $model - */ - $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; - if($model->deleteComment()) { - \Yii::$app->response->data = ['text' => 'Comment marked as deleted and will be check by administrators']; - } else { - \Yii::$app->response->data = ['error' => $model->hasErrors('comment_id')?$model->getFirstError('comment_id'):'Cannot delete message']; - } - }else { - \Yii::$app->response->data = ['error' => 'Comment not found']; - }; - } else { - \Yii::$app->response->data = ['error' => 'Missing comment_id']; - } - \Yii::$app->response->send(); - } - - public function actionUpdate() - { - \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; - $post = \Yii::$app->request->post(); - if(!empty($post['Comment']['comment_id'])) { - if($model = \common\modules\comment\models\Comment::findOne($post['Comment']['comment_id'])) { - /** - * @var \common\modules\comment\models\Comment $model - */ - $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; - $model->load($post); - if(empty($post['Comment']['comment_pid'])) { - $model->comment_pid = null; - } - if($model->updateComment()) { - \Yii::$app->response->data = ['text' => 'Comment successfully updated']; - } else { - \Yii::$app->response->data = ['error' => $model->hasErrors()?$model->getFirstErrors():'Cannot update message']; - } - }else { - \Yii::$app->response->data = ['error' => 'Comment not found']; - }; - } else { - \Yii::$app->response->data = ['error' => 'Missing comment_id']; - } - \Yii::$app->response->send(); - } - - public function actionForm() - { - $post = \Yii::$app->request->post('Comment'); - if(!empty($post['comment_id'])) { - $model = \common\modules\comment\models\Comment::find()->where(['comment_id' => $post['comment_id']])->with('parent', 'author')->one(); - if($model) { - /** - * @var \common\modules\comment\models\Comment $model - */ - $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; - if($model->checkUpdate()) { - return $this->renderAjax('@common/modules/comment/views/comment_form', [ - 'model' => $model, - ]); - } else { - \Yii::$app->response->data = ['error' => 'You are not able to update this comment']; - } - }else { - \Yii::$app->response->data = ['error' => 'Comment not found']; - }; - } else { - \Yii::$app->response->data = ['error' => 'Missing comment_id']; - } - \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; - \Yii::$app->response->send(); - } - + [ + 'class' => \yii\filters\VerbFilter::className(), + 'actions' => [ + '*' => [ 'post' ], + ], + ], + ]; + } + + public function actionDelete() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post('Comment'); + $get = \Yii::$app->request->get(); + if(empty( $post[ 'comment_id' ] ) && !empty( $get[ 'comment_id' ] )) { + $post[ 'comment_id' ] = $get[ 'comment_id' ]; + } + if(!empty( $post[ 'comment_id' ] )) { + if($model = \common\modules\comment\models\Comment::findOne($post[ 'comment_id' ])) { + /** + * @var \common\modules\comment\models\Comment $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; + if($model->deleteComment()) { + \Yii::$app->response->data = [ 'text' => 'Comment marked as deleted and will be check by administrators' ]; + } else { + \Yii::$app->response->data = [ 'error' => $model->hasErrors('comment_id') ? $model->getFirstError('comment_id') : 'Cannot delete message' ]; + } + } else { + \Yii::$app->response->data = [ 'error' => 'Comment not found' ]; + }; + } else { + \Yii::$app->response->data = [ 'error' => 'Missing comment_id' ]; + } + \Yii::$app->response->send(); + } + + public function actionUpdate() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post(); + if(!empty( $post[ 'Comment' ][ 'comment_id' ] )) { + if($model = \common\modules\comment\models\Comment::findOne($post[ 'Comment' ][ 'comment_id' ])) { + /** + * @var \common\modules\comment\models\Comment $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; + $model->load($post); + if(empty( $post[ 'Comment' ][ 'comment_pid' ] )) { + $model->comment_pid = NULL; + } + if($model->updateComment()) { + $model->rating->load($post); + if($model->rating->save()) { + return [ + 'result' => [ + 'text' => 'Comment successfully updated', + 'html' => $this->renderAjax('@common/modules/comment/widgets/views/_review_comment_view', [ 'model' => $model ]), + ], + ]; + } else { + return [ + 'error' => $model->hasErrors() ? $model->getFirstErrors() : 'Cannot update message', + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-review', [ + 'model' => $model, + ]), + ]; + } + } else { + return [ + 'error' => $model->hasErrors() ? $model->getFirstErrors() : 'Cannot update message', + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-review', [ + 'model' => $model, + ]), + ]; + } + } else { + return [ 'error' => 'Comment not found' ]; + } + } else { + return [ 'error' => 'Missing comment_id' ]; + } + } + + public function actionForm() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post('Comment'); + if(!empty( $post[ 'comment_id' ] )) { + $model = \common\modules\comment\models\Comment::find() + ->where([ 'comment_id' => $post[ 'comment_id' ] ]) + ->with('parent', 'user') + ->one(); + if($model) { + /** + * @var \common\modules\comment\models\Comment $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; + if($model->checkUpdate()) { + return [ + 'result' => [ + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-review', [ + 'model' => $model, + ]), + ], + ]; + } else { + return [ 'error' => 'You are not able to update this comment' ]; + } + } else { + return [ 'error' => 'Comment not found' ]; + } + } else { + return [ 'error' => 'Missing comment_id' ]; + } + } + + public function actionUpdateAnswer() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post(); + if(!empty( $post[ 'CommentProjectAnswer' ][ 'comment_id' ] )) { + if($model = \common\modules\comment\models\CommentProjectAnswer::findOne($post[ 'CommentProjectAnswer' ][ 'comment_id' ])) { + /** + * @var \common\modules\comment\models\CommentProjectAnswer $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\CommentProjectAnswer::SCENARIO_USER : \common\modules\comment\models\CommentProjectAnswer::SCENARIO_GUEST; + $model->load($post); + if(empty( $post[ 'CommentProjectAnswer' ][ 'comment_pid' ] )) { + $model->comment_pid = NULL; + } + if($model->updateComment()) { + $model->rating->load($post); + if($model->rating->save()) { + return [ + 'result' => [ + 'text' => 'Comment successfully updated', + 'html' => $this->renderAjax('@common/modules/comment/widgets/views/_question_comment_view', [ 'model' => $model ]), + ], + ]; + } else { + return [ + 'error' => $model->hasErrors() ? $model->getFirstErrors() : 'Cannot update message', + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-answer', [ + 'model' => $model, + ]), + ]; + } + } else { + return [ + 'error' => $model->hasErrors() ? $model->getFirstErrors() : 'Cannot update message', + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-answer', [ + 'model' => $model, + ]), + ]; + } + } else { + return [ 'error' => 'Comment not found' ]; + } + } else { + return [ 'error' => 'Missing comment_id' ]; + } + } + + public function actionFormAnswer() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post('CommentProjectAnswer'); + if(!empty( $post[ 'comment_id' ] )) { + $model = \common\modules\comment\models\CommentProjectAnswer::find() + ->where([ 'comment_id' => $post[ 'comment_id' ] ]) + ->with('parent', 'user') + ->one(); + if($model) { + /** + * @var \common\modules\comment\models\CommentProjectAnswer $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\CommentProjectAnswer::SCENARIO_USER : \common\modules\comment\models\CommentProjectAnswer::SCENARIO_GUEST; + if($model->checkUpdate()) { + return [ + 'result' => [ + 'form' => $this->renderAjax('@common/modules/comment/widgets/views/form-comment-answer', [ + 'model' => $model, + ]), + ], + ]; + } else { + return [ 'error' => 'You are not able to update this comment' ]; + } + } else { + return [ 'error' => 'Comment not found' ]; + } + } else { + return [ 'error' => 'Missing comment_id' ]; + } + } + + public function actionDeleteAnswer() + { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $post = \Yii::$app->request->post('CommentProjectAnswer'); + $get = \Yii::$app->request->get(); + if(empty( $post[ 'comment_id' ] ) && !empty( $get[ 'comment_id' ] )) { + $post[ 'comment_id' ] = $get[ 'comment_id' ]; + } + if(!empty( $post[ 'comment_id' ] )) { + if($model = \common\modules\comment\models\CommentProjectAnswer::findOne($post[ 'comment_id' ])) { + /** + * @var \common\modules\comment\models\Comment $model + */ + $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\CommentProjectAnswer::SCENARIO_USER : \common\modules\comment\models\CommentProjectAnswer::SCENARIO_GUEST; + if($model->deleteComment()) { + \Yii::$app->response->data = [ 'text' => 'Comment marked as deleted and will be check by administrators' ]; + } else { + \Yii::$app->response->data = [ 'error' => $model->hasErrors('comment_id') ? $model->getFirstError('comment_id') : 'Cannot delete message' ]; + } + } else { + \Yii::$app->response->data = [ 'error' => 'Comment not found' ]; + }; + } else { + \Yii::$app->response->data = [ 'error' => 'Missing comment_id' ]; + } + \Yii::$app->response->send(); + } + } \ No newline at end of file diff --git a/common/modules/comment/Module.php b/common/modules/comment/Module.php index e69f500..6a18e72 100755 --- a/common/modules/comment/Module.php +++ b/common/modules/comment/Module.php @@ -1,74 +1,74 @@ - - * [ - * 'rules' => [ - * \full\namapaced\ClassName, - * \another\one\ClassName, - * ], - * 'permissions' => [ - * [ - * 'name' => stringName, - * 'description' => descriptionText, - * 'ruleName' => (new \full\namespaced\ClassName())->name (optional) - * ], - * [ - * 'name' => stringName2, - * 'description' => descriptionText2, - * 'ruleName' => (new \another\one\ClassName())->name (optional) - * ], - * ] - * ] - * - * - * @var array - * @see \common\modules\comment\commands\RbacController - */ - public $rbac = []; - - /** - * @var \yii\db\Connection Connection to the db - */ - public $db = null; - - /** - * @inheritdoc - */ - public function init() - { - parent::init(); - if(\Yii::$app instanceof \yii\console\Application) { - $this->controllerNamespace = 'common\modules\comment\commands'; - } - if($this->db === null) { - $this->db = \Yii::$app->db; - } elseif(!$this->db instanceof \yii\db\Connection) { - throw new \yii\base\InvalidConfigException('Конфиг db обязан наследоваться от'.\yii\db\Connection::className()); - } - } + + * [ + * 'rules' => [ + * \full\namapaced\ClassName, + * \another\one\ClassName, + * ], + * 'permissions' => [ + * [ + * 'name' => stringName, + * 'description' => descriptionText, + * 'ruleName' => (new \full\namespaced\ClassName())->name (optional) + * ], + * [ + * 'name' => stringName2, + * 'description' => descriptionText2, + * 'ruleName' => (new \another\one\ClassName())->name (optional) + * ], + * ] + * ] + * + * + * @var array + * @see \common\modules\comment\commands\RbacController + */ + public $rbac = []; + + /** + * @var \yii\db\Connection Connection to the db + */ + public $db = null; + + /** + * @inheritdoc + */ + public function init() + { + parent::init(); + if(\Yii::$app instanceof \yii\console\Application) { + $this->controllerNamespace = 'common\modules\comment\commands'; + } + if($this->db === null) { + $this->db = \Yii::$app->db; + } elseif(!$this->db instanceof \yii\db\Connection) { + throw new \yii\base\InvalidConfigException('Конфиг db обязан наследоваться от'.\yii\db\Connection::className()); + } + } } \ No newline at end of file diff --git a/common/modules/comment/Permissions.php b/common/modules/comment/Permissions.php index 5328127..965f0f4 100755 --- a/common/modules/comment/Permissions.php +++ b/common/modules/comment/Permissions.php @@ -1,12 +1,12 @@ - \yii\web\View::POS_READY, - ]; - + \yii\web\View::POS_HEAD, + ]; + } \ No newline at end of file diff --git a/common/modules/comment/commands/RbacController.php b/common/modules/comment/commands/RbacController.php index 3ca8555..cd9d130 100755 --- a/common/modules/comment/commands/RbacController.php +++ b/common/modules/comment/commands/RbacController.php @@ -1,81 +1,81 @@ -controller->module; - if(!$module->useRbac) { - throw new \yii\base\InvalidConfigException('Please set useRbac config to TRUE in your module configs'); - } - $auth = \Yii::$app->getAuthManager(); - if(!$auth instanceof \yii\rbac\ManagerInterface) { - throw new \yii\base\InvalidConfigException('ManagerInterface is not configured'); - } - if(!empty($module->rbac['rules'])) { - foreach($module->rbac['rules'] as $rule) { - $rule_model = new $rule(); - echo "Creating rule: ".$rule_model->name."\n"; - if($auth->add($rule_model)) { - echo "Successful\n"; - } else { - echo "Failed\n"; - } - unset($rule_model); - } - } - if(!empty($module->rbac['permissions'])) { - foreach($module->rbac['permissions'] as $permission) { - echo "Creating permission: ".$permission['name']."\n"; - if($auth->add(new \yii\rbac\Permission($permission))) { - echo "Successful\n"; - } else { - echo "Failed\n"; - } - } - } - } - - public function actionUninstall() - { - /** - * @var \common\modules\comment\Module $module - */ - $module = \Yii::$app->controller->module; - if(!$module->useRbac) { - throw new \yii\base\InvalidConfigException('Please set useRbac config to TRUE in your module configs'); - } - $auth = \Yii::$app->getAuthManager(); - if(!$auth instanceof \yii\rbac\ManagerInterface) { - throw new \yii\base\InvalidConfigException('ManagerInterface is not configured'); - } - if(!empty($module->rbac['rules'])) { - foreach($module->rbac['rules'] as $rule) { - $rule_model = new $rule(); - echo "Removing rule: ".$rule_model->name."\n"; - if($auth->remove($rule_model)) { - echo "Successful\n"; - } else { - echo "Failed\n"; - } - unset($rule_model); - } - } - if(!empty($module->rbac['permissions'])) { - foreach($module->rbac['permissions'] as $permission) { - echo "Removing permission: ".$permission['name']."\n"; - if($auth->remove(new \yii\rbac\Permission($permission))) { - echo "Successful\n"; - } else { - echo "Failed\n"; - } - } - } - } - +controller->module; + if(!$module->useRbac) { + throw new \yii\base\InvalidConfigException('Please set useRbac config to TRUE in your module configs'); + } + $auth = \Yii::$app->getAuthManager(); + if(!$auth instanceof \yii\rbac\ManagerInterface) { + throw new \yii\base\InvalidConfigException('ManagerInterface is not configured'); + } + if(!empty($module->rbac['rules'])) { + foreach($module->rbac['rules'] as $rule) { + $rule_model = new $rule(); + echo "Creating rule: ".$rule_model->name."\n"; + if($auth->add($rule_model)) { + echo "Successful\n"; + } else { + echo "Failed\n"; + } + unset($rule_model); + } + } + if(!empty($module->rbac['permissions'])) { + foreach($module->rbac['permissions'] as $permission) { + echo "Creating permission: ".$permission['name']."\n"; + if($auth->add(new \yii\rbac\Permission($permission))) { + echo "Successful\n"; + } else { + echo "Failed\n"; + } + } + } + } + + public function actionUninstall() + { + /** + * @var \common\modules\comment\Module $module + */ + $module = \Yii::$app->controller->module; + if(!$module->useRbac) { + throw new \yii\base\InvalidConfigException('Please set useRbac config to TRUE in your module configs'); + } + $auth = \Yii::$app->getAuthManager(); + if(!$auth instanceof \yii\rbac\ManagerInterface) { + throw new \yii\base\InvalidConfigException('ManagerInterface is not configured'); + } + if(!empty($module->rbac['rules'])) { + foreach($module->rbac['rules'] as $rule) { + $rule_model = new $rule(); + echo "Removing rule: ".$rule_model->name."\n"; + if($auth->remove($rule_model)) { + echo "Successful\n"; + } else { + echo "Failed\n"; + } + unset($rule_model); + } + } + if(!empty($module->rbac['permissions'])) { + foreach($module->rbac['permissions'] as $permission) { + echo "Removing permission: ".$permission['name']."\n"; + if($auth->remove(new \yii\rbac\Permission($permission))) { + echo "Successful\n"; + } else { + echo "Failed\n"; + } + } + } + } + } \ No newline at end of file diff --git a/common/modules/comment/interfaces/CommentInterface.php b/common/modules/comment/interfaces/CommentInterface.php index 3fee3fa..352c423 100755 --- a/common/modules/comment/interfaces/CommentInterface.php +++ b/common/modules/comment/interfaces/CommentInterface.php @@ -1,11 +1,11 @@ - 1, - ], - [ - [ 'comment_pid' ], - 'exist', - 'targetAttribute' => 'comment_id', - 'filter' => [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ], - ], - ]; - } - - public function scenarios() - { - return [ - self::SCENARIO_GUEST => [ - 'user_name', - 'user_email', - 'text', - 'comment_pid', - ], - self::SCENARIO_USER => [ - 'text', - 'comment_pid', - ], - ]; - } - - /** - * @inheritdoc - */ - public function behaviors() - { - return [ - [ - 'class' => \yii\behaviors\TimestampBehavior::className(), - 'createdAtAttribute' => 'date_add', - 'updatedAtAttribute' => 'date_update', - 'value' => new \yii\db\Expression('NOW()'), - ], - ]; - } - - public function afterSave($insert, $changedAttributes) - { - if($this->model == User::className()) { - if($user = User::findOne($this->model_id)) { - /** - * @var User $user - */ - $user->updateRating(); - } - } - parent::afterSave($insert, $changedAttributes); - } - - /** - * @inheritdoc - */ - public static function tableName() - { - return '{{%comment}}'; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'text' => \Yii::t('app', 'Комментарий'), - 'user_name' => \Yii::t('app', 'Имя'), - 'user_email' => \Yii::t('app', 'Email'), - ]; - } - - public function getGuestComment() - { - return $this->guestComment; - } - - public function setGuestComment($value) - { - $this->guestComment = $value; - } - - /** - * @param string $model - * @param integer $model_id - * - * @return ActiveQuery - */ - public function getComments($model, $model_id) - { - return $this->find() - ->where([ - 'comment.model' => $model, - 'comment.model_id' => $model_id, - 'comment.status' => 1, - ])->with('rating'); - } - - public function postComment() - { - if($this->checkCreate()) { - if($this->insert()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } else { - $this->addError('comment_id', 'You can`t post comment here'); - return false; - } - } - - public function updateComment() - { - if($this->checkUpdate()) { - if(empty( $this->comment_id )) { - $this->addError('comment_id', 'Comment ID not found'); - return false; - } else { - if($this->update()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } - } else { - $this->addError('comment_id', 'You can`t update this post'); - return false; - } - } - - public function deleteComment() - { - if($this->checkDelete()) { - if(empty( $this->comment_id )) { - $this->addError('comment_id', 'Comment ID not found'); - return false; - } else { - if($this->status == self::STATUS_DELETED) { - return false; - } - $this->status = self::STATUS_DELETED; - if($this->update()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } - } else { - $this->addError('comment_id', 'You can`t delete this post'); - return false; - } - } - - public function checkCreate() - { - if($this->getGuestComment()) { - return true; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - public function checkUpdate() - { - if($this->scenario == self::SCENARIO_GUEST) { - return false; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE_OWN, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - public function checkDelete() - { - if($this->scenario == self::SCENARIO_GUEST) { - return false; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE_OWN, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - protected function clearSafe($setNew = true) - { - $safe = $this->safeAttributes(); - $count = count($safe); - $values = array_fill(0, $count, NULL); - $result = array_combine($safe, $values); - $this->setAttributes($result); - $this->setIsNewRecord($setNew); - } - - public function getParent() - { - return $this->hasOne(self::className(), [ 'comment_id' => 'comment_pid' ]); - } - - public function getAuthor() - { - // if($this->user_id != NULL) { - return $this->hasOne(\common\models\User::className(), [ 'id' => 'user_id' ]); - // } else { - // return ['firstname' => $this->user_name, 'email' => $this->user_email]; - // } - } - - public function checkRating() - { - $rating = $this->hasOne(\common\modules\comment\models\Rating::className(), [ - 'model_id' => 'comment_id', - ]) - ->andWhere([ - 'model' => $this->className(), - ]) - ->one(); - if(!$rating instanceof \common\modules\comment\models\Rating && !empty($this->primaryKey)) { - $rating = new \common\modules\comment\models\Rating([ - 'model' => $this->className(), - 'model_id' => $this->comment_id, - 'user_id' => $this->user_id, - ]); - $rating->save(); - } - } - - public function getRating() - { - $this->checkRating(); - return $this->hasOne(\common\modules\comment\models\Rating::className(), [ - 'model_id' => 'comment_id', - ]) - ->andWhere([ 'model' => $this->className() ]); - } - - public function hasRating($return = true) - { - $rating = $this->hasOne(\common\modules\comment\models\Rating::className(), [ - 'model_id' => 'comment_id', - ]) - ->andWhere([ 'model' => $this->className() ]) - ->andWhere([ - 'not', - [ 'value' => NULL ], - ]) - ->one(); - if($return) { - return $rating; - } else { - return $rating ? true : false; - } - } - - public function getUser() - { - return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); - } - - } + 1, + ], + [ + [ 'comment_pid' ], + 'exist', + 'targetAttribute' => 'comment_id', + 'filter' => [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ], + ], + ]; + } + + public function scenarios() + { + return [ + self::SCENARIO_GUEST => [ + 'user_name', + 'user_email', + 'text', + 'comment_pid', + ], + self::SCENARIO_USER => [ + 'text', + 'comment_pid', + ], + ]; + } + + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + [ + 'class' => \yii\behaviors\TimestampBehavior::className(), + 'createdAtAttribute' => 'date_add', + 'updatedAtAttribute' => 'date_update', + 'value' => new \yii\db\Expression('NOW()'), + ], + ]; + } + + public function afterSave($insert, $changedAttributes) + { + if($this->model == User::className()) { + if($user = User::findOne($this->model_id)) { + /** + * @var User $user + */ + $user->updateRating(); + } + } + if($this->model == Product::className()) { + if($product = Product::findOne($this->model_id)) { + $product->recalculateRating(); + } + } + parent::afterSave($insert, $changedAttributes); + } + + /** + * @inheritdoc + */ + public static function tableName() + { + return '{{%comment}}'; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'text' => \Yii::t('app', 'Комментарий'), + 'user_name' => \Yii::t('app', 'Имя'), + 'user_email' => \Yii::t('app', 'Email'), + ]; + } + + public function getGuestComment() + { + return $this->guestComment; + } + + public function setGuestComment($value) + { + $this->guestComment = $value; + } + + /** + * @param string $model + * @param integer $model_id + * + * @return ActiveQuery + */ + public static function getComments($model, $model_id) + { + return self::find() + ->where([ + 'comment.model' => $model, + 'comment.model_id' => $model_id, + 'comment.status' => 1, + ]) + ->with('rating'); + } + + public function postComment() + { + if($this->checkCreate()) { + if(!empty($this->comment_pid) && !$this->checkReply()) { + $this->addError('comment_id', 'You can`t reply to this message'); + return false; + } + if($this->insert()) { + $this->clearSafe(); + return true; + } else { + return false; + } + } + $this->addError('comment_id', 'You can`t post comment here'); + return false; + } + + public function updateComment() + { + if($this->checkUpdate()) { + if(empty( $this->comment_id )) { + $this->addError('comment_id', 'Comment ID not found'); + return false; + } else { + if($this->update()) { + // $this->clearSafe(); Clears safe attributes after AJAX update + return true; + } else { + return false; + } + } + } else { + $this->addError('comment_id', 'You can`t update this post'); + return false; + } + } + + public function deleteComment() + { + if($this->checkDelete()) { + if(empty( $this->comment_id )) { + $this->addError('comment_id', 'Comment ID not found'); + return false; + } else { + if($this->user_id == \Yii::$app->user->id) { + if($this->delete()) { + return true; + } else { + $this->addError('comment_id', 'Can\'t delete post.'); + return false; + } + } else { + if($this->status == self::STATUS_DELETED) { + return false; + } + $this->status = self::STATUS_DELETED; + if($this->update()) { + $this->clearSafe(); + return true; + } else { + return false; + } + } + } + } else { + $this->addError('comment_id', 'You can`t delete this post'); + return false; + } + } + + public function checkCreate() + { + if($this->getGuestComment()) { + return true; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment_model' => $this, + ]); + } + } + + public function checkUpdate() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE_OWN, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]); + } + } + + public function checkDelete() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return ( \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE_OWN, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]) ); + } + } + + public function checkReply() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return $this->allowReply; + } + } + + protected function clearSafe($setNew = true) + { + $safe = $this->safeAttributes(); + $count = count($safe); + $values = array_fill(0, $count, NULL); + $result = array_combine($safe, $values); + $this->setAttributes($result); + $this->setIsNewRecord($setNew); + } + + public function getParent() + { + return $this->hasOne(self::className(), [ 'comment_id' => 'comment_pid' ]); + } + + public function getAuthorName() + { + if(!empty( $this->author )) { + return $this->author->username; + } else { + return $this->user_name; + } + } + + public function getAuthor($guestMark = '') + { + if(!empty( $this->user )) { + return $this->user->username; + } else { + $name = $this->user_name; + if(!empty( $guestMark )) { + $name .= $guestMark; + } + return $name; + } + } + + public function checkRating() + { + $rating = $this->hasOne(\common\modules\comment\models\Rating::className(), [ + 'model_id' => 'comment_id', + ]) + ->andWhere([ + 'model' => $this->className(), + ]) + ->one(); + if(!$rating instanceof \common\modules\comment\models\Rating && !empty( $this->primaryKey )) { + $rating = new \common\modules\comment\models\Rating([ + 'model' => $this->className(), + 'model_id' => $this->comment_id, + 'user_id' => $this->user_id, + ]); + $rating->save(); + } + } + + public function getRating() + { + $this->checkRating(); + return $this->hasOne(\common\modules\comment\models\Rating::className(), [ + 'model_id' => 'comment_id', + ]) + ->andWhere([ 'rating.model' => $this->className() ]); + } + + public function hasRating($return = true) + { + $rating = $this->hasOne(\common\modules\comment\models\Rating::className(), [ + 'model_id' => 'comment_id', + ]) + ->andWhere([ 'model' => $this->className() ]) + ->andWhere([ + 'not', + [ 'value' => NULL ], + ]) + ->one(); + if($return) { + return $rating; + } else { + return $rating ? true : false; + } + } + + public function getUser() + { + return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); + } + + public function buildButtons( + $buttons = [ + 'delete', + 'update', + 'reply', + ] + ) { + if(in_array('delete', $buttons)) { + if($this->checkDelete()) { + $this->buttons[ 'delete' ] = Url::to([ + 'artbox-comment/delete', + 'comment_id' => $this->comment_id, + ]); + } + } + if(in_array('update', $buttons)) { + if($this->checkUpdate()) { + $this->buttons[ 'update' ] = Url::to([ + 'artbox-comment/update', + 'comment_id' => $this->comment_id, + ]); + } + } + if(in_array('reply', $buttons)) { + if($this->checkReply()) { + $this->buttons[ 'reply' ] = Url::to([ + 'artbox-comment/reply', + 'comment_id' => $this->comment_id, + ]); + } + } + } + + public function getAllowReply() + { + return $this->hasAttribute('comment_pid'); + } + + } diff --git a/common/modules/comment/models/CommentProject.php b/common/modules/comment/models/CommentProject.php index dd3a942..d35290c 100755 --- a/common/modules/comment/models/CommentProject.php +++ b/common/modules/comment/models/CommentProject.php @@ -1,437 +1,460 @@ - 0, - ], - [ - [ - 'budget_currency', - ], - 'default', - 'value' => 3, - ], - [ - [ 'budget_currency' ], - 'exist', - 'targetClass' => Currency::className(), - 'targetAttribute' => 'currency_id', - ], - [ - [ - 'files', - ], - 'string', - ], - [ - [ - 'file', - ], - 'safe', - ], - [ - [ 'status' ], - 'default', - 'value' => 1, - ], - [ - [ 'state' ], - 'integer', - 'max' => 4, - 'min' => 1, - 'on' => self::SCENARIO_STATE, - ], - [ - [ 'state' ], - 'required', - 'on' => self::SCENARIO_STATE, - ], - [ - [ 'state' ], - 'required', - 'on' => self::SCENARIO_OWNER, - ], - [ - [ 'state' ], - 'in', - 'range' => [ - 1, - 5, - ], - 'on' => self::SCENARIO_OWNER, - ], - ]; - } - - public function scenarios() - { - return [ - self::SCENARIO_USER => [ - 'text', - 'budget_from', - 'budget_to', - 'term_from', - 'term_to', - 'file', - ], - self::SCENARIO_GUEST => [ - - ], - self::SCENARIO_STATE => [ - 'state', - ], - self::SCENARIO_OWNER => [ - 'state', - ], - ]; - } - - /** - * @inheritdoc - */ - public function behaviors() - { - return [ - [ - 'class' => \yii\behaviors\TimestampBehavior::className(), - 'createdAtAttribute' => 'date_add', - 'updatedAtAttribute' => 'date_update', - 'value' => new \yii\db\Expression('NOW()'), - ], - ]; - } - - public static function tableName() - { - return '{{%comment_project}}'; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'text' => \Yii::t('app', 'Текст ответа'), - 'budget_from' => \Yii::t('app', 'от'), - 'budget_to' => \Yii::t('app', 'до'), - 'term_from' => \Yii::t('app', 'от'), - 'term_to' => \Yii::t('app', 'до'), - ]; - } - - public function getGuestComment() - { - return $this->guestComment; - } - - // public function setGuestComment($value) - // { - // $this->guestComment = $value; - // } - - /** - * @param string $model - * @param integer $model_id - * - * @return ActiveQuery - */ - public function getComments($model, $model_id) - { - return $this->find() - ->where([ - 'comment_project.model' => $model, - 'comment_project.model_id' => $model_id, - 'comment_project.status' => 1, - ]) - ->with('currency', 'user', 'user.userInfo', 'user.companyInfo', 'user.comments'); - } - - public function postComment() - { - if($this->checkCreate()) { - if(!empty( \Yii::$app->request->post($this->formName())[ 'anonymous' ] )) { - $this->status = self::STATUS_ANONYMOUS; - } - $this->file = UploadedFile::getInstances($this, 'file'); - if(!empty( $this->file )) { - $file_id = [ ]; - if(is_array($this->file)) { - foreach($this->file as $file) { - if($file instanceof UploadedFile) { - $file_model = new File(); - $file_id[] = $file_model->saveFile($file); - } - } - } else { - if($this->file instanceof UploadedFile) { - $file_model = new File(); - $file_id[] = $file_model->saveFile($this->file); - } - } - $this->files = json_encode($file_id); - } - if($this->insert()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } else { - $this->addError('comment_id', 'You can`t post comment here'); - return false; - } - } - - public function updateComment() - { - if($this->checkUpdate()) { - if(empty( $this->comment_id )) { - $this->addError('comment_id', 'Comment ID not found'); - return false; - } else { - if($this->update()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } - } else { - $this->addError('comment_id', 'You can`t update this post'); - return false; - } - } - - public function deleteComment() - { - if($this->checkDelete()) { - if(empty( $this->comment_id )) { - $this->addError('comment_id', 'Comment ID not found'); - return false; - } else { - if($this->status == self::STATUS_DELETED) { - return false; - } - $this->status = self::STATUS_DELETED; - if($this->update()) { - $this->clearSafe(); - return true; - } else { - return false; - } - } - } else { - $this->addError('comment_id', 'You can`t delete this post'); - return false; - } - } - - public function checkCreate() - { - if($this->getGuestComment()) { - return true; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - public function checkUpdate() - { - if($this->scenario == self::SCENARIO_GUEST) { - return false; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE_OWN, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - public function checkDelete() - { - if($this->scenario == self::SCENARIO_GUEST) { - return false; - } else { - return \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE_OWN, [ - 'model' => $this->model, - 'model_id' => $this->model_id, - ]); - } - } - - protected function clearSafe($setNew = true) - { - $safe = $this->safeAttributes(); - $count = count($safe); - $values = array_fill(0, $count, NULL); - $result = array_combine($safe, $values); - $this->setAttributes($result); - $this->setIsNewRecord($setNew); - } - - public function getAuthor() - { - // if($this->user_id != NULL) { - return $this->hasOne(\common\models\User::className(), [ 'id' => 'user_id' ]); - // } else { - // return ['firstname' => $this->user_name, 'email' => $this->user_email]; - // } - } - - /** - * @return ActiveQuery - */ - public function getCurrency() - { - return $this->hasOne(Currency::className(), [ 'currency_id' => 'budget_currency' ]); - } - - /** - * @return File[] - */ - public function getFilesList() - { - $files = json_decode($this->files); - if(!empty( $files )) { - return File::findAll($files); - } else { - return [ ]; - } - } - - /** - * @return ActiveRecord - * @throws \TypeError - */ - public function getOwner() - { - $model = new $this->model(); - if($model instanceof ActiveRecord) { - return $model->findOne($this->model_id); - } else { - throw new \TypeError('Model must extends Active Record Class'); - } - } - - public function getProject() - { - return $this->hasOne(Project::className(), [ 'project_id' => 'model_id' ]); - } - - /** - * @return User - */ - public function getUser() - { - return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); - } - - public function changeState() - { - if($this->isAttributeChanged('state')) { - if($this->save()) { - return true; - } else { - return false; - } - } else { - return true; - } - } - - } + 0, + ], + [ + [ + 'budget_currency', + ], + 'default', + 'value' => 3, + ], + [ + [ 'budget_currency' ], + 'exist', + 'targetClass' => Currency::className(), + 'targetAttribute' => 'currency_id', + ], + [ + [ + 'files', + ], + 'string', + ], + [ + [ + 'file', + ], + 'safe', + ], + [ + [ 'status' ], + 'default', + 'value' => 1, + ], + [ + [ 'state' ], + 'integer', + 'max' => 4, + 'min' => 1, + 'on' => self::SCENARIO_STATE, + ], + [ + [ 'state' ], + 'required', + 'on' => self::SCENARIO_STATE, + ], + [ + [ 'state' ], + 'required', + 'on' => self::SCENARIO_OWNER, + ], + [ + [ 'state' ], + 'in', + 'range' => [ + 1, + 5, + ], + 'on' => self::SCENARIO_OWNER, + ], + ]; + } + + public function scenarios() + { + return [ + self::SCENARIO_USER => [ + 'text', + 'budget_from', + 'budget_to', + 'budget_currency', + 'term_from', + 'term_to', + 'file', + ], + self::SCENARIO_GUEST => [ + + ], + self::SCENARIO_STATE => [ + 'state', + ], + self::SCENARIO_OWNER => [ + 'state', + ], + ]; + } + + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + [ + 'class' => \yii\behaviors\TimestampBehavior::className(), + 'createdAtAttribute' => 'date_add', + 'updatedAtAttribute' => 'date_update', + 'value' => new \yii\db\Expression('NOW()'), + ], + ]; + } + + public static function tableName() + { + return '{{%comment_project}}'; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'text' => \Yii::t('app', 'Текст ответа'), + 'budget_from' => \Yii::t('app', 'от'), + 'budget_to' => \Yii::t('app', 'до'), + 'term_from' => \Yii::t('app', 'от'), + 'term_to' => \Yii::t('app', 'до'), + ]; + } + + public function getGuestComment() + { + return $this->guestComment; + } + + // public function setGuestComment($value) + // { + // $this->guestComment = $value; + // } + + /** + * @param string $model + * @param integer $model_id + * + * @return ActiveQuery + */ + public static function getComments($model, $model_id) + { + /** + * @var User $user + */ + $user = \Yii::$app->user->identity; + if(!empty($user)) { + $project = Project::findOne($model_id); + if(!empty($project) && $user->id == $project->user_id) { + return self::find() + ->where([ + 'comment_project.model' => $model, + 'comment_project.model_id' => $model_id, + 'comment_project.status' => [self::STATUS_ANONYMOUS, self::STATUS_ACTIVE, self::STATUS_PERSONAL], + ]) + ->with('currency', 'user', 'user.userInfo', 'user.companyInfo', 'user.comments'); + } + } + $query = self::find() + ->where([ + 'comment_project.model' => $model, + 'comment_project.model_id' => $model_id, + ]) + ->with('currency', 'user', 'user.userInfo', 'user.companyInfo', 'user.comments'); + if(!empty($user)) { + $query->andWhere(['or', ['comment_project.status' => self::STATUS_ACTIVE], ['comment_project.status' => self::STATUS_ANONYMOUS, 'comment_project.user_id' => $user->id]]); + } else { + $query->andWhere(['comment_project.status' => 1]); + } + return $query; + } + + public function postComment() + { + if($this->checkCreate()) { + if(!empty( \Yii::$app->request->post($this->formName())[ 'anonymous' ] )) { + $this->status = self::STATUS_ANONYMOUS; + } + $this->file = UploadedFile::getInstances($this, 'file'); + if(!empty( $this->file )) { + $file_id = [ ]; + if(is_array($this->file)) { + foreach($this->file as $file) { + if($file instanceof UploadedFile) { + $file_model = new File(); + $file_id[] = $file_model->saveFile($file); + } + } + } else { + if($this->file instanceof UploadedFile) { + $file_model = new File(); + $file_id[] = $file_model->saveFile($this->file); + } + } + $this->files = json_encode($file_id); + } + if($this->insert()) { + $this->clearSafe(); + return true; + } else { + return false; + } + } else { + $this->addError('comment_id', 'You can`t post comment here'); + return false; + } + } + + public function updateComment() + { + if($this->checkUpdate()) { + if(empty( $this->comment_id )) { + $this->addError('comment_id', 'Comment ID not found'); + return false; + } else { + if($this->update()) { + $this->clearSafe(); + return true; + } else { + return false; + } + } + } else { + $this->addError('comment_id', 'You can`t update this post'); + return false; + } + } + + public function deleteComment() + { + if($this->checkDelete()) { + if(empty( $this->comment_id )) { + $this->addError('comment_id', 'Comment ID not found'); + return false; + } else { + if($this->status == self::STATUS_DELETED) { + return false; + } + $this->status = self::STATUS_DELETED; + if($this->update()) { + $this->clearSafe(); + return true; + } else { + return false; + } + } + } else { + $this->addError('comment_id', 'You can`t delete this post'); + return false; + } + } + + public function checkCreate() + { + if($this->getGuestComment()) { + return true; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment_model' => $this->className(), + ]); + } + } + + public function checkUpdate() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::UPDATE_OWN, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ]); + } + } + + public function checkDelete() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE_OWN, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ]); + } + } + + protected function clearSafe($setNew = true) + { + $safe = $this->safeAttributes(); + $count = count($safe); + $values = array_fill(0, $count, NULL); + $result = array_combine($safe, $values); + $this->setAttributes($result); + $this->setIsNewRecord($setNew); + } + + public function getAuthor() + { + // if($this->user_id != NULL) { + return $this->hasOne(\common\models\User::className(), [ 'id' => 'user_id' ]); + // } else { + // return ['firstname' => $this->user_name, 'email' => $this->user_email]; + // } + } + + /** + * @return ActiveQuery + */ + public function getCurrency() + { + return $this->hasOne(Currency::className(), [ 'currency_id' => 'budget_currency' ]); + } + + /** + * @return File[] + */ + public function getFilesList() + { + $files = json_decode($this->files); + if(!empty( $files )) { + return File::findAll($files); + } else { + return [ ]; + } + } + + /** + * @return ActiveRecord + * @throws \TypeError + */ + public function getOwner() + { + $model = new $this->model(); + if($model instanceof ActiveRecord) { + return $model->findOne($this->model_id); + } else { + throw new \TypeError('Model must extends Active Record Class'); + } + } + + public function getProject() + { + return $this->hasOne(Project::className(), [ 'project_id' => 'model_id' ]); + } + + /** + * @return User + */ + public function getUser() + { + return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); + } + + public function changeState() + { + if($this->isAttributeChanged('state')) { + if($this->save()) { + return true; + } else { + return false; + } + } else { + return true; + } + } + + } diff --git a/common/modules/comment/models/CommentProjectAnswer.php b/common/modules/comment/models/CommentProjectAnswer.php new file mode 100755 index 0000000..2d0b4d1 --- /dev/null +++ b/common/modules/comment/models/CommentProjectAnswer.php @@ -0,0 +1,199 @@ + 1, + ], + [ + [ 'comment_pid' ], + 'exist', + 'targetAttribute' => 'comment_id', + 'filter' => [ + 'model' => $this->model, + 'model_id' => $this->model_id, + ], + ], + [ + ['comment_pid'], + 'required', + 'when' => function($model, $attribute) { + /** + * @var CommentProjectAnswer $model + * @var string $attribute + */ + if(!empty(\Yii::$app->user->id) && $model->isNewRecord && !empty($model->model) && !empty($model->model_id)) { + $project = Project::findOne($model->model_id); + if(!empty($project) && $project->user_id == \Yii::$app->user->id) { + return true; + } + } + return false; + } + ], + ]; + } + + /** + * @param string $model + * @param integer $model_id + * + * @return ActiveQuery + */ + public static function getComments($model, $model_id) + { + $query = self::find() + ->where([ + 'comment.model' => $model, + 'comment.model_id' => $model_id, + 'comment.status' => 1, + 'comment.comment_pid' => NULL, + ]) + ->with('parent'); + $project = Project::findOne($model_id); + $user = \Yii::$app->user; + if(empty( $user ) || $project->user_id != $user->id) { + $query->innerJoin([ 'child' => 'comment' ], 'comment.comment_id = child.comment_pid') + ->andWhere([ + 'not', + [ 'child.comment_id' => NULL ], + ]); + } + return $query; + } + + public function beforeDelete() + { + if(!empty($this->child)) { + $this->child->delete(); + } + return parent::beforeDelete(); // TODO: Change the autogenerated stub + } + + public function checkCreate() + { + if($this->getGuestComment()) { + return true; + } else { + return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment_model' => $this, + ]); + } + } + + public function checkUpdate() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + if(!empty($this->comment_pid) && $this->user_id == \Yii::$app->user->id) { + return true; + } + } + return false; + } + + public function checkDelete() + { + if($this->scenario == self::SCENARIO_GUEST) { + return false; + } else { + return ( \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]) || \Yii::$app->user->can(\common\modules\comment\Permissions::DELETE_OWN, [ + 'model' => $this->model, + 'model_id' => $this->model_id, + 'comment' => $this, + ]) ); + } + } + + public function checkReply() + { + if($this->scenario != self::SCENARIO_GUEST) { + if(!$this->isNewRecord && empty( $this->comment_pid )) { + $project = Project::findOne($this->model_id); + if($project->user_id == \Yii::$app->user->id && empty($this->child)) { + return true; + } + } elseif($this->isNewRecord && !empty($this->comment_pid)) { + $parent = self::findOne($this->comment_pid); + if(!empty($parent) && $parent->checkReply()) { + return true; + } + } + } + return false; + } + + public function getChild() + { + return $this->hasOne($this->className(), [ 'comment_pid' => 'comment_id' ]); + } + + } diff --git a/common/modules/comment/models/CommentProjectSearch.php b/common/modules/comment/models/CommentProjectSearch.php index 0af9bb8..aae75ab 100755 --- a/common/modules/comment/models/CommentProjectSearch.php +++ b/common/modules/comment/models/CommentProjectSearch.php @@ -1,92 +1,92 @@ - 5, - 'min' => 1, - ], - [ - [ - 'state', - ], - 'default', - 'value' => self::STATE_NEW, - ], - ]; - } - - public function scenarios() - { - return array_merge(parent::scenarios(), [ - self::SCENARIO_SEARCH => [ - 'state', - ], - ]); - } - - public function search($params) - { - $query = CommentProject::find() - ->with('project') - ->with('project.budgetCurrency') - ->with('project.comments') - ->where([ 'user_id' => \Yii::$app->user->getId() ]); - - $dataProvider = new ActiveDataProvider([ - 'query' => $query, - ]); - - $this->load($params); - - if(!$this->validate()) { - $query->andWhere('0=1'); - return $dataProvider; - } - - $query->andWhere([ 'state' => $this->state ]); - - return $dataProvider; - } - - } + 5, + 'min' => 1, + ], + [ + [ + 'state', + ], + 'default', + 'value' => self::STATE_NEW, + ], + ]; + } + + public function scenarios() + { + return array_merge(parent::scenarios(), [ + self::SCENARIO_SEARCH => [ + 'state', + ], + ]); + } + + public function search($params) + { + $query = CommentProject::find() + ->with('project') + ->with('project.budgetCurrency') + ->with('project.comments') + ->where([ 'user_id' => \Yii::$app->user->getId() ]); + + $dataProvider = new ActiveDataProvider([ + 'query' => $query, + ]); + + $this->load($params); + + if(!$this->validate()) { + $query->andWhere('0=1'); + return $dataProvider; + } + + $query->andWhere([ 'state' => $this->state ]); + + return $dataProvider; + } + + } diff --git a/common/modules/comment/models/Rating.php b/common/modules/comment/models/Rating.php index 1cef31a..3222732 100755 --- a/common/modules/comment/models/Rating.php +++ b/common/modules/comment/models/Rating.php @@ -1,64 +1,64 @@ - Yii::t('app', 'Rating ID'), - 'date_add' => Yii::t('app', 'Date Add'), - 'date_update' => Yii::t('app', 'Date Update'), - 'user_id' => Yii::t('app', 'User ID'), - 'entity' => Yii::t('app', 'Entity'), - 'value' => Yii::t('app', 'Value'), - ]; - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getUser() - { - return $this->hasOne(\common\models\User::className(), ['id' => 'user_id']); - } -} + Yii::t('app', 'Rating ID'), + 'date_add' => Yii::t('app', 'Date Add'), + 'date_update' => Yii::t('app', 'Date Update'), + 'user_id' => Yii::t('app', 'User ID'), + 'entity' => Yii::t('app', 'Entity'), + 'value' => Yii::t('app', 'Value'), + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getUser() + { + return $this->hasOne(\common\models\User::className(), ['id' => 'user_id']); + } +} diff --git a/common/modules/comment/rbac/ArtboxCommentCreateRule.php b/common/modules/comment/rbac/ArtboxCommentCreateRule.php index 7a8d5b2..10397bc 100755 --- a/common/modules/comment/rbac/ArtboxCommentCreateRule.php +++ b/common/modules/comment/rbac/ArtboxCommentCreateRule.php @@ -1,38 +1,39 @@ -checkProject($user, $item, $params); - } - return true; - } - - public function checkProject($user, $item, $params) - { - $project = \common\models\Project::findOne($params['model_id']); - if($project->user_id == $user) { - return false; - } - $comment = \common\modules\comment\models\CommentProject::find() - ->where([ 'model' => $params[ 'model' ], - 'model_id' => $params[ 'model_id' ], - 'user_id' => $user, - ])->one(); - if(empty($comment)) { - return true; - } else { - return false; - } - } - +checkProject($user, $item, $params); + } + return true; + } + + public function checkProject($user, $item, $params) + { + $project = \common\models\Project::findOne($params['model_id']); + if($project->user_id == $user) { + return false; + } + $comment = \common\modules\comment\models\CommentProject::find() + ->where([ 'model' => $params[ 'model' ], + 'model_id' => $params[ 'model_id' ], + 'user_id' => $user, + ])->one(); + if(empty($comment)) { + return true; + } else { + return false; + } + } + } \ No newline at end of file diff --git a/common/modules/comment/rbac/ArtboxCommentDeleteOwnRule.php b/common/modules/comment/rbac/ArtboxCommentDeleteOwnRule.php index d4ba3b8..b9bc3cc 100755 --- a/common/modules/comment/rbac/ArtboxCommentDeleteOwnRule.php +++ b/common/modules/comment/rbac/ArtboxCommentDeleteOwnRule.php @@ -1,17 +1,22 @@ -user_id == \Yii::$app->user->id) { + return true; + } + } + return false; + } + } \ No newline at end of file diff --git a/common/modules/comment/rbac/ArtboxCommentDeleteRule.php b/common/modules/comment/rbac/ArtboxCommentDeleteRule.php index c5db891..2fa5a63 100755 --- a/common/modules/comment/rbac/ArtboxCommentDeleteRule.php +++ b/common/modules/comment/rbac/ArtboxCommentDeleteRule.php @@ -1,17 +1,33 @@ -hasAttribute('user_id') && $model->user_id == \Yii::$app->user->id) { + return true; + } elseif($model instanceof User && $model->id == \Yii::$app->user->id) { + return true; + } + } + } + return false; + } + } \ No newline at end of file diff --git a/common/modules/comment/rbac/ArtboxCommentUpdateOwnRule.php b/common/modules/comment/rbac/ArtboxCommentUpdateOwnRule.php index 49c4119..edfd0b2 100755 --- a/common/modules/comment/rbac/ArtboxCommentUpdateOwnRule.php +++ b/common/modules/comment/rbac/ArtboxCommentUpdateOwnRule.php @@ -1,17 +1,20 @@ -user_id == \Yii::$app->user->id) { + return true; + } + return false; + } + } \ No newline at end of file diff --git a/common/modules/comment/rbac/ArtboxCommentUpdateRule.php b/common/modules/comment/rbac/ArtboxCommentUpdateRule.php index b0d101f..536ac3f 100755 --- a/common/modules/comment/rbac/ArtboxCommentUpdateRule.php +++ b/common/modules/comment/rbac/ArtboxCommentUpdateRule.php @@ -1,17 +1,17 @@ - div { + float: left; + width: 100%; + font-size: 13px +} + +.comments-name { + font-weight: 700 +} + +.comments-project-link a { + color: #0073bc; + text-decoration: underline; + +} + +.comments-status span { + color: #0072bc; + border-bottom: 1px dashed #0072bc; +} + +.comments-status, .comments-date, .proektant-comments .rating { + margin-top: 3px +} + +.comments-content { + line-height: 18px; + margin-top: 11px +} + +.comments-project-link { + margin-top: 19px +} diff --git a/common/modules/comment/resources/comment.js b/common/modules/comment/resources/comment.js index 71c2c53..65af2b1 100755 --- a/common/modules/comment/resources/comment.js +++ b/common/modules/comment/resources/comment.js @@ -1,89 +1,237 @@ -$(function() { - - $(document).on('click', '.artbox_comment_delete', function() { - var container = $(this).parents('.artbox_comment_container'); - var comment_id = $(container).data('comment_id'); - var form_name = $(container).data('form_name'); - if(confirm("Уверены, что хотите удалить комментарий?")) { - $.post( - '/artbox-comment/delete', - { - Comment: { - comment_id: comment_id - } - }, - function(data, textStatus, jqXHR) { - if(!data.error) { - $(container).after('

'+data.text+'

'); - $(container).remove(); - } else { - $(container).prepend('

'+data.error+'

') - } - } - ); - } - }); - - $(document).on('click', '.artbox_comment_reply', function() { - var container = $(this).parents('.artbox_comment_container').first(); - var comment_id = $(container).data('comment_id'); - var form_name = $(container).data('form_name'); - var author = $(container).find('.artbox_comment_author').first().text(); - var comment_form = $('.artbox_comment_form').first(); - var offset = $(comment_form).offset(); - var reply_block = $(comment_form).find('.artbox_comment_reply_block').first(); - $(reply_block).empty(); - $(reply_block).append(''); - $(reply_block).append('

'+author+'

'); - $('html, body').animate({ - scrollTop: offset.top - 50, - }); - }); - - $(document).on('click', '.artbox_comment_reply_author', function() { - $(this).parents('.artbox_comment_reply_block').first().empty(); - }); - - $(document).on('click', '.artbox_comment_update', function() { - $(this).removeClass('artbox_comment_update'); - $(this).text('Сохранить'); - $(this).addClass('artbox_comment_update_submit'); - var container = $(this).parents('.artbox_comment_container').first(); - var comment_id = $(container).data('comment_id'); - var form_name = $(container).data('form_name'); - var text = $(container).find('.artbox_comment_text'); - var object = {}; - object[form_name] = {comment_id: comment_id}; - $.post( - '/artbox-comment/form', - object, - function(data, textStatus, jqXHR) { - $(text).hide(); - $(text).after( - '
' - + data - + '
' - ); - } - ); - }); - - $(document).on('click', '.artbox_comment_update_reply', function() { - $(this).remove(); - }); - - $(document).on('click', '.artbox_comment_update_submit', function(e) { - e.preventDefault(); - var container = $(this).parents('.artbox_comment_container').first(); - var edit = $(container).find('.artbox_comment_text_edit').first(); - $.post( - '/artbox-comment/update', - $(edit).find('form').serialize(), - function(data) { - if(!data.error) { - location.reload(true); - } - } - ) - }); -}); \ No newline at end of file +$(function() { + + function addRemoveBlocks(data) + { + $('#overlay, .succses_comm').remove(); + $('body').append('
').append('
'+data.text+'
'); + $('#overlay').fadeIn( + 400, function() + { + $('.succses_comm').css({display : 'block'}).animate({opacity : 1, top : '50%'}, 200); + } + ); + function closeSuccsescomm() { + $('.succses_comm') + .animate( + {opacity : 0, top : '30%'}, 200, function() + { + $(this).css('display', 'none') + $('#overlay').fadeOut( + 400, function() + { + $('#overlay, .succses_comm').remove() + } + ) + } + ) + } + $('body').on('click', '.closed-form, #overlay', function() { + closeSuccsescomm() + } + ); + + setTimeout(closeSuccsescomm, 4000) + } + + $(document).on('click', '.artbox_comment_container .removeable', function(e) { + e.preventDefault(); + $(this).parent().remove(); +// var container = $(this).parents('.artbox_comment_container'); +// $(container).remove(); + }); + + $(document).on( + 'click', '.artbox_comment_delete', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container'); + var comment_id = $(container).data('key'); + var form_name = $(container).data('form'); + if(confirm("Уверены, что хотите удалить комментарий?")) + { + $.post( + '/artbox-comment/delete', { + Comment : { + comment_id : comment_id + } + }, function(data, textStatus, jqXHR) + { + if(!data.error) + { + { + $(container).remove(); + addRemoveBlocks(data) + // $(container).append('

' + data.text + '

'); + } + } else + { + $(container).prepend('

' + data.error + '

') + } + } + ); + } + } + ); + + $(document).on( + 'click', '.artbox_comment_reply', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container').first(); + var comment_id = $(container).data('key'); + var form_name = $(container).data('form'); + var author = $(container).find('.artbox_comment_author').first().text(); + var comment_form = $(container).parents('.artbox_comment_widget').find('.artbox_comment_form').first(); + var offset = $(comment_form).offset(); + var reply_block = $(comment_form).find('.artbox_comment_reply_block').first(); + $(reply_block).empty(); + $(reply_block).append(''); + $(reply_block).append('

' + author + '

'); + $('html, body').animate( + { + scrollTop : offset.top - 50, + } + ); + } + ); + + $(document).on( + 'click', '.artbox_comment_reply_author', function() + { + $(this).parents('.artbox_comment_reply_block').first().empty(); + } + ); + + $(document).on( + 'click', '.artbox_comment_update', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container').first(); + var comment_id = $(container).data('key'); + var form_name = $(container).data('form'); + var object = {}; + object[form_name] = {comment_id : comment_id}; + $.post( + '/artbox-comment/form', object, function(data, textStatus, jqXHR) + { + $(container).empty(); + $(container).append(data.result.form); + } + ); + } + ); + + // @TODO What is this + $(document).on( + 'click', '.artbox_comment_update_reply', function() + { + $(this).remove(); + } + ); + + $(document).on( + 'click', '.artbox_comment_update_submit', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container').first(); + $.post( + '/artbox-comment/update', $(container).find('form').serialize(), function(data) + { + $(container).empty(); + if(!data.error) + { + $(container).append('

'+data.result.text+'

'); + $(container).append(data.result.html); + } else { + $(container).append(data.form); + } + } + ) + } + ); + + $(document).on( + 'click', '.artbox_comment_update_answer', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container').first(); + var comment_id = $(container).data('key'); + var form_name = $(container).data('form'); + var object = {}; + object[form_name] = {comment_id : comment_id}; + $.post( + '/artbox-comment/form-answer', object, function(data, textStatus, jqXHR) + { + $(container).empty(); + $(container).append(data.result.form); + } + ); + } + ); + + $(document).on( + 'click', '.artbox_comment_update_answer_submit', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container').first(); + $.post( + '/artbox-comment/update-answer', $(container).find('form').serialize(), function(data) + { + $(container).empty(); + if(!data.error) + { + $(container).append('

'+data.result.text+'

'); + $(container).append(data.result.html); + } else { + $(container).append(data.form); + } + } + ) + } + ); + + $(document).on( + 'click', '.artbox_comment_delete_answer', function(e) + { + e.preventDefault(); + var container = $(this).parents('.artbox_comment_container'); + var comment_id = $(container).data('key'); + var form_name = $(container).data('form'); + if(confirm("Уверены, что хотите удалить вопрос?")) + { + $.post( + '/artbox-comment/delete-answer', { + CommentProjectAnswer : { + comment_id : comment_id + } + }, function(data, textStatus, jqXHR) + { + if(!data.error) + { + $(container).remove(); + addRemoveBlocks(data) + } else + { + $(container).prepend('

' + data.error + '

') + } + } + ); + } + } + ); + + $(document).on('click', '.artbox_comment_reply_answer', function(e) { + e.preventDefault(); + var widget = $(this).parents('.artbox_comment_widget'); + var form = $(widget).find('.artbox_comment_form'); + $(form).removeClass('hidden'); + $(widget).find('.artbox_comment_answer_label').text('Ответ'); + }); + + $(document).on('click', '.artbox_comment_reply_answer_block', function(e) { + var form = $(this).parents('.artbox_comment_form'); + $(form).addClass('hidden'); + $(form).find('.artbox_comment_answer_label').text('Вопрос'); + }); + +}); diff --git a/common/modules/comment/views/comment_form.php b/common/modules/comment/views/comment_form.php index 945abf6..717dcc1 100755 --- a/common/modules/comment/views/comment_form.php +++ b/common/modules/comment/views/comment_form.php @@ -1,38 +1,38 @@ - -field($model, 'comment_id') - ->label(false) - ->hiddenInput(); - if(!empty( $model->parent )) { - ?> -
- "; - if(!empty( $model->parent->author )) { - echo $model->parent->author->firstname . ' ' . $model->parent->author->lastname; - } else { - echo $model->parent->user_name; - } - echo ""; - echo $form->field($model, 'comment_pid') - ->label(false) - ->hiddenInput(); - ?> -
- field($model, 'text') - ->label(false) - ->textarea(); -?> -end(); + +field($model, 'comment_id') + ->label(false) + ->hiddenInput(); + if(!empty( $model->parent )) { + ?> +
+ "; + if(!empty( $model->parent->author )) { + echo $model->parent->author->firstname . ' ' . $model->parent->author->lastname; + } else { + echo $model->parent->user_name; + } + echo ""; + echo $form->field($model, 'comment_pid') + ->label(false) + ->hiddenInput(); + ?> +
+ field($model, 'text') + ->label(false) + ->textarea(); +?> +end(); ?> \ No newline at end of file diff --git a/common/modules/comment/widgets/CommentWidget.php b/common/modules/comment/widgets/CommentWidget.php index 15c7b61..c498f55 100755 --- a/common/modules/comment/widgets/CommentWidget.php +++ b/common/modules/comment/widgets/CommentWidget.php @@ -1,236 +1,288 @@ - 'div', - 'view' => 'list-comment', - 'class' => 'test-class', - ]; - - /** - * @var array Options sent to success part - */ - public $success_options = [ - 'tag' => 'div', - 'content' => NULL, - 'class' => 'test-class-success', - ]; - - /** - * @var array Options sent to form part - */ - public $form_options = [ - 'tag' => 'div', - 'view' => 'form-comment', - 'class' => 'test-class-form', - ]; - - /** - * @var bool Indicates whether any successful action happened - */ - protected $isSuccess = false; - - public $success_text = 'Comment successfully added'; - - /** - * @var string $model Model, to which comments attached - */ - public $model; - - /** - * @var integer $model_id Model id, to which comments attached - */ - public $model_id; - - /** - * @var string Template of the widget. You may use {success}, {form}, {list} - * to render particular parts. You are also able to use common HTML here. - */ - public $template = "{success}\n{form}\n{list}"; - - /** - * @var array Widget options - */ - public $options = [ ]; - - /** - * @var \yii\data\DataProviderInterface Data provider of comments - */ - public $dataProvider; - - /** - * @inheritdoc - */ - public function init() - { - parent::init(); - \common\modules\comment\assets\CommentAsset::register($this->view); - if(is_string($this->comment_class)) { - $this->comment_class = new $this->comment_class($this->class_options); - } else { - throw new \yii\base\InvalidConfigException(__CLASS__ . '->comment_class must be defined as object full class name string.'); - } - if(!empty( $this->rating_class ) && is_string($this->rating_class)) { - $this->rating_class = new $this->rating_class($this->rating_options); - } elseif(!empty( $this->rating_class )) { - throw new \yii\base\InvalidConfigException(__CLASS__ . '->rating_class must be defined as object full class name string.'); - } - $this->comment_class->model = $this->model; - $this->comment_class->model_id = $this->model_id; - $this->createDataProvider(); - $this->process(); - ob_start(); - } - - /** - * @inheritdoc - * @return string - */ - public function run() - { - $content = ob_get_clean(); - $this->createParts(); - return $this->renderWidget(); - } - - public function createParts() - { - if($this->display_comment_success && $this->isSuccess) { - $tag = ArrayHelper::remove($this->success_options, 'tag', 'div'); - if(is_callable($this->success_options[ 'content' ])) { - $result = call_user_func(ArrayHelper::remove($this->success_options, 'content'), $this->success_text); - } elseif($this->success_options[ 'content' ] != NULL) { - $result = Html::encode(ArrayHelper::remove($this->success_options, 'content', $this->success_text)); - } else { - $result = Html::encode($this->success_text); - } - $this->parts[ 'success' ] = Html::tag($tag, $result, $this->success_options); - unset( $tag, $result ); - } - - if($this->display_comment_list) { - $tag = ArrayHelper::remove($this->list_options, 'tag', 'div'); - $view = ArrayHelper::remove($this->list_options, 'view'); - $this->parts[ 'list' ] = Html::tag($tag, $this->renderItems($view), $this->list_options); - } - - if($this->display_comment_form && $this->comment_class->checkCreate()) { - $tag = ArrayHelper::remove($this->form_options, 'tag', 'div'); - $view = ArrayHelper::remove($this->form_options, 'view'); - $this->parts[ 'form' ] = Html::tag($tag, $this->renderForm($view), $this->form_options); - } - } - - public function createDataProvider() - { - $this->dataProvider = new \yii\data\ActiveDataProvider([ - 'query' => $this->comment_class->getComments($this->model, $this->model_id), - 'pagination' => [ - 'pageSize' => 10, - ], - ]); - } - - public function renderItems($view) - { - if(empty( $view )) { - throw new \yii\base\InvalidConfigException("list_options[view] must be set"); - } - return $this->render($view, [ 'dataProvider' => $this->dataProvider ]); - } - - public function renderForm($view) - { - if(empty( $view )) { - throw new \yii\base\InvalidConfigException("form_options[view] must be set"); - } - if($this->comment_class->guestComment || !empty(\Yii::$app->user->identity)) { - return $this->render($view, [ - 'model' => $this->comment_class, - 'rating' => $this->rating_class, - 'user' => \Yii::$app->user->identity, - 'dataProvider' => $this->dataProvider, - ]); - } else { - return ''; - } - } - - public function renderWidget() - { - $template = $this->template; - $parts = $this->parts; - $options = $this->options; - $template = preg_replace('/{success}/', ArrayHelper::remove($parts, 'success', ''), $template); - $template = preg_replace('/{list}/', ArrayHelper::remove($parts, 'list', ''), $template); - $template = preg_replace('/{form}/', ArrayHelper::remove($parts, 'form', ''), $template); - $tag = ArrayHelper::remove($options, 'tag', 'div'); - return Html::tag($tag, $template, $options); - } - - public function process() - { - $data = \Yii::$app->request->post(); - if($this->comment_class->load($data) && $this->comment_class->postComment()) { - if(is_object($this->rating_class)) { - $this->comment_class->checkRating(); - if($this->comment_class->rating->load($data) && $this->comment_class->rating->save()) { - $this->isSuccess = true; - } - } - } - } + 'artbox_comment_container', + 'comment_delete' => 'artbox_comment_delete', + 'comment_reply' => 'artbox_comment_reply', + 'comment_author' => 'artbox_comment_author', + 'widget_container' => 'artbox_comment_widget', + 'form_container' => 'artbox_comment_form', + 'reply_block' => 'artbox_comment_reply_block', + 'reply_author' => 'artbox_comment_reply_author', + 'comment_update' => 'artbox_comment_update', + 'comment_update_submit' => 'artbox_comment_update_submit', + ]; + + /** + * @var null|\yii\web\View + */ + public $context = NULL; + + /** + * @var array Parts of widgets that can be rendered + */ + public $parts = [ ]; + + public $rating_class = NULL; + + public $rating_options = [ ]; + + /** + * @var string|\common\modules\comment\models\Comment + */ + public $comment_class; + + /** + * @var array + */ + public $class_options = [ ]; + + public $provider_options = [ ]; + + /** + * @var bool Wheather to display comment list + */ + public $display_comment_list = true; + + /** + * @var bool Whether to display comment form + */ + public $display_comment_form = true; + + /** + * @var bool Whether to display success text + */ + public $display_comment_success = true; + + /** + * @var bool Whether to allow one user post multiple comments + */ + public $allow_multiple = true; + + public $allow_reply = true; + + /** + * @var array Options sent to list part + */ + public $list_options = [ + 'tag' => 'div', + 'view' => 'list-comment', + 'class' => 'test-class', + ]; + + /** + * @var array Options sent to success part + */ + public $success_options = [ + 'tag' => 'div', + 'content' => NULL, + 'class' => 'test-class-success', + ]; + + /** + * @var array Options sent to form part + */ + public $form_options = [ + 'tag' => 'div', + 'view' => 'form-comment', + 'class' => 'test-class-form', + ]; + + /** + * @var bool Indicates whether any successful action happened + */ + protected $isSuccess = false; + + public $success_text = 'Comment successfully added'; + + /** + * @var string $model Model, to which comments attached + */ + public $model; + + /** + * @var integer $model_id Model id, to which comments attached + */ + public $model_id; + + /** + * @var string Template of the widget. You may use {success}, {form}, {list} + * to render particular parts. You are also able to use common HTML here. + */ + public $template = "{success}\n{form}\n{list}"; + + /** + * @var array Widget options + */ + public $options = [ ]; + + /** + * @var \yii\data\DataProviderInterface Data provider of comments + */ + public $dataProvider; + + /** + * @inheritdoc + */ + public function init() + { + parent::init(); + \common\modules\comment\assets\CommentAsset::register($this->view); + if(is_string($this->comment_class)) { + $this->comment_class = new $this->comment_class($this->class_options); + } else { + throw new \yii\base\InvalidConfigException(__CLASS__ . '->comment_class must be defined as object full class name string.'); + } + if(!empty( $this->rating_class ) && is_string($this->rating_class)) { + $this->rating_class = new $this->rating_class($this->rating_options); + } elseif(!empty( $this->rating_class )) { + throw new \yii\base\InvalidConfigException(__CLASS__ . '->rating_class must be defined as object full class name string.'); + } + $this->comment_class->model = $this->model; + $this->comment_class->model_id = $this->model_id; + $this->createDataProvider(); + $this->process(); + ob_start(); + } + + /** + * @inheritdoc + * @return string + */ + public function run() + { + $content = ob_get_clean(); + $this->createParts(); + return $this->renderWidget(); + } + + public function createParts() + { + if($this->display_comment_success && $this->isSuccess) { + $tag = ArrayHelper::remove($this->success_options, 'tag', 'div'); + if(is_callable($this->success_options[ 'content' ])) { + $result = call_user_func(ArrayHelper::remove($this->success_options, 'content'), $this->success_text); + } elseif($this->success_options[ 'content' ] != NULL) { + $result = Html::encode(ArrayHelper::remove($this->success_options, 'content', $this->success_text)); + } else { + $result = Html::encode($this->success_text); + } + $this->parts[ 'success' ] = Html::tag($tag, $result, $this->success_options); + unset( $tag, $result ); + } + + if($this->display_comment_list) { + $tag = ArrayHelper::remove($this->list_options, 'tag', 'div'); + $view = ArrayHelper::remove($this->list_options, 'view'); + $this->parts[ 'list' ] = Html::tag($tag, $this->renderItems($view), $this->list_options); + } + + if($this->display_comment_form && $this->comment_class->checkCreate()) { + $tag = ArrayHelper::remove($this->form_options, 'tag', 'div'); + $view = ArrayHelper::remove($this->form_options, 'view'); + if(!empty( $this->form_options[ 'class' ] )) { + $this->form_options[ 'class' ] .= ' ' . self::$baseClass[ 'form_container' ]; + } else { + $this->form_options[ 'class' ] = self::$baseClass[ 'form_container' ]; + } + $this->parts[ 'form' ] = Html::tag($tag, $this->renderForm($view), $this->form_options); + } + } + + public function createDataProvider() + { + $this->dataProvider = new \yii\data\ActiveDataProvider([ + 'query' => ArrayHelper::remove($this->provider_options, 'query', $this->comment_class->getComments($this->model, $this->model_id)), + 'sort' => ArrayHelper::remove($this->provider_options, 'sort', new Sort([ + 'defaultOrder' => [ + 'date_add' => SORT_DESC, + ], + ])), + 'pagination' => ArrayHelper::remove($this->provider_options, 'pagination', [ + 'pageSize' => 10, + ]), + ]); + } + + public function renderItems($view) + { + if(empty( $view )) { + throw new \yii\base\InvalidConfigException("list_options[view] must be set"); + } + return $this->render($view, [ + 'dataProvider' => $this->dataProvider, + 'commentClass' => $this->comment_class, + ]); + } + + public function renderForm($view) + { + if(empty( $view )) { + throw new \yii\base\InvalidConfigException("form_options[view] must be set"); + } + if($this->comment_class->guestComment || !empty( \Yii::$app->user->identity )) { + return $this->render($view, [ + 'model' => $this->comment_class, + 'rating' => $this->rating_class, + 'user' => \Yii::$app->user->identity, + 'dataProvider' => $this->dataProvider, + ]); + } else { + return ''; + } + } + + public function renderWidget() + { + $template = $this->template; + $parts = $this->parts; + $options = $this->options; + $template = preg_replace('/{success}/', ArrayHelper::remove($parts, 'success', ''), $template); + $template = preg_replace('/{list}/', ArrayHelper::remove($parts, 'list', ''), $template); + $template = preg_replace('/{form}/', ArrayHelper::remove($parts, 'form', ''), $template); + $tag = ArrayHelper::remove($options, 'tag', 'div'); + if(!empty( $options[ 'class' ] )) { + $options[ 'class' ] .= ' ' . self::$baseClass[ 'widget_container' ]; + } else { + $options[ 'class' ] = self::$baseClass[ 'widget_container' ]; + } + return Html::tag($tag, $template, $options); + } + + public function process() + { + $data = \Yii::$app->request->post(); + if($this->comment_class->load($data) && $this->comment_class->postComment()) { + if(is_object($this->rating_class)) { + $this->comment_class->checkRating(); + if($this->comment_class->rating->load($data) && $this->comment_class->rating->save()) { + $this->isSuccess = true; + \Yii::$app->response->redirect(''); + } + } else { + $this->isSuccess = true; + } + } + } + } \ No newline at end of file diff --git a/common/modules/comment/widgets/views/_project_comment_view.php b/common/modules/comment/widgets/views/_project_comment_view.php index 7b49a60..e8f5ff0 100755 --- a/common/modules/comment/widgets/views/_project_comment_view.php +++ b/common/modules/comment/widgets/views/_project_comment_view.php @@ -1,143 +1,199 @@ -user; -?> -
-
-
- userInfo->image) ?> -
-
-
-
    - userInfo->social_fb )) { - echo '
  • ' . Html::a(Html::img('/images/ico-fb.png'), $user->userInfo->social_fb, [ 'target' => '_blank' ]) . '
  • '; - } - ?> - userInfo->social_t )) { - echo '
  • ' . Html::a(Html::img('/images/ico-tw.png'), $user->userInfo->social_t, [ 'target' => '_blank' ]) . '
  • '; - } - ?> - userInfo->social_in )) { - echo '
  • ' . Html::a(Html::img('/images/ico-in.png'), $user->userInfo->social_in, [ 'target' => '_blank' ]) . '
  • '; - } - ?> - userInfo->social_vk )) { - echo '
  • ' . Html::a(Html::img('/images/ico-vk.png'), $user->userInfo->social_vk, [ 'target' => '_blank' ]) . '
  • '; - } - ?> -
-
-
-
    -
  • -
    userInfo->view_count ?>
    -
  • -
  • -
    - Статус: userInfo->busy ) ? 'Свободен' : 'Занят' ) ?> -
    -
  • -
  • -
    - На сайте: liveTime ?> -
    -
  • -
  • -
    Последний визит:
    lastVisit ?> -
    -
  • -
- link, [ 'class' => 'tender-see-profile style' ]) ?> -
-
-
-
-
-
-
- budget_from . '-' . $model->budget_to . ' ' . $model->currency->label ?> -
-
- term_from . '-' . $model->term_to ?> ДНЯ
-
-
-
-
name ?>
-
- - -
- comments) . ' отзывов', $user->getLink('review'), [ 'class' => 'link-to-comm' ]) ?> -
-
- text ?> -
- -
-
- getLink('portfolio'), [ 'class' => 'get-project-new' ]) ?> - link, [ 'class' => 'get-list-new' ]) ?> -
- user->getId() == $model->owner->user_id) { - ?> -
- Отметить как: - $model->owner->project_id, - 'data-comment-id' => $model->comment_id, - 'class' => 'artbox_project_make_new', - ]); - echo Html::a('кандидат', [ '#' ], [ - 'data-project-id' => $model->owner->project_id, - 'data-comment-id' => $model->comment_id, - 'class' => 'artbox_project_make_candidate', - ]); - echo Html::a('исполнитель', [ '#' ], [ - 'data-project-id' => $model->owner->project_id, - 'data-comment-id' => $model->comment_id, - 'class' => 'artbox_project_make_performer', - ]); - echo Html::a('отказать', [ '#' ], [ - 'data-project-id' => $model->owner->project_id, - 'data-comment-id' => $model->comment_id, - 'class' => 'artbox_project_make_deny', - ]); - ?> -
- - -
+user; +?> +
+
+
+ userInfo->image )) { + echo Html::img($user->userInfo->image); + } else { + echo Html::img('/images/avatar-bg.png'); + } + ?> +
+
+
+
    + userInfo->social_fb )) { + echo '
  • ' . Html::a(Html::img('/images/ico-fb.png'), $user->userInfo->social_fb, [ 'target' => '_blank' ]) . '
  • '; + } + ?> + userInfo->social_t )) { + echo '
  • ' . Html::a(Html::img('/images/ico-tw.png'), $user->userInfo->social_t, [ 'target' => '_blank' ]) . '
  • '; + } + ?> + userInfo->social_in )) { + echo '
  • ' . Html::a(Html::img('/images/ico-in.png'), $user->userInfo->social_in, [ 'target' => '_blank' ]) . '
  • '; + } + ?> + userInfo->social_vk )) { + echo '
  • ' . Html::a(Html::img('/images/ico-vk.png'), $user->userInfo->social_vk, [ 'target' => '_blank' ]) . '
  • '; + } + ?> +
+
+
+
    +
  • +
    userInfo->view_count ?>
    +
  • +
  • +
    + Статус: userInfo->busy ) ? 'Свободен' : 'Занят' ) ?> +
    +
  • +
  • +
    + На сайте: liveTime ?> +
    +
  • +
  • +
    Последний визит:
    lastVisit ?> +
    +
  • +
+ link, [ 'class' => 'tender-see-profile style', + 'target' => '_blank', + ]) ?> +
+
+
+
+
+
+
+ budget_from . '-' . $model->budget_to . ' ' . $model->currency->label ?> +
+
+ term_from . '-' . $model->term_to ?> ДНЯ
+
+
+
+
name ?>
+ 'rating_review_comment', + 'value' => $user->userInfo->rating, + 'pluginOptions' => [ + 'displayOnly' => true, + 'size' => 'xxs', + 'min' => 0, + 'max' => 10, + 'stars' => 10, + ], + ]); + ?> + comments) . ' мнений', $user->getLink('review'), [ 'class' => 'link-to-comm' ]) ?> +
+
+ text ?> +
+ +
+
+ getLink('portfolio'), [ 'class' => 'get-project-new' ]) ?> + link, [ 'class' => 'get-list-new' ]) ?> + + status == $model::STATUS_ANONYMOUS) { + echo Html::tag('div', 'Анонимное предложение', [ 'class' => 'project_status' ]); + } + if(\Yii::$app->user->getId() == $model->owner->user_id) { + ?> +
+

+ state) { + case 1: + echo 'Предложение не рассмотрено'; + break; + case 2: + echo 'Исполнитель поставлен на рассмотрение'; + break; + case 3: + echo 'Исполнитель назначен исполнителем'; + break; + case 4: + echo 'Вы отказали данному исполнителю'; + break; + case 5: + echo 'Исполнитель отказался от данного предложения'; + break; + } + ?> +

+
+ state != $model::STATE_TRASH) { + ?> +
+ Отметить как: +

+
+ $model->owner->project_id, + 'data-comment-id' => $model->comment_id, + 'class' => 'artbox_project_make_new' . ( ( $model->state == $model::STATE_NEW ) ? ' active' : '' ), + ]); + echo Html::a('кандидат', [ '#' ], [ + 'data-project-id' => $model->owner->project_id, + 'data-comment-id' => $model->comment_id, + 'class' => 'artbox_project_make_candidate' . ( ( $model->state == $model::STATE_CANDIDATE ) ? ' active' : '' ), + ]); + echo Html::a('исполнитель', [ '#' ], [ + 'data-project-id' => $model->owner->project_id, + 'data-comment-id' => $model->comment_id, + 'class' => 'artbox_project_make_performer' . ( ( $model->state == $model::STATE_PERFORMER ) ? ' active' : '' ), + ]); + echo Html::a('отказать', [ '#' ], [ + 'data-project-id' => $model->owner->project_id, + 'data-comment-id' => $model->comment_id, + 'class' => 'artbox_project_make_deny' . ( ( $model->state == $model::STATE_DENY ) ? ' active' : '' ), + ]); + ?> +
+
+ +
+ + +
diff --git a/common/modules/comment/widgets/views/_question_comment_view.php b/common/modules/comment/widgets/views/_question_comment_view.php new file mode 100755 index 0000000..c733a62 --- /dev/null +++ b/common/modules/comment/widgets/views/_question_comment_view.php @@ -0,0 +1,91 @@ +user; + if(empty( $model->comment_pid )) { + $model->buildButtons([ + 'reply', + 'delete', + ]); + } +?> +
+
user ) && !empty( $model->user->userInfo->image ) ) ? $model->user->minImg($model->user->userInfo->image, 48, 48) : '/images/ico-profile.png') ?>
+
+ + + +
Pro
+ + + formatter->asDate($model->date_add, 'php:d.m.Y') ?> +
+
+
Вопрос
+
text ?>
+
+ child )) { + echo Html::tag('div', $this->render('@common/modules/comment/widgets/views/_question_comment_view', [ + 'model' => $model->child, + 'key' => $key, + 'index' => $index, + 'widget' => $widget, + ]), [ + 'class' => CommentWidget::$baseClass[ 'comment_container' ], + 'data' => [ + 'key' => $model->child->comment_id, + 'form' => $model->formName(), + ], + ]); + } + ?> + buttons)) { + ?> +
+ buttons[ 'delete' ] )) { + echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => 'artbox_comment_delete_answer' ]); + } + if(!empty( $model->buttons[ 'update' ] )) { + echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => 'artbox_comment_update_answer' ]); + } + if(!empty( $model->buttons[ 'reply' ] )) { + echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] . ' artbox_comment_reply_answer' ]); + } + ?> +
+ +
+ + + \ No newline at end of file diff --git a/common/modules/comment/widgets/views/_review_comment_view.php b/common/modules/comment/widgets/views/_review_comment_view.php index e59efe1..de0cf59 100755 --- a/common/modules/comment/widgets/views/_review_comment_view.php +++ b/common/modules/comment/widgets/views/_review_comment_view.php @@ -1,51 +1,68 @@ -user; -?> -
- name; - } else { - echo $model->user_name; - } - ?> -
- -
Pro
- -
formatter->asDate($model->date_add, 'php:d.m.Y') ?>
-rating )) { - ?> -
- - -
- -
- text ?> -
- - - user; + $model->buildButtons([ 'delete' ]); +?> +
+ getAuthor(' (Гость)') ?> +
+ +
Pro
+ +
formatter->asDate($model->date_add, 'php:d.m.Y') ?>
+rating )) { + echo StarRating::widget([ + 'name' => 'rating_review_comment', + 'value' => $model->rating->value, + 'pluginOptions' => [ + 'size' => 'xxs', + 'displayOnly' => true, + 'min' => 0, + 'max' => 5, + 'stars' => 5, + ], + ]); + } +?> +
+ text ?> +
+
+ buttons[ 'delete' ] )) { + echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => CommentWidget::$baseClass[ 'comment_delete' ] ]); + } + if(!empty( $model->buttons[ 'update' ] )) { + echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => CommentWidget::$baseClass[ 'comment_update' ] ]); + } + if(!empty( $model->buttons[ 'reply' ] )) { + echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] ]); + } + ?> +
+ + + \ No newline at end of file diff --git a/common/modules/comment/widgets/views/form-comment-answer.php b/common/modules/comment/widgets/views/form-comment-answer.php new file mode 100755 index 0000000..1ef750a --- /dev/null +++ b/common/modules/comment/widgets/views/form-comment-answer.php @@ -0,0 +1,98 @@ + +model_id )) { + $project = Project::findOne($model->model_id); + } + if(!empty( $project ) && $project->user_id != \Yii::$app->user->id) { + ?> +
Задать вопрос
+ +
+ + user->id )) { ?> +
+
+ +
+
user->identity->name; ?>
+
+ + + ['data' => ['pjax' => true]]]); + if(!$model->isNewRecord) { + echo $form->field($model, 'comment_id') + ->hiddenInput() + ->label(false) + ->error(false); + } + if(!empty( $model->comment_pid )) { + echo $form->field($model, 'comment_pid') + ->hiddenInput() + ->label(false) + ->error(false); + } + if($model->scenario == $model::SCENARIO_GUEST) { + echo $form->field($model, 'user_name', [ + 'options' => [ + 'class' => 'input-blocks-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput(); + echo $form->field($model, 'user_email', [ + 'options' => [ + 'class' => 'input-blocks-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput(); + } + + ?> +
+ field($model, 'text', [ + 'options' => [ + 'class' => 'input-blocks-comm area-comm tender_com_fix_', + ], + 'inputOptions' => [ + 'class' => 'custom-area-4', + ], + ]) + ->label($model->isNewRecord ? 'Вопрос' : 'Ответ', [ 'class' => 'artbox_comment_answer_label' ]) + ->textarea(); + ?> +
+ isNewRecord) { + echo Html::submitButton('Задать вопрос'); + } else { + echo Html::submitButton('Обновить вопрос', [ 'class' => 'artbox_comment_update_answer_submit' ]); + } + ?> +
+ end(); + ?> +
\ No newline at end of file diff --git a/common/modules/comment/widgets/views/form-comment-review.php b/common/modules/comment/widgets/views/form-comment-review.php index d9b37e3..aa8c8d8 100755 --- a/common/modules/comment/widgets/views/form-comment-review.php +++ b/common/modules/comment/widgets/views/form-comment-review.php @@ -1,66 +1,85 @@ - -
-

Мнения о пользователе: totalCount ?>

-
- field($rating, 'value') - ->label(false) - ->radioList([ - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - ]); - if($model->scenario == $model::SCENARIO_GUEST) { - echo $form->field($model, 'user_name', [ - 'options' => [ - 'class' => 'input-blocks-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-input-4', - ], - ]) - ->textInput(); - echo $form->field($model, 'user_email', [ - 'options' => [ - 'class' => 'input-blocks-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-input-4', - ], - ]) - ->textInput(); - } - - ?> -
- field($model, 'text', [ - 'options' => [ - 'class' => 'input-blocks-comm area-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-area-4', - ], - ]) - ->textarea(); - ?> -
- -
- end(); - ?> + +
+ isNewRecord) { + echo $form->field($model, 'comment_id') + ->hiddenInput() + ->label(false) + ->error(false); + } + echo $form->field(( !empty( $model->rating ) ? $model->rating : $rating ), 'value') + ->label(false) + ->widget(StarRating::className(), [ + 'pluginOptions' => [ + 'size' => 'xxs', + 'step' => 1, + 'value' => 2, + 'showCaption' => false, + 'stars' => 5, + 'min' => 0, + 'max' => 5, + ], + ]); + if($model->scenario == $model::SCENARIO_GUEST) { + echo $form->field($model, 'user_name', [ + 'options' => [ + 'class' => 'input-blocks-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput(); + echo $form->field($model, 'user_email', [ + 'options' => [ + 'class' => 'input-blocks-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput(); + } + if(!empty( $model->comment_pid )) { + echo Html::tag('div', Html::activeHiddenInput($model, 'comment_pid') . Html::tag('p', $model->parent->author, [ 'class' => 'artbox_comment_reply_author' ]), [ 'class' => CommentWidget::$baseClass[ 'reply_block' ] ]); + } else { + echo Html::tag('div', '', [ 'class' => CommentWidget::$baseClass[ 'reply_block' ] . ' test_class' ]); + } + echo $form->field($model, 'text', [ + 'options' => [ + 'class' => 'input-blocks-comm area-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-area-4', + ], + ]) + ->textarea(); + ?> +
+ isNewRecord) { + echo Html::submitButton('Добавить комментарий'); + } else { + echo Html::submitButton('Обновить комментарий', [ 'class' => CommentWidget::$baseClass[ 'comment_update_submit' ] ]); + } + ?> +
+ end(); + ?>
\ No newline at end of file diff --git a/common/modules/comment/widgets/views/form-comment.php b/common/modules/comment/widgets/views/form-comment.php index 9c0ba15..47f4322 100755 --- a/common/modules/comment/widgets/views/form-comment.php +++ b/common/modules/comment/widgets/views/form-comment.php @@ -1,70 +1,77 @@ - -
Комментарии: totalCount ?>
- -
- - field($rating, 'value') - ->label(false) - ->radioList([ - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - ]); - - if($model->scenario == $model::SCENARIO_GUEST) { - echo $form->field($model, 'user_name', [ - 'options' => [ - 'class' => 'input-blocks-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-input-4', - ], - ]) - ->textInput(); - echo $form->field($model, 'user_email', [ - 'options' => [ - 'class' => 'input-blocks-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-input-4', - ], - ]) - ->textInput(); - } - - ?> -
- field($model, 'text', [ - 'options' => [ - 'class' => 'input-blocks-comm area-comm', - ], - 'inputOptions' => [ - 'class' => 'custom-area-4', - ], - ]) - ->textarea(); - ?> -
- -
- end(); - ?> + +
Комментарии: totalCount ?>
+ +
+ + field(( !empty( $model->rating ) ? $model->rating : $rating ), 'value') + ->label(false) + ->widget(StarRating::className(), [ + 'pluginOptions' => [ + 'size' => 'xxs', + 'step' => 1, + 'value' => 2, + 'showCaption' => false, + 'min' => 0, + 'max' => 10, + 'stars' => 10, + ], + ]); + } + + if($model->scenario == $model::SCENARIO_GUEST) { + echo $form->field($model, 'user_name', [ + 'options' => [ + 'class' => 'input-blocks-comm fix_marg_', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput(); + echo $form->field($model, 'user_email', [ + 'options' => [ + 'class' => 'input-blocks-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-input-4', + ], + ]) + ->textInput() + ->hint('Ваш email не будет доступен к просмотру.'); + } + + ?> +
+ field($model, 'text', [ + 'options' => [ + 'class' => 'input-blocks-comm area-comm', + ], + 'inputOptions' => [ + 'class' => 'custom-area-4', + ], + ]) + ->textarea(); + ?> +
+ +
+ end(); + ?>
\ No newline at end of file diff --git a/common/modules/comment/widgets/views/form-project-comment.php b/common/modules/comment/widgets/views/form-project-comment.php index 3f3f962..7437ade 100755 --- a/common/modules/comment/widgets/views/form-project-comment.php +++ b/common/modules/comment/widgets/views/form-project-comment.php @@ -1,101 +1,101 @@ - - -
-
-
-
-
- [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data' ] ]); - ?> -
-
-
- userInfo->image)?:'') ?> -
-
- name ?> -
-
-
-
Стоимость
-
- field($model, 'budget_from', [ - 'template' => "{input}\n{error}", - 'options' => [ 'tag' => 'span' ], - ]) - ->input('number', [ 'placeholder' => $model->getAttributeLabel('budget_from') ]) ?> - field($model, 'budget_to', [ - 'template' => "{input}\n{error}", - 'options' => [ 'tag' => 'span' ], - ]) - ->input('number', [ 'placeholder' => $model->getAttributeLabel('budget_to') ]) ?> - field($model, 'budget_currency', [ - 'template' => "{input}
\n{error}", - 'options' => [ 'class' => 'blocks-check-list-wrapp check-valuta' ], - ]) - ->dropDownList($currencies) ?> -
-
-
-
- Сроки(в днях) -
-
- field($model, 'term_from', [ - 'template' => "{input}\n{error}", - 'options' => [ 'tag' => 'span' ], - ]) - ->input('number', [ 'placeholder' => $model->getAttributeLabel('term_from') ]) ?> - field($model, 'term_to', [ - 'template' => "{input}\n{error}", - 'options' => [ 'tag' => 'span' ], - ]) - ->input('number', [ 'placeholder' => $model->getAttributeLabel('term_to') ]) ?> -
-
-
- field($model, 'text', [ - 'template' => "{input}\n{error}", - 'options' => [ 'class' => 'form-tender-txt style' ], - ]) - ->textarea([ 'placeholder' => $model->getAttributeLabel('text') ]) ?> -
- field($model, 'file[]') - ->fileInput([ 'class' => 'multi' ]) - ->label(false) ?> - Прикрепить файл -
Максимальный размер
файла 5 МБ
-
-
- 'get-project-new' ]); - echo Html::submitInput('ответить анонимно', [ - 'class' => 'get-list-new', - 'name' => 'CommentProject[anonymous]', - ]); - echo Html::a('Очистить', [ - 'tender/view', - 'tender_id' => \Yii::$app->request->get('tender_id'), - '#' => 'w1', - ]); - ?> -
- end(); - ?> -
-
-
+ +
+
+ + + +
+ [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data', 'data' => ['pjax' => true] ] ]); + ?> +
+
+
+ userInfo->image)?:'') ?> +
+
+ name ?> +
+
+
+
Стоимость
+
+ field($model, 'budget_from', [ + 'template' => "{input}\n{error}", + 'options' => [ 'tag' => 'span' ], + ]) + ->input('number', [ 'placeholder' => $model->getAttributeLabel('budget_from') ]) ?> + field($model, 'budget_to', [ + 'template' => "{input}\n{error}", + 'options' => [ 'tag' => 'span' ], + ]) + ->input('number', [ 'placeholder' => $model->getAttributeLabel('budget_to') ]) ?> + field($model, 'budget_currency', [ + 'template' => "{input}
\n{error}", + 'options' => [ 'class' => 'blocks-check-list-wrapp check-valuta' ], + ]) + ->dropDownList($currencies) ?> +
+
+
+
+ Сроки(в днях) +
+
+ field($model, 'term_from', [ + 'template' => "{input}\n{error}", + 'options' => [ 'tag' => 'span' ], + ]) + ->input('number', [ 'placeholder' => $model->getAttributeLabel('term_from') ]) ?> + field($model, 'term_to', [ + 'template' => "{input}\n{error}", + 'options' => [ 'tag' => 'span' ], + ]) + ->input('number', [ 'placeholder' => $model->getAttributeLabel('term_to') ]) ?> +
+
+
+ field($model, 'text', [ + 'template' => "{input}\n{error}", + 'options' => [ 'class' => 'form-tender-txt style' ], + ]) + ->textarea([ 'placeholder' => $model->getAttributeLabel('text') ]) ?> +
+ field($model, 'file[]') + ->fileInput([ 'class' => 'multi' ]) + ->label(false) ?> + Прикрепить файл +
Максимальный размер
файла 5 МБ
+
+
+ 'get-project-new' ]); + echo Html::submitInput('ответить анонимно', [ + 'class' => 'get-list-new', + 'name' => 'CommentProject[anonymous]', + ]); + echo Html::a('Очистить', [ + 'tender/view', + 'tender_id' => \Yii::$app->request->get('tender_id'), + '#' => 'w1', + ]); + ?> +
+ end(); + ?> +
+ +
\ No newline at end of file diff --git a/common/modules/comment/widgets/views/list-comment-question.php b/common/modules/comment/widgets/views/list-comment-question.php new file mode 100755 index 0000000..06b91ba --- /dev/null +++ b/common/modules/comment/widgets/views/list-comment-question.php @@ -0,0 +1,32 @@ + +
Вопросов: (totalCount ?>)
+ $dataProvider, + 'itemView' => '_question_comment_view', + 'options' => [ + 'tag' => 'ul', + 'class' => 'proektant-comments tender_list_comm_ style', + ], + 'itemOptions' => [ + 'tag' => 'li', + 'class' => CommentWidget::$baseClass[ 'comment_container' ], + 'data' => [ + 'form' => $commentClass->formName(), + ], + ], + 'layout' => "{items}\n{pager}", + ]); \ No newline at end of file diff --git a/common/modules/comment/widgets/views/list-comment-review.php b/common/modules/comment/widgets/views/list-comment-review.php index 7bbe3bb..54ba814 100755 --- a/common/modules/comment/widgets/views/list-comment-review.php +++ b/common/modules/comment/widgets/views/list-comment-review.php @@ -1,16 +1,23 @@ - $dataProvider, - 'itemView' => '_review_comment_view', - 'options' => [ - 'tag' => 'ul', - 'class' => 'proektant-comments style' - ], - 'itemOptions' => [ - 'tag' => 'li', - ], - 'layout' => "{items}\n{pager}", -]); \ No newline at end of file + $dataProvider, + 'itemView' => '_review_comment_view', + 'options' => [ + 'tag' => 'ul', + 'class' => 'proektant-comments style', + ], + 'itemOptions' => [ + 'tag' => 'li', + 'class' => CommentWidget::$baseClass[ 'comment_container' ], + 'data' => [ + 'form' => $commentClass->formName(), + ], + ], + 'layout' => "{items}\n", + ]); \ No newline at end of file diff --git a/common/modules/comment/widgets/views/list-comment.php b/common/modules/comment/widgets/views/list-comment.php index 504d43a..4f37738 100755 --- a/common/modules/comment/widgets/views/list-comment.php +++ b/common/modules/comment/widgets/views/list-comment.php @@ -1,12 +1,12 @@ - $dataProvider, - 'itemView' => 'project_comment_view', - 'itemOptions' => [ - 'tag' => false, - ], - 'summary' => '', + $dataProvider, + 'itemView' => 'project_comment_view', + 'itemOptions' => [ + 'tag' => false, + ], + 'summary' => '', ]); \ No newline at end of file diff --git a/common/modules/comment/widgets/views/list-project-comment.php b/common/modules/comment/widgets/views/list-project-comment.php index 8ecb5f4..ce045e5 100755 --- a/common/modules/comment/widgets/views/list-project-comment.php +++ b/common/modules/comment/widgets/views/list-project-comment.php @@ -1,22 +1,22 @@ - -
-
-
Предложения проектантов (getTotalCount()?>)
-
- $dataProvider, - 'itemView' => '_project_comment_view', - 'itemOptions' => [ - 'class' => 'tender-offer-proj-blocks style', - ], - 'summary' => '', - ]); - ?> -
-
+ +
+
+
Предложения проектантов (getTotalCount()?>)
+
+ $dataProvider, + 'itemView' => '_project_comment_view', + 'itemOptions' => [ + 'class' => 'tender-offer-proj-blocks style', + ], + 'summary' => '', + ]); + ?> +
+
\ No newline at end of file diff --git a/common/modules/comment/widgets/views/project_comment_view.php b/common/modules/comment/widgets/views/project_comment_view.php index e035904..15e4d23 100755 --- a/common/modules/comment/widgets/views/project_comment_view.php +++ b/common/modules/comment/widgets/views/project_comment_view.php @@ -1,84 +1,103 @@ -user_id )) { - $user = User::find() - ->where([ 'id' => $model->user_id ]) - ->with('userInfo') - ->one(); - } -?> -
-
-
- userInfo->image )) { - echo ""; - } else { - echo ""; - } - ?> -
-
-
- ' . $user->firstname . ' ' . $user->lastname . '', [ - 'performer/common', - 'performer_id' => $user->id, - ]); - } else { - echo '' . $model->user_name . '' . '(Гость)'; - } - ?> -
-
- hasRating()) { - ?> -
- - - - -
- -
- -
- -
- text) ?> -
-
- -
-
    -
  • Ответить
  • -
  • Редактировать
  • -
  • Удалить
  • -
-
- -
-
+user_id )) { + $user = User::find() + ->where([ 'id' => $model->user_id ]) + ->with('userInfo') + ->one(); + } + $model->buildButtons([ 'delete' ]); +?> +
+
+
+ userInfo->image )) { + echo ""; + } else { + echo ""; + } + ?> +
+
+
+ ' . $user->firstname . ' ' . $user->lastname . '', [ + 'performer/common', + 'performer_id' => $user->id, + ]); + } else { + echo '' . $model->user_name . '' . '(Гость)'; + } + ?> +
+
+ hasRating()) { + echo StarRating::widget([ + 'name' => 'rating_project_comment', + 'value' => $rating->value, + 'pluginOptions' => [ + 'displayOnly' => true, + 'size' => 'xxs', + 'min' => 0, + 'max' => 10, + 'stars' => 10, + ], + ]); + } + ?> +
+ +
+ +
+ text) ?> +
+
+
+ buttons[ 'delete' ] )) { + echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => CommentWidget::$baseClass[ 'comment_delete' ] ]); + } + if(!empty( $model->buttons[ 'update' ] )) { + echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => CommentWidget::$baseClass[ 'comment_update' ] ]); + } + if(!empty( $model->buttons[ 'reply' ] )) { + echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] ]); + } + ?> +
+ +
+
    +
  • Ответить
  • +
  • Редактировать
  • +
  • Удалить
  • +
+
+ +
+
\ No newline at end of file diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index 37d2061..e1ae795 100755 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -3,6 +3,8 @@ namespace common\modules\product\models; use common\behaviors\Slug; +use common\models\ProductToRating; +use common\modules\comment\models\Comment; use common\modules\product\behaviors\FilterBehavior; use common\modules\rubrication\models\TaxGroup; use common\modules\rubrication\models\TaxOption; @@ -28,6 +30,7 @@ use yii\web\UploadedFile; * @property boolean $is_top * @property boolean $is_new * @property boolean $akciya + * @property ProductToRating $averageRating * @property array $properties * @property ProductVariant $enabledVariant * @property array $enabledVariants @@ -378,4 +381,33 @@ class Product extends \yii\db\ActiveRecord } return $op; } + + public function recalculateRating() { + /** + * @var ProductToRating $averageRating + */ + $average = $this->getComments()->joinWith('rating')->select(['average' => 'avg(rating.value)::float'])->scalar(); + if(!$average) { + $average = 0; + } + $averageRating = $this->averageRating; + if(!empty($averageRating)) { + $averageRating->value = $average; + } else { + $averageRating = new ProductToRating(['product_id' => $this->product_id, 'value' => $average]); + } + if($averageRating->save()) { + return true; + } else { + return false; + } + } + + public function getComments() { + return $this->hasMany(Comment::className(), ['model_id' => 'product_id'])->where(['comment.model' => self::className()]); + } + + public function getAverageRating() { + return $this->hasOne(ProductToRating::className(), ['product_id' => 'product_id']); + } } diff --git a/composer.json b/composer.json index 9d55521..815d06a 100755 --- a/composer.json +++ b/composer.json @@ -44,7 +44,8 @@ "yurkinx/yii2-image": "dev-master", "cics/yii2-video-embed-widget": "dev-master", "sersid/yii2-owl-carousel-asset": "*", - "wbraganca/yii2-dynamicform": "dev-master" + "wbraganca/yii2-dynamicform": "dev-master", + "kartik-v/yii2-widget-rating": "*" }, "require-dev": { "yiisoft/yii2-codeception": "*", diff --git a/console/migrations/m160721_152001_create_product_to_rating.php b/console/migrations/m160721_152001_create_product_to_rating.php new file mode 100644 index 0000000..5898e2f --- /dev/null +++ b/console/migrations/m160721_152001_create_product_to_rating.php @@ -0,0 +1,23 @@ +createTable('product_to_rating', [ + 'product_to_rating_id' => $this->primaryKey(), + 'product_id' => $this->integer()->notNull(), + 'value' => $this->float()->defaultValue(0), + ]); + + $this->addForeignKey('product_to_rating_product', 'product_to_rating', 'product_id', 'product', 'product_id', 'CASCADE', 'CASCADE'); + } + + public function down() + { + $this->dropForeignKey('product_to_rating_product', 'product_to_rating'); + $this->dropTable('product_to_rating'); + } +} diff --git a/frontend/controllers/CatalogController.php b/frontend/controllers/CatalogController.php index 64a9c06..457644f 100755 --- a/frontend/controllers/CatalogController.php +++ b/frontend/controllers/CatalogController.php @@ -115,6 +115,15 @@ class CatalogController extends \yii\web\Controller } $priceLimits = $productModel->priceLimits($category, $params); + + /* + * Greedy search for comments and rating + */ + $query = $productProvider->query; + $query->with(['comments', 'averageRating']); + /* + * End of greedy search for rating and comments + */ return $this->render( 'products', diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php index 4508b37..ad959aa 100755 --- a/frontend/views/catalog/product.php +++ b/frontend/views/catalog/product.php @@ -1,9 +1,13 @@ params['seo']['key'] = $product->category->categoryName->value; $this->params['seo']['fields']['name'] = $product->fullname; $this->params['seo']['h1'] = !empty(Seo::widget([ 'row'=>'h1'])) ? Seo::widget([ 'row'=>'h1']) : $product->fullname; @@ -86,8 +90,7 @@ $this->registerJs (" }); ", View::POS_READY, 'Shadowbox'); ?> - - +
+
+ averageRating)) { + echo StarRating::widget([ + 'name' => 'rating_product', + 'value' => $product->averageRating->value, + 'pluginOptions' => [ + 'displayOnly' => true, + 'size' => 'xxs', + 'min' => 0, + 'max' => 5, + 'stars' => 5, + ], + ]); + } + ?> +

+ comments); + if($comment_count) { + echo "Отзывов: ".$comment_count; + } else { + echo "Оставть отзыв"; + } + ?> +

+

@@ -216,7 +246,34 @@ $this->registerJs ("
- +
+ Comment::className(), + 'rating_class' => Rating::className(), + 'success_text' => 'Комментарий успешно добавлен', + 'class_options' => [ + 'scenario' => \Yii::$app->user->isGuest?Comment::SCENARIO_GUEST:Comment::SCENARIO_USER, + 'status' => Comment::STATUS_ACTIVE, + 'user_id' => \Yii::$app->user->isGuest?NULL:\Yii::$app->user->id, + ], + 'model' => $product->className(), + 'model_id' => $product->product_id, + 'list_options' => [ + 'view' => 'list-comment-review', + ], + 'form_options' => [ + 'view' => 'form-comment-review', + 'tag' => 'span', + ], + 'options' => [ + 'class' => 'proektant-comments-wr style', + 'id' => 'artbox-comment', + ], + ]); + ?> +
+ $product])?> 'promo'])?> 'new'])?> diff --git a/frontend/views/catalog/product_item.php b/frontend/views/catalog/product_item.php index 55f9c5c..9570623 100755 --- a/frontend/views/catalog/product_item.php +++ b/frontend/views/catalog/product_item.php @@ -1,73 +1,111 @@
  • - is_top) || !empty($product->is_new) || !empty($product->akciya)) :?> + is_top ) || !empty( $product->is_new ) || !empty( $product->akciya )) : ?>
      - is_top)) :?> -
    • top
    • - - is_new)) :?> -
    • new
    • - - akciya)) :?> -
    • promo
    • - + is_top )) : ?> +
    • +
      top
      +
    • + + is_new )) : ?> +
    • +
      new
      +
    • + + akciya )) : ?> +
    • +
      promo
      +
    • +
    - + +
    + averageRating )) { + echo StarRating::widget([ + 'name' => 'rating_product', + 'value' => $product->averageRating->value, + 'pluginOptions' => [ + 'displayOnly' => true, + 'size' => 'xxs', + 'min' => 0, + 'max' => 5, + 'stars' => 5, + ], + ]); + } + ?> +

    + comments); + echo Html::a(($comment_count?'Отзывов: ' . count($product->comments):"Оставить отзыв"), ['catalog/product', 'product' => $product, '#' => 'artbox-comment']) + ?> +

    +
    fullname ?> -
    - + 'catalog/product', + 'product' => $product, + '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, + ]) ?>" + class="name">fullname ?> +
    + '; - echo '

    '; - // есть скидка - if ($product->enabledVariants[0]->price_old != 0 && $product->enabledVariants[0]->price_old != $product->enabledVariants[0]->price) - { - echo ''.$product->enabledVariants[0]->price_old.' грн. '; - } - - echo $product->enabledVariants[0]->price.' грн.

    '; - echo ''; - echo '
  • '; - + + echo '
    '; + echo '

    '; + // есть скидка + if($product->enabledVariants[ 0 ]->price_old != 0 && $product->enabledVariants[ 0 ]->price_old != $product->enabledVariants[ 0 ]->price) { + echo '' . $product->enabledVariants[ 0 ]->price_old . ' грн. '; + } + + echo $product->enabledVariants[ 0 ]->price . ' грн.

    '; + echo ''; + echo '
    '; + ?>
    Купить - + '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, + ]) ?>" class="link_buy">Купить +
    diff --git a/frontend/views/catalog/products.php b/frontend/views/catalog/products.php index 0433063..b833ff8 100755 --- a/frontend/views/catalog/products.php +++ b/frontend/views/catalog/products.php @@ -12,7 +12,7 @@ use common\modules\product\helpers\FilterHelper; use frontend\widgets\Seo; //$this->title = $category->categoryName->value; $this->params['seo']['title'] = !empty($category->meta_title) ? $category->meta_title : ''; - + $this->params['seo']['fields']['meta-title'] = $category->meta_title; $this->params['seo']['h1'] = !empty($category->h1) ? $category->h1 : $category->name; $this->params['seo']['seo_text'] = $category->seo_text; diff --git a/frontend/views/products/_product.php b/frontend/views/products/_product.php index b1692e9..6303696 100755 --- a/frontend/views/products/_product.php +++ b/frontend/views/products/_product.php @@ -1,6 +1,6 @@
    diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index d9da938..f235e51 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -1 +1 @@ -html,form,body{padding:0;margin:0;font-family:'Roboto';font-size:14px;color:#333;height:100%}h1,h2,h3{margin:0px;padding:0px 0px 10px 0px}.fl{float:left}.fotter .wrap .fr{float:right;width:180px;height:50px;position:relative;font-size:12px}.fotter .wrap .fr img{position:absolute;top:50%;margin-top:-10px;right:0}.fotter .wrap .fl{line-height:50px;font-size:12px}.both{clear:both}h1{margin:10px 0;font-size:24px}h3{margin-bottom:30px}p{margin:3px 0px;padding:0px}a{color:#6a6a6a;font-size:14px;text-decoration:underline}a:hover{color:#799920}.wrap{width:960px;margin:0px auto}.f{background:#ffffff}.br{-webkit-box-shadow:-1px 5px 14px 0px rgba(50, 46, 50, 0.46);-moz-box-shadow:-1px 5px 14px 0px rgba(50, 46, 50, 0.46);box-shadow:-1px 5px 14px 0px rgba(50, 46, 50, 0.46);padding:20px}nav.top{background:#f5f5f5;padding:10px 0px;border-bottom:1px solid #d2d2d2;font-size:12px}nav.top ul{list-style:none;margin:0px;padding:0px}nav.top ul li{float:left;padding-right:20px}nav.top ul li a{font-size:12px}nav.top a{color:#6a6a6a;text-decoration:none}#help{background:url('../img/help.png') right no-repeat;padding-right:20px}#help span{border-bottom:1px dotted #6a6a6a}#login{background:url('../img/login.png') right no-repeat;padding-right:20px;font-size:12px}#login span{border-bottom:1px dotted #6a6a6a}.search{margin:-5px 0px -5px 100px;float:left}nav input[type="text"]{width:325px;outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px}nav input[type="submit"]{width:35px;height:29px;border:none;background:url('../img/lupa_sub.png') center no-repeat;margin-left:-35px;cursor:pointer}.header{margin:0px 0px 20px}.phone{float:left;position:relative;text-align:center;}.phone .tel{font-size:23px}.phone .tel span.more{margin-bottom:3px}.more_block{background:#ffffff;border:1px solid #d2d2d2;padding:10px;position:absolute;font-size:20px;display:none;z-index:99}.more{background:url('../img/more.png') no-repeat;width:12px;height:7px;display:inline-block;cursor:pointer;margin-bottom:5px}.logo{margin:0px auto 0px;width:193px}.logo a{display:block;width:193px;height:84px;background:url('../img/logo.png') no-repeat}.logo a span{display:none}#call{color:#6a6a6a;text-decoration:none;border-bottom:1px dotted #6a6a6a}.basket{float:right;position:relative;border:1px solid #d2d2d2;border-radius:5px;padding:15px 20px;font-size:18px;text-transform:uppercase;margin-top:13px}.basket .info{float:left;border-right:1px solid #d2d2d2;padding-right:10px;margin-right:17px}.basket .info span{color:#f75d50;font-size:22px}.basket a:link,.basket a:visited{text-decoration:none;color:#000000;font-size:18px}.basket span.more{margin-bottom:-1px}.menu{background:#596065;border:1px solid #e8e8e8}.menu ul{margin:0px;padding:0px;list-style:none}.menu ul li{float:left;border-left:1px solid #8b9094;height:43px}.menu ul li:first-child{border-left:none}.menu ul li a{width:100%;height:100%;line-height:43px;float:left;box-sizing:border-box;padding:0 19px;text-transform:uppercase;color:#ffffff;font-size:15px;text-decoration:none;font-weight:600}.menu ul li:hover{background:#3e454b}.menu ul li.active a{background:#f5f5f5;color:#596065}.menu ul li.active a:hover{cursor:default}.menu_childs{background:#f5f5f5;border:1px solid #e8e8e8;border-bottom:2px solid #596065}.menu_childs ul{margin:0px;padding:0px;list-style:none}.menu_childs ul li{float:left}.menu_childs ul li a{float:left;padding:15px 23px 15px 23px;text-transform:uppercase;color:#596065;font-size:14px;font-weight:bold;text-decoration:none}.menu_childs ul li a:hover{color:#878b8e}.fr ul li{border:none}.akciya a{background:#f75d50;color:#ffffff}.brands a{background:#95ba2f;color:#ffffff}a.myorders{color:#f75d50}.sub{margin:2px 0px 0px 0px}.sub img{float:left;margin-right:2px}.rubrics{margin:60px 0 0 0;padding-bottom:27px}.rubrics ul{list-style:none;margin:0px;padding:0px}.rubrics ul li{float:left;margin:0px 35px}.rubrics ul li a{float:left;width:120px;padding-top:130px;text-align:center;text-transform:uppercase;color:#494949;text-decoration:none;font-weight:bold}.rubrics ul li.item_ryukzaki a{background:url('../img/ico1.png') no-repeat}.rubrics ul li.item_sumki a{background:url('../img/ico2.png') no-repeat}.rubrics ul li.item_chehly a{background:url('../img/ico3.png') no-repeat}.rubrics ul li.item_nesessery a{background:url('../img/ico4.png') no-repeat}.rubrics ul li.item_koshelki a{background:url('../img/ico5.png') no-repeat}.products{padding-bottom:30px;padding-top:20px}.why_me_,.products{border-top:1px solid #d2d2d2}.products ul{list-style:none;margin:0;padding:0}.products ul li.item{float:left;width:192px;margin:0 0 50px 0;text-align:center;position:relative}.products ul li a.name,.special-products a.name{display:block;color:#799920;font-size:15px;text-decoration:none;margin:15px 0 0 0;height:35px;overflow:hidden;box-sizing:border-box;padding:0 10px}.products ul li a.name:hover,.special-products a.name:hover{text-decoration:underline}.products ul li .info{text-align:left}.pn{border:none}.cost,.product_read_price #cost{color:#f75d50;font-size:18px;margin:0;padding:0}.cost span,.cost span.valute,.product_read_price .valute{font-size:14px}strike,strike span#old_cost{font-size:14px;color:#333}.submit4m,a.link_buy,.checkout_basket button,.submit4{background:#95ba2f;border-radius:4px;height:29px;text-transform:uppercase;color:#ffffff;text-decoration:none;font-weight:600;text-align:center;border-bottom:3px solid #799920;font-size:12px}.submit4.bottom3{font-size:12px !important;display:block}.basket .submit4.bottom3{font-size:12px !important;display:block;margin-top:10px}a.link_buy,.checkout_basket button{display:block;margin:0 auto 10px auto;width:122px;line-height:32px}.checkout_basket button,.submit4{margin:0;padding:0 20px;line-height:31px;width:auto;border-top:0;border-left:0;border-right:0;cursor:pointer}a.link_buy:hover,.submit4m:hover,.checkout_basket button:hover,.submit4:hover,.btn-primary:hover{border-bottom:3px solid #95ba2f}a.link_buy:active,.submit4m:active,.checkout_basket button:active,.submit4:active,.btn-primary:active{background:#799920;border-bottom:3px solid #799920}.checkout_basket button:focus,.submit4:focus{outline:none}.mycarousel{position:absolute;right:22px;top:13px}ul.mycarousel{list-style:none;margin:0px;padding:0px}ul.mycarousel li{margin:0px;padding:0px}.mycarousel img{border:1px solid #d2d2d2}h3{text-align:center;text-transform:uppercase;font-size:20px}span.why {height: 29px;display: block;width:213px;height:49px;background:url('../img/logo-why.png') no-repeat;margin:0px auto;padding:0 0 20px 0}ul.why_list{list-style:none;margin:0px;padding:0px}ul.why_list li{float:left;margin-left:58px;width:288px;height:96px;box-sizing:border-box;padding-left:110px;margin-top:20px}ul.why_list li div{display:table-cell;height:96px;vertical-align:middle}ul.why_list li span{font-weight:bold;color:#799920}ul.why_list li.item1{background:url('../img/why_item1.png') left no-repeat}ul.why_list li.item2{background:url('../img/why_item2.png') left no-repeat}ul.why_list li.item3{background:url('../img/why_item3.png') left no-repeat}ul.why_list li.item4{background:url('../img/why_item4.png') left no-repeat}ul.why_list li.item5{background:url('../img/why_item5.png') left no-repeat}ul.why_list li.item6{background:url('../img/why_item6.png') left no-repeat}.banner_akciya{margin:50px 0px}.bottom{background:#4d5458;padding:40px 0px;color:#ffffff}.bottom .leftbar{float:left;width:210px}.bottom ul{list-style:none;margin:0px;padding:0px;line-height:23px}.bottom ul a{color:#ffffff;font-size:15px;text-decoration:none}.bottom ul a:hover{color:#799920}.phones{padding-left:25px;background:url('../img/phone.png') left top no-repeat;margin-top:50px;line-height:23px;font-size:18px}.map{padding:5px 0px 5px 25px;background:url('../img/map.png') left no-repeat;margin-bottom:7px}a.more_map{color:#99a5ad;border-bottom:1px dotted #99a5ad;text-decoration:none;font-size:11px;text-align:center}.bread-crumbs{padding:0 0 0 20px;border-bottom:1px solid #d2d2d2;height:29px}.bread-crumbs ul{list-style:none;margin:0 0 0 0;padding:0;height:29px}.bread-crumbs ul li{float:left;padding-left:20px;height:100%;line-height:29px;color:#7d7d7d;position:relative;font-size:12px}.bread-crumbs ul li:first-child{padding-left:0}.bread-crumbs ul li a{font-size:12px;display:block;color:#7d7d7d}.bread-crumbs ul li a:visited,.bread-crumbs ul li a:link{color:#7d7d7d;text-decoration:underline}.bread-crumbs ul li a:hover{color:#464646;text-decoration:none}.breadcrumb > li + li:before{color:#ccc;content:"/";position:absolute;top:0;left:8px}.loyout{padding:20px 0px}.leftbar{float:left;width:172px;margin-right:20px}.rightbar{float:right;width:380px;margin-left:40px}.rightbar.basket_rightbar{margin-right:20px}.rightbar2{float:right;width:320px}.content{overflow:hidden}* html .content{height:1%}.content2{overflow:hidden}* html .content2{height:1%}.filters{border-top:1px solid #d2d2d2;padding:20px 0px 0px;margin-top:20px}.filters .begin{text-transform:uppercase;font-weight:bold;font-size:12px}.filters ul{list-style:none;margin:0px;padding:0px;line-height:22px;margin-top:6px}.filters ul li{position:relative;box-sizing:border-box;padding-left:24px;line-height:16px;margin-top:7px}.filters ul li:first-child{margin-top:0}.filters ul li>input{position:absolute;left:4px;margin:0px 0 0;top:3px}.filters ul li a{color:#464646;text-decoration:none;font-size:13px;line-height:16px}.filters ul li a:hover{text-decoration:underline}.filters ul li.hidden{color: #9da9b1}.productLeftBar{float:left;width:228px;margin-left:20px;margin-right:20px}.productRightBar{float:right;width:260px;margin:0 20px}.productLeftBar h1{font-size:24px;border-bottom:1px solid #d2d2d2;margin-bottom:10px}ul.product_mod{list-style:none;margin:10px 0 0 0;padding:0;float:left}ul.product_mod li{float:left;width:46px;height:46px;background:#fff;border:1px solid #d2d2d2;margin:5px 5px 0 0;text-align:center;position:relative}ul.product_mod li.active:before{width:48px;height:48px;position:absolute;content:'';background:none;border:2px solid #95ba2f;top:-1px;left:-1px;box-sizing:border-box}ul.product_mod li a{width:46px;height:46px;display:table-cell;vertical-align:middle}ul.product_mod li a:focus{outline:none}ul.product_mod li img{vertical-align:middle;max-width:46px;max-height:46px}ul.product_colors{list-style:none;margin:30px 0 0 0;padding:0;float:left}ul.product_colors li{float:left;margin:10px 10px 0 0;width:98px;height:98px;text-align:center;border:1px solid #d2d2d2}ul.product_colors li a{width:98px;height:98px;vertical-align:middle;display:table-cell}ul.product_colors li img{max-width:98px;max-height:98px;vertical-align:middle}.productLeftBar .begin{text-transform:uppercase;font-weight:bold;font-size:12px}.cost_box{border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;margin:10px 0px;padding:10px 0px}.cost_box .w{float:left;margin-right:20px;padding-top:5px}.product_service ul{list-style:none;margin:0px;padding:0px}.product_service ul li a{color:#799920;text-decoration:none;border-bottom:1px dotted #799920;font-size:12px}.product_service ul li.item1{background:url('../img/li1.png') left no-repeat;padding:3px 23px}.product_service ul li.item2{background:url('../img/li2.png') left no-repeat;padding:3px 23px}.product_service ul li.item3{background:url('../img/li3.png') left no-repeat;padding:3px 23px}#nav_product{list-style:none;margin:0px;padding:0px;line-height:23px}#nav_product li a{background:url('../img/li_plus.png') left no-repeat;padding:3px 15px;color:#000000;text-transform:uppercase;text-decoration:none;font-weight:bold;font-size:12px}#nav_product li a.active{background:url('../img/li_minus.png') left no-repeat}#nav_product li .info{display:none;border-bottom:1px solid #d2d2d2;padding:10px 0px;margin-bottom:10px}#nav_product li .info,#nav_product li .info p{font-size:12px;line-height:16px}.modal_box{position:fixed;left:0;top:0;width:100%;height:100%;z-index:999;background:#000;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity:0.5;opacity:0.5}#data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#ffffff;-webkit-box-shadow:0 0 15px #000;-moz-box-shadow:0 0 15px #000;box-shadow:0 0 15px #000;border:7px solid #1b9bb6;border-radius:5px}#data_box .data_wrp{padding:25px 15px 15px 15px}#data_box .data_wrp h1{text-transform:uppercase}#data_box .data_wrp hr{height:1px;border:none;color:#000000;background:#000000;margin:45px 0px 20px 0px}#data_box .data_wrp hr.hr{height:1px;border:none;color:#000000;background:#000000;margin:20px 0px 20px 0px}#data_box .pic-tango{margin-right:7px;margin-bottom:7px}#modal_close{cursor:pointer;margin-top:-80px;margin-right:-50px}.rightbar .control-label,.textareagroup .control-label{float:left;width:80px;padding-top:5px}.form-control{outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px;margin-bottom:3px;width:250px}.form-control:focus{border:#1b9bb6 1px solid;box-shadow:0 0 10px #1b9bb6;-webkit-box-shadow:0 0 10px #1b9bb6;-moz-box-shadow:0 0 10px #1b9bb6}.help-block{color:red;font-size:12px;margin-bottom:5px}.basket_item{padding:10px 0px;border-bottom:1px solid #b7b7b7;clear:both}.basket_item img{margin-right:20px}.basket_item .count{margin:20px 0px}.basket_item .fr{margin-top:13px}.basket_item .info{overflow:hidden}.basket_item > a{display:block;float:left}a.del:visited,a.del:link{background:url('../img/del.png') left center no-repeat;padding:2px 25px;font-size:12px;font-weight:normal;color:#787878;text-decoration:underline}a.del:hover{color:#a52828;text-decoration:underline}.total{text-align:right;color:#87476a;font-size:20px;margin:10px 0px}.submit4m{font-family:Roboto;border:none;background:#95ba2f;border-radius:4px;color:#ffffff;text-transform:uppercase;font-size:10px;cursor:pointer;width:102px;height:29px;border-bottom:3px solid #799920;line-height:29px}.submit4m:active,.submit4m:focus{outline:none}.btn-primary{border-bottom:3px solid #799920;border-top:0;border-right:0;border-left:0;margin-top:5px;padding:0 15px;background:#95ba2f;border-radius:4px;color:#ffffff;text-transform:uppercase;text-decoration:none;font-size:12px;font-weight:bold;cursor:pointer;height:29px;line-height:29px}.btn-primary:active,.btn-primary:focus{outline:none}a.logout:visited,a.logout:link{border:none;padding:3px 5px;background:#f75d50;border-radius:5px;color:#ffffff;text-transform:uppercase;text-decoration:none;font-size:11px;font-weight:normal;cursor:pointer}a.logout:hover{background:#95ba2f}.boy_box{border-bottom:1px solid #b7b7b7;padding:0px 0px 15px 0px}.boy_box div{padding-top:10px}.content_product .info{padding:0px 0px 20px 0px}a.btn-success{display:inline-block;border:2px solid #d8d6d6;color:#95ba2f;border-radius:5px;padding:5px;margin-bottom:10px;text-decoration:none;font-size:14px}a.btn-success:hover{border:#95ba2f 2px solid;color:#f75d50}.txtb1{font-size:14px;font-weight:bold}.txtf{font-size:14px;font-weight:bold;color:#87476a}.txtfb{font-size:20px;font-weight:bold;color:#87476a}.count{margin:20px 0px}.count input[type="number"]{outline:0;width:50px;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px;margin-bottom:7px}a.link2:visited,a.link2:link{font-size:14px;font-weight:bold;color:#95ba2f;text-decoration:none}a.link2:hover{color:#f75d50;text-decoration:underline}.well{margin:50px auto;width:400px;background:#f5f5f5;border:1px solid #e8e8e8;padding:20px;border-radius:5px}.control-label{float:left;width:100px;padding-top:5px}#user-verifycode-image{display:block}.form-inline{display:inline}.form-inline .form-group{float:left;margin-right:10px}.form-inline .form-group select{width:100px}.form-group{margin-bottom:10px}.table-bordered{width:100%;border:1px solid silver}.table-bordered th{background:#B3D1FD;padding:5px}.table-bordered tr td{border:1px solid silver;padding:5px}.table-bordered .filters{display:none}.formCost label{float:left;width:30px}ul.brends_list{list-style:none;margin:0px;padding:0px}ul.brends_list li{float:left;text-align:center;margin:0px 15px 20px 15px}.compare{text-align:center}.compare a:visited,.compare a:link{font-size:12px;text-decoration:underline}.alert-success{margin:10px 0px;padding:10px;border:1px solid #3ed824;border-radius:5px;background:#c0feb5}.news_item{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid silver}.news_item img{margin-right:20px}.news_item a{font-size:16px}.pic{width:392px;height:365px}.pic a{width:392px;height:365px;display:table-cell;vertical-align:middle}.pic a img{max-width:392px;max-height:365px;vertical-align:middle}input#subscribe-email::-webkit-input-placeholder{color:#596065}input#subscribe-email::-moz-placeholder{color:#596065}input#subscribe-email:-ms-input-placeholder{color:#596065}input#subscribe-sale::-webkit-input-placeholder{color:#596065}input#subscribe-sale::-moz-placeholder{color:#596065}input#subscribe-sale:-ms-input-placeholder{color:#596065}#subscribe-email,#subscribe-sale{color:#596065}#subscribe-sale{width:100px;float:left;margin-right:20px;height:28px}.saletxt{width:150px;float:left;color:#ffffff;font-size:12px}#subscribe-email{width:370px}.txts{color:#9da9b1;font-size:18px;margin-bottom:20px}.content ul.pagination{list-style:none;text-align:center;margin:0 0 16px 0;padding:0 0 20px 0;border-bottom:1px solid #d2d2d2}.content ul.pagination li{display:inline}.content ul.pagination li a{padding:3px;color:#82a02f;font-size:15px;margin:0;text-decoration:none}.content ul.pagination li a:hover{text-decoration:underline}.content ul.pagination li.active a{color:#333333}.boxitem{height:283px}ul.social{margin-top:20px}.social{list-style:none;margin:10px;padding:0px;height:48px}.social li{display:inline-block;margin-right:7px;padding-bottom:10px}.social li a{width:36px;height:36px;display:block;margin:0;padding:0;text-indent:-9999px;background:#bcbcbc url(../img/social-ico-two.png) no-repeat 0 0;border-radius:48px;-moz-border-radius:48px;-webkit-border-radius:48px;-webkit-transition:all 0.5s ease-out;-moz-transition:all 0.5s ease-out;transition:all 0.5s ease-out}.social .fb{background-position:-44px 0;cursor:pointer}.social .vk{cursor:pointer}.social .vk:hover{background-color:#5B7FA6}.social .fb:hover{background-color:#354f89}.social .gp{background-position:-132px 0;cursor:pointer}.social .gp:hover{background-color:#c72f21}.social .tw{background-position:-144px 0;cursor:pointer}.social .tw:hover{background-color:#6398c9}.social .ok{background-position:-89px 0;cursor:pointer}.social .ok:hover{background-color:#f88f15}.social ul li a:hover{background-color:#065baa}.socialbox{margin:10px 0px}.hide{display:none}.footer .fl{font-size:12px}.fotter{background:#484f55;height:50px;color:#98a3ab}.fotter a{color:#98a3ab;line-height:50px;float:left;font-size:12px}.view_products2{list-style:none;overflow:auto;height:400px}.view_products2 img{float:left;margin-right:20px}.view_products2 li{margin:10px 0px}.pixbox{width:160px;margin:0 auto;height:200px;overflow:hidden;text-align:center}.form-order{background:#f5f5f5;padding:0 20px 20px 20px}#order-payment{float:right;width:280px}#order-delivery{float:right;width:280px}.delivery-data{margin-bottom:27px;position:relative;background:#95ba2f;display:none;border-radius:5px;float:left;box-sizing:border-box;padding:14px 20px;color:#fff;font-size:13px}.jcarousel-next-disabled,.jcarousel-prev-disabled{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}.content2 br{display:none}.pixbox a{width:160px;height:200px;display:table-cell;vertical-align:middle}.pixbox img{max-width:160px;max-height:200px;vertical-align:middle}.pagination li.prev.disabled span{display:none}.pagination li.next.disabled span{display:none}.fr{float:right}.nobottom{border-bottom:none !important}.dotted a{border-bottom:1px dotted #808080}.mycabinet{padding-left:20px;margin-top:20px}.mycabinet .begin{text-transform:uppercase;font-size:13px;font-weight:bold;padding-bottom:15px}.mycabinet ul{margin:0px;padding:0px;list-style:none}.mycabinet ul li{padding-top:10px;padding-bottom:10px}.mycabinet a{color:#799920;text-decoration:none}.lay_title .uppercase{text-transform:uppercase}.lay_title .center{text-align:center}.lay_title{padding-top:15px;font-size:24px}.user_data{width:390px;border-right:1px solid #d2d2d2;float:left}.user_data .col{padding-bottom:35px}.user_data .col.last{padding-bottom:0px}.user_data .title{text-transform:uppercase;font-weight:bold;width:170px;float:left;font-size:13px}.user_data .data{float:left;font-size:13px}.edit_menu{float:left;padding-left:60px;font-size:13px}.edit_menu div{padding-bottom:20px}.edit_menu a{color:#799920;text-decoration:none}.edit_menu .dotted{border-bottom:1px dotted #799920}.user_edit_area{padding-top:30px}.user_data_editing{float:left}.inputs .col{padding-bottom:12px !important}.user_data_editing .col{padding-bottom:35px;width:432px}.user_data_editing .title{text-transform:uppercase;font-weight:bold;width:170px;float:left;font-size:13px}.user_data_editing .data{float:left;font-size:13px;width:262px}.user_data_editing input[type="text"]{padding:0;margin:0;border:1px solid #d2d2d2;padding-top:7px;padding-bottom:7px;padding-left:10px;padding-right:10px;border-radius:4px;font-size:12px;margin-top:-10px;width:240px}.user_data_editing .add{color:#799920;text-decoration:none;border-bottom:1px dotted #799920}.add_more{padding-bottom:24px;padding-left:170px}.delete{float:right}.delete_button{background:url('../img/ico_close.png') right no-repeat;width:16px;height:16px;float:right}.content_area{width:450px}#cancel{text-decoration:none;color:#799920;font-size:13px;border-bottom:1px dotted #799920;float:left;margin-left:40px}.buttons{display:inline-flex;align-items:center}.favorites{background-color:#f5f5f5;padding:5px;font-size:14px}.favorites .fav_point{background-color:#ffffff;border:1px solid #d2d2d2;border-radius:3px;padding-top:10px;padding-bottom:10px;padding-left:20px;padding-right:20px;margin-top:5px}.favorites .fav_point .left{float:left;padding-right:0;width:178px}.favorites .fav_point .right{float:right;padding-right:0;padding-left:0}.favorites .link{color:#799920;text-decoration:none;border-bottom:1px dotted #799920}.redtext{color:#f75d50}.greentext{color:#95ba2f}.hold .orders_view{display:none !important}.orders_view{width:680px;margin-top:13px;padding-top:13px;padding-bottom:5px;border-top:1px solid #d2d2d2;display:block}.orders_view .order{float:left;width:225px;text-align:center}.orders_view .order .order_price{color:#f75d50;font-weight:bold;font-size:15px}.orders_view .order .order_price span{font-size:24px}.orders_view .order img{padding-bottom:22px}.orders_view .order .note{font-size:13px}.orders_view .order .note span{color:#f75d50}.basket_hovered{position:absolute;border:1px solid #d2d2d2;border-radius:5px;padding:15px 20px;background-color:white;right:-1px;margin-top:10px;width:640px;display:none;z-index:1111}.open .basket_hovered{display:block}.open,.open .basket_hovered{-moz-box-shadow:0px 0px 5px rgba(149,149,149,0.75);-webkit-box-shadow:0px 0px 5px rgba(149,149,149,0.75);box-shadow:0px 0px 5px rgba(149,149,149,0.75)}.basket_hovered1:before{position:absolute;left:0;content:' ';width:100%;background-color:white;height:10px;top:45px;z-index:1112}.basket_item input{border:1px solid #d2d2d2;border-radius:4px;padding:9px;width:26px;font-size:18px;font-weight:bold;text-align:center;background-color:white;color:black;margin:7px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.minus{background:url('../img/minus.png') no-repeat;width:15px;height:15px;display:inline-block;cursor:pointer}.plus{background:url('../img/plus.png') no-repeat;width:15px;height:15px;display:inline-block;cursor:pointer}.basket_sum{padding-top:15px}.basket_sum .sum_text{font-size:15px;text-transform:none;padding-top:12px;float:right !important;padding-top:1px;margin-bottom:11px}.basket_sum .sum_text span{font-size:18px;color:#f75d50;font-weight:bold}.basket_sum a{color:white !important;font-size:15px !important;float:right}.black{z-index:9999;width:100%;height:100%;position:absolute;display:block;padding-top:6%}.black:before{content:'';background-color:rgba(0,0,0,0.5);width:100%;height:100%;position:fixed;top:0}.black.hidden{display:none}.black .item_added_win{background-color:#ffffff;width:640px;margin:auto;position:relative}.black_close{position:absolute;top:30px;right:30px;background:url('../img/ico_close2.png') no-repeat;width:22px;height:22px;display:inline-block;cursor:pointer}.block_content{padding-left:20px;padding-right:20px}.item_added_win h2{text-transform:uppercase;text-align:center;padding:30px}.block_content .item{padding-top:20px;padding-bottom:20px;border-bottom:1px solid #d2d2d2}.uppercase{text-transform:uppercase}.w230{width:230px}.w260{width:260px}.w430{width:430px}.borderbottom{border-bottom:1px solid #d2d2d2}.left_block .begin{text-transform:uppercase;font-size:13px;font-weight:bold;padding-bottom:15px}.color_variants .variant{text-align:center;border:1px solid #d2d2d2;float:left;margin-right:5px;margin-bottom:5px}.variant:hover{cursor:pointer}.color_variants{margin-top:14px;margin-bottom:-5px}.color_variants .variant.active{width:44px;height:44px;border:2px solid #95ba2f}.color_variants .variant.active a{width:44px;height:44px}.tobasket{margin-top:20px;margin-bottom:20px}.tobasket:hover{color:white}.variant{width:46px;height:46px}.variant.active{width:44px;height:44px}.layout{margin-top:15px}.left_block{float:left}.right_block{float:right}.center_block{float:left;margin-left:23px}.left_block .links{margin-top:25px}.left_block .links li{list-style:none;padding-left:25px;display:inline-block;cursor:pointer;height:20px}.left_block .links ul{margin:0;padding:0}.left_block .links a{font-size:13.5px;text-decoration:none;color:#8ba73e}.links .add_bookmarks{background:url('../img/ico_add_bookmark.png') no-repeat center left}.links .what_price{background:url('../img/ico_price.png') no-repeat center left}.links .add_compare{background:url('../img/ico_scales.png') no-repeat center left}.spoiler_one{padding-top:15px;padding-bottom:15px;border-bottom:1px solid #d2d2d2}.spoiler_one .spoiler_content{margin-top:15px;font-size:13px}.spoiler_one .spoiler_content.hidden{display:none}.title_spoiler:hover{cursor:pointer}.title_spoiler{background:url('../img/ico_open.png') no-repeat center left;padding-left:17px;font-size:13px;text-transform:uppercase;color:#333333;font-weight:bold;text-decoration:none}.title_spoiler.closed{background:url('../img/ico_close3.png') no-repeat center left}.features{list-style:none;padding:0;margin:0;font-size:13px}.features a{font-size:13px;text-decoration:none;border-bottom:1px dotted #8ba73e;color:#8ba73e}.features li{padding-top:5px;padding-bottom:4px}.note_prod{width:225px;height:23px;overflow:hidden;border-radius:5px;display:table;text-transform:uppercase;font-size:11px;font-weight:bold}.note_prod .one{z-index:999}.note_prod .two{z-index:998}.note_prod .blue{float:left;padding-top:5px;padding-bottom:5px;background-color:#42b9f6;padding-left:10px;padding-right:5px;position:relative}.note_prod .blue:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #42b9f6;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.note_prod .red{float:left;padding-top:5px;padding-bottom:5px;background-color:#f75d50;padding-left:10px;padding-right:5px;position:relative;color:#ffffff}.note_prod .red:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #f75d50;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.note_prod .yellow{float:left;padding-top:5px;padding-bottom:5px;background-color:#fbc665;padding-left:10px;padding-right:5px;position:relative}.note_prod .yellow:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #fbc665;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.products_block .product{float:left;width:190px;vertical-align:bottom}.product .image{height:225px;position:relative}.product .image img{position:absolute;bottom:0;left:15px}.price{font-size:18px;color:#f75d50;font-weight:bold;text-align:center}.product{padding-bottom:30px;position:relative}.product p{font-size:15px;text-align:center;margin-top:15px}.left52{margin-left:52px}.product a{color:#ffffff}.mrg1{margin-top:25px;margin-bottom:15px}.products_martopbot{margin-top:60px;margin-bottom:100px}.cont_shop_but{display:table-cell;vertical-align:middle;padding:35px}.cont_shop{text-decoration:none;font-size:12px;border-bottom:1px dotted #799920;color:#799920}.icons{width:45px;height:50%;position:absolute;z-index:9;right:0;padding-top:25px;padding-right:15px}.icons a{width:44px;height:44px;float:left;border:1px solid #d2d2d2;margin-bottom:5px;background-color:white}a:hover{cursor:pointer}.basket_item .form-group{display:inline}.basket.open:after{content:'';position:absolute;top:43px;width:100%;height:10px;background-color:white;left:0;z-index:9990}.basket_hovered .basket_sum{float:left}a.active{font-weight:bold;text-decoration:underline}.HOME_RIGHT{display:inline-block;vertical-align:top;margin-left:10px;position:absolute}#HOME_UNDER_SLIDER > div{display:inline-block;margin-right:3px;margin-top:3px}.sort_block{display:inline-block}.sort_block ul{display:inline-block;margin:0;padding:0}.sort_block ul li{display:inline-block;margin:0 0.5em;list-style:none}.sort_block ul li a.asc:after,.sort_block ul li a.desc:after{display:block;width:5px;height:3px;position:absolute;top:50%;margin-top:-1px;right:-10px;content:'';background:url("../img/arrow_sort_asc_desc.png") no-repeat}.sort_block ul li a.asc:after{background-position:0 0}.sort_block ul li a.desc:after{background-position:0 -3px}.home_banner_up{margin-top:20px}.home_banner_up .HOME_RIGHT{display:block;float:right;position:static;margin-left:0}#HOME_SLIDER .jssorb03 div,#HOME_SLIDER .jssorb03 div:hover,#HOME_SLIDER .jssorb03 .av{width:6px;height:6px;border-radius:50%;line-height:6px;background:#fff;border:2px solid #fff;box-shadow:0px 0px 5px 0px rgba(54, 54, 54, 0.75)}#HOME_SLIDER .jssorb03 div.av:hover,#HOME_SLIDER .jssorb03 div.av:active,#HOME_SLIDER .jssorb03 .av{cursor:default;background:#95BA2F}.special-products{padding-top:30px}.special-products .link_buy{margin-bottom:0}.special-products .item{margin-bottom:0 !important;text-align:center}.why_me_{padding-top:30px;overflow:hidden;margin-bottom:60px}.why_me_ .why_list{width:1038px;margin-left:-58px}.seo_text p{margin:12px 0 0 0;font-size:13px !important;color:#333 !important;font-family:Roboto !important}.seo_text p:first-child{margin-top:0}.product-special{position:absolute}.jcarousel-skin-tango .jcarousel-item{width:38px;height:38px;border:1px solid #d2d2d2;text-align:center;background:#fff}.jcarousel-skin-tango .jcarousel-item a{display:table-cell;width:38px;height:38px;vertical-align:middle}.mycarousel img{max-width:38px;max-height:38px;border:0;vertical-align:middle}.jcarousel-skin-tango .jcarousel-clip-vertical,.jcarousel-skin-tango .jcarousel-container-vertical{height:175px}.jcarousel-skin-tango .jcarousel-container-vertical{padding:0}.jcarousel-skin-tango .jcarousel-prev-vertical{top:-13px}.jcarousel-skin-tango .jcarousel-next-vertical{bottom:-13px}.jcarousel-skin-tango .jcarousel-prev-vertical,.jcarousel-skin-tango .jcarousel-next-vertical{left:0;width:42px;background-position:14px 0}.jcarousel-skin-tango .jcarousel-prev-vertical:hover,.jcarousel-skin-tango .jcarousel-next-vertical:hover{background-position:14px 0;left:0}ul.product-special{position:absolute;top:0;left:16px}ul.product-special li{width:100%;float:left}ul.product-special li div{color:#333;font-size:10px;text-transform:uppercase;font-weight:700;height:22px;line-height:24px;padding:0 9px;position:relative;border-top-left-radius:4px;border-bottom-left-radius:4px;margin-top:8px;float:left}ul.product-special li:first-child{margin-top:0}ul.product-special li.top div{background:#fbc665}ul.product-special li.top div:after{content:'';position:absolute;right:-19px;top:3px;border:11px solid transparent;border-top:5px solid #fbc665;transform:rotate(-90deg)}ul.product-special li.new div{background:#42b9f6}ul.product-special li.new div:after{content:'';position:absolute;right:-18px;top:2px;border:11px solid transparent;border-top:5px solid #42b9f6;transform:rotate(-90deg)}ul.product-special li.promo div{background:#f75d50}ul.product-special li.promo div:after{content:'';position:absolute;right:-18px;top:2px;border:11px solid transparent;border-top:5px solid #f75d50;transform:rotate(-90deg)}.cost-block{margin-top:1px}.products.pn a.link_buy{margin-bottom:0}.products.pn{padding-bottom:0}.products.pn>ul{width:100%;float:left;margin-bottom:-3px}._form_checkbox_reset,.sort_block ul li a,.sort_block{font-size:12px}.filter_accept_bloc{margin-top:13px;margin-bottom:0}._form_checkbox_reset{color:#6a6a6a;display:block;width:128px;height:28px;border:1px solid #d2d2d2;line-height:28px;text-align:center;border-radius:4px;text-decoration:none;margin:0 auto}._form_checkbox_reset:hover{border:1px solid #95ba2f;color:#6a6a6a}._form_checkbox_reset:active{border:1px solid #95ba2f;background:#95ba2f;color:#fff}.sort_block ul li a{color:#8fa951;position:relative}.sort_block ul li a:hover{color:#333}#HOME_SLIDER .jssora03l,#HOME_SLIDER .jssora03r{width:36px;height:340px;background:url('../img/new_arrows_.png') no-repeat}#HOME_SLIDER .jssora03l,#HOME_SLIDER .jssora03l:hover{background-position:0 50%;left:0;top:0}#HOME_SLIDER .jssora03r,#HOME_SLIDER .jssora03r:hover{background-position:-36px 50%;right:0;top:0}.loyout ._prd_spec-wr{margin-top:10px}.loyout .special-products:first-child{border-top:0;padding-top:0}.irs-slider{width:13px;height:13px;top:25px;border-radius:100%;box-shadow:none;border:1px solid #d2d2d2;background:#ffffff;background:-moz-linear-gradient(top, #ffffff 0%, #ebebeb 100%);background:-webkit-linear-gradient(top, #ffffff 0%,#ebebeb 100%);background:linear-gradient(to bottom, #ffffff 0%,#ebebeb 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ebebeb',GradientType=0 )}.irs-slider.state_hover,.irs-slider:hover{background:#ffffff}.irs-slider:after{display:none}.irs-slider:before{content:"";position:absolute;width:5px;height:5px;z-index:2;border:1px solid #d2d2d2;border-radius:100%;background:#799920;top:3px;left:3px}.irs-bar{height:3px;top:30px}.irs-line{height:9px;background:#ebebeb;border:1px solid #d2d2d2;top:27px}.irs-line:before{width:166px;height:5px;position:absolute;content:'';top:2px;left:2px;background:#d2d2d2;border-radius:5px}.irs-min,.irs-max{display:none}.irs{height:49px}.price_filter.first_price_li{margin-top:8px}.product_read_ .w{width:110px;overflow:hidden;margin:0;padding-top:0;display:table-cell;vertical-align:middle;height:32px;float:none}.product_read_ .w strike,.product_read_ .w .cost{width:100%;float:left}.product_read_price .link_buy{width:118px;position:absolute;top:50%;right:0;margin:-16px 0 0 0}.product_read_price{position:relative;min-height:32px;margin-top:10px}.special-products.products h3{margin-bottom:10px}.special-products.products li.item{margin-top:30px}.productLeftBar .cost_box{border-top:0;padding:10px 0 15px 0}.productLeftBar .product_mod{width:100%;float:left;border-bottom:1px solid #d2d2d2;padding-bottom:15px}.field-orders-delivery .control-label,.field-orders-payment .control-label,.field-orders-body .control-label,.textareagroup .control-label{width:100%;float:left}.basket_title_{text-align:center}.cont_shopping-wr{width:100%;float:left;margin-top:10px}.cont_shopping-wr .cont_shopping{float:right}.cont_shopping{display:block !important;border-top:0 !important;border-left:0 !important;border-right:0 !important;border-bottom:1px dashed #799920 !important;color:#799920 !important;margin:0 !important;padding:0 !important;font-size:12px !important;float:left;border-radius:0 !important}.info.product-thumb-video{width:100%;height:100%}.info.product-thumb-video iframe,.info.product-thumb-video embed{width:100% !important;height:auto !important}.input-blocks-wrapper,.input-blocks{width:100%;float:left}.form-order .input-blocks-wrapper{margin-top:6px}.input-blocks label{font-size:13px;color:#333}.basket_input_2 label{height:30px;line-height:30px;float:left;width:70px !important;padding-top:0 !important}.custom-input-2{width:100%;height:30px;box-sizing:border-box;outline:none;line-height:30px;padding-left:8px;margin-top:5px;background:#fff;border-radius:4px}.custom-input-2,.custom-area-2,.textareagroup textarea{border:1px solid #d2d2d2;box-sizing:border-box;font-size:13px;color:#636363}.custom-area-2,.textareagroup textarea{min-height:128px;max-height:128px;resize:none;width:100%;max-width:100%;outline:none;padding-left:8px;padding-top:8px;margin-top:8px}.basket_input_2 .custom-input-2{width:270px;float:right;margin-top:0}.custom-input-2:focus,.custom-area-3:focus,.textareagroup textarea:focus{box-shadow:1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset;transition:0.1s}.textareagroup textarea:focus{border:1px solid #d2d2d2}.title_groups,.radio_grp label.control-label,.textareagroup .control-label{font-size:12px;font-weight:bold;text-transform:uppercase;margin-bottom:12px}.input-blocks-group{width:100%;float:left;border-bottom:1px solid #d2d2d2;padding-bottom:20px;margin-top:18px}.custom-form-buttons{width:100%;float:left}input.custom-radio + label,input.custom-check + label{font-size:13px;cursor:pointer;margin-left:6px}input.custom-radio,input.custom-check{display:none}input.custom-radio + label span{width:16px;height:16px;background:url('../img/radio_new.png') no-repeat;float:left;transition:.2s;margin-top:1px}input.custom-radio:checked + label span,input.custom-radio:checked + label:hover span{background:url('../img/radio_new-active.png') no-repeat}input.custom-radio + label:hover{text-decoration:underline}.custom-form-buttons{margin-top:7px}.custom-form-buttons:first-child{margin-top:0}.delivery-data .field-order-delivery-childs .control-label{display:none}.checkout_basket{width:100%;float:left}.checkout_basket button{margin:0 auto}.input-blocks-wrapper .help-block{padding-left:71px;padding-top:4px;width:100%;float:left;box-sizing:border-box;margin-bottom:0}.cont_shop_but-wr{height:33px;margin-top:35px;padding-bottom:29px}.cont_shop_but-wr .cont_shop{margin-top:8px;float:left}.cont_shop_but-wr .submit4.bottom3{float:right}._qqq_ .params{font-size:12px}.activeShow{border-bottom:0 !important}.delivery-data:after{width:100%;border-bottom:1px solid #d2d2d2;position:absolute;content:'';bottom:-27px;left:0}.img_ajax_basket img{margin-right:0 !important;max-width:90px;max-height:90px;vertical-align:middle}.jcarousel-skin-tango>li{display:none}#login-form{margin:50px auto 0 auto}#bg{top:0 !important;z-index:1 !important}.top,.wrap,.bottom,.fotter{position:relative;z-index:2}.owl-pagination{display:none}.owl-controls .owl-buttons div{width:34px !important;height:50px !important;background:#596065 !important;top:50% !important;margin:-25px 0 0 0 !important;opacity:1 !important;border-radius:0 !important;padding:0 !important;position:absolute}.owl-controls .owl-buttons div:hover{background:#acafb2 !important;transition:0.2s !important}.owl-controls .owl-buttons .owl-prev{border-top-right-radius:4px !important;border-bottom-right-radius:4px !important;left:-20px}.owl-controls .owl-buttons .owl-next{border-top-left-radius:4px !important;border-bottom-left-radius:4px !important;right:-20px}.owl-controls .owl-buttons div:before{position:absolute;content:'';width:8px;height:22px;background:url("../img/arrows_blocks.png") no-repeat;top:50%;margin-top:-11px;left:50%;margin-left:-4px}.owl-controls .owl-buttons .owl-prev:before{background-position:0 0}.owl-controls .owl-buttons .owl-next:before{background-position:-8px 0}.basket_input_2.required .control-label{position:relative}.basket_input_2.required .control-label:before{position:absolute;top:0;content:'*';color:#D60000;left:-11px;padding-top:2px}.float-left{float:left}.blog-show-img{padding-right:20px}.text_seo.hidden_seo{height:178px;overflow:hidden;position:relative}.text_seo.hidden_seo div{height:162px;overflow:hidden;position:relative}.text_seo.hidden_seo a{position:absolute;bottom:0;right:0;font-size:16px}.text_seo.hidden_seo div:before{content:'';display:block;position:absolute;bottom:0;right:0;left:0;height:120px;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%)}.special-products{border-bottom:1px solid #d2d2d2}a.link_buy,.checkout_basket button,.submit4{font-size:15px}.cost,.product_read_price #cost{font-size:20px}.cost span,.cost span.valute,.product_read_price .valute{font-size:15px} \ No newline at end of file +html,form,body{padding:0;margin:0;font-family:'Roboto';font-size:14px;color:#333;height:100%}h1,h2,h3{margin:0;padding:0 0 10px}.fl{float:left}.fotter .wrap .fr{float:right;width:180px;height:50px;position:relative;font-size:12px}.fotter .wrap .fr img{position:absolute;top:50%;margin-top:-10px;right:0}.fotter .wrap .fl{line-height:50px;font-size:12px}.both{clear:both}h1{margin:10px 0;font-size:24px}h3{margin-bottom:30px}p{margin:3px 0;padding:0}a{color:#6a6a6a;font-size:14px;text-decoration:underline}a:hover{color:#799920}.wrap{width:960px;margin:0 auto}.f{background:#fff}.br{-webkit-box-shadow:-1px 5px 14px 0 rgba(50,46,50,0.46);-moz-box-shadow:-1px 5px 14px 0 rgba(50,46,50,0.46);box-shadow:-1px 5px 14px 0 rgba(50,46,50,0.46);padding:20px}nav.top{background:#f5f5f5;padding:10px 0;border-bottom:1px solid #d2d2d2;font-size:12px}nav.top ul{list-style:none;margin:0;padding:0}nav.top ul li{float:left;padding-right:20px}nav.top ul li a{font-size:12px}nav.top a{color:#6a6a6a;text-decoration:none}#help{background:url(../img/help.png) right no-repeat;padding-right:20px}#help span{border-bottom:1px dotted #6a6a6a}#login{background:url(../img/login.png) right no-repeat;padding-right:20px;font-size:12px}#login span{border-bottom:1px dotted #6a6a6a}.search{margin:-5px 0 -5px 100px;float:left}nav input[type="text"]{width:325px;outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0;font-size:14px;text-indent:10px}nav input[type="submit"]{width:35px;height:29px;border:none;background:url(../img/lupa_sub.png) center no-repeat;margin-left:-35px;cursor:pointer}.header{margin:0 0 20px}.phone{float:left;position:relative;text-align:center}.phone .tel{font-size:23px}.phone .tel span.more{margin-bottom:3px}.more_block{background:#fff;border:1px solid #d2d2d2;padding:10px;position:absolute;font-size:20px;display:none;z-index:99}.more{background:url(../img/more.png) no-repeat;width:12px;height:7px;display:inline-block;cursor:pointer;margin-bottom:5px}.logo{margin:0 auto;width:193px}.logo a{display:block;width:193px;height:84px;background:url(../img/logo.png) no-repeat}.logo a span{display:none}#call{color:#6a6a6a;text-decoration:none;border-bottom:1px dotted #6a6a6a}.basket{float:right;position:relative;border:1px solid #d2d2d2;border-radius:5px;padding:15px 20px;font-size:18px;text-transform:uppercase;margin-top:13px}.basket .info{float:left;border-right:1px solid #d2d2d2;padding-right:10px;margin-right:17px}.basket .info span{color:#f75d50;font-size:22px}.basket a:link,.basket a:visited{text-decoration:none;color:#000;font-size:18px}.basket span.more{margin-bottom:-1px}.menu{background:#596065;border:1px solid #e8e8e8}.menu ul{margin:0;padding:0;list-style:none}.menu ul li{float:left;border-left:1px solid #8b9094;height:43px}.menu ul li:first-child{border-left:none}.menu ul li a{width:100%;height:100%;line-height:43px;float:left;box-sizing:border-box;padding:0 19px;text-transform:uppercase;color:#fff;font-size:15px;text-decoration:none;font-weight:600}.menu ul li:hover{background:#3e454b}.menu ul li.active a{background:#f5f5f5;color:#596065}.menu ul li.active a:hover{cursor:default}.menu_childs{background:#f5f5f5;border:1px solid #e8e8e8;border-bottom:2px solid #596065}.menu_childs ul{margin:0;padding:0;list-style:none}.menu_childs ul li{float:left}.menu_childs ul li a{float:left;padding:15px 23px;text-transform:uppercase;color:#596065;font-size:14px;font-weight:700;text-decoration:none}.menu_childs ul li a:hover{color:#878b8e}.fr ul li{border:none}.akciya a{background:#f75d50;color:#fff}.brands a{background:#95ba2f;color:#fff}a.myorders{color:#f75d50}.sub{margin:2px 0 0}.sub img{float:left;margin-right:2px}.rubrics{margin:60px 0 0;padding-bottom:27px}.rubrics ul{list-style:none;margin:0;padding:0}.rubrics ul li{float:left;margin:0 35px}.rubrics ul li a{float:left;width:120px;padding-top:130px;text-align:center;text-transform:uppercase;color:#494949;text-decoration:none;font-weight:700}.rubrics ul li.item_ryukzaki a{background:url(../img/ico1.png) no-repeat}.rubrics ul li.item_sumki a{background:url(../img/ico2.png) no-repeat}.rubrics ul li.item_chehly a{background:url(../img/ico3.png) no-repeat}.rubrics ul li.item_nesessery a{background:url(../img/ico4.png) no-repeat}.rubrics ul li.item_koshelki a{background:url(../img/ico5.png) no-repeat}.products{padding-bottom:30px;padding-top:20px}.why_me_,.products{border-top:1px solid #d2d2d2}.products ul{list-style:none;margin:0;padding:0}.products ul li.item{float:left;width:192px;margin:0 0 50px;text-align:center;position:relative}.products ul li a.name,.special-products a.name{display:block;color:#799920;font-size:15px;text-decoration:none;margin:15px 0 0;height:35px;overflow:hidden;box-sizing:border-box;padding:0 10px}.products ul li a.name:hover,.special-products a.name:hover{text-decoration:underline}.products ul li .info{text-align:left}.pn{border:none}.cost,.product_read_price #cost{color:#f75d50;font-size:18px;margin:0;padding:0}.cost span,.cost span.valute,.product_read_price .valute{font-size:14px}strike,strike span#old_cost{font-size:14px;color:#333}.submit4m,a.link_buy,.checkout_basket button,.submit4{background:#95ba2f;border-radius:4px;height:29px;text-transform:uppercase;color:#fff;text-decoration:none;font-weight:600;text-align:center;border-bottom:3px solid #799920;font-size:12px}.submit4.bottom3{font-size:12px!important;display:block}.basket .submit4.bottom3{font-size:12px!important;display:block;margin-top:10px}a.link_buy,.checkout_basket button{display:block;margin:0 auto 10px;width:122px;line-height:32px}.checkout_basket button,.submit4{margin:0;padding:0 20px;line-height:31px;width:auto;border-top:0;border-left:0;border-right:0;cursor:pointer}a.link_buy:hover,.submit4m:hover,.checkout_basket button:hover,.submit4:hover,.btn-primary:hover{border-bottom:3px solid #95ba2f}a.link_buy:active,.submit4m:active,.checkout_basket button:active,.submit4:active,.btn-primary:active{background:#799920;border-bottom:3px solid #799920}.checkout_basket button:focus,.submit4:focus{outline:none}.mycarousel{position:absolute;right:22px;top:13px}ul.mycarousel{list-style:none;margin:0;padding:0}ul.mycarousel li{margin:0;padding:0}.mycarousel img{border:1px solid #d2d2d2}h3{text-align:center;text-transform:uppercase;font-size:20px}span.why{width:213px;height:49px;background:url(../img/logo-why.png) no-repeat;margin:0 auto;padding:0 0 20px;height:29px;display:block}ul.why_list{list-style:none;margin:0;padding:0}ul.why_list li{float:left;margin-left:58px;width:288px;height:96px;box-sizing:border-box;padding-left:110px;margin-top:20px}ul.why_list li div{display:table-cell;height:96px;vertical-align:middle}ul.why_list li span{font-weight:700;color:#799920}ul.why_list li.item1{background:url(../img/why_item1.png) left no-repeat}ul.why_list li.item2{background:url(../img/why_item2.png) left no-repeat}ul.why_list li.item3{background:url(../img/why_item3.png) left no-repeat}ul.why_list li.item4{background:url(../img/why_item4.png) left no-repeat}ul.why_list li.item5{background:url(../img/why_item5.png) left no-repeat}ul.why_list li.item6{background:url(../img/why_item6.png) left no-repeat}.banner_akciya{margin:50px 0}.bottom{background:#4d5458;padding:40px 0;color:#fff}.bottom .leftbar{float:left;width:210px}.bottom ul{list-style:none;margin:0;padding:0;line-height:23px}.bottom ul a{color:#fff;font-size:15px;text-decoration:none}.bottom ul a:hover{color:#799920}.phones{padding-left:25px;background:url(../img/phone.png) left top no-repeat;margin-top:50px;line-height:23px;font-size:18px}.map{padding:5px 0 5px 25px;background:url(../img/map.png) left no-repeat;margin-bottom:7px}a.more_map{color:#99a5ad;border-bottom:1px dotted #99a5ad;text-decoration:none;font-size:11px;text-align:center}.bread-crumbs{padding:0 0 0 20px;border-bottom:1px solid #d2d2d2;height:29px}.bread-crumbs ul{list-style:none;margin:0;padding:0;height:29px}.bread-crumbs ul li{float:left;padding-left:20px;height:100%;line-height:29px;color:#7d7d7d;position:relative;font-size:12px}.bread-crumbs ul li:first-child{padding-left:0}.bread-crumbs ul li a{font-size:12px;display:block;color:#7d7d7d}.bread-crumbs ul li a:visited,.bread-crumbs ul li a:link{color:#7d7d7d;text-decoration:underline}.bread-crumbs ul li a:hover{color:#464646;text-decoration:none}.breadcrumb > li + li:before{color:#ccc;content:"/";position:absolute;top:0;left:8px}.loyout{padding:20px 0}.leftbar{float:left;width:172px;margin-right:20px}.rightbar{float:right;width:380px;margin-left:40px}.rightbar.basket_rightbar{margin-right:20px}.rightbar2{float:right;width:320px}.content{overflow:hidden}* html .content{height:1%}.content2{overflow:hidden}* html .content2{height:1%}.filters{border-top:1px solid #d2d2d2;padding:20px 0 0;margin-top:20px}.filters .begin{text-transform:uppercase;font-weight:700;font-size:12px}.filters ul{list-style:none;margin:0;padding:0;line-height:22px;margin-top:6px}.filters ul li{position:relative;box-sizing:border-box;padding-left:24px;line-height:16px;margin-top:7px}.filters ul li:first-child{margin-top:0}.filters ul li>input{position:absolute;left:4px;margin:0;top:3px}.filters ul li a{color:#464646;text-decoration:none;font-size:13px;line-height:16px}.filters ul li a:hover{text-decoration:underline}.productLeftBar{float:left;width:228px;margin-left:20px;margin-right:20px}.productRightBar{float:right;width:260px;margin:0 20px}.productLeftBar h1{font-size:24px;border-bottom:1px solid #d2d2d2;margin-bottom:10px}ul.product_mod{list-style:none;margin:10px 0 0;padding:0;float:left}ul.product_mod li{float:left;width:46px;height:46px;background:#fff;border:1px solid #d2d2d2;margin:5px 5px 0 0;text-align:center;position:relative}ul.product_mod li.active:before{width:48px;height:48px;position:absolute;content:'';background:none;border:2px solid #95ba2f;top:-1px;left:-1px;box-sizing:border-box}ul.product_mod li a{width:46px;height:46px;display:table-cell;vertical-align:middle}ul.product_mod li a:focus{outline:none}ul.product_mod li img{vertical-align:middle;max-width:46px;max-height:46px}ul.product_colors{list-style:none;margin:30px 0 0;padding:0;float:left}ul.product_colors li{float:left;margin:10px 10px 0 0;width:98px;height:98px;text-align:center;border:1px solid #d2d2d2}ul.product_colors li a{width:98px;height:98px;vertical-align:middle;display:table-cell}ul.product_colors li img{max-width:98px;max-height:98px;vertical-align:middle}.productLeftBar .begin{text-transform:uppercase;font-weight:700;font-size:12px}.cost_box{border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;margin:10px 0;padding:10px 0}.cost_box .w{float:left;margin-right:20px;padding-top:5px}.product_service ul{list-style:none;margin:0;padding:0}.product_service ul li a{color:#799920;text-decoration:none;border-bottom:1px dotted #799920;font-size:12px}.product_service ul li.item1{background:url(../img/li1.png) left no-repeat;padding:3px 23px}.product_service ul li.item2{background:url(../img/li2.png) left no-repeat;padding:3px 23px}.product_service ul li.item3{background:url(../img/li3.png) left no-repeat;padding:3px 23px}#nav_product{list-style:none;margin:0;padding:0;line-height:23px}#nav_product li a{background:url(../img/li_plus.png) left no-repeat;padding:3px 15px;color:#000;text-transform:uppercase;text-decoration:none;font-weight:700;font-size:12px}#nav_product li a.active{background:url(../img/li_minus.png) left no-repeat}#nav_product li .info{display:none;border-bottom:1px solid #d2d2d2;padding:10px 0;margin-bottom:10px}#nav_product li .info,#nav_product li .info p{font-size:12px;line-height:16px}.modal_box{position:fixed;left:0;top:0;width:100%;height:100%;z-index:999;background:#000;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#fff;-webkit-box-shadow:0 0 15px #000;-moz-box-shadow:0 0 15px #000;box-shadow:0 0 15px #000;border:7px solid #1b9bb6;border-radius:5px}#data_box .data_wrp{padding:25px 15px 15px}#data_box .data_wrp h1{text-transform:uppercase}#data_box .data_wrp hr{height:1px;border:none;color:#000;background:#000;margin:45px 0 20px}#data_box .data_wrp hr.hr{height:1px;border:none;color:#000;background:#000;margin:20px 0}#data_box .pic-tango{margin-right:7px;margin-bottom:7px}#modal_close{cursor:pointer;margin-top:-80px;margin-right:-50px}.rightbar .control-label,.textareagroup .control-label{float:left;width:80px;padding-top:5px}.form-control{outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0;font-size:14px;text-indent:10px;margin-bottom:3px;width:250px}.form-control:focus{border:#1b9bb6 1px solid;box-shadow:0 0 10px #1b9bb6;-webkit-box-shadow:0 0 10px #1b9bb6;-moz-box-shadow:0 0 10px #1b9bb6}.help-block{color:red;font-size:12px;margin-bottom:5px}.basket_item{padding:10px 0;border-bottom:1px solid #b7b7b7;clear:both}.basket_item img{margin-right:20px}.basket_item .count{margin:20px 0}.basket_item .fr{margin-top:13px}.basket_item .info{overflow:hidden}.basket_item > a{display:block;float:left}a.del:visited,a.del:link{background:url(../img/del.png) left center no-repeat;padding:2px 25px;font-size:12px;font-weight:400;color:#787878;text-decoration:underline}a.del:hover{color:#a52828;text-decoration:underline}.total{text-align:right;color:#87476a;font-size:20px;margin:10px 0}.submit4m{font-family:Roboto;border:none;background:#95ba2f;border-radius:4px;color:#fff;text-transform:uppercase;font-size:10px;cursor:pointer;width:102px;height:29px;border-bottom:3px solid #799920;line-height:29px}.submit4m:active,.submit4m:focus{outline:none}.btn-primary{border-bottom:3px solid #799920;border-top:0;border-right:0;border-left:0;margin-top:5px;padding:0 15px;background:#95ba2f;border-radius:4px;color:#fff;text-transform:uppercase;text-decoration:none;font-size:12px;font-weight:700;cursor:pointer;height:29px;line-height:29px}.btn-primary:active,.btn-primary:focus{outline:none}a.logout:visited,a.logout:link{border:none;padding:3px 5px;background:#f75d50;border-radius:5px;color:#fff;text-transform:uppercase;text-decoration:none;font-size:11px;font-weight:400;cursor:pointer}a.logout:hover{background:#95ba2f}.boy_box{border-bottom:1px solid #b7b7b7;padding:0 0 15px}.boy_box div{padding-top:10px}.content_product .info{padding:0 0 20px}a.btn-success{display:inline-block;border:2px solid #d8d6d6;color:#95ba2f;border-radius:5px;padding:5px;margin-bottom:10px;text-decoration:none;font-size:14px}a.btn-success:hover{border:#95ba2f 2px solid;color:#f75d50}.txtb1{font-size:14px;font-weight:700}.txtf{font-size:14px;font-weight:700;color:#87476a}.txtfb{font-size:20px;font-weight:700;color:#87476a}.count{margin:20px 0}.count input[type="number"]{outline:0;width:50px;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0;font-size:14px;text-indent:10px;margin-bottom:7px}a.link2:visited,a.link2:link{font-size:14px;font-weight:700;color:#95ba2f;text-decoration:none}a.link2:hover{color:#f75d50;text-decoration:underline}.well{margin:50px auto;width:400px;background:#f5f5f5;border:1px solid #e8e8e8;padding:20px;border-radius:5px}.control-label{float:left;width:100px;padding-top:5px}#user-verifycode-image{display:block}.form-inline{display:inline}.form-inline .form-group{float:left;margin-right:10px}.form-inline .form-group select{width:100px}.form-group{margin-bottom:10px}.table-bordered{width:100%;border:1px solid silver}.table-bordered th{background:#B3D1FD;padding:5px}.table-bordered tr td{border:1px solid silver;padding:5px}.table-bordered .filters{display:none}.formCost label{float:left;width:30px}ul.brends_list{list-style:none;margin:0;padding:0}ul.brends_list li{float:left;text-align:center;margin:0 15px 20px}.compare{text-align:center}.compare a:visited,.compare a:link{font-size:12px;text-decoration:underline}.alert-success{margin:10px 0;padding:10px;border:1px solid #3ed824;border-radius:5px;background:#c0feb5}.news_item{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid silver}.news_item img{margin-right:20px}.news_item a{font-size:16px}.pic{width:392px;height:365px}.pic a{width:392px;height:365px;display:table-cell;vertical-align:middle}.pic a img{max-width:392px;max-height:365px;vertical-align:middle}input#subscribe-email::-webkit-input-placeholder{color:#596065}input#subscribe-email::-moz-placeholder{color:#596065}input#subscribe-email:-ms-input-placeholder{color:#596065}input#subscribe-sale::-webkit-input-placeholder{color:#596065}input#subscribe-sale::-moz-placeholder{color:#596065}input#subscribe-sale:-ms-input-placeholder{color:#596065}#subscribe-email,#subscribe-sale{color:#596065}#subscribe-sale{width:100px;float:left;margin-right:20px;height:28px}.saletxt{width:150px;float:left;color:#fff;font-size:12px}#subscribe-email{width:370px}.txts{color:#9da9b1;font-size:18px;margin-bottom:20px}.content ul.pagination{list-style:none;text-align:center;margin:0 0 16px;padding:0 0 20px;border-bottom:1px solid #d2d2d2}.content ul.pagination li{display:inline}.content ul.pagination li a{padding:3px;color:#82a02f;font-size:15px;margin:0;text-decoration:none}.content ul.pagination li a:hover{text-decoration:underline}.content ul.pagination li.active a{color:#333}.boxitem{height:318px}ul.social{margin-top:20px}.social{list-style:none;margin:10px;padding:0;height:48px}.social li{display:inline-block;margin-right:7px;padding-bottom:10px}.social li a{width:36px;height:36px;display:block;margin:0;padding:0;text-indent:-9999px;background:#bcbcbc url(../img/social-ico-two.png) no-repeat 0 0;border-radius:48px;-moz-border-radius:48px;-webkit-border-radius:48px;-webkit-transition:all .5s ease-out;-moz-transition:all .5s ease-out;transition:all .5s ease-out}.social .fb{background-position:-44px 0;cursor:pointer}.social .vk{cursor:pointer}.social .vk:hover{background-color:#5B7FA6}.social .fb:hover{background-color:#354f89}.social .gp{background-position:-132px 0;cursor:pointer}.social .gp:hover{background-color:#c72f21}.social .tw{background-position:-144px 0;cursor:pointer}.social .tw:hover{background-color:#6398c9}.social .ok{background-position:-89px 0;cursor:pointer}.social .ok:hover{background-color:#f88f15}.social ul li a:hover{background-color:#065baa}.socialbox{margin:10px 0}.hide{display:none}.footer .fl{font-size:12px}.fotter{background:#484f55;height:50px;color:#98a3ab}.fotter a{color:#98a3ab;line-height:50px;float:left;font-size:12px}.view_products2{list-style:none;overflow:auto;height:400px}.view_products2 img{float:left;margin-right:20px}.view_products2 li{margin:10px 0}.pixbox{width:160px;margin:0 auto;height:200px;overflow:hidden;text-align:center}.form-order{background:#f5f5f5;padding:0 20px 20px}#order-payment{float:right;width:280px}#order-delivery{float:right;width:280px}.delivery-data{margin-bottom:27px;position:relative;background:#95ba2f;display:none;border-radius:5px;float:left;box-sizing:border-box;padding:14px 20px;color:#fff;font-size:13px}.jcarousel-next-disabled,.jcarousel-prev-disabled{opacity:0;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0)}.content2 br{display:none}.pixbox a{width:160px;height:200px;display:table-cell;vertical-align:middle}.pixbox img{max-width:160px;max-height:200px;vertical-align:middle}.pagination li.prev.disabled span{display:none}.pagination li.next.disabled span{display:none}.fr{float:right}.nobottom{border-bottom:none!important}.dotted a{border-bottom:1px dotted gray}.mycabinet{padding-left:20px;margin-top:20px}.mycabinet .begin{text-transform:uppercase;font-size:13px;font-weight:700;padding-bottom:15px}.mycabinet ul{margin:0;padding:0;list-style:none}.mycabinet ul li{padding-top:10px;padding-bottom:10px}.mycabinet a{color:#799920;text-decoration:none}.lay_title .uppercase{text-transform:uppercase}.lay_title .center{text-align:center}.lay_title{padding-top:15px;font-size:24px}.user_data{width:390px;border-right:1px solid #d2d2d2;float:left}.user_data .col{padding-bottom:35px}.user_data .col.last{padding-bottom:0}.user_data .title{text-transform:uppercase;font-weight:700;width:170px;float:left;font-size:13px}.user_data .data{float:left;font-size:13px}.edit_menu{float:left;padding-left:60px;font-size:13px}.edit_menu div{padding-bottom:20px}.edit_menu a{color:#799920;text-decoration:none}.edit_menu .dotted{border-bottom:1px dotted #799920}.user_edit_area{padding-top:30px}.user_data_editing{float:left}.inputs .col{padding-bottom:12px!important}.user_data_editing .col{padding-bottom:35px;width:432px}.user_data_editing .title{text-transform:uppercase;font-weight:700;width:170px;float:left;font-size:13px}.user_data_editing .data{float:left;font-size:13px;width:262px}.user_data_editing input[type="text"]{padding:0;margin:0;border:1px solid #d2d2d2;padding-top:7px;padding-bottom:7px;padding-left:10px;padding-right:10px;border-radius:4px;font-size:12px;margin-top:-10px;width:240px}.user_data_editing .add{color:#799920;text-decoration:none;border-bottom:1px dotted #799920}.add_more{padding-bottom:24px;padding-left:170px}.delete{float:right}.delete_button{background:url(../img/ico_close.png) right no-repeat;width:16px;height:16px;float:right}.content_area{width:450px}#cancel{text-decoration:none;color:#799920;font-size:13px;border-bottom:1px dotted #799920;float:left;margin-left:40px}.buttons{display:inline-flex;align-items:center}.favorites{background-color:#f5f5f5;padding:5px;font-size:14px}.favorites .fav_point{background-color:#fff;border:1px solid #d2d2d2;border-radius:3px;margin-top:5px;padding:10px 20px}.favorites .fav_point .left{float:left;padding-right:0;width:178px}.favorites .fav_point .right{float:right;padding-right:0;padding-left:0}.favorites .link{color:#799920;text-decoration:none;border-bottom:1px dotted #799920}.redtext{color:#f75d50}.greentext{color:#95ba2f}.hold .orders_view{display:none!important}.orders_view{width:680px;margin-top:13px;padding-top:13px;padding-bottom:5px;border-top:1px solid #d2d2d2;display:block}.orders_view .order{float:left;width:225px;text-align:center}.orders_view .order .order_price{color:#f75d50;font-weight:700;font-size:15px}.orders_view .order .order_price span{font-size:24px}.orders_view .order img{padding-bottom:22px}.orders_view .order .note{font-size:13px}.orders_view .order .note span{color:#f75d50}.basket_hovered{position:absolute;border:1px solid #d2d2d2;border-radius:5px;padding:15px 20px;background-color:#fff;right:-1px;margin-top:10px;width:640px;display:none;z-index:1111}.open .basket_hovered{display:block}.open,.open .basket_hovered{-moz-box-shadow:0 0 5px rgba(149,149,149,0.75);-webkit-box-shadow:0 0 5px rgba(149,149,149,0.75);box-shadow:0 0 5px rgba(149,149,149,0.75)}.basket_hovered1:before{position:absolute;left:0;content:' ';width:100%;background-color:#fff;height:10px;top:45px;z-index:1112}.basket_item input{border:1px solid #d2d2d2;border-radius:4px;padding:9px;width:26px;font-size:18px;font-weight:700;text-align:center;background-color:#fff;color:#000;margin:7px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.minus{background:url(../img/minus.png) no-repeat;width:15px;height:15px;display:inline-block;cursor:pointer}.plus{background:url(../img/plus.png) no-repeat;width:15px;height:15px;display:inline-block;cursor:pointer}.basket_sum{padding-top:15px}.basket_sum .sum_text{font-size:15px;text-transform:none;padding-top:12px;float:right!important;padding-top:1px;margin-bottom:11px}.basket_sum .sum_text span{font-size:18px;color:#f75d50;font-weight:700}.basket_sum a{color:#fff!important;font-size:15px!important;float:right}.black{z-index:9999;width:100%;height:100%;position:absolute;display:block;padding-top:6%}.black:before{content:'';background-color:rgba(0,0,0,0.5);width:100%;height:100%;position:fixed;top:0}.black.hidden{display:none}.black .item_added_win{background-color:#fff;width:640px;margin:auto;position:relative}.black_close{position:absolute;top:30px;right:30px;background:url(../img/ico_close2.png) no-repeat;width:22px;height:22px;display:inline-block;cursor:pointer}.block_content{padding-left:20px;padding-right:20px}.item_added_win h2{text-transform:uppercase;text-align:center;padding:30px}.block_content .item{padding-top:20px;padding-bottom:20px;border-bottom:1px solid #d2d2d2}.uppercase{text-transform:uppercase}.w230{width:230px}.w260{width:260px}.w430{width:430px}.borderbottom{border-bottom:1px solid #d2d2d2}.left_block .begin{text-transform:uppercase;font-size:13px;font-weight:700;padding-bottom:15px}.color_variants .variant{text-align:center;border:1px solid #d2d2d2;float:left;margin-right:5px;margin-bottom:5px}.variant:hover{cursor:pointer}.color_variants{margin-top:14px;margin-bottom:-5px}.color_variants .variant.active{width:44px;height:44px;border:2px solid #95ba2f}.color_variants .variant.active a{width:44px;height:44px}.tobasket{margin-top:20px;margin-bottom:20px}.tobasket:hover{color:#fff}.variant{width:46px;height:46px}.variant.active{width:44px;height:44px}.layout{margin-top:15px}.left_block{float:left}.right_block{float:right}.center_block{float:left;margin-left:23px}.left_block .links{margin-top:25px}.left_block .links li{list-style:none;padding-left:25px;display:inline-block;cursor:pointer;height:20px}.left_block .links ul{margin:0;padding:0}.left_block .links a{font-size:13.5px;text-decoration:none;color:#8ba73e}.links .add_bookmarks{background:url(../img/ico_add_bookmark.png) no-repeat center left}.links .what_price{background:url(../img/ico_price.png) no-repeat center left}.links .add_compare{background:url(../img/ico_scales.png) no-repeat center left}.spoiler_one{padding-top:15px;padding-bottom:15px;border-bottom:1px solid #d2d2d2}.spoiler_one .spoiler_content{margin-top:15px;font-size:13px}.spoiler_one .spoiler_content.hidden{display:none}.title_spoiler:hover{cursor:pointer}.title_spoiler{background:url(../img/ico_open.png) no-repeat center left;padding-left:17px;font-size:13px;text-transform:uppercase;color:#333;font-weight:700;text-decoration:none}.title_spoiler.closed{background:url(../img/ico_close3.png) no-repeat center left}.features{list-style:none;padding:0;margin:0;font-size:13px}.features a{font-size:13px;text-decoration:none;border-bottom:1px dotted #8ba73e;color:#8ba73e}.features li{padding-top:5px;padding-bottom:4px}.note_prod{width:225px;height:23px;overflow:hidden;border-radius:5px;display:table;text-transform:uppercase;font-size:11px;font-weight:700}.note_prod .one{z-index:999}.note_prod .two{z-index:998}.note_prod .blue{float:left;background-color:#42b9f6;position:relative;padding:5px 5px 5px 10px}.note_prod .blue:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #42b9f6;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.note_prod .red{float:left;background-color:#f75d50;position:relative;color:#fff;padding:5px 5px 5px 10px}.note_prod .red:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #f75d50;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.note_prod .yellow{float:left;background-color:#fbc665;position:relative;padding:5px 5px 5px 10px}.note_prod .yellow:after{content:'';width:0;height:0;border-top:13px solid transparent;border-left:5px solid #fbc665;border-bottom:13px solid transparent;position:absolute;top:-1px;margin-left:5px}.products_block .product{float:left;width:190px;vertical-align:bottom}.product .image{height:225px;position:relative}.product .image img{position:absolute;bottom:0;left:15px}.price{font-size:18px;color:#f75d50;font-weight:700;text-align:center}.product{padding-bottom:30px;position:relative}.product p{font-size:15px;text-align:center;margin-top:15px}.left52{margin-left:52px}.product a{color:#fff}.mrg1{margin-top:25px;margin-bottom:15px}.products_martopbot{margin-top:60px;margin-bottom:100px}.cont_shop_but{display:table-cell;vertical-align:middle;padding:35px}.cont_shop{text-decoration:none;font-size:12px;border-bottom:1px dotted #799920;color:#799920}.icons{width:45px;height:50%;position:absolute;z-index:9;right:0;padding-top:25px;padding-right:15px}.icons a{width:44px;height:44px;float:left;border:1px solid #d2d2d2;margin-bottom:5px;background-color:#fff}a:hover{cursor:pointer}.basket_item .form-group{display:inline}.basket.open:after{content:'';position:absolute;top:43px;width:100%;height:10px;background-color:#fff;left:0;z-index:9990}.basket_hovered .basket_sum{float:left}a.active{font-weight:700;text-decoration:underline}.HOME_RIGHT{display:inline-block;vertical-align:top;margin-left:10px;position:absolute}#HOME_UNDER_SLIDER > div{display:inline-block;margin-right:3px;margin-top:3px}.sort_block{display:inline-block}.sort_block ul{display:inline-block;margin:0;padding:0}.sort_block ul li{display:inline-block;margin:0 .5em;list-style:none}.sort_block ul li a.asc:after,.sort_block ul li a.desc:after{display:block;width:5px;height:3px;position:absolute;top:50%;margin-top:-1px;right:-10px;content:'';background:url(../img/arrow_sort_asc_desc.png) no-repeat}.sort_block ul li a.asc:after{background-position:0 0}.sort_block ul li a.desc:after{background-position:0 -3px}.home_banner_up{margin-top:20px}.home_banner_up .HOME_RIGHT{display:block;float:right;position:static;margin-left:0}#HOME_SLIDER .jssorb03 div,#HOME_SLIDER .jssorb03 div:hover,#HOME_SLIDER .jssorb03 .av{width:6px;height:6px;border-radius:50%;line-height:6px;background:#fff;border:2px solid #fff;box-shadow:0 0 5px 0 rgba(54,54,54,0.75)}#HOME_SLIDER .jssorb03 div.av:hover,#HOME_SLIDER .jssorb03 div.av:active,#HOME_SLIDER .jssorb03 .av{cursor:default;background:#95BA2F}.special-products{padding-top:30px}.special-products .link_buy{margin-bottom:0}.special-products .item{margin-bottom:0!important;text-align:center}.why_me_{padding-top:30px;overflow:hidden;margin-bottom:60px}.why_me_ .why_list{width:1038px;margin-left:-58px}.seo_text p{margin:12px 0 0;font-size:13px!important;color:#333!important;font-family:Roboto!important}.seo_text p:first-child{margin-top:0}.product-special{position:absolute}.jcarousel-skin-tango .jcarousel-item{width:38px;height:38px;border:1px solid #d2d2d2;text-align:center;background:#fff}.jcarousel-skin-tango .jcarousel-item a{display:table-cell;width:38px;height:38px;vertical-align:middle}.mycarousel img{max-width:38px;max-height:38px;border:0;vertical-align:middle}.jcarousel-skin-tango .jcarousel-clip-vertical,.jcarousel-skin-tango .jcarousel-container-vertical{height:175px}.jcarousel-skin-tango .jcarousel-container-vertical{padding:0}.jcarousel-skin-tango .jcarousel-prev-vertical{top:-13px}.jcarousel-skin-tango .jcarousel-next-vertical{bottom:-13px}.jcarousel-skin-tango .jcarousel-prev-vertical,.jcarousel-skin-tango .jcarousel-next-vertical{left:0;width:42px;background-position:14px 0}.jcarousel-skin-tango .jcarousel-prev-vertical:hover,.jcarousel-skin-tango .jcarousel-next-vertical:hover{background-position:14px 0;left:0}ul.product-special{position:absolute;top:0;left:16px}ul.product-special li{width:100%;float:left}ul.product-special li div{color:#333;font-size:10px;text-transform:uppercase;font-weight:700;height:22px;line-height:24px;padding:0 9px;position:relative;border-top-left-radius:4px;border-bottom-left-radius:4px;margin-top:8px;float:left}ul.product-special li:first-child{margin-top:0}ul.product-special li.top div{background:#fbc665}ul.product-special li.top div:after{content:'';position:absolute;right:-19px;top:3px;border:11px solid transparent;border-top:5px solid #fbc665;transform:rotate(-90deg)}ul.product-special li.new div{background:#42b9f6}ul.product-special li.new div:after{content:'';position:absolute;right:-18px;top:2px;border:11px solid transparent;border-top:5px solid #42b9f6;transform:rotate(-90deg)}ul.product-special li.promo div{background:#f75d50}ul.product-special li.promo div:after{content:'';position:absolute;right:-18px;top:2px;border:11px solid transparent;border-top:5px solid #f75d50;transform:rotate(-90deg)}.cost-block{margin-top:1px}.products.pn a.link_buy{margin-bottom:0}.products.pn{padding-bottom:0}.products.pn>ul{width:100%;float:left;margin-bottom:-3px}._form_checkbox_reset,.sort_block ul li a,.sort_block{font-size:12px}.filter_accept_bloc{margin-top:13px;margin-bottom:0}._form_checkbox_reset{color:#6a6a6a;display:block;width:128px;height:28px;border:1px solid #d2d2d2;line-height:28px;text-align:center;border-radius:4px;text-decoration:none;margin:0 auto}._form_checkbox_reset:hover{border:1px solid #95ba2f;color:#6a6a6a}._form_checkbox_reset:active{border:1px solid #95ba2f;background:#95ba2f;color:#fff}.sort_block ul li a{color:#8fa951;position:relative}.sort_block ul li a:hover{color:#333}#HOME_SLIDER .jssora03l,#HOME_SLIDER .jssora03r{width:36px;height:340px;background:url(../img/new_arrows_.png) no-repeat}#HOME_SLIDER .jssora03l,#HOME_SLIDER .jssora03l:hover{background-position:0 50%;left:0;top:0}#HOME_SLIDER .jssora03r,#HOME_SLIDER .jssora03r:hover{background-position:-36px 50%;right:0;top:0}.loyout ._prd_spec-wr{margin-top:10px}.loyout .special-products:first-child{border-top:0;padding-top:0}.irs-slider{width:13px;height:13px;top:25px;border-radius:100%;box-shadow:none;border:1px solid #d2d2d2;background:#fff;background:-moz-linear-gradient(top,#fff 0%,#ebebeb 100%);background:-webkit-linear-gradient(top,#fff 0%,#ebebeb 100%);background:linear-gradient(to bottom,#fff 0%,#ebebeb 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#ebebeb',GradientType=0)}.irs-slider.state_hover,.irs-slider:hover{background:#fff}.irs-slider:after{display:none}.irs-slider:before{content:"";position:absolute;width:5px;height:5px;z-index:2;border:1px solid #d2d2d2;border-radius:100%;background:#799920;top:3px;left:3px}.irs-bar{height:3px;top:30px}.irs-line{height:9px;background:#ebebeb;border:1px solid #d2d2d2;top:27px}.irs-line:before{width:166px;height:5px;position:absolute;content:'';top:2px;left:2px;background:#d2d2d2;border-radius:5px}.irs-min,.irs-max{display:none}.irs{height:49px}.price_filter.first_price_li{margin-top:8px}.product_read_ .w{width:110px;overflow:hidden;margin:0;padding-top:0;display:table-cell;vertical-align:middle;height:32px;float:none}.product_read_ .w strike,.product_read_ .w .cost{width:100%;float:left}.product_read_price .link_buy{width:118px;position:absolute;top:50%;right:0;margin:-16px 0 0}.product_read_price{position:relative;min-height:32px;margin-top:10px}.special-products.products h3{margin-bottom:10px}.special-products.products li.item{margin-top:30px}.productLeftBar .cost_box{border-top:0;padding:10px 0 15px}.productLeftBar .product_mod{width:100%;float:left;border-bottom:1px solid #d2d2d2;padding-bottom:15px}.field-orders-delivery .control-label,.field-orders-payment .control-label,.field-orders-body .control-label,.textareagroup .control-label{width:100%;float:left}.basket_title_{text-align:center}.cont_shopping-wr{width:100%;float:left;margin-top:10px}.cont_shopping-wr .cont_shopping{float:right}.cont_shopping{display:block!important;border-top:0!important;border-left:0!important;border-right:0!important;border-bottom:1px dashed #799920!important;color:#799920!important;margin:0!important;padding:0!important;font-size:12px!important;float:left;border-radius:0!important}.info.product-thumb-video{width:100%;height:100%}.info.product-thumb-video iframe,.info.product-thumb-video embed{width:100%!important;height:auto!important}.input-blocks-wrapper,.input-blocks{width:100%;float:left}.form-order .input-blocks-wrapper{margin-top:6px}.input-blocks label{font-size:13px;color:#333}.basket_input_2 label{height:30px;line-height:30px;float:left;width:70px!important;padding-top:0!important}.custom-input-2{width:100%;height:30px;box-sizing:border-box;outline:none;line-height:30px;padding-left:8px;margin-top:5px;background:#fff;border-radius:4px}.custom-input-2,.custom-area-2,.textareagroup textarea{border:1px solid #d2d2d2;box-sizing:border-box;font-size:13px;color:#636363}.custom-area-2,.textareagroup textarea{min-height:128px;max-height:128px;resize:none;width:100%;max-width:100%;outline:none;padding-left:8px;padding-top:8px;margin-top:8px}.basket_input_2 .custom-input-2{width:270px;float:right;margin-top:0}.custom-input-2:focus,.custom-area-3:focus,.textareagroup textarea:focus{box-shadow:1px 2px 2px 0 rgba(215,215,215,0.75) inset;transition:.1s}.textareagroup textarea:focus{border:1px solid #d2d2d2}.title_groups,.radio_grp label.control-label,.textareagroup .control-label{font-size:12px;font-weight:700;text-transform:uppercase;margin-bottom:12px}.input-blocks-group{width:100%;float:left;border-bottom:1px solid #d2d2d2;padding-bottom:20px;margin-top:18px}.custom-form-buttons{width:100%;float:left}input.custom-radio + label,input.custom-check + label{font-size:13px;cursor:pointer;margin-left:6px}input.custom-radio,input.custom-check{display:none}input.custom-radio + label span{width:16px;height:16px;background:url(../img/radio_new.png) no-repeat;float:left;transition:.2s;margin-top:1px}input.custom-radio:checked + label span,input.custom-radio:checked + label:hover span{background:url(../img/radio_new-active.png) no-repeat}input.custom-radio + label:hover{text-decoration:underline}.custom-form-buttons{margin-top:7px}.custom-form-buttons:first-child{margin-top:0}.delivery-data .field-order-delivery-childs .control-label{display:none}.checkout_basket{width:100%;float:left}.checkout_basket button{margin:0 auto}.input-blocks-wrapper .help-block{padding-left:71px;padding-top:4px;width:100%;float:left;box-sizing:border-box;margin-bottom:0}.cont_shop_but-wr{height:33px;margin-top:35px;padding-bottom:29px}.cont_shop_but-wr .cont_shop{margin-top:8px;float:left}.cont_shop_but-wr .submit4.bottom3{float:right}._qqq_ .params{font-size:12px}.activeShow{border-bottom:0!important}.delivery-data:after{width:100%;border-bottom:1px solid #d2d2d2;position:absolute;content:'';bottom:-27px;left:0}.img_ajax_basket img{margin-right:0!important;max-width:90px;max-height:90px;vertical-align:middle}.jcarousel-skin-tango>li{display:none}#login-form{margin:50px auto 0}#bg{top:0!important;z-index:1!important}.top,.wrap,.bottom,.fotter{position:relative;z-index:2}.owl-pagination{display:none}.owl-controls .owl-buttons div{width:34px!important;height:50px!important;background:#596065!important;top:50%!important;margin:-25px 0 0!important;opacity:1!important;border-radius:0!important;padding:0!important;position:absolute}.owl-controls .owl-buttons div:hover{background:#acafb2!important;transition:.2s!important}.owl-controls .owl-buttons .owl-prev{border-top-right-radius:4px!important;border-bottom-right-radius:4px!important;left:-20px}.owl-controls .owl-buttons .owl-next{border-top-left-radius:4px!important;border-bottom-left-radius:4px!important;right:-20px}.owl-controls .owl-buttons div:before{position:absolute;content:'';width:8px;height:22px;background:url(../img/arrows_blocks.png) no-repeat;top:50%;margin-top:-11px;left:50%;margin-left:-4px}.owl-controls .owl-buttons .owl-prev:before{background-position:0 0}.owl-controls .owl-buttons .owl-next:before{background-position:-8px 0}.basket_input_2.required .control-label{position:relative}.basket_input_2.required .control-label:before{position:absolute;top:0;content:'*';color:#D60000;left:-11px;padding-top:2px}.float-left{float:left}.blog-show-img{padding-right:20px}.text_seo.hidden_seo{height:178px;overflow:hidden;position:relative}.text_seo.hidden_seo div{height:162px;overflow:hidden;position:relative}.text_seo.hidden_seo a{position:absolute;bottom:0;right:0;font-size:16px}.text_seo.hidden_seo div:before{content:'';display:block;position:absolute;bottom:0;right:0;left:0;height:120px;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%);background:linear-gradient(top,rgba(255,255,255,0) 0%,#fff 100%)}.special-products{border-bottom:1px solid #d2d2d2}a.link_buy,.checkout_basket button,.submit4{font-size:15px}.cost,.product_read_price #cost{font-size:20px}.cost span,.cost span.valute,.product_read_price .valute{font-size:15px}.comment_display_block{height:35px} \ No newline at end of file diff --git a/frontend/web/css/style.dev.css b/frontend/web/css/style.dev.css index 1ab7c5f..a6cd91d 100755 --- a/frontend/web/css/style.dev.css +++ b/frontend/web/css/style.dev.css @@ -500,7 +500,7 @@ input#subscribe-sale:-ms-input-placeholder { .content ul.pagination li a:hover {text-decoration: underline} .content ul.pagination li.active a{color: #333333;} .boxitem{ - height:283px; + height:318px; } ul.social {margin-top: 20px;} .social{list-style: none;margin: 10px;padding: 0px;height:48px;} @@ -1613,4 +1613,7 @@ input.custom-radio + label:hover { background: -ms-linear-gradient(top, rgba(255, 255, 255, 0) 0%, #fff 100%); background: linear-gradient(top, rgba(255, 255, 255, 0) 0%, #fff 100%); } -.special-products{border-bottom:1px solid #d2d2d2}a.link_buy,.checkout_basket button,.submit4{font-size:15px}.cost,.product_read_price #cost{font-size:20px}.cost span,.cost span.valute,.product_read_price .valute{font-size:15px} \ No newline at end of file +.special-products{border-bottom:1px solid #d2d2d2}a.link_buy,.checkout_basket button,.submit4{font-size:15px}.cost,.product_read_price #cost{font-size:20px}.cost span,.cost span.valute,.product_read_price .valute{font-size:15px} +.comment_display_block { + height: 35px; +} \ No newline at end of file -- libgit2 0.21.4