Skip to content

Commit

Permalink
情報入力欄を切り出し
Browse files Browse the repository at this point in the history
  • Loading branch information
a-terumoto-gs committed Apr 9, 2024
1 parent de92c74 commit df10637
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
40 changes: 40 additions & 0 deletions app/views/movies/_form.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
= form_with model: movie, local: true, class: 'form', html: { name: 'movie' } do |f|
.form__items
.form-item
.row
.col-lg-6.col-xs-12
.form-item
= f.label :practice, class: 'a-form-label'
.select-practices
= f.select(:practice_id, practice_options(@categories), { include_blank: '関連プラクティスを指定しない' }, { id: 'js-choices-single-select' })
.form-item
.row
.col-md-6.col-xs-12
= f.label :title, class: 'a-form-label'
= f.text_field :title, class: 'a-text-input js-warning-form'
.form-item
.row.js-markdown-parent
.col-md-6.col-xs-12
= f.label :description, class: 'a-form-label'
.form-textarea
.form-textarea__body
= f.text_area :description, class: 'a-text-input js-warning-form markdown-form__text-area js-markdown',
data: { 'preview': '.js-preview', 'input': '.file-input' }
.col-md-6.col-xs-12
.a-form-label
| プレビュー
.js-preview.a-long-text.markdown-form__preview
.form-item
.row
.col-md-6.col-xs-12
= f.label :movie_data, class: 'a-form-label'
= f.file_field :movie_data, class: 'a-text-input', accept: 'video/mp4, video/quicktime', direct_upload: true
.form-item
.row
.col-md-6.col-xs-12
= f.label :tag_list, 'タグを入力してください', class: 'a-form-label'
= render partial: 'tags_input', locals: { taggable: movie }
.form-actions
ul.form-actions__items
li.form-actions__item.is-main
= f.submit '動画を追加する', class: 'a-button is-lg is-primary is-block', id: 'js-shortcut-submit'
44 changes: 3 additions & 41 deletions app/views/movies/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,7 @@ header.page-header
h1.page-header__title
= title
hr.a-border
.page-body
.container.is-xxl
= render 'form', movie: @movie, categories: @categories

= form_with model: @movie, url: movies_path, local: true, class: 'form', html: { multipart: true } do |f|
= render 'errors', object: @movie
.form__items
.form-item
.row
.col-lg-6.col-xs-12
.form-item
= f.label :practice, class: 'a-form-label'
.select-practices
= f.select(:practice_id, practice_options(@categories), { include_blank: '関連プラクティスを指定しない' }, { id: 'js-choices-single-select' })
.form-item
.row
.col-md-6.col-xs-12
= f.label :title, class: 'a-form-label'
= f.text_field :title, class: 'a-text-input js-warning-form'
.form-item
.row.js-markdown-parent
.col-md-6.col-xs-12
= f.label :description, class: 'a-form-label'
.form-textarea
.form-textarea__body
= f.text_area :description, class: 'a-text-input js-warning-form markdown-form__text-area js-markdown',
data: { 'preview': '.js-preview', 'input': '.file-input' }
.col-md-6.col-xs-12
.a-form-label
| プレビュー
.js-preview.a-long-text.markdown-form__preview
.form-item
.row
.col-md-6.col-xs-12
= f.label :movie_data, class: 'a-form-label'
= f.file_field :movie_data, class: 'a-text-input', accept: 'video/mp4, video/quicktime', direct_upload: true
.form-item
.row
.col-md-6.col-xs-12
= f.label :tag_list, 'タグを入力してください', class: 'a-form-label'
= render partial: 'tags_input', locals: { taggable: @movie }
.form-actions
ul.form-actions__items
li.form-actions__item.is-main
= f.submit '動画を追加する', class: 'a-button is-lg is-primary is-block', id: 'js-shortcut-submit'

0 comments on commit df10637

Please sign in to comment.