Skip to content

Commit

Permalink
introduce admin/shared/_edit partial
Browse files Browse the repository at this point in the history
  • Loading branch information
fwolfst committed Oct 7, 2020
1 parent a793aec commit d3eb274
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
13 changes: 4 additions & 9 deletions app/views/admin/course/lessons/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
-#
-# SPDX-License-Identifier: AGPL-3.0-or-later
%h1.title
=t('.edit.title')

= render 'form'

= link_to t('Show'), [:admin, @lesson.style, @lesson]
\|
= link_to t('Back'), admin_course_path(@lesson.style)

= render layout: 'admin/shared/edit',
locals: { edit_title: t('.edit.title'),
back_target: admin_course_path(@lesson.style) } do
= render 'form'
12 changes: 4 additions & 8 deletions app/views/admin/places/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
-#
-# SPDX-License-Identifier: AGPL-3.0-or-later
%h1.title
= t("admin.places.edit")

= render 'form'

= link_to 'Show', [:admin, @place]
\|
= link_to 'Back', admin_places_path
= render layout: 'admin/shared/edit',
locals: { edit_title: t('admin.places.edit'),
back_target: admin_places_path } do
= render 'form'
15 changes: 15 additions & 0 deletions app/views/admin/shared/_edit.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-# SPDX-FileCopyrightText: 2020 Felix Wolfsteller
-#
-# SPDX-License-Identifier: AGPL-3.0-or-later
%h1.title
= edit_title

= yield

%hr

= link_to back_target, class: 'has-text-danger' do
%span.icon
%i.fa.fa-arrow-left
= t('actions.Back')

0 comments on commit d3eb274

Please sign in to comment.