Skip to content

Commit

Permalink
Merge pull request #7354 from fjordllc/feature/course-list-copy
Browse files Browse the repository at this point in the history
コース一覧に「コースのコピー」が欲しい
  • Loading branch information
komagata authored Feb 19, 2024
2 parents 25695bc + 40eb0c4 commit 1f8ef98
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
7 changes: 6 additions & 1 deletion app/controllers/mentor/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion app/views/courses/_course.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
| コピー
2 changes: 1 addition & 1 deletion app/views/mentor/courses/categories/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f8ef98

Please sign in to comment.