Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2023-08-03 08:48:43 #6770

Merged
merged 165 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
e4cdbb8
discord_profilesをDBへ追加
mono-nobe Apr 11, 2023
c87011d
discord_profileとuserを関連付け
mono-nobe Apr 11, 2023
5025739
testファイルの新規追加
mono-nobe Apr 11, 2023
a3de4d1
画面から以下の項目を設定できるところまで
mono-nobe Apr 11, 2023
0dca336
テストデータの切り分け
mono-nobe Apr 15, 2023
e54de93
APIレスポンスの修正
mono-nobe Apr 15, 2023
a78ca78
ホーム画面に切り出したdiscord情報を渡す
mono-nobe Apr 15, 2023
cf682b3
バリデーションの追加
mono-nobe Apr 15, 2023
e2aa032
不要なバリデーションを削除
mono-nobe Apr 15, 2023
a5dbb7b
検索機能の修正
mono-nobe Apr 15, 2023
aa5e102
ホーム画面における必須項目名を修正
mono-nobe Apr 15, 2023
61f2d01
users周りにおいてdiscord_accountを廃止
mono-nobe Apr 15, 2023
1766ab9
休会画面のdiscordのURL周りを修正
mono-nobe Apr 15, 2023
173cd16
user一覧画面におけるdiscord周りの判定式を修正
mono-nobe Apr 15, 2023
583da5f
usersテーブルから discord_account, times_url カラムを削除
mono-nobe Apr 15, 2023
f6ceec4
unitテスト用のテストデータを作成
mono-nobe Apr 15, 2023
16278a5
不要なテストデータを削除
mono-nobe Apr 15, 2023
cf34283
times_urlを参照する際の条件式を修正
mono-nobe Apr 15, 2023
b7227fa
discord_profileのmodelテストを追加
mono-nobe Apr 15, 2023
9a2c970
userのmodelテストを修正
mono-nobe Apr 15, 2023
2848ac0
システムテストを移行
mono-nobe Apr 15, 2023
6f87208
ダッシュボードのシステムテスト修正
mono-nobe Apr 15, 2023
41f71ba
相談部屋の検索機能を修正
mono-nobe May 9, 2023
85acffc
相談部屋の未返信画面の絞り込み修正
mono-nobe May 9, 2023
5533d8d
入会時の分報チャンネル自動作成周りを修正
mono-nobe May 9, 2023
597f87b
Userクラスに残っている不要なURL変換メソッドを削除
mono-nobe May 10, 2023
4c42b02
lintによる整形
mono-nobe May 10, 2023
c44febc
userテーブルからdiscord関連のカラムを削除するmigrationを削除
mono-nobe May 19, 2023
79b4fd2
usersテーブルのdiscord関連のカラムの値をdiscord_profilesテーブルにコピー
mono-nobe May 19, 2023
3b2df1c
migrationを削除したことによる修正
mono-nobe May 19, 2023
b06e120
seedsにdiscord_profilesを追加
mono-nobe May 24, 2023
88f4231
Discord情報が未登録のテストユーザーを追加
mono-nobe May 24, 2023
40544d8
システムテストの修正
mono-nobe May 30, 2023
a60863b
システムテストの修正
mono-nobe May 30, 2023
f6e5d02
システムテストの修正
mono-nobe May 30, 2023
b235671
Seedデータについてユーザー名を明記した
mono-nobe Jun 27, 2023
baeb061
リベースによりテストが壊れたため修正
mono-nobe Jun 27, 2023
26252f4
空の/buzzアクセス時にレコードを1件作成するように修正
djkazunoko Jul 22, 2023
6e60e3b
ユーザー作成時にdiscord_profileを持たせるようにする
mono-nobe Jul 18, 2023
f17bca9
userがdiscord_profileを持たない場合を担保しないようにする
mono-nobe Jul 18, 2023
25594f4
prefecture_codeを削除
monyatto Jul 24, 2023
f6b33e4
ダッシュボードの近日開催のイベント表示のデザインを作成
wata00913 Jul 11, 2023
eeaad72
イベントの通知バー表示と通知バーに関する不要な処理を削除
wata00913 Apr 16, 2023
fb1496f
ダッシュボードのカード形式の近日開催イベントに表示機能を追加
wata00913 Apr 19, 2023
3c2be4b
eventをspecial_eventにリネーム
wata00913 Apr 15, 2023
2d10506
定期イベントが連続開催の場合に明日、明後日の日付が正常に表示できるように修正
wata00913 Apr 16, 2023
38b2f92
範囲条件の日時が余分に9時間追加されて、適切な範囲のイベントを取得できないので修正
wata00913 Apr 15, 2023
36ee5b4
RegularEventモデルのテストを追加
wata00913 Apr 15, 2023
2584b63
カード形式の近日開催イベント通知のテストコードを作成
wata00913 Apr 16, 2023
51c6361
重複するテストを削除
wata00913 Apr 17, 2023
63979bc
明後日開催のイベントデータを作成
wata00913 Apr 17, 2023
c169cad
不要なヘルパーメソッドを削除
wata00913 Apr 17, 2023
a0b2814
lintの修正
wata00913 Apr 17, 2023
2b173ee
エイリアスと誤解のないように明示的に引数を指定するように修正
wata00913 May 2, 2023
8531c41
テスト名を修正
wata00913 May 2, 2023
9ead018
Relationを返すクラスメソッドをscopeで定義
wata00913 Jun 20, 2023
c4221cb
関連リンク集を紹介記事に名称を変更し、buzzページのサマリーを削除、初期データの変更をした
machida Jul 26, 2023
fc8982b
初期データ変更に伴う関連箇所の変更の変更し忘れ対応
machida Jul 26, 2023
df40240
タイポを修正
djkazunoko Jul 26, 2023
f343ef5
本番環境のbuzzの初期データをdata-migrateで作成するように修正
djkazunoko Jul 26, 2023
af16564
メンターのカテゴリー画面のカテゴリー作成ボタンの移動
rira100000000 Jul 15, 2023
19c9e29
カテゴリーの新規作成ボタン周りのレイアウト調整
machida Jul 26, 2023
134252d
Bump semver from 5.7.1 to 5.7.2
dependabot[bot] Jul 11, 2023
d9e06b8
カテゴリーに紐づいたプラクティスの並び替え機能を作成
monyatto Jul 4, 2023
22c3bdc
viewを修正
monyatto Jul 7, 2023
b7c5835
テストを追加
monyatto Jul 7, 2023
cc03d87
テストを修正
monyatto Jul 11, 2023
a50f87a
既存のプラクティス並び替え関連を削除
monyatto Jul 13, 2023
d6f75c4
不要な記述の削除
monyatto Jul 27, 2023
790c7e9
textarea-markdownを最新版に更新
YukiWatanabe824 Jun 15, 2023
45afae4
reports/newとreports/showのテキストエリアに機能追加
YukiWatanabe824 Jun 11, 2023
6a34329
questionの作成/編集/コメント作成/コメント編集に機能追加
YukiWatanabe824 Jun 11, 2023
bcdd602
reportのコメント編集に機能追加
YukiWatanabe824 Jun 11, 2023
725fd59
DOCSのnewに機能追加
YukiWatanabe824 Jun 11, 2023
8fd8dbc
eventのnewに機能追加
YukiWatanabe824 Jun 11, 2023
038072a
regular_eventのnewに機能追加
YukiWatanabe824 Jun 11, 2023
c598e97
announcements/newに機能追加
YukiWatanabe824 Jun 11, 2023
cb25b3f
productsに機能追加
YukiWatanabe824 Jun 11, 2023
1085fd3
textarea-markdownを機能追加したFork版に一時的に変更
YukiWatanabe824 Jun 17, 2023
25b3cf4
textarea-markdownライブラリを本家git版に変更
YukiWatanabe824 Jun 18, 2023
f80dc30
linterによる修正
YukiWatanabe824 Jun 19, 2023
dd2a306
Markdownエディタのファイルインプットにデザインを入れた
machida Jun 20, 2023
901ecfe
デザインを追加
YukiWatanabe824 Jun 20, 2023
e18d06a
testを追加
YukiWatanabe824 Jun 20, 2023
a828034
rubocop
YukiWatanabe824 Jun 20, 2023
daf85ae
Linter
YukiWatanabe824 Jun 20, 2023
660f197
コメント編集の画面にファイル挿入のデザインを入れ、色を微調整した
machida Jun 21, 2023
3286400
コンフリクト解消後の表示崩れ対応
YukiWatanabe824 Jul 11, 2023
9d102c2
textarea-markdownの1.4.0リリースに伴い、ライブラリ取得元をGitHubからnpmに修正
YukiWatanabe824 Jul 25, 2023
8abb5cb
Merge pull request #6713 from fjordllc/dependabot/npm_and_yarn/semver…
komagata Jul 29, 2023
eb1a2d7
Bump word-wrap from 1.2.3 to 1.2.4
dependabot[bot] Jul 18, 2023
c6187a3
Merge pull request #6447 from fjordllc/feature/move-discord-columns
komagata Jul 29, 2023
2fbcfbe
8時間後に5日経過に到達する提出物の件数を表示
May 8, 2023
c0ea80b
prettierを通した
May 8, 2023
2a6ca7c
8時間後に5日経過に到達する提出物の件数の表示に制限をかけた
May 8, 2023
b3bbd4d
lintを通した
May 8, 2023
9df7990
処理を分割
May 8, 2023
4865c94
prettierを通した
May 8, 2023
ad3ffcc
メソッド名の修正
May 13, 2023
8ba1a56
同じ処理を共通化
May 15, 2023
34e2713
実装に伴いテストを追加
May 15, 2023
e1a4a56
テストを追加
May 16, 2023
a1d93e5
テストを追加
May 16, 2023
469a1e5
提出物の予告件数の見た目を整えた
machida May 22, 2023
22de879
prettierを通した
May 24, 2023
2cfb231
文言修正に伴いテストを変更
May 24, 2023
ab48260
8時間後に5日経過に到達する提出物が2件から1件に変わるかのテストを追加
Jun 6, 2023
97af715
引数名がnだとわかりずらいのでelapsedDaysに変更
Jun 6, 2023
5222747
マジックナンバーを定数化
Jun 13, 2023
1b94677
timeという変数名を変更
Jun 14, 2023
a92f527
lintの指摘箇所を修正
Jun 15, 2023
9d31725
必要なデータをブラウザを使って用意していたが、DBを直接変更して用意するように変更
Jun 22, 2023
04645a6
mainの変更に合わせて、修正
Jun 22, 2023
40872a8
elapsedTimesという変数をメソッドとして切り出した
Jul 19, 2023
095a643
メソッド内で変数を使わずにreturnするように修正
Jul 30, 2023
c1524ab
不要な`window.onpopstate`を削除し、RangeErrorを解消
gogutan Jul 30, 2023
baca19f
Merge pull request #6739 from fjordllc/dependabot/npm_and_yarn/word-w…
komagata Jul 30, 2023
13f6213
Merge pull request #6454 from fjordllc/feature/change-display-format-…
komagata Jul 31, 2023
84c975f
Merge pull request #6771 from gogutan/bug/range-error
komagata Jul 31, 2023
22219f2
不足しているdiscord関連のローカルデータを追加
mono-nobe Jul 31, 2023
d207bd8
ローカルデータを生成するusers.ymlにdiscord関連の注意書きを追加
mono-nobe Jul 31, 2023
d03ce27
Merge pull request #6773 from fjordllc/feature/create-discord-local-data
komagata Aug 1, 2023
739b9f1
Merge pull request #6754 from fjordllc/hotfix/fix-empty-buzz-500-error
komagata Aug 1, 2023
2933872
Merge pull request #6757 from fjordllc/feature/remove-prefecture-code
komagata Aug 1, 2023
7a03c91
Merge pull request #6717 from fjordllc/feature/create_sorting_page_fo…
komagata Aug 1, 2023
7d83e09
Merge pull request #6729 from fjordllc/feature/move-category-new-button
komagata Aug 1, 2023
440d131
Merge pull request #6649 from fjordllc/feature/add_file_to_be_attache…
komagata Aug 1, 2023
33590b0
Merge pull request #6505 from fjordllc/feature/display-numbers-of-pro…
komagata Aug 1, 2023
0f64167
タブの色を変更した
machida Jul 26, 2023
4879861
ダッシュボードのイベント一覧のデザインを微調整
machida Aug 1, 2023
e7f97f8
testを通すために一旦カテゴリー表示を戻した
machida Aug 2, 2023
34a776a
色の微調整
machida Aug 2, 2023
fe10a99
一般ユーザーの提出物ページの幅を狭めた
machida Aug 2, 2023
72659ee
提出物削除のヘルプ文章追加
machida Aug 2, 2023
cdcc6dc
/buzz公開
machida Aug 2, 2023
1c2289d
不要なCSSを削除
machida Aug 2, 2023
000a8ed
質問削除のリンクをメンターだけに表示した
machida Aug 2, 2023
bd23d89
modalのidを変更
machida Aug 2, 2023
ff2eb14
仕様変更に伴うtest変更
machida Aug 2, 2023
6f610fa
:cop:
machida Aug 2, 2023
e17364f
buzz 公開のためのtest修正
machida Aug 2, 2023
889f5b1
:cop:
machida Aug 2, 2023
e3c40be
仕様変更に伴うtest修正
machida Aug 2, 2023
06beacc
仕様変更に伴うtest修正
machida Aug 2, 2023
256858d
staging環境用のcloudbuild設定ファイルを追加
komagata Aug 2, 2023
18a0592
Merge pull request #6784 from fjordllc/chore/split-cloudbuild
komagata Aug 2, 2023
ebda549
Pushより後にDBを削除するように変更
komagata Aug 2, 2023
12446f8
仕様変更に伴うtest修正
machida Aug 2, 2023
db2edc6
仕様変更に伴うtest修正
machida Aug 2, 2023
9272e4e
productionへのデプロイ時にdata-migrationも実行するように変更
komagata Aug 2, 2023
b029685
Buildを待つようにcloudbuildの設定を変更
komagata Aug 2, 2023
d90edef
DeleteととCreateを一つのstepにした
komagata Aug 2, 2023
f1326ce
Merge pull request #6780 from fjordllc/ch-c
machida Aug 2, 2023
0b4d634
headerのborderをhrに移行
machida Aug 2, 2023
54169a8
borderをhrに移行
machida Aug 2, 2023
6132a15
borderをhrに移行
machida Aug 2, 2023
a35dcf1
管理画面ユーザー一覧で表示エラーを回避
machida Aug 2, 2023
66408e9
borderの色、有無を調整
machida Aug 2, 2023
2ee6f14
不要な色を削除
machida Aug 2, 2023
3b25a2f
ページ内検索などのパーツのレイストを整えた
machida Aug 3, 2023
df6286a
:cop:
machida Aug 3, 2023
a4b6cc2
デザイン崩れ修正
machida Aug 3, 2023
3be7c86
Merge pull request #6785 from fjordllc/bd
machida Aug 3, 2023
4450266
FontAwesomeのフォント名を変更
machida Aug 3, 2023
9ea4f62
Merge pull request #6788 from fjordllc/fw
machida Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .cloudbuild/cloudbuild-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
steps:
- id: Fetch
name: gcr.io/cloud-builders/docker
entrypoint: bash
args:
- '-c'
- 'docker pull asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest || exit 0'
- id: Build
name: gcr.io/cloud-builders/docker
args:
- build
- '-t'
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
- '-t'
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest'
- '--cache-from'
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest'
- .
- '-f'
- Dockerfile
- id: Push
name: gcr.io/cloud-builders/docker
args:
- push
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
waitFor:
- Build
- id: SqlProxy
name: 'gcr.io/cloudsql-docker/gce-proxy:1.16'
args:
- /cloud_sql_proxy
- '-dir=/cloudsql'
- '-instances=$_CLOUD_SQL_HOST'
waitFor:
- '-'
volumes:
- name: db
path: /cloudsql
- name: gcr.io/google.com/cloudsdktool/cloud-sdk
args:
- '-c'
- 'gcloud sql databases delete bootcamp_staging --instance=bootcamp --quiet || gcloud sql databases create bootcamp_staging --instance=bootcamp --quiet || exit 0'
id: DropAndCreateDB
waitFor:
- Fetch
entrypoint: sh
volumes:
- name: db
path: /cloudsql
- id: DBMigrate
name: 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
args:
- bin/rails
- db:migrate
- db:seed
waitFor:
- DropAndCreateDB
volumes:
- name: db
path: /cloudsql
env:
- RAILS_ENV=production
- DISABLE_DATABASE_ENVIRONMENT_CHECK=1
- DB_HOST=/cloudsql/$_CLOUD_SQL_HOST
- DB_NAME=$_DB_NAME
- DB_PASS=$_DB_PASS
- DB_USER=$_DB_USER
- RAILS_MASTER_KEY=$_RAILS_MASTER_KEY
- id: Kill_SqlProxy
name: gcr.io/cloud-builders/docker
entrypoint: sh
args:
- '-c'
- docker kill -s TERM $(docker ps -q --filter "volume=db")
waitFor:
- DBMigrate
- id: Deploy
name: gcr.io/google.com/cloudsdktool/cloud-sdk
entrypoint: gcloud
args:
- run
- deploy
- $_SERVICE_NAME
- '--platform=managed'
- '--region=asia-northeast1'
- '--quiet'
- '--image=asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
- '--allow-unauthenticated'
- '--clear-vpc-connector'
- '--add-cloudsql-instances'
- $_CLOUD_SQL_HOST
- '--memory'
- $_MEMORY
- '--timeout'
- '10m'
- '--set-env-vars=LANG=ja_JP.UTF-8'
- '--set-env-vars=TZ=Asia/Tokyo'
- '--set-env-vars=RAILS_SERVE_STATIC_FILES=true'
- '--set-env-vars=RAILS_LOG_TO_STDOUT=true'
- '--set-env-vars=RAILS_ENV=production'
- '--set-env-vars=RACK_ENV=production'
- '--set-env-vars=APP_HOST_NAME=$_APP_HOST_NAME'
- '--set-env-vars=CLOUD_RUN_HOST_NAME=$_CLOUD_RUN_HOST_NAME'
- '--set-env-vars=RAILS_MASTER_KEY=$_RAILS_MASTER_KEY'
- '--set-env-vars=DB_NAME=$_DB_NAME'
- '--set-env-vars=DB_USER=$_DB_USER'
- '--set-env-vars=DB_PASS=$_DB_PASS'
- '--set-env-vars=DB_HOST=/cloudsql/$_CLOUD_SQL_HOST'
- '--set-env-vars=GOOGLE_CREDENTIALS=$_GOOGLE_CREDENTIALS'
- '--set-env-vars=GCS_BUCKET=$_GCS_BUCKET'
- '--set-env-vars=TOKEN=$_TOKEN'
- '--set-env-vars=DISCORD_NOTICE_WEBHOOK_URL=$_DISCORD_NOTICE_WEBHOOK_URL'
- '--set-env-vars=DISCORD_INTRODUCTION_WEBHOOK_URL=$_DISCORD_INTRODUCTION_WEBHOOK_URL'
- '--set-env-vars=DISCORD_ALL_WEBHOOK_URL=$_DISCORD_ALL_WEBHOOK_URL'
- '--set-env-vars=DISCORD_ADMIN_WEBHOOK_URL=$_DISCORD_ADMIN_WEBHOOK_URL'
- '--set-env-vars=DISCORD_MENTOR_WEBHOOK_URL=$_DISCORD_MENTOR_WEBHOOK_URL'
- '--set-env-vars=DISCORD_BUG_WEBHOOK_URL=$_DISCORD_BUG_WEBHOOK_URL'
- '--set-env-vars=DISCORD_REPORT_WEBHOOK_URL=$_DISCORD_REPORT_WEBHOOK_URL'
- '--set-env-vars=DISCORD_GUILD_ID=$_DISCORD_GUILD_ID'
- '--set-env-vars=DISCORD_TIMES_CHANNEL_CATEGORY_ID=$_DISCORD_TIMES_CHANNEL_CATEGORY_ID'
- '--set-env-vars=DISCORD_BOT_TOKEN=$_DISCORD_BOT_TOKEN'
- '--set-env-vars=GOOD_JOB_USERNAME=$_GOOD_JOB_USERNAME'
- '--set-env-vars=GOOD_JOB_PASSWORD=$_GOOD_JOB_PASSWORD'
- '--set-env-vars=STRIPE_ENDPOINT_SECRET=$_STRIPE_ENDPOINT_SECRET'
- '--set-env-vars=BASIC_AUTH_USER=$_BASIC_AUTH_USER'
- '--set-env-vars=BASIC_AUTH_PASSWORD=$_BASIC_AUTH_PASSWORD'
- '--set-env-vars=RECAPTCHA_SITE_KEY=$_RECAPTCHA_SITE_KEY'
- '--set-env-vars=RECAPTCHA_SECRET_KEY=$_RECAPTCHA_SECRET_KEY'
- '--set-env-vars=ROLLBAR_CLIENT_TOKEN=$_ROLLBAR_CLIENT_TOKEN'
- '--set-env-vars=OPEN_AI_ACCESS_TOKEN=$_OPEN_AI_ACCESS_TOKEN'
- '--set-env-vars=$_ENVS'
- >-
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS
- id: Notify
name: 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest'
args:
- bin/notify
waitFor:
- Deploy
env:
- DB_NAME=$_DB_NAME
- DEPLOY_NOTIFY_WEBHOOK_URL=$_DEPLOY_NOTIFY_WEBHOOK_URL
timeout: 7200s
images:
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest'
2 changes: 1 addition & 1 deletion .cloudbuild/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
name: 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
args:
- bin/rails
- bootcamp:migrate
- db:migrate:with_data
waitFor:
- Push
volumes:
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def user_params
params.require(:user).permit(
:adviser, :login_name, :name,
:name_kana, :email, :course_id, :subscription_id,
:description, :discord_account, :github_account,
:twitter_account, :facebook_url, :blog_url, :times_url,
:description, :github_account,
:twitter_account, :facebook_url, :blog_url,
:password, :password_confirmation, :job,
:organization, :os, :study_place,
:experience, :company_id,
Expand All @@ -60,7 +60,7 @@ def user_params
:officekey_permission, :tag_list, :training_ends_on,
:profile_image, :profile_name, :profile_job, :mentor,
:profile_text, { authored_books_attributes: %i[id title url cover _destroy] },
:country_code, :subdivision_code
:country_code, :subdivision_code, discord_profile_attributes: %i[account_name times_url]
)
end

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/api/talks/unreplied_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class API::Talks::UnrepliedController < API::BaseController
PAGER_NUMBER = 20

def index
@talks = Talk.eager_load(user: { avatar_attachment: :blob })
@talks = Talk.joins(:user)
.includes(user: [{ avatar_attachment: :blob }, :discord_profile])
.unreplied
.order(updated_at: :desc, id: :asc)
@talks =
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/api/talks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class API::TalksController < API::BaseController
def index
@target = params[:target]
@target = 'all' unless TARGETS.include?(@target)
@talks = Talk.eager_load(user: { avatar_attachment: :blob })
@talks = Talk.joins(:user)
.includes(user: [{ avatar_attachment: :blob }, :discord_profile])
.order(updated_at: :desc, id: :asc)
@talks =
if params[:search_word]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/buzz_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def edit; end

def update
if @buzz.update(buzz_params)
redirect_to buzz_path, notice: '関連リンク集を更新しました'
redirect_to buzz_path, notice: '紹介記事を更新しました'
else
render :edit
end
Expand Down
13 changes: 13 additions & 0 deletions app/controllers/categories/practices_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

class Categories::PracticesController < ApplicationController
before_action :require_admin_login

def index
@category = Category.find(params[:category_id])
@categories_practices = @category
.categories_practices
.includes(:practice)
.order(:position)
end
end
12 changes: 0 additions & 12 deletions app/controllers/courses/practices/sort_controller.rb

This file was deleted.

26 changes: 0 additions & 26 deletions app/controllers/current_user/products/index.html.slim

This file was deleted.

6 changes: 3 additions & 3 deletions app/controllers/current_user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def user_params
user_attribute = [
:adviser, :login_name, :name,
:name_kana, :email, :course_id,
:description, :job_seeking, :discord_account,
:description, :job_seeking,
:github_account, :twitter_account, :facebook_url,
:blog_url, :times_url, :password, :password_confirmation,
:blog_url, :password, :password_confirmation,
:job, :organization, :os,
:experience, :company_id,
:nda, :avatar, :trainee,
:mail_notification, :job_seeker, :tag_list,
:after_graduation_hope, :training_ends_on, :profile_image,
:profile_name, :profile_job, :profile_text, { authored_books_attributes: %i[id title url cover _destroy] },
:feed_url, :country_code, :subdivision_code
:feed_url, :country_code, :subdivision_code, { discord_profile_attributes: %i[id account_name times_url] }
]
user_attribute.push(:retired_on, :graduated_on, :free, :github_collaborator) if current_user.admin?
params.require(:user).permit(user_attribute)
Expand Down
32 changes: 10 additions & 22 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def index
if current_user
display_dashboard
display_events_on_dashboard
display_regular_events_on_dashboard
display_welcome_message_for_adviser
set_required_fields
render aciton: :index
Expand All @@ -30,21 +29,13 @@ def set_required_fields
avatar_attached: current_user.avatar.attached?,
tag_list_count: current_user.tag_list.size,
after_graduation_hope: current_user.after_graduation_hope,
discord_account: current_user.discord_account,
discord_account_name: current_user.discord_profile.account_name,
github_account: current_user.github_account,
blog_url: current_user.blog_url,
graduated: current_user.graduated?
)
end

def today_to_tomorrow
(Time.zone.today + 9.hours)..(Time.zone.tomorrow + 9.hours)
end

def tomorrow_to_day_after_tomorrow
(Time.zone.tomorrow + 9.hours)..(Time.zone.tomorrow + 1.day + 9.hours)
end

def display_dashboard
@announcements = Announcement.with_avatar.where(wip: false).order(published_at: :desc).limit(5)
@bookmarks = current_user.bookmarks.order(created_at: :desc).limit(5)
Expand All @@ -57,18 +48,15 @@ def display_dashboard
end

def display_events_on_dashboard
cookies_ids = JSON.parse(cookies[:confirmed_event_ids]) if cookies[:confirmed_event_ids]
@events_coming_soon = Event.where(start_at: today_to_tomorrow).or(Event.where(start_at: tomorrow_to_day_after_tomorrow)).where.not(id: cookies_ids)
@events_coming_soon_except_job_hunting = @events_coming_soon.where.not(job_hunting: true)
end

def display_regular_events_on_dashboard
cookies_ids = JSON.parse(cookies[:confirmed_regular_event_ids]) if cookies[:confirmed_regular_event_ids]
@today_regular_events, @tomorrow_regular_events = RegularEvent.comming_soon_events(current_user)

cookies_ids&.each do |id|
RegularEvent.remove_event([@today_regular_events, @tomorrow_regular_events], id)
end
@today_events = (Event.today_events.related_to(current_user) \
+ RegularEvent.today_events.participated_by(current_user))
.sort_by { |e| e.start_at.strftime('%H:%M') }
@tomorrow_events = (Event.tomorrow_events.related_to(current_user) \
+ RegularEvent.tomorrow_events.participated_by(current_user))
.sort_by { |e| e.start_at.strftime('%H:%M') }
@day_after_tomorrow_events = (Event.day_after_tomorrow_events.related_to(current_user) \
+ RegularEvent.day_after_tomorrow_events.participated_by(current_user))
.sort_by { |e| e.start_at.strftime('%H:%M') }
end

def display_welcome_message_for_adviser
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def create
@user = User.new(user_params)
@user.course_id ||= Course.first.id
@user.free = true if @user.trainee?
@user.build_discord_profile
Newspaper.publish(:user_create, @user)
if @user.staff? || @user.trainee?
create_free_user!
Expand Down Expand Up @@ -147,8 +148,8 @@ def user_params
params.require(:user).permit(
:login_name, :name, :name_kana,
:email, :course_id, :description,
:discord_account, :github_account, :twitter_account,
:facebook_url, :blog_url, :times_url, :password,
:github_account, :twitter_account,
:facebook_url, :blog_url, :password,
:password_confirmation, :job, :organization,
:os, :experience,
:company_id, :nda, :avatar,
Expand Down
10 changes: 1 addition & 9 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
# frozen_string_literal: true

module HomeHelper
def today_or_tommorow(event)
if event.holding_today?
'今日'
elsif event.holding_tomorrow?
'明日'
end
end

def anchor_to_required_field(attribute)
{
avatar_attached: 'form-user-avatar',
tag_list_count: 'form-tag-list',
after_graduation_hope: 'form-after-graduation-hope',
discord_account: 'form-discord-account',
discord_account_name: 'form-discord-account',
github_account: 'form-github-account',
blog_url: 'form-blog-url'
}[attribute]
Expand Down
Loading
Loading