Skip to content

Commit

Permalink
Merge pull request #6865 from fjordllc/feature/display-do-not-partici…
Browse files Browse the repository at this point in the history
…pate-regular-event-and-special-event-on-dashboard

ダッシュボードの近日開催のイベントに、参加していない定期イベントも表示するようにした&参加登録済イベントに表示をつけた
  • Loading branch information
komagata authored Dec 14, 2023
2 parents cc4ab7e + c3a56a6 commit 0670e4e
Show file tree
Hide file tree
Showing 33 changed files with 354 additions and 209 deletions.
9 changes: 3 additions & 6 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ def display_dashboard
end

def display_events_on_dashboard
@today_events = (Event.today_events.related_to(current_user) \
+ RegularEvent.today_events.participated_by(current_user))
@today_events = (Event.today_events + RegularEvent.today_events)
.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))
@tomorrow_events = (Event.tomorrow_events + RegularEvent.tomorrow_events)
.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))
@day_after_tomorrow_events = (Event.day_after_tomorrow_events + RegularEvent.day_after_tomorrow_events)
.sort_by { |e| e.start_at.strftime('%H:%M') }
end

Expand Down
3 changes: 2 additions & 1 deletion app/javascript/bookmark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.card-list-item(:class='isBookmarkClassName')
.card-list-item__inner
.card-list-item__label
| {{ bookmark.modelNameI18n }}
span.card-list-item__label-inner
| {{ bookmark.modelNameI18n }}
.card-list-item__rows
.card-list-item__row
.card-list-item-title
Expand Down
17 changes: 16 additions & 1 deletion app/javascript/components/watch.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
<template lang="pug">
.card-list-item(:class='isWatchClassName')
.card-list-item__inner
.card-list-item__label
.card-list-item__label(v-if='watch.model_name == "regular_event"')
span.card-list-item__label-inner.is-sm
| 定期
br
| イベント
.card-list-item__label(v-else-if='watch.model_name == "event"')
span.card-list-item__label-inner.is-sm
| 特別
br
| イベント
.card-list-item__label(v-else-if='watch.model_name == "practice"')
span.card-list-item__label-inner
| プラク
br
| ティス
.card-list-item__label(v-else)
| {{ watch.model_name_with_i18n }}
.card-list-item__rows
.card-list-item__row
Expand Down
12 changes: 9 additions & 3 deletions app/javascript/searchable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
| 定期
br
| イベント
.card-list-item__label(v-else-if='searchable.model_name == "event"')
span.card-list-item__label-inner.is-sm
| 特別
br
| イベント
.card-list-item__label(v-else-if='searchable.model_name == "practice"')
| プラク
br
| ティス
span.card-list-item__label-inner
| プラク
br
| ティス
.card-list-item__label(v-else)
| {{ searchable.model_name_with_i18n }}
.card-list-item__rows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
.header-dropdown__item:not(:last-child) &
border-bottom: solid 1px var(--border-tint)
&:hover
background-color: var(--background-tint)
background-color: var(--background-more-tint)
+media-breakpoint-down(sm)
color: var(--reversal-text)
border-bottom: solid 1px var(--main-semi-shade)
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/stylesheets/atoms/_a-text-link.sass
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.a-text-link
+hover-link-reversal
+default-link
&.has-badge
text-decoration: none
.a-text-link__text
+hover-link-reversal
+default-link

.a-hover-link
+hover-link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.card-list-item__inner
+position(relative)
display: flex
gap: .75rem
gap: 1rem

a.card-list-item__inner
+flex-link
Expand Down Expand Up @@ -66,66 +66,22 @@ a.card-list-item__inner

.card-list-item__label
border-radius: .25rem
background-color: var(--accent)
color: var(--main)
background-color: var(--base)
border: solid 1px var(--main)
display: flex
align-items: center
justify-content: center
+text-block(.625rem 1.3, center)
+text-block(.625rem 1.4, center)
position: relative
font-feature-settings: "palt"
+media-breakpoint-up(md)
+size(2.75rem)
+media-breakpoint-down(sm)
+size(2.5rem)
.card-list-item.is-report &
background-color: #7f6fb7
color: var(--reversal-text)
.card-list-item.is-practice &
background-color: #5bbcc7
color: var(--reversal-text)
.card-list-item.is-question &
background-color: #e2965b
color: var(--reversal-text)
.card-list-item.is-page &
background-color: #56925c
color: var(--reversal-text)
.card-list-item.is-announcement &
background-color: #f7cd5b
color: var(--default-text)
.card-list-item.is-event &
background-color: #fb96a3
color: var(--reversal-text)
.card-list-item.is-regular_event &
background-color: #dc6ed2
color: var(--reversal-text)
.card-list-item.is-product &
background-color: #909b3c
color: var(--reversal-text)
.card-list-item.is-user &
background-color: #7cbd9c
color: var(--reversal-text)
// events
&.is-special
background-color: #ee8d8d
color: var(--reversal-text)
// regular_events
&.is-meeting
background-color: #7f6fb7
color: var(--reversal-text)
&.is-reading-circle
background-color: #79bcc3
color: var(--reversal-text)
&.is-question
background-color: #de9172
color: var(--reversal-text)
&.is-chat
background-color: #56925c
color: var(--reversal-text)
&.is-others
background-color: #f7cd5b
color: var(--default-text)
&.is-no-holding
background-color: transparent
border: none

.card-list-item__label-inner
&.is-sm
Expand Down Expand Up @@ -229,3 +185,6 @@ a.card-list-item__inner
.card-list-item__empty
+text-block(.8125rem 1.4, center)
color: var(--muted-text)

.card-list-item__badge
margin-right: .25rem
1 change: 1 addition & 0 deletions app/views/api/watches/_watch.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ json.updated_at matched_document(watch.watchable).updated_at
json.url searchable_url(watch.watchable)
json.title matched_document(watch.watchable).title
json.watch_class_name watch.watchable_type.to_s.tableize.chop
json.model_name matched_document(watch.watchable_type).to_s.tableize.singularize
json.model_name_with_i18n t("activerecord.models.#{matched_document(watch.watchable_type).to_s.tableize.singularize}")
json.summary searchable_summary(filtered_message(watch.watchable))
29 changes: 21 additions & 8 deletions app/views/events/edit.html.slim
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
- title '特別イベント編集'
- set_meta_tags description: '特別イベント編集ページです。'

header.page-header
.container
.page-header__inner
h2.page-header__title = title
hr.a-border
.page-body
.container.is-xxl
= render 'form', event: @event
= render 'events/header'
= render 'events/tabs'

.page-main
header.page-main-header
.container
.page-main-header__inner
.page-main-header__start
h2.page-header__title
= title
.page-main-header__end
.page-main-header-actions
ul.page-main-header-actions__items
li.page-main-header-actions__item
= link_to events_path, class: 'a-button is-md is-secondary is-block is-back' do
| 特別イベント一覧
hr.a-border

.page-body
.container.is-xxl
= render 'form', event: @event
5 changes: 4 additions & 1 deletion app/views/events/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- title 'イベント'
- title '特別イベント'
- set_meta_tags description: '特別イベント一覧ページです。'

= render 'events/header'
= render 'events/tabs'
Expand All @@ -8,6 +9,8 @@
.container
.page-main-header__inner
.page-main-header__start
h2.page-header__title
= title
.page-main-header__end
.page-main-header-actions
ul.page-main-header-actions__items
Expand Down
33 changes: 20 additions & 13 deletions app/views/events/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
- title '特別イベント作成'
- set_meta_tags description: '特別イベント作成ページです。'

header.page-header
.container
.page-header__inner
h2.page-header__title = title
.page-header-actions
.page-header-actions__items
.page-header-actions__item
= link_to events_path, class: 'a-button is-md is-secondary is-block is-back' do
| 特別イベント一覧
hr.a-border
.page-body
.container.is-xxl
= render 'form', event: @event
= render 'events/header'
= render 'events/tabs'

.page-main
header.page-main-header
.container
.page-main-header__inner
.page-main-header__start
h2.page-header__title
= title
.page-main-header__end
.page-main-header-actions
ul.page-main-header-actions__items
li.page-main-header-actions__item
= link_to events_path, class: 'a-button is-md is-secondary is-block is-back' do
| 特別イベント一覧
hr.a-border
.page-body
.container.is-xxl
= render 'form', event: @event
95 changes: 50 additions & 45 deletions app/views/events/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
- title @event.title
- set_meta_tags description: "特別イベント「#{@event.title}」のページです。#{@event.period}に開催。"

header.page-header
.container
.page-header__inner
.page-header__title
| イベント
.page-header-actions
ul.page-header-actions__items
- if admin_or_mentor_login?
li.page-header-actions__item.is-only-mentor
= link_to new_event_path, class: 'a-button is-md is-secondary is-block' do
i.fa-regular.fa-plus
| 特別イベント作成
li.page-header-actions__item
= link_to events_path, class: 'a-button is-md is-secondary is-block is-back' do
| 特別イベント一覧

= render 'events/header'
= render 'events/tabs'

- if @event.wip?
.a-page-notice.is-danger
.container.is-md
.a-page-notice__inner
p
| 公開されるまでお待ちください。
- elsif [email protected]?
.page-main
header.page-main-header
.container
.page-main-header__inner
.page-main-header__start
.page-main-header__title
| 特別イベント
.page-main-header__end
.page-main-header-actions
ul.page-main-header-actions__items
li.page-main-header-actions__item
= link_to new_event_path, class: 'a-button is-md is-secondary is-block' do
i.fa-regular.fa-plus
| 特別イベント作成
li.page-main-header-actions__item
= link_to events_path, class: 'a-button is-md is-secondary is-block is-back' do
| 特別イベント一覧

- if @event.wip?
.a-page-notice.is-danger
.container.is-md
.a-page-notice__inner
p
| 公開されるまでお待ちください。
- elsif @event.before_opening?
.a-page-notice.is-danger
.container.is-md
.a-page-notice__inner
p
| 募集開始までお待ち下さい。
- elsif @event.closing?
.a-page-notice.is-muted
.container.is-md
.a-page-notice__inner
p
| 募集受付は終了しました。
- elsif [email protected]?
- if @event.wip?
.a-page-notice.is-danger
.container.is-md
.a-page-notice__inner
p
| 公開されるまでお待ちください。
- elsif @event.before_opening?
.a-page-notice.is-danger
.container.is-md
.a-page-notice__inner
p
| 募集開始までお待ち下さい。
- elsif @event.closing?
.a-page-notice.is-muted
.container.is-md
.a-page-notice__inner
p
| 募集受付は終了しました。
- else
.a-page-notice.is-muted
.container.is-md
.a-page-notice__inner
p
| このイベントは終了しました。
- else
.a-page-notice.is-muted
.container.is-md
.a-page-notice__inner
p
| このイベントは終了しました。
hr.a-border

.page-body
.container.is-md
= render 'event', event: @event
#js-comments(data-commentable-id="#{@event.id}" data-commentable-type='Event' data-current-user-id="#{current_user.id}")
div(data-vue='Footprints' data-vue-footprintable-id="#{@event.id}" data-vue-footprintable-type='Event')
.page-body
.container.is-md
= render 'event', event: @event
#js-comments(data-commentable-id="#{@event.id}" data-commentable-type='Event' data-current-user-id="#{current_user.id}")
div(data-vue='Footprints' data-vue-footprintable-id="#{@event.id}" data-vue-footprintable-type='Event')
3 changes: 2 additions & 1 deletion app/views/home/_bookmark.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
= "#{bookmark.bookmarkable.user.long_name} さんの相談部屋"
- else
.card-list-item__label
= bookmark.bookmarkable.model_name.human
span.card-list-item__label-inner
= bookmark.bookmarkable.model_name.human
.card-list-item__rows
.card-list-item__row
header.card-list-item-title
Expand Down
Loading

0 comments on commit 0670e4e

Please sign in to comment.