diff --git a/app/assets/stylesheets/_common-imports.sass b/app/assets/stylesheets/_common-imports.sass index 202b38b63ba..aac3abdcdc1 100644 --- a/app/assets/stylesheets/_common-imports.sass +++ b/app/assets/stylesheets/_common-imports.sass @@ -20,6 +20,7 @@ @import "variables/welcome-colors" @import "variables/layout" @import "variables/fonts" +@import "variables/choices" //////////// // mixins diff --git a/app/assets/stylesheets/atoms/_a-badge.sass b/app/assets/stylesheets/atoms/_a-badge.sass index 004d03d0c37..d273961e5d5 100644 --- a/app/assets/stylesheets/atoms/_a-badge.sass +++ b/app/assets/stylesheets/atoms/_a-badge.sass @@ -23,6 +23,11 @@ color: $muted-text font-weight: 400 background-color: $background + &.is-dark-muted + border: none + color: $semi-muted-text + font-weight: 400 + background-color: $background-shade //size &.is-xs diff --git a/app/assets/stylesheets/atoms/_a-card.sass b/app/assets/stylesheets/atoms/_a-card.sass index 85d149a1769..47dc63a039a 100644 --- a/app/assets/stylesheets/atoms/_a-card.sass +++ b/app/assets/stylesheets/atoms/_a-card.sass @@ -1,7 +1,7 @@ .a-card background-color: $base border-radius: .25rem - border: solid 1px $border-more-shade + border: solid 1px $border-shade +margin(horizontal, auto) +media-breakpoint-down(lg) &:not(:last-child) @@ -21,6 +21,20 @@ max-width: 100% +media-breakpoint-down(sm) +margin(horizontal, 1rem) + &.is-toggle + label + cursor: pointer + > input:not(:checked) + * + * + display: none + > input:not(:checked) + * + border-bottom: none + > input:checked + * + * + display: block + > input:not(:checked) + * .is-hidden-then-unchecked + display: none + > input:checked + * .is-hidden-then-checked + display: none + .a-card-notice p diff --git a/app/assets/stylesheets/atoms/_a-file-input.sass b/app/assets/stylesheets/atoms/_a-file-input.sass index b6054fea7a8..7183c11c8cf 100644 --- a/app/assets/stylesheets/atoms/_a-file-input.sass +++ b/app/assets/stylesheets/atoms/_a-file-input.sass @@ -25,7 +25,7 @@ max-height: 100% max-width: 100% object-fit: contain - border: solid 1px $background + border: solid 1px $border-tint input overflow: hidden +size(0) diff --git a/app/assets/stylesheets/atoms/_a-short-text.sass b/app/assets/stylesheets/atoms/_a-short-text.sass index 8ab2b22796b..6aacfa4b3d6 100644 --- a/app/assets/stylesheets/atoms/_a-short-text.sass +++ b/app/assets/stylesheets/atoms/_a-short-text.sass @@ -9,3 +9,5 @@ border: none border-top: dashed 1px $border +margin(vertical, 1.25em) + &.is-ta-center + text-align: center diff --git a/app/assets/stylesheets/atoms/_a-text-input.sass b/app/assets/stylesheets/atoms/_a-text-input.sass index 245481c1382..3e0d5e8cfca 100644 --- a/app/assets/stylesheets/atoms/_a-text-input.sass +++ b/app/assets/stylesheets/atoms/_a-text-input.sass @@ -1,6 +1,6 @@ .a-text-input +text-block(1em 1.45, block) - background-color: #fafafa + background-color: $input-background width: 100% padding: .5rem border: solid 1px $input-border diff --git a/app/assets/stylesheets/atoms/_a-title-label.sass b/app/assets/stylesheets/atoms/_a-title-label.sass new file mode 100644 index 00000000000..7749dbeb6cd --- /dev/null +++ b/app/assets/stylesheets/atoms/_a-title-label.sass @@ -0,0 +1,21 @@ +.a-title-label + +text-block(.5em 1, flex nowrap 0) + background-color: #e9ebef + +padding(horizontal, 1em) + border-radius: .75rem + align-items: center + +position(relative, top .75em) + margin-right: .5em + +media-breakpoint-up(md) + height: 1.5em + +position(top .75em) + +media-breakpoint-down(sm) + font-size: .625rem + height: 1.75em + +position(top .375em) + &.is-solved + color: $reversal-text + &.is-success + background-color: $success + &.is-danger + background-color: $danger diff --git a/app/assets/stylesheets/atoms/_a-user-name.sass b/app/assets/stylesheets/atoms/_a-user-name.sass index 59c9f88e9f9..fc4c2bdefcb 100644 --- a/app/assets/stylesheets/atoms/_a-user-name.sass +++ b/app/assets/stylesheets/atoms/_a-user-name.sass @@ -3,6 +3,7 @@ font-size: .8125rem line-height: 1.4 white-space: nowrap + font-weight: 400 .thread-list-item-name & font-size: .75rem diff --git a/app/assets/stylesheets/blocks/auth-form/_auth-form.sass b/app/assets/stylesheets/blocks/auth-form/_auth-form.sass index ac8bde61705..133c562155c 100644 --- a/app/assets/stylesheets/blocks/auth-form/_auth-form.sass +++ b/app/assets/stylesheets/blocks/auth-form/_auth-form.sass @@ -21,14 +21,14 @@ margin-top: 2rem .auth-form__header - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint padding: 1rem 1.25rem .auth-form__body padding: 1.5rem 1.25rem .auth-form__footer - border-top: solid 1px $background + border-top: solid 1px $border-tint padding: 1rem 1.25rem .auth-form__title diff --git a/app/assets/stylesheets/blocks/card/_card-body.sass b/app/assets/stylesheets/blocks/card/_card-body.sass index 62346402cff..1f1ba1cad48 100644 --- a/app/assets/stylesheets/blocks/card/_card-body.sass +++ b/app/assets/stylesheets/blocks/card/_card-body.sass @@ -4,6 +4,6 @@ +media-breakpoint-down(sm) padding: .75rem &:not(:last-child) - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint p +text-block(1em 1.6) diff --git a/app/assets/stylesheets/blocks/card/_card-books.sass b/app/assets/stylesheets/blocks/card/_card-books.sass index d72a8ac554a..9a362bf3a38 100644 --- a/app/assets/stylesheets/blocks/card/_card-books.sass +++ b/app/assets/stylesheets/blocks/card/_card-books.sass @@ -57,7 +57,7 @@ max-width: 100% object-fit: contain object-position: 50% 0 - border: solid 1px $background + border: solid 1px $border-tint border-radius: 2px .card-books-item__description diff --git a/app/assets/stylesheets/blocks/card/_card-footer.sass b/app/assets/stylesheets/blocks/card/_card-footer.sass index 96cbc541cf9..ec45b4c7556 100644 --- a/app/assets/stylesheets/blocks/card/_card-footer.sass +++ b/app/assets/stylesheets/blocks/card/_card-footer.sass @@ -1,5 +1,5 @@ .card-footer - border-top: $background solid 1px + border-top: solid 1px $border-tint +media-breakpoint-up(md) padding: .75rem 1.25rem +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/card/_card-header.sass b/app/assets/stylesheets/blocks/card/_card-header.sass index 18034d14bfc..92fe5be0e38 100644 --- a/app/assets/stylesheets/blocks/card/_card-header.sass +++ b/app/assets/stylesheets/blocks/card/_card-header.sass @@ -1,5 +1,5 @@ .card-header - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint padding: .75rem 1.25rem display: flex align-items: center @@ -16,7 +16,11 @@ margin-top: -1px .card-header__title - +text-block(1rem 1.4, 600) + +text-block(1em 1.4, 600) + +media-breakpoint-up(md) + font-size: 1rem + +media-breakpoint-down(sm) + font-size: .875rem .card-header.is-sm & font-size: .875rem diff --git a/app/assets/stylesheets/blocks/card/_card-list.sass b/app/assets/stylesheets/blocks/card/_card-list.sass index c242327181b..9d08be16fce 100644 --- a/app/assets/stylesheets/blocks/card/_card-list.sass +++ b/app/assets/stylesheets/blocks/card/_card-list.sass @@ -24,10 +24,10 @@ .card-list__items .card-list__deacription + & - border-top: dotted .0625rem $background + border-top: dotted .0625rem $border-tint .card-list__item:not(:last-child) - border-bottom: dotted .0625rem $background + border-bottom: dotted .0625rem $border-tint .card-list__item-link +text-block(.8125rem 1.6, block $main) diff --git a/app/assets/stylesheets/blocks/card/_congrats-card-body.sass b/app/assets/stylesheets/blocks/card/_congrats-card-body.sass index 83edf604e9d..291310061f2 100644 --- a/app/assets/stylesheets/blocks/card/_congrats-card-body.sass +++ b/app/assets/stylesheets/blocks/card/_congrats-card-body.sass @@ -15,7 +15,7 @@ .congrats-card-body__image border-radius: .75rem - border: solid .5rem $background + border: solid .5rem $border-tint .congrats-card-body .card-main-actions diff --git a/app/assets/stylesheets/blocks/entry/_entry-header.sass b/app/assets/stylesheets/blocks/entry/_entry-header.sass index e8cc303ea12..ac18b8e72a8 100644 --- a/app/assets/stylesheets/blocks/entry/_entry-header.sass +++ b/app/assets/stylesheets/blocks/entry/_entry-header.sass @@ -2,7 +2,7 @@ margin-bottom: 1.5rem +padding(horizontal, 1.25rem) +padding(vertical, 1rem) - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-down(sm) +padding(horizontal, 1rem) margin-bottom: 1rem diff --git a/app/assets/stylesheets/blocks/header/_header-dropdown.sass b/app/assets/stylesheets/blocks/header/_header-dropdown.sass index d1b8b522aba..5a7fdbb2888 100644 --- a/app/assets/stylesheets/blocks/header/_header-dropdown.sass +++ b/app/assets/stylesheets/blocks/header/_header-dropdown.sass @@ -61,7 +61,7 @@ +media-breakpoint-up(md) color: $default-text .header-dropdown__item:not(:last-child) & - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint &:hover background-color: $background-tint +media-breakpoint-down(sm) @@ -74,7 +74,7 @@ +border-radius(bottom, .25rem) overflow: hidden +media-breakpoint-up(md) - border-top: solid 1px $background + border-top: solid 1px $border-tint +media-breakpoint-down(sm) border-top: solid 1px $side-border @@ -97,7 +97,7 @@ background-color: $side-shade +media-breakpoint-up(md) &:not(:last-child) - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-down(sm) border-bottom: solid 1px $side-border diff --git a/app/assets/stylesheets/blocks/header/_header-links.sass b/app/assets/stylesheets/blocks/header/_header-links.sass index 8f11801e2af..6a38b09d5ec 100644 --- a/app/assets/stylesheets/blocks/header/_header-links.sass +++ b/app/assets/stylesheets/blocks/header/_header-links.sass @@ -10,7 +10,7 @@ .header-links__item display: flex height: 100% - border-left: solid $background .0625rem + border-left: solid $border-tint .0625rem +position(relative) transition: color .2s ease-in, background-color .2s ease-in diff --git a/app/assets/stylesheets/blocks/header/_header.sass b/app/assets/stylesheets/blocks/header/_header.sass index fb7a8c24dc7..84cf450e81e 100644 --- a/app/assets/stylesheets/blocks/header/_header.sass +++ b/app/assets/stylesheets/blocks/header/_header.sass @@ -1,7 +1,7 @@ .header background-color: $base z-index: 3 - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-up(md) +position(sticky, top 0) +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/page/_page-header-actions.sass b/app/assets/stylesheets/blocks/page/_page-header-actions.sass index 916e52ead1f..71984f66022 100644 --- a/app/assets/stylesheets/blocks/page/_page-header-actions.sass +++ b/app/assets/stylesheets/blocks/page/_page-header-actions.sass @@ -4,7 +4,7 @@ padding-top: .5rem +margin(horizontal, -1rem) +padding(horizontal, 1rem) - border-top: solid 1px $background + border-top: solid 1px $border-tint .page-header-actions__items display: flex diff --git a/app/assets/stylesheets/blocks/page/_page-tabs.sass b/app/assets/stylesheets/blocks/page/_page-tabs.sass index 0108cf22cdc..f6c6e3afb8d 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-more-shade + border-bottom: solid 1px $border-more-shade .sort-nav + & border-top: solid 1px $border-more-more-shade .page-header + & @@ -28,10 +28,10 @@ align-items: center justify-content: center height: 2.75rem - background-color: #dedede + background-color: #dfdfe5 +padding(horizontal, 1em) +border-radius(top, .25rem) - border: solid 1px $border-more-more-shade + border: solid 1px $border-more-shade +position(relative) transition: all .2s ease-out +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/practice/_categories.sass b/app/assets/stylesheets/blocks/practice/_categories.sass index 3cef1455c75..994ba3fc76c 100644 --- a/app/assets/stylesheets/blocks/practice/_categories.sass +++ b/app/assets/stylesheets/blocks/practice/_categories.sass @@ -22,12 +22,8 @@ +media-breakpoint-down(sm) margin-bottom: 2rem -.categories-item__anchor - +media-breakpoint-up(md) - +position(relative, top -3.5rem) - .categories-item__title - +text-block(1.5rem 1.5, $main-text 600) + +text-block(1.5rem 1.5, $main-text 700) position: relative +media-breakpoint-down(sm) font-size: 1.25rem diff --git a/app/assets/stylesheets/blocks/practice/_category-practices-item.sass b/app/assets/stylesheets/blocks/practice/_category-practices-item.sass index ffbeb6ea7cb..0b5a99c4833 100644 --- a/app/assets/stylesheets/blocks/practice/_category-practices-item.sass +++ b/app/assets/stylesheets/blocks/practice/_category-practices-item.sass @@ -1,11 +1,11 @@ .category-practices-item padding: .75rem 1rem - border-bottom: solid 1px $background + border-bottom: solid 1px $border +position(relative) &:last-child border-bottom: none - &:nth-child(odd) - background-color: #fafafa + &:nth-child(even) + background-color: $background-more-tint +media-breakpoint-down(sm) flex-wrap: wrap padding: .5rem .75rem .75rem diff --git a/app/assets/stylesheets/blocks/practice/_practice-contents.sass b/app/assets/stylesheets/blocks/practice/_practice-contents.sass index c0c2910c587..b19f2aba2ac 100644 --- a/app/assets/stylesheets/blocks/practice/_practice-contents.sass +++ b/app/assets/stylesheets/blocks/practice/_practice-contents.sass @@ -16,7 +16,7 @@ padding-bottom: .25rem .practice-contents__title - +text-block(1.5rem 1.4, 600 $side) + +text-block(1.5rem 1.4, 700 $side) +media-breakpoint-down(sm) font-size: 1.25rem word-break: break-all diff --git a/app/assets/stylesheets/blocks/product/_product-header.sass b/app/assets/stylesheets/blocks/product/_product-header.sass new file mode 100644 index 00000000000..cf8b34657e0 --- /dev/null +++ b/app/assets/stylesheets/blocks/product/_product-header.sass @@ -0,0 +1,59 @@ +.product-header + +media-breakpoint-up(md) + display: flex + margin-bottom: 2rem + .a-user-name + +media-breakpoint-down(sm) + display: block + text-align: center + margin-bottom: .5rem + +.product-header__start + +media-breakpoint-up(md) + flex: 0 0 5rem + +.product-header__end + +media-breakpoint-up(md) + flex: 1 + +media-breakpoint-down(sm) + margin-top: .5rem + +.product-header__user + +media-breakpoint-down(sm) + display: flex + justify-content: center + +.product-header__user-link + +block-link + +.product-header__user-icon + +size(3.5rem) + +.product-header__title + font-feature-settings: "palt" + letter-spacing: .02em + +text-block(1em 1.45, 700 $main) + padding-bottom: .25rem + border-bottom: solid 1px $border-shade + +media-breakpoint-up(md) + font-size: 1.5rem + margin-top: .125rem + +media-breakpoint-down(sm) + font-size: 1.125rem + margin-top: .125rem + word-break: break-all + &.is-wip + color: $muted-text + .a-title-label + display: inline-flex + vertical-align: top + +media-breakpoint-up(md) + +position(relative, top .75em) + +media-breakpoint-down(sm) + +position(relative, top .5em) + +.product-header__title-link + +hover-link + color: $main + .product-header__title.is-wip & + color: $muted-text diff --git a/app/assets/stylesheets/blocks/product/_product.sass b/app/assets/stylesheets/blocks/product/_product.sass new file mode 100644 index 00000000000..25fa0b731fb --- /dev/null +++ b/app/assets/stylesheets/blocks/product/_product.sass @@ -0,0 +1,13 @@ +.product + +position(relative) + +margin(horizontal, auto) + +media-breakpoint-up(md) + width: $thread-max-width + max-width: 100% + .a-watch-button.is-inactive, + .a-bookmark-button.is-inactive + color: $semi-muted-text + background-color: $background-shade + .a-title-label + color: $semi-muted-text + background-color: $background-shade diff --git a/app/assets/stylesheets/blocks/shared/_modal.sass b/app/assets/stylesheets/blocks/shared/_modal.sass index f7613411013..2f856409267 100644 --- a/app/assets/stylesheets/blocks/shared/_modal.sass +++ b/app/assets/stylesheets/blocks/shared/_modal.sass @@ -21,7 +21,7 @@ display: flex align-items: center justify-content: space-between - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-up(md) padding: .25rem 1.5rem +media-breakpoint-down(sm) @@ -70,7 +70,7 @@ .modal-body max-height: calc(100vh - 11.5rem) overflow: auto - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-up(md) padding: 1rem 1.5rem +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass b/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass index 832ab305c75..d67789f31cd 100644 --- a/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass +++ b/app/assets/stylesheets/blocks/shared/_page-tags-nav.sass @@ -3,19 +3,22 @@ +position(sticky, right 0, top 3.5rem) .page-tags-nav__body - max-height: calc(100vh - 6.5rem) + max-height: calc(100vh - 7rem) padding: .5rem .75rem overflow-y: auto .page-tags-nav__items display: flex flex-wrap: wrap - gap: .5rem + gap: .25rem .page-tags-nav__item-link - padding: .3125rem .75rem + padding: .3125rem .5rem border-radius: 1.5em - +text-block(.75rem 1.4, $primary) + +text-block(.625rem 1.4, $primary nowrap) + max-width: 8.5rem + overflow: hidden + text-overflow: ellipsis border: solid 1px $primary +block-link transition: all .1s ease-in diff --git a/app/assets/stylesheets/blocks/shared/_sort-nav.sass b/app/assets/stylesheets/blocks/shared/_sort-nav.sass index 6bdb4e19220..9d8a9037ba4 100644 --- a/app/assets/stylesheets/blocks/shared/_sort-nav.sass +++ b/app/assets/stylesheets/blocks/shared/_sort-nav.sass @@ -1,5 +1,5 @@ .sort-nav - +padding(vertical, .75rem) + +padding(vertical, .5rem) background-color: $background-shade .page-tabs + & +padding(vertical, 0) diff --git a/app/assets/stylesheets/blocks/static-pages/_error-message.sass b/app/assets/stylesheets/blocks/static-pages/_error-message.sass index d42303fc276..bb1aacab9b8 100644 --- a/app/assets/stylesheets/blocks/static-pages/_error-message.sass +++ b/app/assets/stylesheets/blocks/static-pages/_error-message.sass @@ -2,7 +2,7 @@ max-width: 40rem .retire-message__header - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +border-radius(top, .25rem) padding: .88em 1.33em font-size: 1.125rem diff --git a/app/assets/stylesheets/blocks/thread/_thread-comment-form.sass b/app/assets/stylesheets/blocks/thread/_thread-comment-form.sass index 9017308e8c4..e217fbba1bc 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-comment-form.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-comment-form.sass @@ -9,7 +9,7 @@ +position(absolute, left 0, top 0) +size($thread-header-author 100%) padding-right: 2rem - border-right: $background solid 1px + border-right: solid 1px $border-tint .thread-comment-form__user-icon +size(100% auto) diff --git a/app/assets/stylesheets/blocks/thread/_thread-comments.sass b/app/assets/stylesheets/blocks/thread/_thread-comments.sass index 8aa7e861332..8b415859752 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-comments.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-comments.sass @@ -73,7 +73,7 @@ display: flex justify-content: space-between align-items: center - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +padding(horizontal, 1rem) +padding(vertical, .75rem) +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/thread/_thread-footer.sass b/app/assets/stylesheets/blocks/thread/_thread-footer.sass index 7bff2f3314c..4f62e7e615c 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-footer.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-footer.sass @@ -1,6 +1,5 @@ .thread-footer__inner - border-top: solid 1px $background + border-top: solid 1px $border-tint padding: 1rem 2rem +media-breakpoint-down(sm) +padding(horizontal, 1rem) - diff --git a/app/assets/stylesheets/blocks/thread/_thread-header-actions.sass b/app/assets/stylesheets/blocks/thread/_thread-header-actions.sass index b16c6f73c2a..157cca6c813 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-header-actions.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-header-actions.sass @@ -3,13 +3,11 @@ display: flex justify-content: space-between flex-wrap: wrap - margin-bottom: -.5rem .thread-header-actions__start, .thread-header-actions__end display: flex flex: 1 - padding-bottom: .5rem gap: .5rem .thread-header-actions__start diff --git a/app/assets/stylesheets/blocks/thread/_thread-header-title.sass b/app/assets/stylesheets/blocks/thread/_thread-header-title.sass index 409e7bfb035..7f10911d1b7 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-header-title.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-header-title.sass @@ -19,27 +19,5 @@ .thread-header-title.is-wip & color: $muted-text -.thread-header-title__label - +text-block(.5em 1, flex nowrap 0) - background-color: #e9ebef - +padding(horizontal, 1em) - border-radius: .75rem - align-items: center - +position(relative, top .75em) - margin-right: .5em - +media-breakpoint-up(md) - height: 1.5em - +position(top .75em) - +media-breakpoint-down(sm) - font-size: .625rem - height: 1.75em - +position(top .375em) - &.is-solved - color: $reversal-text - &.is-success - background-color: $success - &.is-danger - background-color: $danger - .thread-header-title__title font-weight: 700 diff --git a/app/assets/stylesheets/blocks/thread/_thread-list-item.sass b/app/assets/stylesheets/blocks/thread/_thread-list-item.sass index 62d0a03f2b1..5642505f015 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-list-item.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-list-item.sass @@ -1,6 +1,6 @@ .thread-list-item &:not(:last-child) - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +media-breakpoint-up(md) padding: .75rem 1rem min-height: 3.875rem diff --git a/app/assets/stylesheets/blocks/thread/_thread-questions.sass b/app/assets/stylesheets/blocks/thread/_thread-questions.sass index f20fb28d06d..0a91f5e9313 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-questions.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-questions.sass @@ -71,7 +71,7 @@ display: flex justify-content: space-between align-items: center - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint +padding(horizontal, 1rem) +padding(vertical, .75rem) +media-breakpoint-down(sm) diff --git a/app/assets/stylesheets/blocks/thread/_thread-tags.sass b/app/assets/stylesheets/blocks/thread/_thread-tags.sass index 73b5fce3656..f04e61ceee7 100644 --- a/app/assets/stylesheets/blocks/thread/_thread-tags.sass +++ b/app/assets/stylesheets/blocks/thread/_thread-tags.sass @@ -1,6 +1,6 @@ .thread__tags padding: .625rem 2rem - border-top: solid 1px $background + border-top: solid 1px $border-tint +media-breakpoint-down(sm) padding: .5rem 1rem .form-actions diff --git a/app/assets/stylesheets/blocks/thread/_thread.sass b/app/assets/stylesheets/blocks/thread/_thread.sass index 95506b2f360..ac2196da30b 100644 --- a/app/assets/stylesheets/blocks/thread/_thread.sass +++ b/app/assets/stylesheets/blocks/thread/_thread.sass @@ -8,6 +8,8 @@ margin-bottom: 2rem &.is-header-author margin-top: 3rem + &.has-no-author + padding-left: 0 +media-breakpoint-down(sm) margin-top: 1.5rem margin-bottom: 1rem @@ -16,19 +18,10 @@ padding-left: 0 .thread__body - border-top: $background solid 1px + border-top: solid 1px $border-tint .thread__inner +position(relative) - // +balloon-tail(left $base .625rem .75rem, false, top 2rem) - +media-breakpoint-down(sm) - &::before, - &::after - content: none - .thread.is-page & - &::before, - &::after - content: none .thread__user-link +position(absolute, left 0, top 0) @@ -53,7 +46,7 @@ padding: .75rem & + .thread__description, .thread-header + & - border-top: solid 1px $background + border-top: solid 1px $border-tint .thread__warning-message background-color: $warning diff --git a/app/assets/stylesheets/blocks/user/_active-practices-list.sass b/app/assets/stylesheets/blocks/user/_active-practices-list.sass index 82c55840f3d..8594c047a37 100644 --- a/app/assets/stylesheets/blocks/user/_active-practices-list.sass +++ b/app/assets/stylesheets/blocks/user/_active-practices-list.sass @@ -2,7 +2,7 @@ margin-bottom: -.25rem .active-practices-list-item:not(:last-child) - border-bottom: dotted .0625rem $background + border-bottom: dotted .0625rem $border-tint .active-practices-list-item__link +text-block(.875rem 1.55, block $main) diff --git a/app/assets/stylesheets/blocks/user/_companies-item.sass b/app/assets/stylesheets/blocks/user/_companies-item.sass index e2368a40c13..e5de94d46c8 100644 --- a/app/assets/stylesheets/blocks/user/_companies-item.sass +++ b/app/assets/stylesheets/blocks/user/_companies-item.sass @@ -14,7 +14,7 @@ +media-breakpoint-down(sm) padding-left: 3rem &:not(:last-child) - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint .companies-item__name +text-block(1em 1.4, 600 $main block) diff --git a/app/assets/stylesheets/blocks/user/_completed-practices-list.sass b/app/assets/stylesheets/blocks/user/_completed-practices-list.sass index 2b311ec2286..f54dc609860 100644 --- a/app/assets/stylesheets/blocks/user/_completed-practices-list.sass +++ b/app/assets/stylesheets/blocks/user/_completed-practices-list.sass @@ -2,7 +2,7 @@ margin-bottom: -.25rem .completed-practices-list-item:not(:last-child) - border-bottom: dotted .0625rem $background + border-bottom: dotted .0625rem $border-tint .completed-practices-list-item__link +text-block(.875rem 1.55, block $main) diff --git a/app/assets/stylesheets/blocks/user/_niconico-calendar.sass b/app/assets/stylesheets/blocks/user/_niconico-calendar.sass index 2d286b403d0..e900ae68b23 100644 --- a/app/assets/stylesheets/blocks/user/_niconico-calendar.sass +++ b/app/assets/stylesheets/blocks/user/_niconico-calendar.sass @@ -30,6 +30,8 @@ th, td border: solid 1px $border-shade + td + height: 3rem .niconico-calendar__header background-color: $background-tint @@ -66,8 +68,11 @@ a.niconico-calendar__day-inner transition: all .2s ease-out + cursor: pointer &:hover background-color: rgba($warning, .1) + box-shadow: $warning 0 0 0 1px inset + position: relative .niconico-calendar__day-label +text-block(.625rem 1, center $default-text) diff --git a/app/assets/stylesheets/blocks/user/_user-metas.sass b/app/assets/stylesheets/blocks/user/_user-metas.sass index 8ec55533c99..9f198b288ec 100644 --- a/app/assets/stylesheets/blocks/user/_user-metas.sass +++ b/app/assets/stylesheets/blocks/user/_user-metas.sass @@ -17,7 +17,7 @@ +media-breakpoint-down(sm) display: block &:nth-child(even) - background-color: #fafafa + background-color: $input-background &:not(:last-child) border-bottom: solid 1px $background-shade diff --git a/app/assets/stylesheets/blocks/user/_users-item.sass b/app/assets/stylesheets/blocks/user/_users-item.sass index e71c9644e6e..f5990825878 100644 --- a/app/assets/stylesheets/blocks/user/_users-item.sass +++ b/app/assets/stylesheets/blocks/user/_users-item.sass @@ -17,7 +17,7 @@ +position(relative) +padding(horizontal, 1rem) padding-top: .5rem - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint padding-bottom: .5rem .users-item__header-inner diff --git a/app/assets/stylesheets/modules/_choices.sass b/app/assets/stylesheets/modules/_choices.sass index 69be1e8cea7..66608e8d14a 100644 --- a/app/assets/stylesheets/modules/_choices.sass +++ b/app/assets/stylesheets/modules/_choices.sass @@ -1,11 +1,63 @@ body .choices__inner - display: inline-flex - align-items: center - +padding(vertical, 0) - background-color: #fafafa + background-color: $input-background border-color: $input-border + padding: .25rem + border-radius: 4px .choices.is-focused .choices__inner background-color: $base .choices[data-type*=select-one] .choices__inner - padding-bottom: 0 + +padding(vertical, 0) + display: flex + + .choices__list--single + padding: .25rem 2.5rem .25rem .5rem + display: flex + align-items: center + .choices__item + white-space: nowrap + text-overflow: ellipsis + overflow: hidden + + .choices__list--multiple + .choices__item, + .choices__item[data-deletable] + display: inline-block + position: relative + max-width: calc(100% - .25rem) + overflow: hidden + text-overflow: ellipsis + white-space: nowrap + align-items: center + border-color: $main + color: $main-text + background-color: $main-shade + border-radius: 4px + line-height: calc(1.75rem - .125rem) + height: 1.75rem + padding: 0 2rem 0 .25rem + margin: .125rem + &.is-highlighted + border-color: $main + color: $main-text + background-color: $main-shade + + .choices[data-type*=select-multiple] .choices__button, + .choices[data-type*=text] .choices__button + border-left-color: $main + color: $main-text + height: 100% + background-image: $choices-icon-cross + margin: 0 0 0 .5rem + width: 1.75rem + +position(absolute, right 0, top 0) + transition: all .2s ease-out + &:hover + background-color: $main + background-image: $choices-icon-cross-inverse + +.choices__list--dropdown .choices__item, .choices__list[aria-expanded] .choices__item + line-height: 1.5 + padding: .5rem + &:not(:first-child) + border-top: solid 1px $border-tint diff --git a/app/assets/stylesheets/molecules/_m-user-icons.sass b/app/assets/stylesheets/molecules/_m-user-icons.sass index b11456365ec..1cabfae8e0b 100644 --- a/app/assets/stylesheets/molecules/_m-user-icons.sass +++ b/app/assets/stylesheets/molecules/_m-user-icons.sass @@ -1,7 +1,7 @@ .m-user-icons padding-top: .5rem margin-top: .75rem - border-top: dotted 1px $background + border-top: dotted 1px $border-tint margin-bottom: -.25rem .m-user-icons__items diff --git a/app/assets/stylesheets/variables/_choices.sass b/app/assets/stylesheets/variables/_choices.sass new file mode 100644 index 00000000000..06f4d108782 --- /dev/null +++ b/app/assets/stylesheets/variables/_choices.sass @@ -0,0 +1,24 @@ +$choices-selector: "choices" !default +$choices-font-size-lg: 1rem +$choices-font-size-md: .875rem +$choices-font-size-sm: .75rem +$choices-guttering: 1.5rem +$choices-border-radius: 4px +$choices-border-radius-item: 4px +$choices-bg-color: #f9f9f9 !default +$choices-bg-color-disabled: #eaeaea !default +$choices-bg-color-dropdown: #fff !default +$choices-text-color: $main-text +$choices-keyline-color: #ddd !default +$choices-primary-color: $main-shade +$choices-disabled-color: #eaeaea !default +$choices-highlight-color: $main-shade +$choices-button-dimension: 8px !default +$choices-button-offset: 8px !default +$choices-icon-cross: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2021%2021%22%20style%3D%22enable-background%3Anew%200%200%2021%2021%22%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%3E.st0%7Bfill%3A%233f3290%7D%3C%2Fstyle%3E%3Cpath%20class%3D%22st0%22%20d%3D%22M2.6%200%2021%2018.4%2018.4%2021%200%202.6%202.6%200z%22%2F%3E%3Cpath%20class%3D%22st0%22%20d%3D%22M0%2018.4%2018.4%200l2.5%202.5L2.5%2020.9%200%2018.4z%22%2F%3E%3C%2Fsvg%3E') +$choices-icon-cross-inverse: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2021%2021%22%20style%3D%22enable-background%3Anew%200%200%2021%2021%22%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%3E.st0%7Bfill%3A%23ffffff%7D%3C%2Fstyle%3E%3Cpath%20class%3D%22st0%22%20d%3D%22M2.6%200%2021%2018.4%2018.4%2021%200%202.6%202.6%200z%22%2F%3E%3Cpath%20class%3D%22st0%22%20d%3D%22M0%2018.4%2018.4%200l2.5%202.5L2.5%2020.9%200%2018.4z%22%2F%3E%3C%2Fsvg%3E') + +$choices-z-index: 1 + +// +// diff --git a/app/assets/stylesheets/variables/_colors.sass b/app/assets/stylesheets/variables/_colors.sass index c60569192a9..2c3d9ad6250 100644 --- a/app/assets/stylesheets/variables/_colors.sass +++ b/app/assets/stylesheets/variables/_colors.sass @@ -1,16 +1,16 @@ $main: #4638a0 $accent: #ffbe0a $base: white -$background: #ececec +$background: #efeff3 // background -$background-shade: #d6d6d6 +$background-shade: #d5d5d8 $background-tint: #eceeef -$background-more-tint: #f7f7f9 +$background-more-tint: #f9f9fa $hover-background: $background-more-tint // text -$default-text: #403f47 +$default-text: #565461 $reversal-text: white $muted-text: #9da4a7 $semi-muted-text: #898998 @@ -19,18 +19,20 @@ $main-text: #3c3282 $link-text: #2e2088 $side: $main -$side-border: #6b4eca +$side-border: rgba(black, .175) $side-tint: #4e6165 $side-shade: #3a228a $side-active: $accent // border -$border: #e6e6e6 -$border-shade: #d7d7d7 -$border-more-shade: #cacaca -$border-more-more-shade: #c1c1c1 +$border: #e1e2e5 +$border-tint: $background +$border-shade: #d2d2d8 +$border-more-shade: #c6c7cd +$border-more-more-shade: #b8b8c0 $welcome-card-border: #5a5f60 $input-border: #c1c5b9 +$input-background: #fafafa // Welcome Colors $welcome-default-text: #333738 @@ -69,6 +71,9 @@ $primary-shade: tint($primary, 90%) $warning-text: shade($warning, 60%) $warning-shade: tint($warning, 90%) +$main-text: shade($main, 10%) +$main-shade: tint($main, 90%) + =default-link transition: color .2s ease-in color: $link-text diff --git a/app/assets/stylesheets/welcome/auth-form2/_auth-form.sass b/app/assets/stylesheets/welcome/auth-form2/_auth-form.sass index ea10ce279c2..3c7e122e5fe 100644 --- a/app/assets/stylesheets/welcome/auth-form2/_auth-form.sass +++ b/app/assets/stylesheets/welcome/auth-form2/_auth-form.sass @@ -19,11 +19,11 @@ border-radius: 0 .auth-form__header - border-bottom: solid 1px $background + border-bottom: solid 1px $border-tint padding: 1.25rem .auth-form__footer - border-top: solid 1px $background + border-top: solid 1px $border-tint padding: 1rem 1.25rem .auth-form__title diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb index 5bb8ad0e523..dbd54f21757 100644 --- a/app/controllers/api/products_controller.rb +++ b/app/controllers/api/products_controller.rb @@ -1,13 +1,15 @@ # frozen_string_literal: true class API::ProductsController < API::BaseController - before_action :require_staff_login_for_api, only: :index + before_action :require_login_for_api, only: :index def index + @company = Company.find(params[:company_id]) if params[:company_id] @products = Product .list .ascending_by_date_of_publishing_and_id .page(params[:page]) @products_grouped_by_elapsed_days = @products.group_by { |product| product.elapsed_days >= 7 ? 7 : product.elapsed_days } + @products = @products.joins(:user).where(users: { company_id: params[:company_id] }) if params[:company_id] end end diff --git a/app/controllers/api/questions_controller.rb b/app/controllers/api/questions_controller.rb index b7be2c6720b..8e646e03861 100644 --- a/app/controllers/api/questions_controller.rb +++ b/app/controllers/api/questions_controller.rb @@ -11,7 +11,7 @@ def index elsif params[:all].present? Question.all else - Question.not_solved + Question.not_solved.not_wip end questions = params[:practice_id].present? ? questions.where(practice_id: params[:practice_id]) : questions questions = params[:user_id].present? ? Question.where(user_id: params[:user_id]) : questions diff --git a/app/controllers/card_controller.rb b/app/controllers/card_controller.rb deleted file mode 100644 index 1e2b6730d4f..00000000000 --- a/app/controllers/card_controller.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -class CardController < ApplicationController - before_action :require_login - before_action :require_card, only: :show - before_action :require_subscription, only: :show - - def show - @card = current_user.card - end - - def new; end - - # rubocop:disable Metrics/MethodLength - def create - begin - token = params[:idempotency_token] - customer = Card.new.create(current_user, params[:stripeToken], token) - Subscription.new.create(customer['id'], "#{token}-subscription") - current_user.customer_id = customer['id'] - current_user.save(validate: false) - - flash[:notice] = 'カードを登録しました。' - logger.info '[Payment] カードを登録しました。' - rescue Stripe::CardError => e - current_user.customer_id = nil - current_user.save(validate: false) - flash[:alert] = "カード情報に不備があります。:#{e.message}" - logger.warn "[Payment] カード情報に不備があります。:#{e.message}" - rescue StandardError => e - current_user.customer_id = nil - current_user.save(validate: false) - flash[:alert] = "カード登録に失敗しました。運営会社までお問い合わせください。:#{e.message}" - logger.warn "[Payment] カード登録に失敗しました。運営会社までお問い合わせください。:#{e.message}" - end - - if flash[:alert] - redirect_to new_card_url - else - redirect_to card_url - end - end - # rubocop:enable Metrics/MethodLength - - def edit; end - - def update - begin - Card.new.update(current_user.customer_id, params[:stripeToken]) - - flash[:notice] = 'カードを編集しました。' - logger.info '[Payment] カードを編集しました。' - rescue Stripe::CardError => e - current_user.customer_id = nil - current_user.save(validate: false) - flash[:alert] = "カード情報に不備があります。:#{e.message}" - logger.warn "[Payment] カード情報に不備があります。:#{e.message}" - rescue StandardError => e - current_user.customer_id = nil - current_user.save(validate: false) - flash[:alert] = "カード編集に失敗しました。運営会社までお問い合わせください。:#{e.message}" - logger.warn "[Payment] カード編集に失敗しました。運営会社までお問い合わせください。:#{e.message}" - end - - if flash[:alert] - redirect_to edit_card_url - else - redirect_to card_url - end - end -end diff --git a/app/controllers/companies/products_controller.rb b/app/controllers/companies/products_controller.rb index 71b105f1aa9..f393f573a0e 100644 --- a/app/controllers/companies/products_controller.rb +++ b/app/controllers/companies/products_controller.rb @@ -5,11 +5,5 @@ class Companies::ProductsController < ApplicationController def index @company = Company.find(params[:company_id]) - @products = Product - .includes(:user) - .where(users: { company: @company }) - .list - .order_for_list - .page(params[:page]) end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2381c2d934b..32f72aa6ee2 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -39,7 +39,8 @@ def set_required_fields after_graduation_hope: current_user.after_graduation_hope, discord_account: current_user.discord_account, github_account: current_user.github_account, - blog_url: current_user.blog_url + blog_url: current_user.blog_url, + graduated: current_user.graduated? ) end diff --git a/app/controllers/practices/questions_controller.rb b/app/controllers/practices/questions_controller.rb index 8b670e58b5e..32f586be3ce 100644 --- a/app/controllers/practices/questions_controller.rb +++ b/app/controllers/practices/questions_controller.rb @@ -9,7 +9,7 @@ def index if params[:solved].present? @practice.questions.solved elsif params[:not_solved].present? - @practice.questions.not_solved + @practice.questions.not_solved.not_wip else @practice.questions end diff --git a/app/controllers/practices_controller.rb b/app/controllers/practices_controller.rb index e0d893da1b4..1bbf029efaf 100644 --- a/app/controllers/practices_controller.rb +++ b/app/controllers/practices_controller.rb @@ -11,6 +11,7 @@ def show @categories = @practice.categories @tweet_url = @practice.tweet_url(practice_completion_url(@practice.id)) @common_page = Page.find_by(slug: 'practice_common_description') + @common_page = nil if @common_page&.wip? end def new diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 75a60f7a9fb..7ad3b9511ef 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -26,14 +26,18 @@ def show end def new - @report = Report.new(reported_on: Date.current) + year, month, day = params[:reported_on].scan(/\d+/).map(&:to_i) if params[:reported_on] + @report = if Date.valid_date?(year, month, day) + Report.new(reported_on: params[:reported_on].to_date) + else + Report.new(reported_on: Date.current) + end @report.learning_times.build return unless params[:id] report = current_user.reports.find(params[:id]) @report.title = report.title - @report.reported_on = Date.current @report.emotion = report.emotion @report.description = "\n" + report.description @report.practices = report.practices diff --git a/app/controllers/retirement_controller.rb b/app/controllers/retirement_controller.rb index 9ff0ab66557..3d0dd7a3245 100644 --- a/app/controllers/retirement_controller.rb +++ b/app/controllers/retirement_controller.rb @@ -15,6 +15,7 @@ def create UserMailer.retire(user).deliver_now destroy_subscription notify_to_admins + notify_to_mentors logout redirect_to retirement_url else @@ -37,4 +38,10 @@ def notify_to_admins NotificationFacade.retired(current_user, admin_user) end end + + def notify_to_mentors + User.mentor.each do |mentor_user| + NotificationFacade.retired(current_user, mentor_user) + end + end end diff --git a/app/helpers/talks_helper.rb b/app/helpers/talks_helper.rb index 455ee933a20..90d4bd1df2a 100644 --- a/app/helpers/talks_helper.rb +++ b/app/helpers/talks_helper.rb @@ -2,6 +2,6 @@ module TalksHelper def unreplied_index_path(talk) - admin_login? ? talks_unreplied_index_path : talk_path(talk) + admin_login? ? talks_unreplied_index_path : talk_path(talk, anchor: 'latest-comment') end end diff --git a/app/javascript/choices-ui.js b/app/javascript/choices-ui.js new file mode 100644 index 00000000000..3bcdcc93b49 --- /dev/null +++ b/app/javascript/choices-ui.js @@ -0,0 +1,31 @@ +import Choices from 'choices.js' + +document.addEventListener('DOMContentLoaded', () => { + const element = document.getElementById('js-company-select') + if (element) { + return new Choices(element, { + removeItemButton: true, + allowHTML: true, + searchResultLimit: 10, + searchPlaceholderValue: '検索ワード', + noResultsText: '一致する情報は見つかりません', + itemSelectText: '選択' + }) + } + + const elementMultipleSelect = document.getElementById( + 'js-choices-multiple-select' + ) + if (elementMultipleSelect) { + return new Choices(elementMultipleSelect, { + removeItemButton: true, + allowHTML: true, + searchResultLimit: 6, + searchPlaceholderValue: '検索ワード', + noResultsText: '一致する情報は見つかりません', + itemSelectText: '選択', + shouldSort: false, + renderSelectedChoices: 'always' + }) + } +}) diff --git a/app/javascript/comments.vue b/app/javascript/comments.vue index f4429382f9c..2682c860bd5 100644 --- a/app/javascript/comments.vue +++ b/app/javascript/comments.vue @@ -12,11 +12,12 @@ :key='comment.id', :comment='comment', :currentUser='currentUser', - :id='"comment_" + comment.id', + :id='index === comments.length - 1 ? "latest-comment" : "comment_" + comment.id', @delete='deleteComment', @update='updateComment' ) .thread-comment-form + #latest-comment(v-if='comments.length === 0') .thread-comment__author img.thread-comment__user-icon.a-user-icon( :src='currentUser.avatar_url', diff --git a/app/javascript/company-products.js b/app/javascript/company-products.js new file mode 100644 index 00000000000..4ee08cb83c1 --- /dev/null +++ b/app/javascript/company-products.js @@ -0,0 +1,24 @@ +import Vue from 'vue' +import CompanyProducts from './company-products.vue' + +document.addEventListener('DOMContentLoaded', () => { + const selector = '#js-company-products' + const products = document.querySelector(selector) + if (products) { + const title = products.getAttribute('data-title') + const companyID = products.getAttribute('company-id') + const isMentor = products.getAttribute('data-mentor-login') + const currentUserId = products.getAttribute('data-current-user-id') + new Vue({ + render: (h) => + h(CompanyProducts, { + props: { + title: title, + companyID: companyID, + isMentor: isMentor === 'true', + currentUserId: currentUserId + } + }) + }).$mount(selector) + } +}) diff --git a/app/javascript/company-products.vue b/app/javascript/company-products.vue new file mode 100644 index 00000000000..7780a61d37d --- /dev/null +++ b/app/javascript/company-products.vue @@ -0,0 +1,123 @@ + + + diff --git a/app/javascript/company-select.js b/app/javascript/company-select.js deleted file mode 100644 index 090bb57b84c..00000000000 --- a/app/javascript/company-select.js +++ /dev/null @@ -1,15 +0,0 @@ -import Choices from 'choices.js' - -document.addEventListener('DOMContentLoaded', () => { - const element = document.getElementById('js-company-select') - if (element) { - return new Choices(element, { - removeItemButton: true, - allowHTML: true, - searchResultLimit: 10, - searchPlaceholderValue: '検索ワード', - noResultsText: '一致する情報は見つかりません', - itemSelectText: '選択' - }) - } -}) diff --git a/app/javascript/courses-categories.vue b/app/javascript/courses-categories.vue index a00c168924f..7a75d202007 100644 --- a/app/javascript/courses-categories.vue +++ b/app/javascript/courses-categories.vue @@ -5,8 +5,6 @@ tr.admin-table__labels th.admin-table__label | 名前 - th.admin-table__label - | URLスラッグ th.admin-table__label.handle | 並び順 draggable.admin-table__items( @@ -22,8 +20,6 @@ ) td.admin-table__item-value | {{ coursesCategory.category.name }} - td.admin-table__item-value - | {{ coursesCategory.slug }} td.admin-table__item-value.is-text-align-center.is-grab span.js-grab.a-grab i.fa-solid.fa-align-justify diff --git a/app/javascript/courses-practices.vue b/app/javascript/courses-practices.vue index 5fb63f88fff..ca00357adf5 100644 --- a/app/javascript/courses-practices.vue +++ b/app/javascript/courses-practices.vue @@ -8,8 +8,7 @@ v-for='category in containsPractices', :key='category.id' ) - a.categories-item__anchor(:id='`category-${category.id}`') - header.categories-item__header + header.categories-item__header(:id='`category-${category.id}`') h2.categories-item__title | {{ category.name }} span.stamp.is-circle.is-solved( diff --git a/app/javascript/niconico_calendar.vue b/app/javascript/niconico_calendar.vue index 2437e3ba496..9ee4a4cac3b 100644 --- a/app/javascript/niconico_calendar.vue +++ b/app/javascript/niconico_calendar.vue @@ -56,6 +56,13 @@ :src='`/images/emotion/${date.emotion}.svg`', :alt='date.emotion' ) + a.niconico-calendar__day-inner( + v-else-if='date.date && isPastDate(date.date)', + :href='`/reports/new?reported_on=${calendarYear}-${calendarMonth}-${date.date}`' + ) + .niconico-calendar__day-label {{ date.date }} + .niconico-calendar__day-value + i.fas.fa-minus(v-if='date.date') .niconico-calendar__day-inner(v-else) .niconico-calendar__day-label {{ date.date }} .niconico-calendar__day-value @@ -247,6 +254,14 @@ export default { const params = new URLSearchParams(location.search) params.set('niconico_calendar', `${year}-${month}`) history.replaceState(history.state, '', `?${params}${location.hash}`) + }, + isPastDate(date) { + if (this.calendarYear > this.currentYear) return false + if (this.calendarYear < this.currentYear) return true + if (this.calendarMonth > this.currentMonth) return false + if (this.calendarMonth < this.currentMonth) return true + if (date > this.today) return false + return true } } } diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 7a902e7ea5f..c093bfd39e0 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -70,6 +70,7 @@ import '../generation-users.js' import '../learning-completion-message.js' import '../practices-pages.js' import '../users-questions.js' -import '../company-select.js' +import '../choices-ui.js' import '../users-answers.js' import '../training-info-toggler.js' +import '../company-products.js' diff --git a/app/javascript/question-edit.vue b/app/javascript/question-edit.vue index 5452c6e27ad..b10c9f5156e 100644 --- a/app/javascript/question-edit.vue +++ b/app/javascript/question-edit.vue @@ -34,13 +34,13 @@ | {{ updatedAt }} .thread-header__row .thread-header-title(:class='question.wip ? "is-wip" : ""') - .thread-header-title__label.is-solved.is-success( + .a-title-label.is-solved.is-success( v-if='question.correct_answer !== null' ) | 解決済 - .thread-header-title__label.is-wip(v-else-if='question.wip') + .a-title-label.is-wip(v-else-if='question.wip') | WIP - .thread-header-title__label.is-solved.is-danger(v-else) + .a-title-label.is-solved.is-danger(v-else) | 未解決 h1.thread-header-title__title | {{ title }} diff --git a/app/javascript/searchable.vue b/app/javascript/searchable.vue index 25f03e78cdc..ea38a9c4fe2 100644 --- a/app/javascript/searchable.vue +++ b/app/javascript/searchable.vue @@ -1,5 +1,5 @@