diff --git a/.traceroute.yml b/.traceroute.yml index c42e9f7626b..cf45b1e703c 100644 --- a/.traceroute.yml +++ b/.traceroute.yml @@ -16,6 +16,7 @@ ignore_unreachable_actions: - .*#require_staff_login - .*#require_admin_login - .*#require_mentor_login + - .*#require_admin_or_mentor_login - mails#welcome - reports#convert_to_hour_minute - reports#convert_to_ceiled_hour diff --git a/Gemfile b/Gemfile index 609895f6fc9..acb77ce2b94 100644 --- a/Gemfile +++ b/Gemfile @@ -44,7 +44,6 @@ gem 'rails_autolink' gem 'rails-i18n' gem 'ransack' gem 'rollbar' -gem 'rqrcode' gem 'slim-rails' gem 'sorcery' gem 'sorcery-jwt' diff --git a/Gemfile.lock b/Gemfile.lock index 6aedbdfb6ba..ccc68c456e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,6 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) childprocess (3.0.0) - chunky_png (1.4.0) cocoon (1.2.15) coderay (1.1.3) coffee-rails (5.0.0) @@ -345,10 +344,6 @@ GEM retriable (3.1.2) rexml (3.2.5) rollbar (3.1.1) - rqrcode (1.2.0) - chunky_png (~> 1.0) - rqrcode_core (~> 0.2) - rqrcode_core (0.2.0) rubocop (1.18.3) parallel (~> 1.10) parser (>= 3.0.0.0) @@ -531,7 +526,6 @@ DEPENDENCIES rails_autolink ransack rollbar - rqrcode rubocop rubocop-fjord rubocop-minitest diff --git a/app/assets/images/pijord-book-logo.svg b/app/assets/images/pijord-book-logo.svg deleted file mode 100644 index 4ecf5b9a6b3..00000000000 --- a/app/assets/images/pijord-book-logo.svg +++ /dev/null @@ -1 +0,0 @@ -アートボード 1 \ No newline at end of file diff --git a/app/assets/stylesheets/atoms/_a-meta.sass b/app/assets/stylesheets/atoms/_a-meta.sass index 1bb7e79d5c5..e2f26099a42 100644 --- a/app/assets/stylesheets/atoms/_a-meta.sass +++ b/app/assets/stylesheets/atoms/_a-meta.sass @@ -30,7 +30,7 @@ a.a-meta color: $muted-text transition: all .2s ease-out &:hover - color: $main + color: $main-text &.is-disabled pointer-events: none diff --git a/app/assets/stylesheets/atoms/_a-user-name.sass b/app/assets/stylesheets/atoms/_a-user-name.sass index dbcdb8a8316..2e9fc209110 100644 --- a/app/assets/stylesheets/atoms/_a-user-name.sass +++ b/app/assets/stylesheets/atoms/_a-user-name.sass @@ -2,6 +2,7 @@ color: $muted-text font-size: .8125rem line-height: 1.4 + white-space: nowrap a.a-user-name +hover-link diff --git a/app/assets/stylesheets/blocks/admin/_admin-table.sass b/app/assets/stylesheets/blocks/admin/_admin-table.sass index 2dc4f6b3581..06e04393374 100644 --- a/app/assets/stylesheets/blocks/admin/_admin-table.sass +++ b/app/assets/stylesheets/blocks/admin/_admin-table.sass @@ -93,7 +93,7 @@ text-decoration: underline .admin-table__user-login-name - color: $main + color: $main-text .is-user-icon-xl +size(100% auto) diff --git a/app/assets/stylesheets/blocks/calender/_calender-header.sass b/app/assets/stylesheets/blocks/calender/_calender-header.sass deleted file mode 100644 index 95d5c812864..00000000000 --- a/app/assets/stylesheets/blocks/calender/_calender-header.sass +++ /dev/null @@ -1,11 +0,0 @@ -.calender-header - margin-bottom: 1rem - -.calender-header__inner - display: flex - justify-content: center - align-items: center - -.calender-header__title - font-size: 1.25rem - +margin(horizontal, 1rem) diff --git a/app/assets/stylesheets/blocks/card/_card-books.sass b/app/assets/stylesheets/blocks/card/_card-books.sass index b0b5f21c5a1..7b3a5b38bd4 100644 --- a/app/assets/stylesheets/blocks/card/_card-books.sass +++ b/app/assets/stylesheets/blocks/card/_card-books.sass @@ -1,5 +1,13 @@ +.card-books__items + +media-breakpoint-up(md) + display: flex + flex-wrap: wrap .card-books-item + +media-breakpoint-up(md) + flex: 0 0 50% + &:nth-child(odd) + border-right: solid 1px $border &:not(:first-child) border-top: solid 1px $border @@ -39,7 +47,7 @@ .card-books-item__inner:hover .card-books-item__title-label text-decoration: underline - color: $main + color: $main-text .card-books-item__price +text-block(.875rem 1.4 .5em, $default-text) diff --git a/app/assets/stylesheets/blocks/course/_courses.sass b/app/assets/stylesheets/blocks/course/_courses.sass index 3e532e4a893..f82a26b7964 100644 --- a/app/assets/stylesheets/blocks/course/_courses.sass +++ b/app/assets/stylesheets/blocks/course/_courses.sass @@ -13,7 +13,7 @@ .courses-item__title-link display: block - color: $main + color: $main-text +hover-link .courses-item__description diff --git a/app/assets/stylesheets/blocks/form/_form-actions.sass b/app/assets/stylesheets/blocks/form/_form-actions.sass index afac5a11898..7a4e82541d4 100644 --- a/app/assets/stylesheets/blocks/form/_form-actions.sass +++ b/app/assets/stylesheets/blocks/form/_form-actions.sass @@ -34,7 +34,7 @@ margin-bottom: 1rem &.is-main +media-breakpoint-up(md) - min-width: 16rem + min-width: 20rem +media-breakpoint-down(sm) width: 100% &.has-help diff --git a/app/assets/stylesheets/blocks/form/_many-check-boxes.sass b/app/assets/stylesheets/blocks/form/_many-check-boxes.sass index b16c638c414..8f2f89a8afd 100644 --- a/app/assets/stylesheets/blocks/form/_many-check-boxes.sass +++ b/app/assets/stylesheets/blocks/form/_many-check-boxes.sass @@ -12,7 +12,7 @@ cursor: pointer &.is-checked background-color: $accent - color: $main + color: $main-text .many-check-boxes__item:last-child & border-bottom: none input diff --git a/app/assets/stylesheets/blocks/form/_reservations.sass b/app/assets/stylesheets/blocks/form/_reservations.sass deleted file mode 100644 index 775e3c09b8e..00000000000 --- a/app/assets/stylesheets/blocks/form/_reservations.sass +++ /dev/null @@ -1,86 +0,0 @@ -=calender-size - &.is-day - flex-basis: 4.5rem - width: 4.5rem - min-width: 4.5rem - max-width: 4.5rem - &.is-seat - flex-basis: 5rem - width: 5rem - min-width: 5rem - max-width: 5rem - &.is-memo - flex: 100 - +media-breakpoint-down(sm) - min-width: 15rem - -.reservations__outer - overflow-x: auto - background-color: $base - -.reservations__calender - min-width: 100% - table-layout: fixed - background-color: $base - -.reservations__calender-header - background-color: #eceeef - display: flex - -.reservations__calender-header-label - padding: .25rem - background-color: #eceeef - border: solid 1px $border-shade - +text-block(.75rem, nowrap flex) - align-items: center - justify-content: center - +calender-size - &:not(:last-child) - border-right: none - -.reservations__day-item - display: flex - &.is-holiday - background-color: tint($danger, 98%) - .reservations__day-item-value - border: solid 1px $border-shade - +calender-size - border-top: none - display: flex - align-items: center - justify-content: center - &:not(:last-child) - border-right: none - &.is-memo - justify-content: flex-start - padding: .375rem - +text-block(.75rem 1.2) - +position(relative) - &:hover - background-color: tint($warning, 94%) - -.reservation - +size(100%) - -.reservations__seat-action - +size(100%) - min-height: 2rem - +padding(horizontal, .375rem) - cursor: pointer - +text-block(.75rem 1.1, flex) - align-items: center - justify-content: center - word-break: break-all - &:hover - box-shadow: inset rgba($primary, .5) 0 0 0 1px - &.is-reserved.is-not-me - background-color: rgba(black, .05) - &.is-reserved.is-me - background-color: $danger - color: $reversal-text - -.reservations__day - +text-block(.75rem, right nowrap) - +padding(horizontal, .5rem) - .reservations__day-item.is-holiday & - color: $danger diff --git a/app/assets/stylesheets/blocks/header/_header-dropdown.sass b/app/assets/stylesheets/blocks/header/_header-dropdown.sass index 18024ea74fa..9fed3dc5956 100644 --- a/app/assets/stylesheets/blocks/header/_header-dropdown.sass +++ b/app/assets/stylesheets/blocks/header/_header-dropdown.sass @@ -87,7 +87,7 @@ +size(100% 2.75rem) transition: all .2s ease-out +media-breakpoint-up(md) - color: $main + color: $main-text +media-breakpoint-down(sm) color: $reversal-text &:hover diff --git a/app/assets/stylesheets/blocks/header/_header-links.sass b/app/assets/stylesheets/blocks/header/_header-links.sass index ca4fe287b0a..8f11801e2af 100644 --- a/app/assets/stylesheets/blocks/header/_header-links.sass +++ b/app/assets/stylesheets/blocks/header/_header-links.sass @@ -34,7 +34,7 @@ background-color: #f8f8f8 &.is-active background-color: $warning - color: $main + color: $main-text .header-links__link-label margin-top: .375em diff --git a/app/assets/stylesheets/blocks/page/_page-tabs.sass b/app/assets/stylesheets/blocks/page/_page-tabs.sass index 66b9e4cbe66..974811ea124 100644 --- a/app/assets/stylesheets/blocks/page/_page-tabs.sass +++ b/app/assets/stylesheets/blocks/page/_page-tabs.sass @@ -2,7 +2,7 @@ background-color: $background-shade padding-top: .5rem border-top: solid 1px $border-shade - border-bottom: solid 1px $border-more-shade + border-bottom: solid 1px $border-more-more-shade .sort-nav + & border-top: solid 1px $border-more-more-shade +media-breakpoint-down(sm) @@ -31,24 +31,28 @@ .page-tabs__item-link +flex-link - +text-block(.825rem 1, #7d8486 600) + +text-block(.825rem 1, $default-text 600) align-items: center justify-content: center height: 2.75rem background-color: #dedede +padding(horizontal, 1em) +border-radius(top, .25rem) - border: solid 1px $border-more-shade + border: solid 1px $border-more-more-shade +position(relative) + transition: all .2s ease-out +media-breakpoint-down(sm) font-size: .75rem &:hover - color: $default-text + background-color: $background &.is-active background-color: $background - border-color: $border-more-shade + border-color: $border-more-more-shade border-bottom-color: $background - color: $default-text + color: $main-text + &.is-inactive + pointer-events: none + color: $muted-text .page-tabs__item-count +position(right .125rem, top .125rem) diff --git a/app/assets/stylesheets/blocks/page/_switch.sass b/app/assets/stylesheets/blocks/page/_switch.sass index 87366fc6b9c..888abf1c1a8 100644 --- a/app/assets/stylesheets/blocks/page/_switch.sass +++ b/app/assets/stylesheets/blocks/page/_switch.sass @@ -15,7 +15,7 @@ +position(relative, top -1px) &:hover .switch__label-text - color: $main + color: $main-text text-decoration: underline .a-help background-color: $main diff --git a/app/assets/stylesheets/blocks/practice/_categories.sass b/app/assets/stylesheets/blocks/practice/_categories.sass index 9e02752c990..36daa26a374 100644 --- a/app/assets/stylesheets/blocks/practice/_categories.sass +++ b/app/assets/stylesheets/blocks/practice/_categories.sass @@ -49,7 +49,7 @@ +text-block(1rem 1, $muted-text) transition: all .2s ease-out &:hover - color: $main + color: $main-text .categories__label +text-block(.75rem 2rem, $main center 600) @@ -94,4 +94,4 @@ +text-block(1rem 1, $muted-text) transition: all .2s ease-out &:hover - color: $main + color: $main-text diff --git a/app/assets/stylesheets/blocks/practice/_practice-contents.sass b/app/assets/stylesheets/blocks/practice/_practice-contents.sass index 9006dd8e0b0..2dbf082c2c3 100644 --- a/app/assets/stylesheets/blocks/practice/_practice-contents.sass +++ b/app/assets/stylesheets/blocks/practice/_practice-contents.sass @@ -39,6 +39,6 @@ transition: all .2s ease-out &:hover .a-meta - color: $main + color: $main-text .a-help background-color: $main diff --git a/app/assets/stylesheets/blocks/shared/_page-nav.sass b/app/assets/stylesheets/blocks/shared/_page-nav.sass index 8c4dd689440..f86df964806 100644 --- a/app/assets/stylesheets/blocks/shared/_page-nav.sass +++ b/app/assets/stylesheets/blocks/shared/_page-nav.sass @@ -1,7 +1,7 @@ .page-nav +position(right 0, top 3.5rem) flex: 1 - min-width: 14rem + min-width: 20rem position: sticky background-color: $base border: solid 1px #dadada @@ -36,15 +36,15 @@ border-bottom: none .page-nav__item-link - padding: .375rem .75rem - +text-block(.75rem 1.4, block $muted-text) + padding: .5rem .75rem + +text-block(.8125rem 1.4, block $muted-text) +block-link transition: all .1s ease-in background-color: transparent .page-nav__item:last-child & +border-radius(bottom, .25rem) &:hover - color: $main + color: $main-text text-decoration: underline &.is-current pointer-events: none diff --git a/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass b/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass index c19f23fc4cb..6bd6516e5ef 100644 --- a/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass +++ b/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass @@ -5,7 +5,7 @@ +media-breakpoint-up(md) +position(sticky, right 0, top 3.5rem) flex: 1 - min-width: 16rem + min-width: 20rem margin-left: 1.5rem +media-breakpoint-down(sm) margin-top: 1rem diff --git a/app/assets/stylesheets/blocks/shared/_tab-nav.sass b/app/assets/stylesheets/blocks/shared/_tab-nav.sass index 177af63ef68..77ddfa29a86 100644 --- a/app/assets/stylesheets/blocks/shared/_tab-nav.sass +++ b/app/assets/stylesheets/blocks/shared/_tab-nav.sass @@ -1,5 +1,11 @@ .tab-nav border-bottom: solid 1px $background-shade + &.is-centered + border-bottom: none + .tab-nav__items + justify-content: center + padding-top: 1.5rem + padding-bottom: 0 &:not(:last-child) margin-bottom: 1.5rem @@ -26,7 +32,7 @@ transition: all.2s ease-out &:hover background-color: shade($background-shade, 10%) - color: $main + color: $main-text &.is-active background-color: $accent - color: $main + color: $main-text diff --git a/app/assets/stylesheets/blocks/thread/_thread-comments.sass b/app/assets/stylesheets/blocks/thread/_thread-comments.sass index cd92b353376..87a8a89a5e4 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-comments.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-comments.sass @@ -34,7 +34,7 @@ $thread-header-author: 3.5rem margin-right: 0 .thread-comment__title-link - color: $main + color: $main-text height: 100% display: flex align-items: center diff --git a/app/assets/stylesheets/blocks/thread/_thread-list-item-actions.sass b/app/assets/stylesheets/blocks/thread/_thread-list-item-actions.sass index 7eb9af170f0..886609e4acd 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-list-item-actions.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-list-item-actions.sass @@ -38,4 +38,4 @@ margin-right: .5em &:hover background-color: tint($main, 95%) - color: $main + color: $main-text diff --git a/app/assets/stylesheets/blocks/thread/_thread-list-item-meta.sass b/app/assets/stylesheets/blocks/thread/_thread-list-item-meta.sass index 3b4499dbbee..76a9801e955 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-list-item-meta.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-list-item-meta.sass @@ -22,7 +22,7 @@ +margin(horizontal, .125em) .thread-list-item-meta__item-link +hover-link-reversal - color: $main + color: $main-text .thread-list-item-meta__item-note +text-block(.75rem 1.4, $default-text) diff --git a/app/assets/stylesheets/blocks/thread/_thread-list-item-tags-edit.sass b/app/assets/stylesheets/blocks/thread/_thread-list-item-tags-edit.sass index f2cd059a4bf..71f67c8784d 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-list-item-tags-edit.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-list-item-tags-edit.sass @@ -4,7 +4,7 @@ .thread-list-item-tags__item-edit +hover-link-reversal cursor: pointer - color: $main + color: $main-text .thread-list-item-tags-edit__actions margin-top: .5rem diff --git a/app/assets/stylesheets/blocks/thread/_thread-list-item.sass b/app/assets/stylesheets/blocks/thread/_thread-list-item.sass index fe731624ded..3ea3f3825de 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-list-item.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-list-item.sass @@ -37,19 +37,15 @@ color: $reversal-text border-color: #b50f38 - .thread-list-item__inner +position(relative) padding-left: 3.75rem +media-breakpoint-down(sm) padding-left: 3rem - .thread-list-item.has-assigned & - +media-breakpoint-up(md) - padding-right: 8.75rem .thread-list-item__assignee +media-breakpoint-up(md) - +position(absolute, right 0, top 0) + +position(absolute, right -.5rem, top -.25rem) width: 8rem +media-breakpoint-down(sm) margin-top: .75rem @@ -118,14 +114,19 @@ opacity: .6 .thread-list-item__row-separator - // TODO resetに移す - border: none - margin-bottom: .25rem border-top: dashed 1px $border + height: 1px + +media-breakpoint-up(md) + +margin(vertical, .5rem) + +media-breakpoint-down(sm) + +margin(vertical, .75rem .25rem) .thread-list-item__row &:not(:first-child) margin-top: .25rem + .thread-list-item.has-assigned &:first-child + +media-breakpoint-up(md) + padding-right: 8.5rem .thread-list-item__show-user-detail +position(absolute, top 0) diff --git a/app/assets/stylesheets/blocks/thread/_thread-questions.sass b/app/assets/stylesheets/blocks/thread/_thread-questions.sass index d5f4f0e7269..10b9842785f 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-questions.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-questions.sass @@ -33,7 +33,7 @@ $thread-header-author: 3.5rem font-size: .9375rem .thread-question__title-link - color: $main + color: $main-text height: 100% display: flex align-items: center diff --git a/app/assets/stylesheets/blocks/thread/_thread-watch.sass b/app/assets/stylesheets/blocks/thread/_thread-watch.sass index d729045d6d2..6d74af76903 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-watch.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-watch.sass @@ -3,8 +3,8 @@ height: 1.375rem width: 5.5rem &.is-active - color: $main + color: $main-text border-color: $main &:hover - color: $main + color: $main-text border-color: $main diff --git a/app/assets/stylesheets/blocks/user/_completed-practices-progress.sass b/app/assets/stylesheets/blocks/user/_completed-practices-progress.sass index 8087a39843e..d562f597b71 100644 --- a/app/assets/stylesheets/blocks/user/_completed-practices-progress.sass +++ b/app/assets/stylesheets/blocks/user/_completed-practices-progress.sass @@ -23,6 +23,6 @@ $bar-height: .75rem +position(relative, top $bar-height * -1) box-shadow: rgba(black, .2) 0 .0625rem .0625rem -.completed-practices-progress__percentage-number +.completed-practices-progress__number +text-block(.875rem 1rem, right) +size(2.5rem 1rem) diff --git a/app/assets/stylesheets/blocks/user/_niconico-calendar.sass b/app/assets/stylesheets/blocks/user/_niconico-calendar.sass index 2429167d1ba..40d2650d1c1 100644 --- a/app/assets/stylesheets/blocks/user/_niconico-calendar.sass +++ b/app/assets/stylesheets/blocks/user/_niconico-calendar.sass @@ -14,7 +14,7 @@ +hover-link transition: all .2s ease-out &:hover - color: $main + color: $main-text &.is-blank cursor: default pointer-events: none @@ -40,7 +40,7 @@ &.is-sunday color: $danger &.is-saturday - color: $main + color: $main-text .niconico-calendar__day &.is-blank diff --git a/app/assets/stylesheets/blocks/user/_sns-links.sass b/app/assets/stylesheets/blocks/user/_sns-links.sass index 22f23e5c947..a5456a913ae 100644 --- a/app/assets/stylesheets/blocks/user/_sns-links.sass +++ b/app/assets/stylesheets/blocks/user/_sns-links.sass @@ -4,4 +4,4 @@ .sns-links__item-link font-size: .875rem &:hover - color: $main + color: $main-text diff --git a/app/assets/stylesheets/blocks/user/_user-group.sass b/app/assets/stylesheets/blocks/user/_user-group.sass index e0d11524614..b8d264026a6 100644 --- a/app/assets/stylesheets/blocks/user/_user-group.sass +++ b/app/assets/stylesheets/blocks/user/_user-group.sass @@ -11,7 +11,7 @@ .user-group__title-link text-decoration: none - color: $main + color: $main-text +media-breakpoint-up(md) display: flex align-items: flex-end diff --git a/app/assets/stylesheets/blocks/user/_users-item.sass b/app/assets/stylesheets/blocks/user/_users-item.sass index 590739cb5f2..03b20154999 100644 --- a/app/assets/stylesheets/blocks/user/_users-item.sass +++ b/app/assets/stylesheets/blocks/user/_users-item.sass @@ -36,7 +36,7 @@ font-size: .75em .users-item__name-link - color: $main + color: $main-text display: block +hover-link diff --git a/app/assets/stylesheets/mixins/_long-text-style.sass b/app/assets/stylesheets/mixins/_long-text-style.sass index fbe1ef1141f..8ce0f1f6f8b 100644 --- a/app/assets/stylesheets/mixins/_long-text-style.sass +++ b/app/assets/stylesheets/mixins/_long-text-style.sass @@ -61,6 +61,7 @@ word-break: break-all a +hover-link-reversal + +default-link &:hover img border-color: mix($font, $background, 16%) diff --git a/app/assets/stylesheets/qrcodes.sass b/app/assets/stylesheets/qrcodes.sass deleted file mode 100644 index 8ceda5d9c8f..00000000000 --- a/app/assets/stylesheets/qrcodes.sass +++ /dev/null @@ -1,67 +0,0 @@ -html - font-size: 100% - line-height: 1 - color: black - -body - margin: 0 - padding: 16px - font-family: 'Hiragino Kaku Gothic Pro W3','Hiragino Kaku Gothic ProN',Meiryo,sans-serif - -* - box-sizing: border-box - -.sheet - display: block - break-after: page - -.book-stickers - display: flex - flex-wrap: wrap - align-content: flex-start - -.book-sticker - border: 1px solid #ccc - font-size: 12px - flex-basis: 220px - width: 220px - max-width: 220px - min-width: 220px - padding: 12px 10px - text-align: center - margin-right: -1px - margin-bottom: -1px - -.book-sticker__inner - display: flex - align-items: center - margin: 8px 0 - -.book-sticker__logo - padding: 0 8px - -.book-sticker__logo-image - width: 100% - -.book-sticker__qrcode - flex: 1 - padding: 0 16px 0 0 - -.book-sticker__id - flex: 2 - -.book-sticker__id-label - font-size: 10px - font-weight: bold - margin-bottom: 3px - -.book-sticker__id-body - text-align: center - border: 1px solid black - padding: 3px - border-radius: 2px - -.book-sticker__text - font-size: 10px - line-height: 1.4 - text-align: left diff --git a/app/assets/stylesheets/variables/_colors.sass b/app/assets/stylesheets/variables/_colors.sass index 79d961cbb09..1881f065ec1 100644 --- a/app/assets/stylesheets/variables/_colors.sass +++ b/app/assets/stylesheets/variables/_colors.sass @@ -11,6 +11,7 @@ $reversal-text: white $muted-text: #9da4a7 $semi-muted-text: #898998 $placeholder-text: #bbbbbb +$main-text: #3c3282 $side: $main $side-border: #6b4eca @@ -53,9 +54,9 @@ $input-border: #c1c5b9 =default-link transition: color .2s ease-in - color: #4834ce + color: #4e3fad &:link - color: #4834ce + color: #4e3fad &:visited color: #6f78b7 &:hover diff --git a/app/controllers/admin/books/qrcodes_controller.rb b/app/controllers/admin/books/qrcodes_controller.rb deleted file mode 100644 index 467ca2a9c86..00000000000 --- a/app/controllers/admin/books/qrcodes_controller.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class Admin::Books::QrcodesController < AdminController - layout 'qrcodes' - DESPLAY_NUM = 12 - - def index - @books = Book.all - end - - def show - @book = Book.find(params[:id]) - end -end diff --git a/app/controllers/admin/books_controller.rb b/app/controllers/admin/books_controller.rb deleted file mode 100644 index 279940af58c..00000000000 --- a/app/controllers/admin/books_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class Admin::BooksController < AdminController - before_action :set_book, only: %i[show edit update destroy] - - def index - @books = Book.order(:title).page(params[:page]) - end - - def show; end - - def new - @book = Book.new - end - - def edit; end - - def create - @book = Book.new(book_params) - - if @book.save - redirect_to admin_books_url, notice: '書籍を登録しました。' - else - render action: 'new' - end - end - - def update - if @book.update(book_params) - redirect_to admin_books_url, notice: '書籍を更新しました。' - else - render action: 'edit' - end - end - - def destroy - @book.destroy - redirect_to admin_books_url, notice: '書籍を削除しました。' - end - - private - - def set_book - @book = Book.find(params[:id]) - end - - def book_params - params.require(:book).permit( - :title, - :isbn, - :borrowed - ) - end -end diff --git a/app/controllers/admin/seats_controller.rb b/app/controllers/admin/seats_controller.rb deleted file mode 100644 index 67eb745a913..00000000000 --- a/app/controllers/admin/seats_controller.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -class Admin::SeatsController < AdminController - before_action :set_seat, only: %i[edit update destroy] - - def index - @seats = Seat.all - end - - def new - @seat = Seat.new - end - - def edit; end - - def create - @seat = Seat.new(seat_params) - - if @seat.save - redirect_to admin_seats_path, notice: '席を作成しました。' - else - render :new - end - end - - def update - if @seat.update(seat_params) - redirect_to admin_seats_path, notice: '席を更新しました。' - else - render :edit - end - end - - def destroy - @seat.destroy - redirect_to admin_seats_path, notice: '席を削除しました。' - end - - private - - def set_seat - @seat = Seat.find(params[:id]) - end - - def seat_params - params.require(:seat).permit(:name) - end -end diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb new file mode 100644 index 00000000000..e77809c7c40 --- /dev/null +++ b/app/controllers/api/events_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class API::EventsController < API::BaseController + before_action :require_login + + def index + @events = Event.with_avatar + .includes(:comments, :users) + .order(created_at: :desc) + .page(params[:page]) + end +end diff --git a/app/controllers/api/notifications/unread_controller.rb b/app/controllers/api/notifications/unread_controller.rb deleted file mode 100644 index 35bed44a747..00000000000 --- a/app/controllers/api/notifications/unread_controller.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class API::Notifications::UnreadController < API::BaseController - def index - @notifications = if params[:page] - current_user.notifications - .unreads_with_avatar - .order(created_at: :desc) - .page(params[:page]) - else - current_user.notifications.unreads_with_avatar - end - render template: 'api/notifications/index' - end -end diff --git a/app/controllers/api/notifications_controller.rb b/app/controllers/api/notifications_controller.rb index 8c808af322c..4472b2a0cf9 100644 --- a/app/controllers/api/notifications_controller.rb +++ b/app/controllers/api/notifications_controller.rb @@ -2,8 +2,12 @@ class API::NotificationsController < API::BaseController def index + target = params[:target].presence&.to_sym + status = params[:status] + @notifications = current_user.notifications - .reads_with_avatar + .by_target(target) + .by_read_status(status) .order(created_at: :desc) .page(params[:page]) end diff --git a/app/controllers/api/reservations_controller.rb b/app/controllers/api/reservations_controller.rb deleted file mode 100644 index 67bc3959589..00000000000 --- a/app/controllers/api/reservations_controller.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -class API::ReservationsController < API::BaseController - before_action :set_reservation, only: %i[destroy] - - def index - @reservations = Reservation.where( - date: params[:beggining_of_this_month]..params[:end_of_this_month] - ).includes(:user) - end - - def create - if reservation_params[:seat_id].instance_of?(Array) || reservation_params[:date].instance_of?(Array) - create_reservations(seat_id: reservation_params[:seat_id], date: reservation_params[:date]) - else - @reservation = Reservation.new(reservation_params) - @reservation.user = current_user - if @reservation.save - render :create, status: :created - else - render status: :bad_request, json: { message: @reservation.errors.full_messages } - end - end - end - - def destroy - @reservation.destroy - end - - private - - def reservation_params - params.require(:reservation).permit( - :date, - :seat_id, - { seat_id: [] }, - { date: [] } - ) - end - - def set_reservation - @reservation = current_user.reservations.find(params[:id]) - end - - def create_reservations(seat_id:, date:) - @reservations = [] - values = seat_id if seat_id.instance_of?(Array) && date.instance_of?(String) - values = date if date.instance_of?(Array) && seat_id.instance_of?(Integer) - values.each do |value| - @reservation = Reservation.new(seat_id: value, date: date) if seat_id.instance_of?(Array) - @reservation = Reservation.new(seat_id: seat_id, date: value) if date.instance_of?(Array) - @reservation.user = current_user - @reservation.save - @reservations << @reservation - end - render :index, status: :created - end -end diff --git a/app/controllers/books/borrowed_controller.rb b/app/controllers/books/borrowed_controller.rb deleted file mode 100644 index f6e304fe14b..00000000000 --- a/app/controllers/books/borrowed_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class Books::BorrowedController < ApplicationController - def index - @books = Book.borrowed.order(:title).page(params[:page]) - end -end diff --git a/app/controllers/books/search_results_controller.rb b/app/controllers/books/search_results_controller.rb deleted file mode 100644 index 9c72f4f1fbf..00000000000 --- a/app/controllers/books/search_results_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class Books::SearchResultsController < ApplicationController - before_action :require_login - - def index - @search_results = Book.search(params[:word]).page(params[:page]) - end -end diff --git a/app/controllers/books_controller.rb b/app/controllers/books_controller.rb deleted file mode 100644 index a4a3a4dddd6..00000000000 --- a/app/controllers/books_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class BooksController < ApplicationController - before_action :require_login - - def index - @books = Book.order(:title).page(params[:page]) - end - - def show - @book = Book.find(params[:id]) - end -end diff --git a/app/controllers/borrowings_controller.rb b/app/controllers/borrowings_controller.rb deleted file mode 100644 index 531bd6bf1ad..00000000000 --- a/app/controllers/borrowings_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BorrowingsController < ApplicationController - before_action :require_login, only: %i[create destroy] - - def create - book = Book.find(params[:book_id]) - current_user.borrow(book) - redirect_to book_url(book), notice: '書籍を借りました。' - end - - def destroy - book = Book.find(params[:book_id]) - current_user.give_back(book) - redirect_to book_url(book), notice: '書籍を返却しました。' - end -end diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index 107ad45de5d..8f0460fb571 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -57,6 +57,12 @@ def require_admin_login redirect_to root_path, alert: '管理者としてログインしてください' end + def require_admin_or_mentor_login + return if admin_or_mentor_login? + + redirect_to root_path, alert: '管理者・メンターとしてログインしてください' + end + def require_staff_login return if staff_login? diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 49b2c61ee92..c07593ff211 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -5,12 +5,7 @@ class EventsController < ApplicationController before_action :set_event, only: %i[show edit update destroy] before_action :set_footprints, only: %i[show] - def index - @events = Event.with_avatar - .includes(:comments, :users) - .order(created_at: :desc) - .page(params[:page]) - end + def index; end def show footprint! diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 19d3c67422b..766ee27a688 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -12,8 +12,6 @@ def index .order(published_at: :desc) .limit(5) @completed_learnings = current_user.learnings.where(status: 3).order(updated_at: :desc) - @my_seat_today = current_user.reservations.find_by(date: Date.current)&.seat&.name - @reservations_for_today = Reservation.where(date: Date.current).to_a set_required_fields render aciton: :index end diff --git a/app/controllers/notifications/unread_controller.rb b/app/controllers/notifications/unread_controller.rb deleted file mode 100644 index 4c7318914d6..00000000000 --- a/app/controllers/notifications/unread_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class Notifications::UnreadController < ApplicationController - def index; end -end diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 697bdc4b3f1..d0d5959e5b5 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -4,7 +4,9 @@ class NotificationsController < ApplicationController before_action :require_login, only: %i[index show] before_action :set_my_notification, only: %i[show] - def index; end + def index + @target = params[:target] + end def show path = @notification.read_attribute :path diff --git a/app/controllers/practices_controller.rb b/app/controllers/practices_controller.rb index 98a8ca4bc15..d537ea0110f 100644 --- a/app/controllers/practices_controller.rb +++ b/app/controllers/practices_controller.rb @@ -2,7 +2,8 @@ class PracticesController < ApplicationController before_action :require_login - before_action :require_admin_login, except: %i[show] + before_action :require_admin_login, only: %i[new create] + before_action :require_admin_or_mentor_login, only: %i[edit update] before_action :set_course, only: %i[new] before_action :set_practice, only: %i[show edit update] diff --git a/app/controllers/reservation_calenders_controller.rb b/app/controllers/reservation_calenders_controller.rb deleted file mode 100644 index 217449728ad..00000000000 --- a/app/controllers/reservation_calenders_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -class ReservationCalendersController < ApplicationController - before_action :set_seats, only: %w[show] - - def index - this_month = l(Date.new(Date.current.year, Date.current.month, 1), format: :ym) - redirect_to action: 'show', id: this_month - end - - def show - days_of_this_month = beggining_of_this_month..beggining_of_this_month.end_of_month - @reservations = Reservation.where(date: days_of_this_month).includes(:user) - - @memos = Memo.one_month_memos(beggining_of_this_month) - @holidays = Holiday.one_month_holidays(beggining_of_this_month) - - @this_month = beggining_of_this_month - @prev_month = beggining_of_this_month.prev_month - @next_month = beggining_of_this_month.next_month - end - - private - - def beggining_of_this_month - if @beggining_of_this_month.nil? - @beggining_of_this_month = if year_and_month?(params[:id]) - Date.new(params[:id].slice(0, 4).to_i, params[:id].slice(4, 2).to_i, 1) - else - Date.current.beginning_of_month - end - else - @beggining_of_this_month - end - end - - def year_and_month?(params_id) - /^\d{4}(0[1-9]|1[0-2])$/.match?(params_id) - end - - def set_seats - @seats = [] - Seat.all.order(:name).each do |seat| - @seats.push(id: seat['id'], name: seat['name']) - end - end -end diff --git a/app/decorators/book_decorator.rb b/app/decorators/book_decorator.rb deleted file mode 100644 index 742a87364de..00000000000 --- a/app/decorators/book_decorator.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module BookDecorator - def borrowing_user_name - users.first.login_name - end - - def borrowing_user_avatar - users.first.avatar_url - end - - def borrowing_days - borrowed_date = borrowings.first.created_at - (Time.current - borrowed_date).to_i / (60 * 60 * 24) - end -end diff --git a/app/javascript/comments.vue b/app/javascript/comments.vue index a2e4f828e1d..84dcaa61f22 100644 --- a/app/javascript/comments.vue +++ b/app/javascript/comments.vue @@ -1,7 +1,7 @@