afisha phone
This commit is contained in:
parent
4c783f2fb7
commit
d7a8790cae
|
|
@ -66,7 +66,7 @@ class Post extends Model
|
||||||
/**
|
/**
|
||||||
* @var array Attributes to be stored as JSON
|
* @var array Attributes to be stored as JSON
|
||||||
*/
|
*/
|
||||||
protected $jsonable = ['metadata', 'more_photo'];
|
protected $jsonable = ['metadata', 'more_photo', 'afisha_phone_new'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be mutated to dates.
|
* The attributes that should be mutated to dates.
|
||||||
|
|
@ -228,7 +228,9 @@ class Post extends Model
|
||||||
|
|
||||||
public function filterFields($fields, $context = null)
|
public function filterFields($fields, $context = null)
|
||||||
{
|
{
|
||||||
|
$fields->tags_ru->hidden = true;
|
||||||
|
$fields->tags_tm->hidden = true;
|
||||||
|
$fields->tags_en->hidden = true;
|
||||||
// $fields->afisha_phone->value = $fields->category_groupsq->value;
|
// $fields->afisha_phone->value = $fields->category_groupsq->value;
|
||||||
// $fields->category_groups->value = $fields->category_groupsq->value;
|
// $fields->category_groups->value = $fields->category_groupsq->value;
|
||||||
|
|
||||||
|
|
@ -290,9 +292,11 @@ class Post extends Model
|
||||||
|
|
||||||
if($this->category_groups->where('type', 'afisha')->count()){
|
if($this->category_groups->where('type', 'afisha')->count()){
|
||||||
$fields->afisha_phone->hidden = false;
|
$fields->afisha_phone->hidden = false;
|
||||||
|
$fields->afisha_phone_new->hidden = false;
|
||||||
$fields->afisha_address->hidden = false;
|
$fields->afisha_address->hidden = false;
|
||||||
}else{
|
}else{
|
||||||
$fields->afisha_phone->hidden = true;
|
$fields->afisha_phone->hidden = true;
|
||||||
|
$fields->afisha_phone_new->hidden = true;
|
||||||
$fields->afisha_address->hidden = true;
|
$fields->afisha_address->hidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,18 +145,11 @@ secondaryTabs:
|
||||||
required: 0
|
required: 0
|
||||||
type: balloon-selector
|
type: balloon-selector
|
||||||
tab: 'Category Group'
|
tab: 'Category Group'
|
||||||
# category_groups:
|
|
||||||
# span: left
|
|
||||||
# path: field_category_group_item
|
|
||||||
# type: partial
|
|
||||||
# dependsOn: category_groupsq
|
|
||||||
# tab: 'Category Group'
|
|
||||||
category_groups:
|
category_groups:
|
||||||
span: left
|
span: left
|
||||||
path: field_category_group_item
|
path: field_category_group_item
|
||||||
type: relation
|
type: relation
|
||||||
tab: 'Category Group'
|
tab: 'Category Group'
|
||||||
# options: getCategoryGroupsOptions
|
|
||||||
categories:
|
categories:
|
||||||
tab: 'Category Group'
|
tab: 'Category Group'
|
||||||
type: checkboxlist
|
type: checkboxlist
|
||||||
|
|
@ -175,3 +168,17 @@ secondaryTabs:
|
||||||
type: text
|
type: text
|
||||||
dependsOn: category_groups
|
dependsOn: category_groups
|
||||||
tab: 'Category Group'
|
tab: 'Category Group'
|
||||||
|
afisha_phone_new:
|
||||||
|
label: 'Afisha Phones'
|
||||||
|
prompt: 'Add new phone'
|
||||||
|
style: default
|
||||||
|
span: auto
|
||||||
|
type: repeater
|
||||||
|
dependsOn: category_groups
|
||||||
|
tab: 'Category Group'
|
||||||
|
form:
|
||||||
|
fields:
|
||||||
|
phone:
|
||||||
|
label: Phone
|
||||||
|
span: full
|
||||||
|
type: text
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace RainLab\Blog\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRainlabBlogPosts19 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('rainlab_blog_posts', function($table)
|
||||||
|
{
|
||||||
|
$table->text('afisha_phone_new')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('rainlab_blog_posts', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('afisha_phone_new');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -174,3 +174,6 @@
|
||||||
1.5.38:
|
1.5.38:
|
||||||
- 'Updated table rainlab_blog_posts'
|
- 'Updated table rainlab_blog_posts'
|
||||||
- builder_table_update_rainlab_blog_posts_18.php
|
- builder_table_update_rainlab_blog_posts_18.php
|
||||||
|
1.5.39:
|
||||||
|
- 'Updated table rainlab_blog_posts'
|
||||||
|
- builder_table_update_rainlab_blog_posts_19.php
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue