-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizable details #750
Customizable details #750
Conversation
Hi @AbbyJanke , Wooww. This looks like a lot of work, thanks for the PR. I do think Backpack\CRUD needs to include only broad functionality by default, though, and I don't think the stats on the left would fit many projects... I do love how the right-hand-side info is being displayed, though. That's pretty much what I had in mind for the SHOW functionality (or PREVIEW, whatever). Putting it in a zebra table makes so much sense, you're right. What stopped me from developing the preview functionality so far was that:
What do you think? |
Also, I probably should not be saying this because I'm overcomplicating it, but in the medium to long future (maybe Backpack\CRUD v4), since:
You normally won't have to specify the field/column/preview types at all. But when you do, you'd be able to "overwrite" the types be specifying something like this on your Model: class Monster extends Model
{
use CrudTrait;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'monsters';
protected $primaryKey = 'id';
public $timestamps = true;
// protected $guarded = ['id'];
protected $fillable = ['address', 'base64_image', 'browse', 'checkbox', 'wysiwyg', 'color', 'color_picker', 'date', 'date_picker', 'start_date', 'end_date', 'datetime', 'datetime_picker', 'email', 'hidden', 'icon_picker', 'image', 'month', 'number', 'float', 'password', 'radio', 'range', 'select', 'select_from_array', 'select2', 'select2_from_ajax', 'select2_from_array', 'simplemde', 'summernote', 'table', 'textarea', 'text', 'tinymce', 'upload', 'upload_multiple', 'url', 'video', 'week', 'extras'];
// protected $hidden = [];
// protected $dates = [];
protected $casts = [
'address' => 'array',
];
protected $crudTypes = [
'address' => 'address',
'something' => 'email',
'description' => 'tinyMCE'
]; Maybe, I don't know if it's doable or such a great idea. Just wanted to let you in on it, maybe it will be relevant in thinking this PREVIEW functionality through. |
That functionality should be doable to be honest. Would take a lot of work to be honest and a major breaking change. The stats on the left are basically just model relations, things that I could display within the table but wanted to make it look prettier, it allows the option to add them or just the table. Will see what i can do working on your suggestions. |
A LOT of work. I know. But I don't think it should be a breaking change, as right now we do have the You can enable the "show" method with Ok, it's doable, I agree, but... what do you think about it? Good/bad course of action? Any way we can improve on it? |
This is a primitive attempt at improving the "show" view: #308 |
The table for the preview of an item would not be the breaking change, but your ultimate goal of moving from defining each column in my opinion would be as you are automatically doing |
Closing PR, working on better method to do this automatically and removing left statistic options. |
Similar to customizable fields within Backpack this allows you to customize the 'show' views with two options (statistics and details)
Statistics are free flowing small info boxes on the left, regular details are placed within a table. If no statistics are defined the table is full-width.
see issue #749 for discussion
Information on how to define each detail option is located within the
view
until we get better documentation for it.