diff --git a/app/views/movies/_form.html.slim b/app/views/movies/_form.html.slim new file mode 100644 index 00000000000..ad9f9d13ae6 --- /dev/null +++ b/app/views/movies/_form.html.slim @@ -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' diff --git a/app/views/movies/new.html.slim b/app/views/movies/new.html.slim index ffe76fe934e..2349e49603d 100644 --- a/app/views/movies/new.html.slim +++ b/app/views/movies/new.html.slim @@ -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'