diff --git a/app/controllers/mentor/courses_controller.rb b/app/controllers/mentor/courses_controller.rb index 1695bc85d08..11ac2af7ffd 100644 --- a/app/controllers/mentor/courses_controller.rb +++ b/app/controllers/mentor/courses_controller.rb @@ -8,7 +8,12 @@ def index end def new - @course = Course.new + if params[:course_id].present? + original_course = Course.find(params[:course_id]) + @course = Course.new(category_ids: original_course.category_ids) + else + @course = Course.new + end end def edit; end diff --git a/app/javascript/stylesheets/shared/blocks/card/_card-footer.sass b/app/javascript/stylesheets/shared/blocks/card/_card-footer.sass index 17fe24beac9..ddf6527adf9 100644 --- a/app/javascript/stylesheets/shared/blocks/card/_card-footer.sass +++ b/app/javascript/stylesheets/shared/blocks/card/_card-footer.sass @@ -1,6 +1,7 @@ .card-footer + container: card-footer / inline-size +media-breakpoint-up(md) - padding: .5rem 1.25rem + padding: .5rem 1rem min-height: 3rem +media-breakpoint-down(sm) padding: .5rem .75rem diff --git a/app/javascript/stylesheets/shared/blocks/card/_card-main-actions.sass b/app/javascript/stylesheets/shared/blocks/card/_card-main-actions.sass index 1f87c7b7c4b..af6576a3376 100644 --- a/app/javascript/stylesheets/shared/blocks/card/_card-main-actions.sass +++ b/app/javascript/stylesheets/shared/blocks/card/_card-main-actions.sass @@ -5,29 +5,29 @@ .card-main-actions__items display: flex gap: .75rem - +media-breakpoint-up(md) + @container card-footer (min-width: 20em) +position(relative) justify-content: center flex-wrap: wrap align-items: flex-end min-height: 1.875rem - +media-breakpoint-down(sm) + @container card-footer (max-width: 19.9375em) flex-direction: column &.is-sub-actions justify-content: flex-end - +media-breakpoint-down(sm) + @container card-footer (max-width: 19.9375em) flex-direction: row .card-main-actions__item.is-sub position: static flex: 0 0 auto .card-main-actions__item - +media-breakpoint-up(md) - flex: 0 0 12rem - max-width: calc(50% - .375rem) + @container card-footer (min-width: 20em) + flex: 1 + max-width: 15rem &.is-sub +position(absolute, right 0, bottom 0) - +media-breakpoint-down(sm) + @container card-footer (max-width: 19.9375em) flex-basis: 100% max-width: 100% &.is-sub @@ -37,6 +37,10 @@ &.is-end margin-left: auto flex-basis: 2.5rem + .card-main-actions.is-3-items & + @container card-footer (min-width: 20em) + flex: 1 0 0 + .card-main-actions__muted-action +hover-link-reversal diff --git a/app/views/courses/_course.html.slim b/app/views/courses/_course.html.slim index 4770b7caf46..59a7e18789f 100644 --- a/app/views/courses/_course.html.slim +++ b/app/views/courses/_course.html.slim @@ -14,7 +14,7 @@ - if mentor_login? hr.a-border-tint footer.card-footer - .card-main-actions + .card-main-actions.is-3-items ul.card-main-actions__items li.card-main-actions__item = link_to edit_mentor_course_path(course), class: 'a-button is-sm is-secondary is-block' do @@ -24,3 +24,7 @@ = link_to mentor_course_categories_path(course), class: 'a-button is-sm is-secondary is-block' do i.fa-solid.fa-align-justify | 並び替え + li.card-main-actions__item + = link_to new_mentor_course_path(course_id: course.id), class: 'a-button is-sm is-secondary is-block' do + i.fa-solid.fa-copy + | コピー diff --git a/app/views/mentor/courses/categories/index.html.slim b/app/views/mentor/courses/categories/index.html.slim index 4aafd8678d8..4318313b538 100644 --- a/app/views/mentor/courses/categories/index.html.slim +++ b/app/views/mentor/courses/categories/index.html.slim @@ -23,7 +23,7 @@ header.page-header | コース一覧 hr.a-border .page-body - .container.is-lg + .container.is-md .admin-table.is-grab table.admin-table__table thead.admin-table__header