@foreach($parts as $p)
@if($p->ascii=='palmilha' || $p->is_editable)
@include('back.buildmodel.parts.part_with_plastic')
@endif
@endforeach
@foreach($parts as $p)
{{$p->name}}
@if(!$p->have_sides)
@if(isset($models_parts_images[$model->id][$p->id][0]))
![{{$models_parts_images[$model->id][$p->id][0]}}]({{url(env('IMG_MODELS_RENDER_FOLDER')).'/'.$model->id.'/'.$models_parts_images[$model->id][$p->id][0]}})
@endif
@endif
@if(!in_array($p->ascii,['cosidos']))
@if(!$p->have_colors && !$p->have_submodels)
@if(!$p->have_sides)
@include('back.buildmodel.parts.part_with_textures')
@else
@include('back.buildmodel.parts.part_with_textures_and_sides')
@endif
@else
@if($p->have_colors && $p->have_textures)
@include('back.buildmodel.parts.part_with_textures_and_colors')
@elseif($p->have_colors && !$p->have_submodels)
@include('back.buildmodel.parts.part_with_colors')
@elseif($p->have_colors && !$p->have_subparts && $p->have_submodels)
@include('back.buildmodel.parts.part_with_colors_and_submodels')
@endif
@endif
@else
@if($p->ascii=='cosidos')
@include('back.buildmodel.parts.part_stiches',['color_stiches'=>$p->colors->all()])
@endif
@endif
@endforeach