Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class User extends Model

public $implement = ['@Winter.Translate.Behaviors.TranslatableModel'];

public $translatable = ['media_image'];
public $translatable = ['media_image', 'my_title'];

/**
* @var array Guarded fields
Expand All @@ -28,6 +28,13 @@ class User extends Model
*/
protected $fillable = [];

/**
* @var array Jsonable fields
*/
protected $jsonable = [
'my_repeater'
];

/**
* @var array Rules
*/
Expand Down
54 changes: 54 additions & 0 deletions models/user/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,60 @@ fields:
type: number
comment: This code should appear as a number.

my_title:
label: My title - issue 44 wn-translate
span: auto
placeholder: Hello world
comment: This field is ignored, no matter the value. It is always overridden by MY_REPEATER -> MY_TITLE (refresh after rename and save)

my_repeater:
label: My repeater - issue 44 wn-translate, 715 winter, 716 winter
span: auto
type: repeater
form:
fields:
my_random_field:
label: Trigger issue 716
type: checkbox

my_nested_form:
label: Nested form
type: nestedform
usePanelStyles: false
cssClass: my-nested-form-custom-css
form:
tabs:
icons:
Issue 44 TRANS: icon-keyboard
Issue 715 WINTER: icon-list
Issue 716 WINTER: icon-toggle-on
fields:
my_title:
tab: Issue 44 TRANS
label: My title
placeholder: Hello WinterCMS
span: auto
commentAbove: Note the language switcher in this field (refresh after rename and save)

my_reorder_bug:
tab: Issue 715 WINTER
label: My reorder bug
type: repeater
commentAbove: Reordering the fields is not working (refresh after reorder and save)
form:
fields:
my_text:
type: text

my_trigger_bug:
tab: Issue 716 WINTER
label: My trigger bug
commentAbove: Hidden when my_random_field is checked. No matter how many ^ I add, the trigger never happens
trigger:
action: hide
field: ^^^my_random_field
condition: checked

tabs:
fields:

Expand Down
25 changes: 25 additions & 0 deletions updates/v2.0.5/aic_translate_issue_44
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php namespace Winter\Test\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

return new class extends Migration
{
public function up()
{
Schema::table('winter_test_users', function ($table) {
$table->string('my_title', 100)->nullable();
$table->json('my_repeater')->nullable();
});
}

public function down()
{
Schema::table('winter_test_users', function ($table) {
$table->dropColumn([
'my_title',
'my_repeater',
]);
});
}
};
3 changes: 3 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
"2.0.4":
- "Add settings columns for pages"
- v2.0.4/add_page_settings_columns.php
"2.0.5":
- "Add AIC WN-TRANSLATE-PLUGIN issue 44"
- v2.0.5/aic_translate_issue_44.php