Skip to content

Commit

Permalink
Merge pull request #5071 from fjordllc/main
Browse files Browse the repository at this point in the history
Release 2022-06-30 04:04:17
  • Loading branch information
komagata authored Jun 30, 2022
2 parents c6b8898 + f3a90ae commit a125df6
Show file tree
Hide file tree
Showing 99 changed files with 719 additions and 582 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Metrics/ClassLength:
- app/models/user.rb
- app/models/product.rb
- app/models/report.rb
- app/notifiers/activity_notifier.rb

AllCops:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ GEM
railties (>= 5.0)
dead_end (3.1.1)
declarative (0.0.20)
diffy (3.4.0)
diffy (3.4.1)
digest (3.1.0)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/atoms/_a-file-input.sass
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
cursor: pointer
border-radius: .25rem
padding: .5rem .5rem 2.75rem .5rem
&.is-thumbnail
label
height: 15rem
img
max-height: 100%
transition: all .2s ease-out
Expand Down
48 changes: 48 additions & 0 deletions app/assets/stylesheets/atoms/_a-list-item-badge.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.a-list-item-badge
+text-block(.625rem, inline-flex $semi-muted-text nowrap 400)
border-radius: .75rem
align-self: flex-start
align-items: center
justify-content: center
position: relative
+size(3.75rem .8125rem)
span
+position(absolute, left 50%, top 50%)
transform: translate(-50%, -50%) scale(.8)
letter-spacing: -.05em
&.is-wip
background-color: $background-semi-shade
color: $semi-muted-text
&.is-unread
background-color: $danger
color: $reversal-text
&.is-serchable
border: solid 1px $muted-text
color: $muted-text
&.is-ended
background-color: #bbbbbb
color: $reversal-text
&.is-report
background-color: #7f6fb7
color: $reversal-text
&.is-practice
background-color: #79bcc3
color: $reversal-text
&.is-question
background-color: #de9172
color: $reversal-text
&.is-page
background-color: #9fc593
color: $reversal-text
&.is-announcement
background-color: #f7cd5b
color: $default-text
&.is-event
background-color: #ef9da8
color: $reversal-text
&.is-product
background-color: #909b3c
color: $reversal-text
&.is-user
background-color: #7cbd9c
color: $reversal-text
71 changes: 8 additions & 63 deletions app/assets/stylesheets/blocks/card-list/_card-list-item-title.sass
Original file line number Diff line number Diff line change
@@ -1,72 +1,17 @@
.card-list-item-title
display: flex
align-items: center
justify-content: space-between
+media-breakpoint-up(md)
align-items: center
+media-breakpoint-down(sm)
flex-direction: column
align-items: flex-start

.card-list-item-title__icon
+text-block(.75rem, inline-flex $semi-muted-text nowrap 400)
margin-top: .25rem
+padding(horizontal, .5rem)
height: 1.125rem
margin-right: .5rem
border-radius: .75rem
align-self: flex-start
align-items: center
justify-content: center
+media-breakpoint-down(sm)
float: left
&.is-wip
background-color: $background-tint
&.is-unread
background-color: $danger
color: $reversal-text
font-size: .625rem
&.is-ended
background-color: #bbbbbb
color: $reversal-text
&.is-report
background-color: #7f6fb7
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-practice
background-color: #79bcc3
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-question
background-color: #de9172
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-page
background-color: #9fc593
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-announcement
background-color: #f7cd5b
color: $default-text
font-size: .625rem
width: 3.25rem
&.is-event
background-color: #ef9da8
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-product
background-color: #909b3c
color: $reversal-text
font-size: .625rem
width: 3.25rem
&.is-user
background-color: #7cbd9c
color: $reversal-text
font-size: .625rem
width: 3.25rem
.a-list-item-badge
+media-breakpoint-up(md)
margin-top: .3125rem
margin-right: .5rem
+media-breakpoint-down(sm)
margin-bottom: .25rem

.card-list-item-title__start
+media-breakpoint-up(md)
Expand Down
10 changes: 4 additions & 6 deletions app/assets/stylesheets/blocks/card-list/_card-list-item.sass
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
+position(relative)
display: flex
position: relative
+media-breakpoint-up(md)
gap: 1rem
+media-breakpoint-down(sm)
gap: .75rem
gap: .75rem

.card-list-item__assignee
+media-breakpoint-up(md)
Expand Down Expand Up @@ -63,10 +60,11 @@
justify-content: center
+text-block(.625rem 1.3, center 600)
position: relative
padding: 1px
+media-breakpoint-up(md)
+size(3rem)
+media-breakpoint-down(sm)
+size(2.5rem)
+media-breakpoint-down(sm)
+size(2.25rem)
.card-list-item.is-report &
background-color: #7f6fb7
color: $reversal-text
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/card/_card-body.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

.card__description
overflow: hidden
p
+text-block(1em 1.6)
+media-breakpoint-up(md)
padding: 1rem
font-size: .8125rem
Expand Down
38 changes: 28 additions & 10 deletions app/assets/stylesheets/blocks/card/_card-books.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
+media-breakpoint-up(md)
border-top: solid 1px $border-tint
flex: 0 0 50%
height: 100%
display: flex
flex-direction: column
&:nth-child(odd)
border-right: solid 1px $border-tint
+media-breakpoint-down(sm)
&:not(:first-child)
border-top: solid 1px $border-tint

.card-books-item__body
+media-breakpoint-up(md)
flex: 1

.card-books-item__inner
padding: .75rem 1rem
text-decoration: none
Expand All @@ -39,12 +46,24 @@
.card-books-item__end
flex: 1

.card-books-item__row
&:not(:first-child)
margin-top: .25rem

.card-books-item__cover-container
height: 100%
display: flex
align-items: center
justify-content: center

.card-books-item__image
max-height: 100%
max-width: 100%
object-fit: contain
object-position: 50% 0
border: solid 1px $border-tint
border-radius: 2px

.card-books-item__title
+text-block(.875rem 1.4, $default-text 600)
transition: all .2s ease-out
Expand All @@ -64,17 +83,16 @@ a.card-books-item__inner:hover
color: $main-text

.card-books-item__price
+text-block(.75rem 1.4 .25rem, $default-text)

.card-books-item__image
max-height: 100%
max-width: 100%
object-fit: contain
object-position: 50% 0
border: solid 1px $border-tint
border-radius: 2px
+text-block(.75rem 1.4, $default-text)

.card-books-item__description
font-size: .75rem
color: $semi-muted-text
margin-top: .25rem

.card-books-item__practices
padding: 0 1rem .75rem
.tag-links__item-link
max-width: 9rem
text-overflow: ellipsis
overflow: hidden
white-space: nowrap
3 changes: 3 additions & 0 deletions app/assets/stylesheets/blocks/form/_form-item.sass
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
&.is-md
width: 40rem
max-width: 100%
.choices
width: 100%
z-index: 2
.a-page-notice
margin-bottom: 1rem
border-radius: .25rem
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/form/_talk-search.sass

This file was deleted.

14 changes: 10 additions & 4 deletions app/assets/stylesheets/blocks/page-content/_page-content.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
width: $thread-max-width
max-width: 100%
+margin(horizontal, auto)
+media-breakpoint-up(md)
margin-bottom: 2rem
+media-breakpoint-down(sm)
margin-bottom: 1rem
&:not(:first-child)
+media-breakpoint-up(md)
margin-top: 1.25rem
+media-breakpoint-down(sm)
margin-top: 1rem
&:not(:last-child)
+media-breakpoint-up(md)
margin-bottom: 2rem
+media-breakpoint-down(sm)
margin-bottom: 1rem
2 changes: 2 additions & 0 deletions app/assets/stylesheets/blocks/page/_o-empty-message.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
+margin(horizontal, auto)
text-align: center
color: $semi-muted-text
&:not(:first-child)
margin-top: 1.5rem

.o-empty-message__icon
+text-block(5rem 1)
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/blocks/page/_page-filter.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.page-filter
9 changes: 5 additions & 4 deletions app/assets/stylesheets/blocks/shared/_pagination.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
&:first-child
+media-breakpoint-up(md)
margin-bottom: 1rem
margin-top: -.75rem
+media-breakpoint-down(sm)
margin-bottom: .5rem
margin-top: -.25rem
.pill-nav + .page-body &
margin-top: 0
.page-content:first-child &
+media-breakpoint-up(md)
margin-top: -.5rem
+media-breakpoint-down(sm)
margin-top: -.25rem
&:not(:first-child)
+media-breakpoint-up(md)
margin-top: 1rem
Expand Down
7 changes: 4 additions & 3 deletions app/assets/stylesheets/blocks/shared/_pill-nav.sass
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.pill-nav
&:not(:first-child)
padding-top: 1.25rem

.pill-nav__items
display: flex
+padding(vertical, .875rem)
overflow-x: auto
overflow-y: hidden
justify-content: center
padding-top: 1.5rem
padding-bottom: 0

.pill-nav__item
&:first-child .pill-nav__item-link
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/modules/_choices.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ body
border-color: $input-border
padding: .25rem
border-radius: 4px
min-height: 2.5rem
.choices.is-focused .choices__inner
background-color: $base
.choices[data-type*=select-one] .choices__inner
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/api/products/unchecked_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class API::Products::UncheckedController < API::BaseController
def index
@target = params[:target]
@target = 'unchecked_all' unless target_allowlist.include?(@target)
checker_id = params[:checker_id]
@products = case @target
when 'unchecked_all'
Product.unchecked
Expand All @@ -13,12 +14,13 @@ def index
.ascending_by_date_of_publishing_and_id
.page(params[:page])
when 'unchecked_no_replied'
Product.unchecked_no_replied_products(current_user.id)
Product.unchecked_no_replied_products
.unchecked
.not_wip
.list
.page(params[:page])
end
@products = @products.where(checker_id: checker_id) if checker_id.present?
@products_grouped_by_elapsed_days = @products.group_by { |product| product.elapsed_days >= 7 ? 7 : product.elapsed_days }
end

Expand Down
9 changes: 5 additions & 4 deletions app/controllers/api/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ class API::QuestionsController < API::BaseController

def index
questions =
if params[:solved].present?
case params[:target]
when 'solved'
Question.solved
elsif params[:all].present?
Question.all
else
when 'not_solved'
Question.not_solved.not_wip
else
Question.all
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
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/api/user_icon_urls_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

class API::UserIconUrlsController < API::BaseController
skip_before_action :require_login_for_api

def index
@users = User.with_attached_avatar
@users = User.with_attached_avatar.select(:id, :login_name).where(id: ActiveStorage::Attachment.select(:record_id).where(record_type: 'User'))
end
end
Loading

0 comments on commit a125df6

Please sign in to comment.