Skip to content

Commit

Permalink
Merge pull request #3104 from fjordllc/main
Browse files Browse the repository at this point in the history
Release 2021-08-12 14:02:37
  • Loading branch information
komagata authored Aug 13, 2021
2 parents 791630c + d67efd5 commit d6c19f4
Show file tree
Hide file tree
Showing 154 changed files with 808 additions and 429 deletions.
14 changes: 7 additions & 7 deletions app/assets/stylesheets/article.sass
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ body
margin-top: 2rem
margin-bottom: 2rem

.a-card
background-color: white
border-radius: .25rem
border: solid 1px $border-more-shade
max-width: 50rem
margin-left: auto
margin-right: auto
.a-card
background-color: white
border-radius: .25rem
border: solid 1px $border-more-shade
max-width: 50rem
margin-left: auto
margin-right: auto

.article__title
padding: 1.25rem 2rem
Expand Down
6 changes: 2 additions & 4 deletions app/assets/stylesheets/atoms/_a-card.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
background-color: $base
border-radius: .25rem
border: solid 1px $border-more-shade
max-width: 48rem
+margin(horizontal, auto)
+media-breakpoint-down(lg)
&:not(:last-child)
margin-bottom: 1rem
.a-card + &
margin-top: 1.25rem
+media-breakpoint-up(xl)
margin-top: 1.25rem
+media-breakpoint-down(lg)
margin-top: 1rem
&.is-borderd
border: solid 4px $welcome-default-text
[class*=col-] + [class*=col-] &:first-child
+media-breakpoint-down(md)
margin-top: 1rem
&.is-max-width-100
max-width: 110rem

.a-card-notice
p
Expand Down
15 changes: 15 additions & 0 deletions app/assets/stylesheets/atoms/_a-form-help.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
font-size: .75rem
margin-top: .5em
color: $semi-muted-text
&.is-important
border: dashed 1px $border-shade
padding: 1em 1.25em
border-radius: 4px
color: $default-text
h2
+text-block(1.125em 1.4)
margin-bottom: .25em
[class*=is-select] + &
margin-top: .75rem
.a-horizontal-dashed
+margin(vertical, 1em)
.a-form-help-link
display: inline-block
margin-top: .25em
&.is-text-align-right
text-align: right
&.is-text-align-center
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/atoms/_a-horizontal-dashed.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a-horizontal-dashed
+size(100% 1px)
border-top: dashed 1px $border-shade
3 changes: 0 additions & 3 deletions app/assets/stylesheets/blocks/admin/_admin-table.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
100%
background-color: $base


.admin-table
max-width: 110rem
+margin(horizontal, auto)
margin-bottom: 1.5rem
+media-breakpoint-down(sm)
overflow-x: auto
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/blocks/card/_card-books.sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
+flex-link
+media-breakpoint-down(sm)
+block-link
overflow: hidden

.card-books-item__start
+media-breakpoint-up(md)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/blocks/card/_card-main-actions.sass
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
max-width: 100%
&.is-sub
text-align: right
&.is-end
margin-left: auto
flex-basis: 2.5rem

.card-main-actions__delete
+hover-link-reversal
Expand Down
3 changes: 0 additions & 3 deletions app/assets/stylesheets/blocks/form/_form.sass
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
.form
max-width: 87.5rem
+margin(horizontal, auto)
.a-card + &
margin-top: 1.25rem

.form__items
max-width: 82rem
+margin(horizontal, auto)
.form__items + &
margin-top: 1.75rem

Expand Down
4 changes: 1 addition & 3 deletions app/assets/stylesheets/blocks/page/_two-columns.sass
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
.two-columns
+margin(horizontal, auto)
+position(relative)
+media-breakpoint-up(md)
max-width: 58rem
display: flex
justify-content: space-between
align-items: flex-start

.two-columns__inner
flex: 100
flex: 1
4 changes: 1 addition & 3 deletions app/assets/stylesheets/blocks/practice/_categories.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
width: 100%

.categories-items
max-width: 58rem
+margin(horizontal, auto)
+position(relative)
display: flex
justify-content: space-between
Expand All @@ -15,7 +13,7 @@
display: none

.categories-items__inner
flex: 100
flex: 1

.categories-item
&:not(:last-child)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.practice-contents
max-width: 58rem
+margin(horizontal, auto)
+position(relative)
display: flex
justify-content: space-between
Expand All @@ -19,7 +17,7 @@
.practice-contents__title
+text-block(1.5rem 1.4, 600 $side)
+media-breakpoint-down(sm)
font-size: 1rem
font-size: 1.25rem
word-break: break-all

.practice-contents__pub-date
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.thread-comments-container
max-width: 52rem
+margin(horizontal, auto)

.thread-comments-container__title
+text-block(1.125rem 1.45 0 1.5rem, flex 600)
align-items: center
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/thread/_thread-comments.sass
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
$thread-header-author: 3.5rem
.thread-comments
+position(relative)
max-width: 52rem
+margin(horizontal, auto)
border-radius: .25rem

.thread-comment
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/thread/_thread-questions.sass
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
$thread-header-author: 3.5rem
.thread-questions
+position(relative)
max-width: 52rem
+margin(horizontal, auto)
border-radius: .25rem

.thread-question
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/blocks/thread/_thread.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ $thread-header-author: 6rem
+position(relative)
+margin(horizontal, auto)
+media-breakpoint-up(md)
max-width: 52rem
padding-left: 5rem
margin-bottom: 2rem
&.is-header-author
Expand All @@ -14,7 +13,6 @@ $thread-header-author: 6rem
&.is-page
margin-top: 1rem
padding-left: 0
max-width: 47rem

.thread__body
border-top: $background solid 1px
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/blocks/user/_niconico-calendar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
background-color: #ecf3f7
&.is-soso
background-color: #fff9e8
&.is-today
.niconico-calendar__day-inner
border: dashed 2px $info
.niconico-calendar__day-label
font-weight: 600
color: $info

.niconico-calendar__day-inner
+block-link
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/initializers/_reset.sass
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ input[type="submit"]
+placeholder
color: $placeholder-text
font-weight: 400

hr
border: none
20 changes: 0 additions & 20 deletions app/assets/stylesheets/shared/_base.sass
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,7 @@ body
padding-top: 4rem
overflow-y: auto

.container
+padding(horizontal, 1.5rem)
max-width: 100%
body &.has-no-right-padding
padding-right: 0
+media-breakpoint-down(md)
+padding(horizontal, 1rem)
body.is-learning-page &
&.is-md
width: 48rem
+margin(horizontal, auto)
body.welcome &
width: 75rem
+padding(horizontal, 1rem)
+margin(horizontal, auto)
&.is-md
width: 48rem

.columns
max-width: 75rem
+margin(horizontal, auto)
.columns + &
margin-top: 1.5rem

Expand Down
21 changes: 21 additions & 0 deletions app/assets/stylesheets/shared/_container.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.container
max-width: 100%
+margin(horizontal, auto)
+media-breakpoint-up(lg)
+padding(horizontal, 1.5rem)
+media-breakpoint-down(md)
+padding(horizontal, 1rem)
&.is-xxxl
width: 93.75rem
&.is-xxl
width: 82.5rem
&.is-xl
width: 71.5rem
&.is-lg
width: 60rem
&.is-md
width: 45rem
&.is-sm
width: 33.75rem
body &.has-no-right-padding
padding-right: 0
8 changes: 6 additions & 2 deletions app/controllers/api/correct_answers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ class API::CorrectAnswersController < API::BaseController
def create
@answer = @question.answers.find(params[:answer_id])
@answer.type = 'CorrectAnswer'
@answer.save!
render json: @answer
if @answer.save
ChatNotifier.message("質問「#{@answer.question.title}」のベストアンサーが選ばれました。\r#{url_for(@answer.question)}")
render json: @answer
else
head :bad_request
end
end

def update
Expand Down
24 changes: 24 additions & 0 deletions app/controllers/api/mentor_memos_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

class API::MentorMemosController < API::BaseController
before_action :require_mentor_login_for_api
before_action :set_user, only: %i[update]

def update
if @user.update_mentor_memo(user_params[:mentor_memo])
head :ok
else
head :bad_request
end
end

private

def set_user
@user = User.find(params[:id])
end

def user_params
params.require(:user).permit(:mentor_memo)
end
end
1 change: 0 additions & 1 deletion app/controllers/api/products/not_responded_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def index
.not_responded_products
.list
.reorder_for_not_responded_products
.page(params[:page])
@latest_product_submitted_just_5days = @products.find { |product| product.elapsed_days == 5 }
@latest_product_submitted_just_6days = @products.find { |product| product.elapsed_days == 6 }
@latest_product_submitted_over_7days = @products.find { |product| product.elapsed_days >= 7 }
Expand Down
7 changes: 3 additions & 4 deletions app/controllers/api/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class API::UsersController < API::BaseController
before_action :set_user, only: %i[show update]
before_action :require_mentor_login_for_api, only: %i[update]
before_action :require_login_for_api
PAGER_NUMBER = 20

def index
Expand Down Expand Up @@ -30,8 +30,7 @@ def index
def show; end

def update
@user = User.find(params[:id])
if @user.update_mentor_memo(user_params[:mentor_memo])
if @user == current_user && @user.update(user_params)
head :ok
else
head :bad_request
Expand All @@ -52,6 +51,6 @@ def set_user
end

def user_params
params.require(:user).permit(:tag_list, :mentor_memo)
params.require(:user).permit(:tag_list)
end
end
10 changes: 10 additions & 0 deletions app/controllers/courses/categories_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class Courses::CategoriesController < ApplicationController
before_action :require_admin_login

def index
@course = Course.find(params[:course_id])
@categories = @course.categories.order(:position)
end
end
2 changes: 1 addition & 1 deletion app/controllers/current_user/products/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ header.page-header
= render 'home/page_tabs', user: @current_user

.page-body
.container
.container.is-md
- if @products.present?
.thread-list.a-card
= render partial: 'products/product', collection: @products, as: :product
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/announcements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
i.far.fa-smile
p.o-empty-message__text
| {{ title }}はありません
.container(v-else)
.container.is-md(v-else)
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')
.thread-list.a-card
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/answer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default {
hasCorrectAnswer: { type: Boolean, required: true },
questionUser: { type: Object, required: true }
},
data: () => {
data() {
return {
description: '',
editing: false,
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/answers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default {
questionUser: { type: Object, required: true },
currentUser: { type: Object, required: true }
},
data: () => {
data() {
return {
answers: [],
description: '',
Expand Down
Loading

0 comments on commit d6c19f4

Please sign in to comment.