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 @@
+
+.page-body
+ .container(v-if='products.length === 0')
+ .o-empty-message
+ .o-empty-message__icon
+ i.far.fa-smile
+ p.o-empty-message__text
+ | {{ title }}はありません
+ .container.is-md(v-else)
+ nav.pagination(v-if='totalPages > 1')
+ pager(v-bind='pagerProps')
+ .thread-list.a-card
+ .thread-list__items
+ product(
+ v-for='product in products',
+ :key='product.id',
+ :product='product',
+ :currentUserId='currentUserId',
+ :isMentor='isMentor'
+ )
+ nav.pagination(v-if='totalPages > 1')
+ pager(v-bind='pagerProps')
+
+
+
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 @@
-.thread-list-item(:class='modelName')
+.thread-list-item(:class='searchableClass')
.thread-list-item__inner
.thread-list-item__label(v-if='searchable.is_comment_or_answer')
| {{ searchable.model_name_with_i18n }}
@@ -10,6 +10,8 @@
.thread-list-item__rows
.thread-list-item__row
.thread-list-item-title
+ .thread-list-item-title__icon.is-wip(v-if='searchable.wip')
+ | WIP
.thread-list-item-title__title
a.thread-list-item-title__link.a-text-link(:href='searchable.url')
| {{ searchable.title }}
@@ -59,9 +61,6 @@ export default {
}
},
computed: {
- modelName() {
- return `is-${this.searchable.model_name}`
- },
userUrl() {
return `/users/${this.searchable.user_id}`
},
@@ -94,6 +93,13 @@ export default {
} else {
return this.searchable.summary
}
+ },
+ searchableClass() {
+ if (this.searchable.wip) {
+ return `is-wip is-${this.searchable.model_name}`
+ } else {
+ return `is-${this.searchable.model_name}`
+ }
}
}
}
diff --git a/app/javascript/talk.vue b/app/javascript/talk.vue
index 93eb24be112..9dab363869f 100644
--- a/app/javascript/talk.vue
+++ b/app/javascript/talk.vue
@@ -12,7 +12,7 @@
.thread-list-item-title
h2.thread-list-item-title__title(itemprop='name')
a.thread-list-item-title__link.a-text-link(
- :href='`/talks/${talk.id}`',
+ :href='`/talks/${talk.id}#latest-comment`',
itemprop='url'
)
| {{ user.long_name }} さんの相談部屋
diff --git a/app/models/required_field.rb b/app/models/required_field.rb
index 55d5f37f4a8..a6d768d364b 100644
--- a/app/models/required_field.rb
+++ b/app/models/required_field.rb
@@ -10,10 +10,11 @@ class RequiredField
attribute :discord_account, :string
attribute :github_account, :string
attribute :blog_url, :string
+ attribute :graduated, :boolean
validates :avatar_attached, presence: { message: 'ユーザーアイコンを登録してください。' }
validates :tag_list_count, numericality: { greater_than: 0, message: 'タグを登録してください。' }
- validates :after_graduation_hope, presence: { message: 'フィヨルドブートキャンプを卒業した自分はどうなっていたいかを登録してください。' }
+ validates :after_graduation_hope, presence: { message: 'フィヨルドブートキャンプを卒業した自分はどうなっていたいかを登録してください。' }, unless: :graduated
validates :discord_account, presence: { message: 'Discordアカウントを登録してください。' }
validates :github_account, presence: { message: 'GitHubアカウントを登録してください。' }
validates :blog_url, presence: { message: 'ブログURLを登録してください。' }
diff --git a/app/views/announcements/_announcement.html.slim b/app/views/announcements/_announcement.html.slim
index c8794aebef1..9336d791966 100644
--- a/app/views/announcements/_announcement.html.slim
+++ b/app/views/announcements/_announcement.html.slim
@@ -38,8 +38,9 @@
| コピー
.thread__body
- .thread__description.a-long-text.is-md.js-markdown-view
- = announcement.description
+ .thread__description
+ .a-long-text.is-md.js-markdown-view
+ = announcement.description
= render 'reactions/reactions', reactionable: @announcement
.card-footer
.card-main-actions
diff --git a/app/views/api/searchables/_searchable.json.jbuilder b/app/views/api/searchables/_searchable.json.jbuilder
index 8dd6b6efe8d..f7e0f53894d 100644
--- a/app/views/api/searchables/_searchable.json.jbuilder
+++ b/app/views/api/searchables/_searchable.json.jbuilder
@@ -5,6 +5,7 @@ json.model_name document.class.to_s.tableize.singularize
json.model_name_with_i18n t("activerecord.models.#{document.class.to_s.tableize.singularize}")
json.summary searchable_summary(filtered_message(searchable), 90, params[:word])
json.updated_at searchable.updated_at
+json.wip searchable.respond_to?(:wip?) ? searchable.wip? : false
if searchable.respond_to?(:user)
json.login_name searchable.user.login_name
json.user_id searchable.user.id
diff --git a/app/views/card/_notice.html.slim b/app/views/application/_card_notice.html.slim
similarity index 100%
rename from app/views/card/_notice.html.slim
rename to app/views/application/_card_notice.html.slim
diff --git a/app/views/application/_global_nav.slim b/app/views/application/_global_nav.slim
index 7aa848c0731..f1196fd6831 100644
--- a/app/views/application/_global_nav.slim
+++ b/app/views/application/_global_nav.slim
@@ -62,12 +62,11 @@ nav.global-nav
.global-nav-links__link-icon
i.fa-solid.fa-hands-helping
.global-nav-links__link-label ヘルプ
- - if admin_login? || student_login?
- li.global-nav-links__item
- = link_to unreplied_index_path(current_user.talk), class: "global-nav-links__link #{current_link(/talk/)}" do
- .global-nav-links__link-icon
- i.fa-solid.fa-comment-alt-smile
- - if admin_or_mentor_login? && Talk.unreplied.count.positive?
- .global-nav__item-count.a-notification-count.is-only-mentor
- = Talk.unreplied.count
- .global-nav-links__link-label 相談
+ li.global-nav-links__item
+ = link_to unreplied_index_path(current_user.talk), class: "global-nav-links__link #{current_link(/talk/)}" do
+ .global-nav-links__link-icon
+ i.fa-solid.fa-comment-alt-smile
+ - if admin_or_mentor_login? && Talk.unreplied.count.positive?
+ .global-nav__item-count.a-notification-count.is-only-mentor
+ = Talk.unreplied.count
+ .global-nav-links__link-label 相談
diff --git a/app/views/application/_user_menu.html.slim b/app/views/application/_user_menu.html.slim
index 48ee21b58e5..8961c636015 100644
--- a/app/views/application/_user_menu.html.slim
+++ b/app/views/application/_user_menu.html.slim
@@ -6,17 +6,9 @@
li.header-dropdown__item
= link_to edit_current_user_path, class: 'header-dropdown__item-link' do
| 登録情報変更
- - if !current_user.adviser? && !current_user.mentor? && !current_user.trainee?
- - if current_user.card?
+ - if current_user.card?
li.header-dropdown__item
= link_to 'お支払い情報', billing_portal_path, method: :post, class: 'header-dropdown__item-link'
- li.header-dropdown__item
- = link_to 'クレジットカード情報', card_path, class: 'header-dropdown__item-link'
- li.header-dropdown__item
- = link_to 'クレジットカード変更', edit_card_path, class: 'header-dropdown__item-link'
- - else
- li.header-dropdown__item
- = link_to 'クレジットカード登録', new_card_path, class: 'header-dropdown__item-link'
li.header-dropdown__item
= link_to logout_path, class: 'header-dropdown__item-link' do
| ログアウト
diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim
index bae4201285a..6dee303b254 100644
--- a/app/views/articles/show.html.slim
+++ b/app/views/articles/show.html.slim
@@ -26,7 +26,7 @@
.article__body
.js-markdown-view.a-long-text.is-md
= @article.body
- - if admin_login?
+ - if admin_or_mentor_login?
.article__actions
ul
li
diff --git a/app/views/card/_form.html.slim b/app/views/card/_form.html.slim
deleted file mode 100644
index 8e6c50d7eba..00000000000
--- a/app/views/card/_form.html.slim
+++ /dev/null
@@ -1,18 +0,0 @@
-- method = action == :new ? 'post' : 'put'
-= javascript_include_tag 'https://js.stripe.com/v3/'
-= form_with url: card_path, method: method, local: true, id: 'payment-form' do |_|
- = hidden_field_tag :idempotency_token, SecureRandom.uuid
- .form__items
- .form-item
- label.a-form-label(for='card-element') カード番号
- #card-element.a-text-input
- .a-form-help
- p
- | 対応ブランド:Visa、Master、JCB、Diners、Amex
- br
- | プリペイドのクレジットカードは登録できない場合があります。
- #card-errors(role='alert')
- .form-actions
- ul.form-actions__items
- li.form-actions__item.is-main
- = submit_tag 'カードを登録', class: 'a-button is-lg is-warning is-block'
diff --git a/app/views/card/edit.html.slim b/app/views/card/edit.html.slim
deleted file mode 100644
index 317a6b966c6..00000000000
--- a/app/views/card/edit.html.slim
+++ /dev/null
@@ -1,16 +0,0 @@
-- title 'クレジットカード変更'
-
-header.page-header
- .container
- .page-header__inner
- h2.page-header__title
- = title
-
-.page-body
- .auth-form.is-sign-up.a-card.is-in-app
- header.auth-form__header
- h1.auth-form__title
- | クレジットカード変更
- .auth-form__body
- = render 'form', action: :edit
- = render 'notice'
diff --git a/app/views/card/new.html.slim b/app/views/card/new.html.slim
deleted file mode 100644
index 7776560a236..00000000000
--- a/app/views/card/new.html.slim
+++ /dev/null
@@ -1,17 +0,0 @@
-- if current_user.card?
- - title 'クレジットカード変更'
-- else
- - title 'クレジットカード登録'
-
-header.page-header
- .container
- .page-header__inner
- h2.page-header__title = title
-
-.auth-form.is-sign-up.is-in-app
- .a-card
- header.auth-form__header
- h1.auth-form__title = title
- .auth-form__body
- = render 'form', action: :new
-= render 'notice'
diff --git a/app/views/card/show.html.slim b/app/views/card/show.html.slim
deleted file mode 100644
index dcc43e32305..00000000000
--- a/app/views/card/show.html.slim
+++ /dev/null
@@ -1,28 +0,0 @@
-- title '登録済クレジットカード'
-
-header.page-header
- .container
- .page-header__inner
- h2.page-header__title = title
-
-.auth-form.is-sign-up.a-card.is-in-app
- .a-card
- header.auth-form__header
- h1.auth-form__title
- | 登録済クレジットカード
- .auth-form__body
- .form__items
- .form-item
- .a-text-input.is-inputed.is-align-center
- | #{@card['brand']} **** **** **** #{@card['last4']} #{format('%02d', @card['exp_month'].to_i)}/#{@card['exp_year']}
- .form-actions
- ul.form-actions__items
- li.form-actions__item.is-main
- = link_to 'カード変更', edit_card_path, class: 'a-button is-lg is-warning is-block'
- .auth-form__footer
- .next-settlement-time
- h2.next-settlement-time__title
- | 次回決済日時
- .next-settlement-time__time
- = l Time.zone.at(current_user.subscription['current_period_end'])
-= render 'notice'
diff --git a/app/views/companies/products/index.html.slim b/app/views/companies/products/index.html.slim
index efd11a3e7f3..ad0656bf63d 100644
--- a/app/views/companies/products/index.html.slim
+++ b/app/views/companies/products/index.html.slim
@@ -8,9 +8,4 @@ header.page-header
= render 'companies/tabs', company: @company
.page-body
- .container.is-md
- = paginate @products
- - if @products.present?
- .thread-list.a-card
- = render partial: 'products/product', collection: @products, as: :product
- = paginate @products
+ #js-company-products(company-id="#{@company.id}" data-title="#{title}" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
diff --git a/app/views/courses/practices/sort/index.html.slim b/app/views/courses/practices/sort/index.html.slim
index 5d4a128257a..9342ab77c5f 100644
--- a/app/views/courses/practices/sort/index.html.slim
+++ b/app/views/courses/practices/sort/index.html.slim
@@ -27,8 +27,7 @@ header.page-header
- @categories.each do |category|
- if category.practices.present?
.categories-item.practices
- 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
.categories-item__description
diff --git a/app/views/events/_event.html.slim b/app/views/events/_event.html.slim
index 8bf49b09efe..96292776561 100644
--- a/app/views/events/_event.html.slim
+++ b/app/views/events/_event.html.slim
@@ -22,7 +22,7 @@
.thread-header__row
h1.thread-header-title
- if event.wip?
- span.thread-header-title__label
+ span.a-title-label
| WIP
span.thread-header-title__title
= event.title
diff --git a/app/views/pages/show.html.slim b/app/views/pages/show.html.slim
index 617e87fe951..959371d4a38 100644
--- a/app/views/pages/show.html.slim
+++ b/app/views/pages/show.html.slim
@@ -94,8 +94,9 @@ header.page-header
data-page-id="#{@page.id}"
)
.thread__body
- .thread__description.js-markdown-view.a-long-text.is-md
- = @page.body
+ .thread__description
+ .a-long-text.is-md.js-markdown-view
+ = @page.body
= render 'reactions/reactions', reactionable: @page
footer.card-footer
.card-main-actions
diff --git a/app/views/products/_message_for_after_submission.html.slim b/app/views/products/_message_for_after_submission.html.slim
new file mode 100644
index 00000000000..0df58cfee14
--- /dev/null
+++ b/app/views/products/_message_for_after_submission.html.slim
@@ -0,0 +1,8 @@
+.a-page-alert
+ .container.is-md
+ .a-page-alert__inner
+ .a-short-text
+ p
+ | 7日以内にメンターがレビューしますので、次のプラクティスにお進みください。
+ br
+ | もし、7日以上経ってもレビューされない場合は、メンターにお問い合わせください。
diff --git a/app/views/products/_message_for_wip.html.slim b/app/views/products/_message_for_wip.html.slim
new file mode 100644
index 00000000000..95cd586ef0b
--- /dev/null
+++ b/app/views/products/_message_for_wip.html.slim
@@ -0,0 +1,6 @@
+.a-page-alert
+ .container.is-md
+ .a-page-alert__inner
+ .a-short-text.is-ta-center
+ p
+ | 提出物はまだ提出されていません。
完成したら「提出する」をクリック!
diff --git a/app/views/products/_product_body.html.slim b/app/views/products/_product_body.html.slim
new file mode 100644
index 00000000000..0d6ea0502c5
--- /dev/null
+++ b/app/views/products/_product_body.html.slim
@@ -0,0 +1,45 @@
+.thread.has-no-author
+ .thread__inner.a-card
+ header.card-header.is-sm
+ h2.card-header__title
+ | 提出物
+ .thread__description
+ .a-long-text.is-md.js-markdown-view(data-taskable-id="#{product.id}" data-taskable-type='Product' data-taskable="#{product.taskable?(current_user).to_s}")
+ = product.body
+ = render 'reactions/reactions', reactionable: product
+
+ - if product.user == current_user || admin_or_mentor_login?
+ .card-footer
+ .card-main-actions
+ ul.card-main-actions__items
+ - if product.wip?
+ li.card-main-actions__item
+ = form_with model: product, local: true do |f|
+ = f.hidden_field :body
+ = f.submit '提出する', class: 'a-button is-md is-warning is-block'
+ li.card-main-actions__item
+ = link_to edit_product_path(product), class: 'card-main-actions_action a-button is-md is-secondary is-block' do
+ i.fa-solid.fa-pen
+ | 内容修正
+ li.card-main-actions__item.is-sub.is-only-mentor
+ = link_to product, data: { confirm: '本当によろしいですか?' }, method: :delete, class: 'card-main-actions__muted-action' do
+ | 削除する
+
+ - if (product.user.daimyo? && staff_login?) || admin_or_mentor_login?
+ #js-check(data-checkable-id="#{product.id}"
+ data-checkable-type='Product'
+ data-checkable-label="#{Product.model_name.human}"
+ data-checker-id="#{product.checker_id}"
+ data-checker-name="#{product.checker_name}"
+ data-checker-avatar="#{product.checker_avatar}"
+ data-current-user-id="#{current_user.id}")
+
+ .thread-prev-next
+ .thread-prev-next__item
+ = link_to product.practice, class: 'thread-prev-next__item-link is-index' do
+ | プラクティスに戻る
+ - if current_user.mentor?
+ .thread-prev-next__item.is-only-mentor
+ = link_to '提出物・自分の担当', products_self_assigned_index_path, class: 'thread-prev-next__item-link is-index'
+ .thread-prev-next__item.is-only-mentor
+ = link_to '提出物・未アサイン', products_unassigned_index_path, class: 'thread-prev-next__item-link is-index'
diff --git a/app/views/products/_product_header.html.slim b/app/views/products/_product_header.html.slim
new file mode 100644
index 00000000000..f0c853e685b
--- /dev/null
+++ b/app/views/products/_product_header.html.slim
@@ -0,0 +1,61 @@
+header.product-header
+ #js-check-stamp(data-checkable-id="#{@product.id}" data-checkable-type='Product')
+ .product-header__start
+ .product-header__user
+ = render 'users/icon', user: @product.user, link_class: 'product-header__user-link', image_class: 'product-header__user-icon'
+ .product-header__end
+ .thread-header__row
+ = link_to @product.user, class: 'a-user-name' do
+ = @product.user.long_name
+ h1.product-header__title(class="#{@product.wip? ? 'is-wip' : ''}")
+ - if @product.user.daimyo?
+ | ★
+ - if @product.wip?
+ span.a-title-label
+ | WIP
+ | #{link_to @product.practice.title, @product.practice, class: 'product-header__title-link'}の提出物
+ .thread-header__row
+ .thread-header-metas
+ .thread-header-metas__start
+ .thread-header-metas__meta
+ .a-meta
+ - if @product.wip?
+ .a-meta__value
+ | 提出物作成中
+ - elsif @product.published_at.present?
+ span.a-meta__label
+ | 提出日
+ time.a-meta__value(datetime="#{@product.published_at.to_datetime}")
+ = l @product.published_at
+ - else
+ span.a-meta__label
+ | 提出日
+ time.a-meta__value(datetime="#{@product.created_at.to_datetime}")
+ = l @product.created_at
+
+ - if @product.updated_at.present?
+ .thread-header-metas__meta
+ .a-meta
+ span.a-meta__label
+ | 更新
+ time.a-meta__value(datetime="#{@product.updated_at.to_datetime}")
+ = l @product.updated_at
+
+ .thread-header-metas__meta
+ - length = @product.comments.length
+ a.a-meta(href='#comments' class="#{length.zero? ? 'is-disabled' : ''}")
+ | コメント(
+ span(class="#{length.zero? ? 'is-muted' : 'is-emphasized'}")
+ = length
+ | )
+
+ .thread-header__row
+ .thread-header-actions
+ .thread-header-actions__start
+ .thread-header-actions__action
+ #js-watch-toggle(data-watchable-id="#{@product.id}", data-watchable-type='Product')
+ .thread-header-actions__action
+ #js-bookmark(data-bookmarkable-id="#{@product.id}", data-bookmarkable-type='Product')
+ .thread-header-actions__end
+ .thread-header-actions__action
+ = link_to 'Raw', product_path(format: :md), class: 'a-button is-sm is-secondary is-block', target: '_blank', rel: 'noopener'
diff --git a/app/views/products/_product_practice_goal.html.slim b/app/views/products/_product_practice_goal.html.slim
new file mode 100644
index 00000000000..e2fd6f66bdd
--- /dev/null
+++ b/app/views/products/_product_practice_goal.html.slim
@@ -0,0 +1,13 @@
+.thread.has-no-author
+ .thread__inner.a-card.is-toggle
+ input.a-toggle-checkbox#toggle_goal_body(type='checkbox')
+ label.card-header.is-sm(for='toggle_goal_body')
+ h2.card-header__title
+ | 終了条件を確認
+ .is-hidden-then-checked
+ i.fas.fa-angle-down
+ .is-hidden-then-unchecked
+ i.fas.fa-angle-up
+ .thread__description
+ .a-long-text.is-md.js-markdown-view
+ = product.practice.goal
diff --git a/app/views/products/index.html.slim b/app/views/products/index.html.slim
index 205851b0c91..2a5b8e1b35e 100644
--- a/app/views/products/index.html.slim
+++ b/app/views/products/index.html.slim
@@ -9,4 +9,4 @@ header.page-header
- if current_user.admin? || current_user.mentor?
= render 'products/tabs'
-#js-products(data-title="#{title}" data-selected-tab="all" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
+ #js-products(data-title="#{title}" data-selected-tab="all" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
diff --git a/app/views/products/show.html.slim b/app/views/products/show.html.slim
index fd5f24c9d4b..cbb0773ca71 100644
--- a/app/views/products/show.html.slim
+++ b/app/views/products/show.html.slim
@@ -18,22 +18,20 @@ header.page-header
class: 'a-button is-md is-secondary is-block is-back' do
| プラクティス一覧
- if current_user.admin?
- li.page-header-actions__item
+ li.page-header-actions__item.is-only-mentor
= link_to products_unchecked_index_path, class: 'a-button is-md is-secondary is-block is-back' do
| 未完了一覧
= render 'page_tabs', resource: @product.practice
.page-body
+
- if @product.user == current_user && !@product.wip? && !@product.checked? && @product.commented_users.mentor.empty?
- .a-page-alert
- .container.is-md
- .a-page-alert__inner
- .a-short-text
- p
- | 7日以内にメンターがレビューしますので、次のプラクティスにお進みください。
- br
- | もし、7日以上経ってもレビューされない場合は、メンターにお問い合わせください。
+ = render 'message_for_after_submission'
+
+ - if @product.wip?
+ = render 'message_for_wip'
+
//
[TODO]完了Tweetの正式リリース後にコメントを外す
- if @product.user == current_user && @learning&.complete?
@@ -42,116 +40,12 @@ header.page-header
.container.is-xxxl
div(class="#{current_user.mentor? || current_user.admin? ? 'row is-jc:c' : ''}")
div(class="#{current_user.mentor? || current_user.admin? ? 'col-xl-7 col-xs-12' : ''}")
- .thread
- .thread__inner.a-card
- header.thread-header
- #js-check-stamp(data-checkable-id="#{@product.id}" data-checkable-type='Product')
- .thread-header__row
- .thread-header-metas
- .thread-header-metas__start
- .thread-header-metas__meta
- = link_to @product.user, class: 'a-user-name' do
- = @product.user.long_name
- .thread-header-metas__end
- .thread-header-metas__meta
- - length = @product.comments.length
- a.a-meta(href='#comments' class="#{length.zero? ? 'is-disabled' : ''}")
- | コメント(
- span(class="#{length.zero? ? 'is-muted' : 'is-emphasized'}")
- = length
- | )
- .thread-header__row
- h1.thread-header-title(class="#{@product.wip? ? 'is-wip' : ''}")
- - if @product.wip?
- span.thread-header-title__label
- | WIP
- span.thread-header-title__title
- - if @product.user.daimyo?
- | ★
- | #{link_to @product.practice.title, @product.practice, class: 'thread-header-title__link'}の提出物
- .thread-header__row
- .thread-header-metas
- .thread-header-metas__start
- .thread-header-metas__meta
- .a-meta
- - if @product.wip?
- .a-meta__value
- | 提出物作成中
- - elsif @product.published_at.present?
- span.a-meta__label
- | 提出日
- time.a-meta__value(datetime="#{@product.published_at.to_datetime}")
- = l @product.published_at
- - else
- span.a-meta__label
- | 提出日
- time.a-meta__value(datetime="#{@product.created_at.to_datetime}")
- = l @product.created_at
-
- - if @product.updated_at.present?
- .thread-header-metas__meta
- .a-meta
- span.a-meta__label
- | 更新
- time.a-meta__value(datetime="#{@product.updated_at.to_datetime}")
- = l @product.updated_at
-
- .thread-header__row
- .thread-header-actions
- .thread-header-actions__start
- .thread-header-actions__action
- #js-watch-toggle(data-watchable-id="#{@product.id}", data-watchable-type='Product')
- .thread-header-actions__action
- #js-bookmark(data-bookmarkable-id="#{@product.id}", data-bookmarkable-type='Product')
- .thread-header-actions__end
- .thread-header-actions__action
- = link_to 'Raw', product_path(format: :md), class: 'a-button is-sm is-secondary is-block', target: '_blank', rel: 'noopener'
- - if @product.wip?
- .thread__warning-message
- | まだ提出されていません。
完成したら「提出する」をクリック!
- .thread__description.a-long-text.is-md.js-markdown-view
- = @product.practice.goal
- .thread__description.a-long-text.is-md.js-markdown-view(data-taskable-id="#{@product.id}" data-taskable-type='Product' data-taskable="#{@product.taskable?(current_user).to_s}")
- = @product.body
- = render 'reactions/reactions', reactionable: @product
-
- - if @product.user == current_user || admin_or_mentor_login?
- .card-footer
- .card-main-actions
- ul.card-main-actions__items
- - if @product.wip?
- li.card-main-actions__item
- = form_with model: @product, local: true do |f|
- = f.hidden_field :body
- = f.submit '提出する', class: 'a-button is-md is-warning is-block'
- li.card-main-actions__item
- = link_to edit_product_path(@product), class: 'card-main-actions_action a-button is-md is-secondary is-block' do
- i.fa-solid.fa-pen
- | 内容修正
- li.card-main-actions__item.is-sub
- = link_to @product, data: { confirm: '本当によろしいですか?' }, method: :delete, class: 'card-main-actions__muted-action' do
- | 削除する
-
- - if (@product.user.daimyo? && staff_login?) || admin_or_mentor_login?
- #js-check(data-checkable-id="#{@product.id}"
- data-checkable-type='Product'
- data-checkable-label="#{Product.model_name.human}"
- data-checker-id="#{@product.checker_id}"
- data-checker-name="#{@product.checker_name}"
- data-checker-avatar="#{@product.checker_avatar}"
- data-current-user-id="#{current_user.id}")
- .thread-prev-next
- .thread-prev-next__item
- = link_to @product.practice, class: 'thread-prev-next__item-link is-index' do
- | プラクティスに戻る
- - if current_user.mentor?
- .thread-prev-next__item
- = link_to '提出物・自分の担当', products_self_assigned_index_path, class: 'thread-prev-next__item-link is-index'
- .thread-prev-next__item
- = link_to '提出物・未アサイン', products_unassigned_index_path, class: 'thread-prev-next__item-link is-index'
+ .product
+ = render 'product_header', product: @product
+ = render 'product_practice_goal', product: @product
+ = render 'product_body', product: @product
- = render 'users/icon', user: @product.user, link_class: 'thread__user-link', image_class: 'thread__user-icon'
#js-comments(data-commentable-id="#{@product.id}" data-commentable-type='Product' data-current-user-id="#{current_user.id}")
= render 'footprints/footprints', footprints: @footprints
diff --git a/app/views/reports/_form.html.slim b/app/views/reports/_form.html.slim
index e99302ecc05..429bb8c0a1f 100644
--- a/app/views/reports/_form.html.slim
+++ b/app/views/reports/_form.html.slim
@@ -5,7 +5,7 @@
.form-item
= f.label :practice, class: 'a-form-label'
.select-practices
- = f.select(:practice_ids, practice_options_within_course, { include_hidden: false }, { multiple: true, class: 'js-select2' })
+ = f.select(:practice_ids, practice_options_within_course, { include_hidden: false }, { multiple: true, id: 'js-choices-multiple-select' })
.form-item
= f.label :title, class: 'a-form-label'
= f.text_field :title, class: 'a-text-input js-warning-form', placeholder: 'display: inline-block の挙動の調査を進めた'
diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim
index 09490201231..e8e2b71324d 100644
--- a/app/views/reports/show.html.slim
+++ b/app/views/reports/show.html.slim
@@ -98,8 +98,9 @@ header.page-header
= render 'reports/learning_times', report: @report
.thread__body
- .thread__description.a-long-text.is-md.js-markdown-view(data-taskable-id="#{@report.id}" data-taskable-type='Report' data-taskable="#{@report.taskable?(current_user).to_s}")
- = @report.description
+ .thread__description
+ .a-long-text.is-md.js-markdown-view(data-taskable-id="#{@report.id}" data-taskable-type='Report' data-taskable="#{@report.taskable?(current_user).to_s}")
+ = @report.description
= render 'reactions/reactions', reactionable: @report
- if @report.user_id == current_user.id
diff --git a/app/views/talks/show.html.slim b/app/views/talks/show.html.slim
index 0f11be21400..00104a70195 100644
--- a/app/views/talks/show.html.slim
+++ b/app/views/talks/show.html.slim
@@ -17,10 +17,11 @@ header.page-header
h1.thread-header-title
= title
.thread__body
- .thread__description.a-long-text.is-md
- p
- | ここは#{@user.login_name}さんと管理者のみが閲覧することのできる相談部屋です。
- | 就職に関することや受講に関することなど、何か相談したいことがある場合にお気軽にコメントをしてください。
+ .thread__description
+ .a-long-text.is-md
+ p
+ | ここは#{@user.login_name}さんと管理者のみが閲覧することのできる相談部屋です。
+ | 就職に関することや受講に関することなど、何か相談したいことがある場合にお気軽にコメントをしてください。
.thread-footer
.thread-footer__inner
.thread-members
diff --git a/app/views/users/_form.html.slim b/app/views/users/_form.html.slim
index 299598f1443..90d235b6ac4 100644
--- a/app/views/users/_form.html.slim
+++ b/app/views/users/_form.html.slim
@@ -52,6 +52,7 @@
- if admin_login?
.form__items
h3.form__items-title 以下管理者のみ操作ができます
+ = render 'users/form/course', f: f
= render 'users/form/job_seeking', f: f
= render 'users/form/company', f: f
= render 'users/form/retire', f: f
diff --git a/app/views/users/form/_card.html.slim b/app/views/users/form/_card.html.slim
index 4580ae83ac6..0ad0442450f 100644
--- a/app/views/users/form/_card.html.slim
+++ b/app/views/users/form/_card.html.slim
@@ -8,4 +8,4 @@
br
| プリペイドのクレジットカードは登録できない場合があります。
#card-errors(role='alert')
- = render '/card/notice'
+ = render 'card_notice'
diff --git a/app/views/users/form/_course.html.slim b/app/views/users/form/_course.html.slim
index 57caac1079c..6f72d6b7d2c 100644
--- a/app/views/users/form/_course.html.slim
+++ b/app/views/users/form/_course.html.slim
@@ -1,4 +1,4 @@
-.form-item.is-hidden
+.form-item
= f.label :course_id, class: 'a-form-label is-required'
.a-button.is-md.is-secondary.is-select.is-block
= f.collection_select :course_id, Course.order(:created_at), :id, :title, {}
diff --git a/config/routes.rb b/config/routes.rb
index 6831ceee8fc..6a3fb569f66 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -24,7 +24,6 @@
draw :reports
resources :announcements
resource :retirement, only: %i(show new create), controller: "retirement"
- resource :card, only: %i(show new create edit update), controller: "card"
resource :current_user, only: %i(edit update), controller: "current_user" do
resource :password, only: %i(edit update), controller: "current_user/password"
end
diff --git a/test/integration/api/products_test.rb b/test/integration/api/products_test.rb
index 988cfd6327a..6053efe9a8b 100644
--- a/test/integration/api/products_test.rb
+++ b/test/integration/api/products_test.rb
@@ -3,8 +3,6 @@
require 'test_helper'
class API::ProductsTest < ActionDispatch::IntegrationTest
- fixtures :products
-
test 'GET /api/products.json' do
get api_products_path(format: :json)
assert_response :unauthorized
@@ -54,4 +52,15 @@ class API::ProductsTest < ActionDispatch::IntegrationTest
actual = response.parsed_body['products'].map { |product| product['practice']['title'] }
assert_equal expected, actual
end
+
+ test 'GET /api/products.json?company_id=362477616' do
+ company = companies(:company4)
+ get api_products_path(company_id: company.id, format: :json)
+ assert_response :unauthorized
+
+ token = create_token('kimura', 'testtest')
+ get api_products_path(company_id: company.id, format: :json),
+ headers: { 'Authorization' => "Bearer #{token}" }
+ assert_response :ok
+ end
end
diff --git a/test/system/admin/users_test.rb b/test/system/admin/users_test.rb
index 899458ccf86..c52542d7581 100644
--- a/test/system/admin/users_test.rb
+++ b/test/system/admin/users_test.rb
@@ -216,4 +216,21 @@ class Admin::UsersTest < ApplicationSystemTestCase
assert has_checked_field?('user_trainee', visible: false)
assert has_field?('user_training_ends_on', with: '')
end
+
+ test 'admin can change user course' do
+ user = users(:kensyu)
+ visit_with_auth "/admin/users/#{user.id}/edit", 'machida'
+ within 'form[name=user]' do
+ select 'iOSプログラマー', from: 'user[course_id]'
+ end
+ click_on '更新する'
+ assert_equal 'iOSプログラマー', user.reload.course.title
+ end
+
+ test 'general user cannot change user course' do
+ user = users(:kensyu)
+ visit_with_auth "/admin/users/#{user.id}/edit", 'kimura'
+ assert_current_path('/')
+ assert_text '管理者としてログインしてください'
+ end
end
diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb
index 6fcdd6086a1..1ca6d62d949 100644
--- a/test/system/articles_test.rb
+++ b/test/system/articles_test.rb
@@ -135,4 +135,70 @@ class ArticlesTest < ApplicationSystemTestCase
visit_with_auth articles_url, 'komagata'
find 'nav.pagination'
end
+
+ test "general user can't see edit and delete buttons" do
+ visit_with_auth article_path(@article), 'kimura'
+ assert_no_text '内容修正'
+ assert_no_text '削除'
+ end
+
+ test 'admin can see edit and delete buttons' do
+ visit_with_auth article_path(@article), 'komagata'
+ assert_text '内容修正'
+ assert_text '削除'
+ end
+
+ test 'mentor can see edit and delete buttons' do
+ visit_with_auth article_path(@article), 'mentormentaro'
+ assert_text '内容修正'
+ assert_text '削除'
+ end
+
+ test 'admin can edit an article' do
+ visit_with_auth article_path(@article), 'komagata'
+ assert_text @article.title
+ click_on '内容修正'
+
+ fill_in 'article[title]', with: 'edited by mentor'
+ click_on '更新する'
+
+ visit article_path(@article)
+ assert_text 'edited by mentor'
+ end
+
+ test 'mentor can edit an article' do
+ visit_with_auth article_path(@article), 'mentormentaro'
+ assert_text @article.title
+ click_on '内容修正'
+
+ fill_in 'article[title]', with: 'edited by mentor'
+ click_on '更新する'
+
+ visit article_path(@article)
+ assert_text 'edited by mentor'
+ end
+
+ test 'admin can delete an article' do
+ visit_with_auth articles_path, 'komagata'
+ assert_text @article.title
+
+ visit article_path(@article)
+ accept_confirm do
+ click_on '削除'
+ end
+
+ assert_no_text @article.title
+ end
+
+ test 'mentor can delete an article' do
+ visit_with_auth articles_path, 'mentormentaro'
+ assert_text @article.title
+
+ visit article_path(@article)
+ accept_confirm do
+ click_on '削除'
+ end
+
+ assert_no_text @article.title
+ end
end
diff --git a/test/system/home_test.rb b/test/system/home_test.rb
index 1715f1930b1..78c78f05422 100644
--- a/test/system/home_test.rb
+++ b/test/system/home_test.rb
@@ -82,6 +82,12 @@ class HomeTest < ApplicationSystemTestCase
assert_no_text 'ブログURLを登録してください。'
end
+ test 'not show message of after_graduation_hope for graduated user' do
+ visit_with_auth '/', 'sotugyou'
+ assert_selector 'h2.page-header__title', text: 'ダッシュボード'
+ assert_no_text 'フィヨルドブートキャンプを卒業した自分はどうなっていたいかを登録してください。'
+ end
+
test 'not show messages of required field' do
user = users(:hatsuno)
# hatsuno の未入力項目を登録
@@ -144,6 +150,23 @@ class HomeTest < ApplicationSystemTestCase
assert_current_path(/niconico_calendar=#{1.month.ago.strftime('%Y-%m')}/)
end
+ test 'set a link to the new report form at today on Nico Nico calendar' do
+ visit_with_auth "/?niconico_calendar=#{Time.current.strftime('%Y-%m')}", 'hajime'
+ find('.niconico-calendar').click_on Time.current.day.to_s
+ assert_current_path("/reports/new?reported_on=#{Time.current.strftime('%Y-%-m-%-d')}")
+ end
+
+ test 'set a link to the new report form at past date on Nico Nico calendar' do
+ visit_with_auth '/?niconico_calendar=2022-03', 'hajime'
+ find('.niconico-calendar').click_on '1'
+ assert_current_path('/reports/new?reported_on=2022-3-1')
+ end
+
+ test 'no link to the new report on future dates in the Nico Nico calendar' do
+ visit_with_auth "/?niconico_calendar=#{Time.current.next_month.strftime('%Y-%m')}", 'hajime'
+ assert_no_link(href: "/reports/new?reported_on=#{Time.current.next_month.strftime('%Y-%-m-%-d')}")
+ end
+
test 'show the grass for student' do
assert users(:kimura).student?
visit_with_auth '/', 'kimura'
diff --git a/test/system/practice/questions_test.rb b/test/system/practice/questions_test.rb
index 56dc1c79ef8..4031d59ca8f 100644
--- a/test/system/practice/questions_test.rb
+++ b/test/system/practice/questions_test.rb
@@ -7,4 +7,15 @@ class Practice::QuestionsTest < ApplicationSystemTestCase
visit_with_auth "/practices/#{practices(:practice1).id}/questions", 'hatsuno'
assert_equal 'OS X Mountain Lionをクリーンインストールする | FJORD BOOT CAMP(フィヨルドブートキャンプ)', title
end
+
+ test 'show a WIP question on the all questions list ' do
+ visit_with_auth "/practices/#{practices(:practice1).id}/questions", 'hatsuno'
+ assert_text 'wipテスト用の質問(wip中)'
+ end
+
+ test 'not show a WIP question on the unsolved questions list ' do
+ visit_with_auth "/practices/#{practices(:practice1).id}/questions?not_solved=true", 'hatsuno'
+ assert_no_text 'wipテスト用の質問(wip中)'
+ assert_selector('a.tab-nav__item-link.is-active', text: '未解決')
+ end
end
diff --git a/test/system/practices_test.rb b/test/system/practices_test.rb
index 87dd9414c81..df11f7ee5d7 100644
--- a/test/system/practices_test.rb
+++ b/test/system/practices_test.rb
@@ -265,4 +265,18 @@ def wait_for_status_change
visit "/practices/#{practices(:practice2).id}"
assert_text '困った時は'
end
+
+ test 'not show common description block when practice_common_description is wip' do
+ pages(:page10).update!(wip: true) # practice_common_description
+ visit_with_auth "/practices/#{practices(:practice1).id}", 'hajime'
+ assert_selector '.page-header__title', text: 'OS X Mountain Lionをクリーンインストールする'
+ assert_no_selector '.common-page-body', text: '困った時は'
+ end
+
+ test 'not show common description block when practice_common_description does not exist' do
+ pages(:page10).delete # practice_common_description
+ visit_with_auth "/practices/#{practices(:practice1).id}", 'hajime'
+ assert_selector '.page-header__title', text: 'OS X Mountain Lionをクリーンインストールする'
+ assert_no_selector '.common-page-body', text: '困った時は'
+ end
end
diff --git a/test/system/questions_test.rb b/test/system/questions_test.rb
index b520a85c913..48c4bfd8fd4 100644
--- a/test/system/questions_test.rb
+++ b/test/system/questions_test.rb
@@ -252,7 +252,7 @@ class QuestionsTest < ApplicationSystemTestCase
end
assert_text '質問をWIPとして保存しました。'
- visit_with_auth questions_path, 'komagata'
+ visit_with_auth questions_path(all: 'true'), 'komagata'
click_link 'WIPタイトル'
assert_text '削除する'
assert_no_text 'Watch中'
@@ -267,7 +267,7 @@ class QuestionsTest < ApplicationSystemTestCase
end
assert_text '質問をWIPとして保存しました。'
- visit questions_path
+ visit questions_path(all: 'true')
click_link 'WIPタイトル'
assert_text '削除する'
click_button '内容修正'
@@ -312,7 +312,7 @@ class QuestionsTest < ApplicationSystemTestCase
fill_in 'question[description]', with: '更新されたWIP本文'
end
click_button 'WIP'
- assert_selector '.thread-header-title__label.is-wip', text: 'WIP'
+ assert_selector '.a-title-label.is-wip', text: 'WIP'
end
test 'update a WIP question as published' do
@@ -324,7 +324,7 @@ class QuestionsTest < ApplicationSystemTestCase
fill_in 'question[description]', with: '更新された本文'
end
click_button '質問を公開'
- assert_selector '.thread-header-title__label.is-solved.is-danger', text: '未解決'
+ assert_selector '.a-title-label.is-solved.is-danger', text: '未解決'
end
test 'update a published question as WIP' do
@@ -336,11 +336,11 @@ class QuestionsTest < ApplicationSystemTestCase
fill_in 'question[description]', with: '更新されたWIP本文'
end
click_button 'WIP'
- assert_selector '.thread-header-title__label.is-wip', text: 'WIP'
+ assert_selector '.a-title-label.is-wip', text: 'WIP'
end
- test 'show a WIP question on the Q&A list page' do
- visit_with_auth questions_path, 'kimura'
+ test 'show a WIP question on the All Q&A list page' do
+ visit_with_auth questions_path(all: 'true'), 'kimura'
assert_text 'wipテスト用の質問(wip中)'
element = all('.thread-list-item').find { |component| component.has_text?('wipテスト用の質問(wip中)') }
within element do
@@ -348,6 +348,12 @@ class QuestionsTest < ApplicationSystemTestCase
end
end
+ test 'not show a WIP question on the unsolved Q&A list page' do
+ visit_with_auth questions_path, 'kimura'
+ assert_no_text 'wipテスト用の質問(wip中)'
+ assert_text '未解決の質問一覧'
+ end
+
test "visit user profile page when clicked on user's name on question" do
visit_with_auth questions_path, 'kimura'
assert_text '質問のタブの作り方'
diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb
index ce09d94636c..72c5408816b 100644
--- a/test/system/reports_test.rb
+++ b/test/system/reports_test.rb
@@ -71,7 +71,7 @@ class ReportsTest < ApplicationSystemTestCase
report = reports(:report10)
visit_with_auth "/reports/#{report.id}", 'hajime'
click_link '内容修正'
- first('.select2-selection__choice__remove').click
+ first('.choices__button').click
click_button '内容変更'
assert_no_text 'Terminalの基礎を覚える'
@@ -130,24 +130,24 @@ class ReportsTest < ApplicationSystemTestCase
test 'equal practices order in practices and new report' do
visit_with_auth '/reports/new', 'komagata'
- first('.select2-selection--multiple').click
- report_practices = page.all('.select2-results__option').map(&:text)
+ first('.choices__inner').click
+ report_practices = page.all('.choices__item--choice').map(&:text)
current_user = users(:komagata)
category_ids = current_user.course.category_ids
assert_equal report_practices.count, Practice.joins(:categories).merge(Category.where(id: category_ids)).count
- assert_match(/OS X Mountain Lionをクリーンインストールする$/, first('.select2-results__option').text)
- assert_match(/sslの基礎を理解する$/, all('.select2-results__option').last.text)
+ assert_match(/OS X Mountain Lionをクリーンインストールする/, first('.choices__item--choice').text)
+ assert_match(/sslの基礎を理解する/, all('.choices__item--choice').last.text)
end
test 'equal practices order in practices and edit report' do
visit_with_auth "/reports/#{reports(:report1).id}/edit", 'komagata'
- first('.select2-selection--multiple').click
- report_practices = page.all('.select2-results__option').map(&:text)
+ first('.choices__inner').click
+ report_practices = page.all('.choices__item--choice').map(&:text)
current_user = users(:komagata)
category_ids = current_user.course.category_ids
assert_equal report_practices.count, Practice.joins(:categories).merge(Category.where(id: category_ids)).count
- assert_match(/OS X Mountain Lionをクリーンインストールする$/, first('.select2-results__option').text)
- assert_match(/sslの基礎を理解する$/, all('.select2-results__option').last.text)
+ assert_match(/OS X Mountain Lionをクリーンインストールする/, first('.choices__item--choice').text)
+ assert_match(/sslの基礎を理解する/, all('.choices__item--choice').last.text)
end
test 'issue #360 duplicate' do
@@ -730,4 +730,9 @@ def wait_for_watch_change
assert_text '2022年04月01日 の日報'
assert_text '今日は1時間学習しました。'
end
+
+ test 'open new report with a past date' do
+ visit_with_auth '/reports/new?reported_on=2022-1-1', 'komagata'
+ assert_equal '2022-01-01', find('#report_reported_on').value
+ end
end
diff --git a/test/system/retirement_test.rb b/test/system/retirement_test.rb
index 90a3a435dd1..8fab18777a7 100644
--- a/test/system/retirement_test.rb
+++ b/test/system/retirement_test.rb
@@ -13,6 +13,7 @@ class RetirementTest < ApplicationSystemTestCase
assert_equal Date.current, user.reload.retired_on
assert_equal 'kananashiさんが退会しました。', users(:komagata).notifications.last.message
assert_equal 'kananashiさんが退会しました。', users(:machida).notifications.last.message
+ assert_equal 'kananashiさんが退会しました。', users(:mentormentaro).notifications.last.message
login_user 'kananashi', 'testtest'
assert_text 'ログインができません'
@@ -26,6 +27,7 @@ class RetirementTest < ApplicationSystemTestCase
assert_equal Date.current, user.reload.retired_on
assert_equal 'osnashiさんが退会しました。', users(:komagata).notifications.last.message
assert_equal 'osnashiさんが退会しました。', users(:machida).notifications.last.message
+ assert_equal 'osnashiさんが退会しました。', users(:mentormentaro).notifications.last.message
login_user 'osnashi', 'testtest'
assert_text 'ログインができません'
@@ -41,6 +43,7 @@ class RetirementTest < ApplicationSystemTestCase
assert_equal Date.current, user.reload.retired_on
assert_equal 'discordinvalidさんが退会しました。', users(:komagata).notifications.last.message
assert_equal 'discordinvalidさんが退会しました。', users(:machida).notifications.last.message
+ assert_equal 'discordinvalidさんが退会しました。', users(:mentormentaro).notifications.last.message
login_user 'discordinvalid', 'testtest'
assert_text 'ログインができません'
@@ -56,6 +59,7 @@ class RetirementTest < ApplicationSystemTestCase
assert_equal Date.current, user.reload.retired_on
assert_equal 'twitterinvalidさんが退会しました。', users(:komagata).notifications.last.message
assert_equal 'twitterinvalidさんが退会しました。', users(:machida).notifications.last.message
+ assert_equal 'twitterinvalidさんが退会しました。', users(:mentormentaro).notifications.last.message
login_user 'twitterinvalid', 'testtest'
assert_text 'ログインができません'