diff --git a/Gemfile.lock b/Gemfile.lock index f5581f5be7f..6aedbdfb6ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,40 +10,40 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.3.2) - actionpack (= 6.1.3.2) - activesupport (= 6.1.3.2) + actioncable (6.1.4.1) + actionpack (= 6.1.4.1) + activesupport (= 6.1.4.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.3.2) - actionpack (= 6.1.3.2) - activejob (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) + actionmailbox (6.1.4.1) + actionpack (= 6.1.4.1) + activejob (= 6.1.4.1) + activerecord (= 6.1.4.1) + activestorage (= 6.1.4.1) + activesupport (= 6.1.4.1) mail (>= 2.7.1) - actionmailer (6.1.3.2) - actionpack (= 6.1.3.2) - actionview (= 6.1.3.2) - activejob (= 6.1.3.2) - activesupport (= 6.1.3.2) + actionmailer (6.1.4.1) + actionpack (= 6.1.4.1) + actionview (= 6.1.4.1) + activejob (= 6.1.4.1) + activesupport (= 6.1.4.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.3.2) - actionview (= 6.1.3.2) - activesupport (= 6.1.3.2) + actionpack (6.1.4.1) + actionview (= 6.1.4.1) + activesupport (= 6.1.4.1) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.3.2) - actionpack (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) + actiontext (6.1.4.1) + actionpack (= 6.1.4.1) + activerecord (= 6.1.4.1) + activestorage (= 6.1.4.1) + activesupport (= 6.1.4.1) nokogiri (>= 1.8.5) - actionview (6.1.3.2) - activesupport (= 6.1.3.2) + actionview (6.1.4.1) + activesupport (= 6.1.4.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -54,22 +54,22 @@ GEM activerecord (>= 5) active_storage_validations (0.9.2) rails (>= 5.2.0) - activejob (6.1.3.2) - activesupport (= 6.1.3.2) + activejob (6.1.4.1) + activesupport (= 6.1.4.1) globalid (>= 0.3.6) - activemodel (6.1.3.2) - activesupport (= 6.1.3.2) - activerecord (6.1.3.2) - activemodel (= 6.1.3.2) - activesupport (= 6.1.3.2) - activestorage (6.1.3.2) - actionpack (= 6.1.3.2) - activejob (= 6.1.3.2) - activerecord (= 6.1.3.2) - activesupport (= 6.1.3.2) + activemodel (6.1.4.1) + activesupport (= 6.1.4.1) + activerecord (6.1.4.1) + activemodel (= 6.1.4.1) + activesupport (= 6.1.4.1) + activestorage (6.1.4.1) + actionpack (= 6.1.4.1) + activejob (= 6.1.4.1) + activerecord (= 6.1.4.1) + activesupport (= 6.1.4.1) marcel (~> 1.0.0) - mini_mime (~> 1.0.2) - activesupport (6.1.3.2) + mini_mime (>= 1.1.0) + activesupport (6.1.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -119,7 +119,7 @@ GEM coffee-script-source (1.12.2) commonmarker (0.21.1) ruby-enum (~> 0.5) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) connection_pool (2.2.3) crack (0.4.5) rexml @@ -136,9 +136,9 @@ GEM execjs (2.7.0) faraday (0.17.4) multipart-post (>= 1.2, < 3) - ffi (1.14.2) - globalid (0.4.2) - activesupport (>= 4.2.0) + ffi (1.15.3) + globalid (0.5.2) + activesupport (>= 5.0) google-apis-core (0.2.1) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.14) @@ -215,7 +215,7 @@ GEM listen (3.4.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.1) + loofah (2.12.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -229,8 +229,8 @@ GEM actionpack (>= 3.2.0, < 6.2) method_source (1.0.0) mini_magick (4.11.0) - mini_mime (1.0.3) - mini_portile2 (2.5.1) + mini_mime (1.1.1) + mini_portile2 (2.6.1) minitest (5.14.4) minitest-retry (0.2.2) minitest (>= 5.0) @@ -240,11 +240,11 @@ GEM multipart-post (2.1.1) net-http-persistent (3.1.0) connection_pool (~> 2.2) - nio4r (2.5.7) - nokogiri (1.11.4) - mini_portile2 (~> 2.5.0) + nio4r (2.5.8) + nokogiri (1.12.3) + mini_portile2 (~> 2.6.1) racc (~> 1.4) - nokogiri (1.11.4-x86_64-darwin) + nokogiri (1.12.3-x86_64-darwin) racc (~> 1.4) oauth (0.5.5) oauth2 (1.4.4) @@ -297,39 +297,39 @@ GEM rack-user_agent (0.5.2) rack (>= 1.5) woothee (>= 1.0.0) - rails (6.1.3.2) - actioncable (= 6.1.3.2) - actionmailbox (= 6.1.3.2) - actionmailer (= 6.1.3.2) - actionpack (= 6.1.3.2) - actiontext (= 6.1.3.2) - actionview (= 6.1.3.2) - activejob (= 6.1.3.2) - activemodel (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) + rails (6.1.4.1) + actioncable (= 6.1.4.1) + actionmailbox (= 6.1.4.1) + actionmailer (= 6.1.4.1) + actionpack (= 6.1.4.1) + actiontext (= 6.1.4.1) + actionview (= 6.1.4.1) + activejob (= 6.1.4.1) + activemodel (= 6.1.4.1) + activerecord (= 6.1.4.1) + activestorage (= 6.1.4.1) + activesupport (= 6.1.4.1) bundler (>= 1.15.0) - railties (= 6.1.3.2) + railties (= 6.1.4.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) rails_autolink (1.1.6) rails (> 3.1) - railties (6.1.3.2) - actionpack (= 6.1.3.2) - activesupport (= 6.1.3.2) + railties (6.1.4.1) + actionpack (= 6.1.4.1) + activesupport (= 6.1.4.1) method_source - rake (>= 0.8.7) + rake (>= 0.13) thor (~> 1.0) rainbow (3.0.0) - rake (13.0.3) + rake (13.0.6) ransack (2.4.2) activerecord (>= 5.2.4) activesupport (>= 5.2.4) @@ -474,7 +474,7 @@ GEM railties (>= 5.2) semantic_range (>= 2.3.0) webrick (1.7.0) - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) woothee (1.11.1) diff --git a/app/assets/stylesheets/atoms/_a-button.sass b/app/assets/stylesheets/atoms/_a-button.sass index 79b4a38c812..e1076f59dfc 100644 --- a/app/assets/stylesheets/atoms/_a-button.sass +++ b/app/assets/stylesheets/atoms/_a-button.sass @@ -99,6 +99,14 @@ input[type="button"] .a-button border-radius: 0 +.is-inline-buttons + display: flex + +margin(horizontal, -.25rem) + .is-text-align-center & + justify-content: center + >li + +padding(horizontal, .25rem) + .a-welcome-button +size(auto 4rem) +text-block(1.125rem 1, flex 700 $welcome-default-text) diff --git a/app/assets/stylesheets/blocks/admin/_admin-table.sass b/app/assets/stylesheets/blocks/admin/_admin-table.sass index ee6b9b242ba..2dc4f6b3581 100644 --- a/app/assets/stylesheets/blocks/admin/_admin-table.sass +++ b/app/assets/stylesheets/blocks/admin/_admin-table.sass @@ -14,8 +14,8 @@ width: 100% .admin-table__header - background-color: $background - border: solid 1px #aaaaaa + background-color: $background-shade + border: solid 1px #bbbbbb +border-radius(top, .25rem) .admin-table__items @@ -26,7 +26,7 @@ .admin-table__label +text-block(.75rem 1.4, $main center 600) - border: solid 1px #aaaaaa + border: solid 1px #bbbbbb white-space: nowrap height: 2rem +padding(horizontal, .5rem) @@ -36,7 +36,8 @@ font-size: .75rem margin-left: .5rem +padding(horizontal, .375rem) - background-color: #dedede + background-color: $base + border-color: #bbbbbb color: $default-text .admin-table__item @@ -48,6 +49,7 @@ +border-radius(bottom, .25rem) &.sortable-chosen background-color: tint($warning, 80%) + &:hover, .admin-table.is-grab &:hover background-color: tint($warning, 90%) &[draggable="false"] @@ -70,7 +72,7 @@ .admin-table__item-logo-image border: solid 1px $border - width: 5rem + width: 2.5rem border-radius: .25rem .admin-table-item__body diff --git a/app/controllers/admin/courses_controller.rb b/app/controllers/admin/courses_controller.rb new file mode 100644 index 00000000000..b1d86e2217e --- /dev/null +++ b/app/controllers/admin/courses_controller.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class Admin::CoursesController < AdminController + def index + @courses = Course.order(created_at: :desc) + end +end diff --git a/app/javascript/categories.vue b/app/javascript/categories.vue index 9c17c5298e3..f27590d7289 100644 --- a/app/javascript/categories.vue +++ b/app/javascript/categories.vue @@ -20,7 +20,7 @@ td.admin-table__item-value | {{ category.slug }} td.admin-table__item-value.is-text-align-center - ul.is-button-group + ul.is-inline-buttons li a.a-button.is-sm.is-secondary.is-icon.spec-edit( :href='`/admin/categories/${category.id}/edit`' diff --git a/app/views/admin/_admin_page_tabs.html.slim b/app/views/admin/_admin_page_tabs.html.slim index 83dcf7c43f4..1a9f004c7af 100644 --- a/app/views/admin/_admin_page_tabs.html.slim +++ b/app/views/admin/_admin_page_tabs.html.slim @@ -13,6 +13,10 @@ = link_to 'カテゴリー', admin_categories_path, class: "page-tabs__item-link #{current_link(/^admin-categories/)}" + li.page-tabs__item + = link_to 'コース', + admin_courses_path, + class: "page-tabs__item-link #{current_link(/^admin-courses/)}" li.page-tabs__item = link_to '企業', admin_companies_path, diff --git a/app/views/admin/books/_table.html.slim b/app/views/admin/books/_table.html.slim index e5d2339d533..df0f6519422 100644 --- a/app/views/admin/books/_table.html.slim +++ b/app/views/admin/books/_table.html.slim @@ -31,7 +31,7 @@ = link_to admin_books_qrcode_path(book), class: 'a-button is-sm is-secondary is-icon', target: '_blank', rel: 'noopener' do i.fas.fa-print td.admin-table__item-value.is-text-align-center - ul.is-button-group + ul.is-inline-buttons li = link_to edit_admin_book_path(book), class: 'a-button is-sm is-secondary is-icon' do i.fas.fa-pen diff --git a/app/views/admin/companies/index.html.slim b/app/views/admin/companies/index.html.slim index 350480cf13e..104fc420d4d 100644 --- a/app/views/admin/companies/index.html.slim +++ b/app/views/admin/companies/index.html.slim @@ -33,7 +33,7 @@ header.page-header td.admin-table__item-value - if company.present? = company.name - td.admin-table__item-value + td.admin-table__item-value.is-text-align-center - if company.logo.attached? = image_tag company.logo_url, class: 'admin-table__item-logo-image' td.admin-table__item-value @@ -46,7 +46,7 @@ header.page-header class: 'a-button is-sm is-secondary is-icon' do i.fas.fa-user-plus td.admin-table__item-value.is-text-align-center - ul.is-button-group + ul.is-inline-buttons li = link_to edit_admin_company_path(company), class: 'a-button is-sm is-secondary is-icon' do i.fas.fa-pen diff --git a/app/views/admin/courses/_course.html.slim b/app/views/admin/courses/_course.html.slim new file mode 100644 index 00000000000..04898126dda --- /dev/null +++ b/app/views/admin/courses/_course.html.slim @@ -0,0 +1,16 @@ +tr.admin-table__item(id="course_#{course.id}") + td.admin-table__item-value + = link_to course.title, [course, :practices], class: 'courses-item__title-link' + td.admin-table__item-value + = course.description.truncate(100) + td.admin-table__item-value.admin-table__item-value.is-text-align-center + ul.is-inline-buttons + li + = link_to edit_course_path(course), class: 'a-button is-sm is-secondary is-icon is-block' do + i.fas.fa-pen + li + = link_to course_categories_path(course), class: 'a-button is-sm is-secondary is-icon is-block' do + i.fas.fa-align-justify + li + = link_to course, method: :delete, class: 'a-button is-sm is-danger is-icon is-block js-delete', data: { confirm: '本当によろしいですか?' } do + i.far.fa-trash-alt diff --git a/app/views/admin/courses/index.html.slim b/app/views/admin/courses/index.html.slim new file mode 100644 index 00000000000..15ab7498f90 --- /dev/null +++ b/app/views/admin/courses/index.html.slim @@ -0,0 +1,29 @@ +- title 'コース一覧' +header.page-header + .container + .page-header__inner + h2.page-header__title = title + .page-header-actions + ul.page-header-actions__items + li.page-header-actions__item + = link_to new_course_path, class: 'a-button is-md is-secondary is-block' do + i.fas.fa-plus + | コース作成 + +.page-tools + = render 'admin/admin_page_tabs' + +.page-body + .container.is-padding-horizontal-0-sm-down + .admin-table + table.admin-table__table + thead.admin-table__header + tr.admin-table__labels + th.admin-table__label + | コース名 + th.admin-table__label + | 説明文 + th.admin-table__label + | 操作 + tbody.admin-table__items + = render @courses.order(:created_at) diff --git a/app/views/admin/seats/_table.html.slim b/app/views/admin/seats/_table.html.slim index f1bcaf478a7..64a90f5d3bc 100644 --- a/app/views/admin/seats/_table.html.slim +++ b/app/views/admin/seats/_table.html.slim @@ -10,7 +10,7 @@ td.admin-table__item-value = seat.name td.admin-table__item-value.is-text-align-center - ul.is-button-group + ul.is-inline-buttons li = link_to edit_admin_seat_path(seat), class: 'a-button is-sm is-secondary is-icon' do i.fas.fa-pen diff --git a/app/views/courses/edit.html.slim b/app/views/courses/edit.html.slim index f9e98146fc0..1e0b02412a2 100644 --- a/app/views/courses/edit.html.slim +++ b/app/views/courses/edit.html.slim @@ -12,5 +12,5 @@ = link_to courses_path, class: 'a-button is-md is-secondary is-block' do | コース一覧 .page-body - .container + .container.is-xxl = render 'form', course: @course diff --git a/config/routes.rb b/config/routes.rb index 865745b9bd4..17e6a899a69 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,7 +88,7 @@ resource :password, only: %i(edit update), controller: "users/password" end resources :categories, except: %i(show) - + resources :courses, only: %i(index) namespace :books do resources :qrcodes, only: %i(index show) end diff --git a/test/system/admin/courses_test.rb b/test/system/admin/courses_test.rb new file mode 100644 index 00000000000..65772dcb80d --- /dev/null +++ b/test/system/admin/courses_test.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +require 'application_system_test_case' + +class Admin::CoursesTest < ApplicationSystemTestCase + test 'show listing courses' do + visit_with_auth 'admin/courses', 'komagata' + assert_equal 'コース一覧 | FJORD BOOT CAMP(フィヨルドブートキャンプ)', title + end +end