Cleanup the Fix
This commit is contained in:
parent
8140ebd1cc
commit
3c0cbe55b6
|
@ -91,11 +91,7 @@ class ImportSchedule extends BaseController
|
||||||
public function edit(Request $request): Response
|
public function edit(Request $request): Response
|
||||||
{
|
{
|
||||||
$scheduleId = $request->getAttribute('schedule_id'); // optional
|
$scheduleId = $request->getAttribute('schedule_id'); // optional
|
||||||
|
|
||||||
$schedule = ScheduleUrl::find($scheduleId);
|
$schedule = ScheduleUrl::find($scheduleId);
|
||||||
if ($schedule == null) {
|
|
||||||
$schedule = new ScheduleUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->response->withView(
|
return $this->response->withView(
|
||||||
'admin/schedule/edit.twig',
|
'admin/schedule/edit.twig',
|
||||||
|
|
|
@ -64,7 +64,11 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for id,name in locations %}
|
{% for id,name in locations %}
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{{ f.checkbox('location_' ~ id, name, {'checked': id in schedule.activeLocations.pluck('id')}) }}
|
{{ f.checkbox(
|
||||||
|
'location_' ~ id,
|
||||||
|
name,
|
||||||
|
{'checked': schedule and id in schedule.activeLocations.pluck('id')}
|
||||||
|
) }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue