Skip to content

Commit

Permalink
ユーザーグループ分けの一覧のカードを別々にした
Browse files Browse the repository at this point in the history
  • Loading branch information
machida committed Aug 30, 2024
1 parent c0fe8f9 commit 775cd7a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

.user-group__title
+media-breakpoint-up(md)
font-size: 1.125rem
font-size: 1rem
+media-breakpoint-down(sm)
font-size: 1rem

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/stylesheets/atoms/_a-user-icons.sass
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.a-user-icons
padding-top: .5rem
margin-top: .75rem
border-top: dotted 1px var(--border-tint)
border-top: dashed 1px var(--border)
margin-bottom: -.25rem

.a-user-icons__items
Expand Down
8 changes: 4 additions & 4 deletions app/views/generations/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ main.page-main
| ユーザーはありません
- else
.container.is-lg
.card-list.a-card
- @generations.each do |generation|
- users = Generation.new(generation.number).target_users(@target)
- if !users.empty?
- @generations.each do |generation|
- users = Generation.new(generation.number).target_users(@target)
- if !users.empty?
.a-card
.user-group
header.user-group__header
h2.user-group__title
Expand Down
35 changes: 18 additions & 17 deletions app/views/tags/_tag.html.slim
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
.user-group class="#{users_tags_gradation(tag.count, @top3_tags_counts[0])}"
header.user-group__header
h2.user-group__title.is-inline
= link_to users_tag_path(tag.name), class: 'user-group__title-link'
- rank = users_tags_rank(tag.count, @top3_tags_counts)
- if rank.present?
span.user-group__title-icon(class="#{rank}")
i.fa-solid.fa-crown
span.user-group__title-label
| #{tag.name}
span.user-group__count
| (#{tag.count}
.a-user-icons
.a-user-icons__items
= render partial: 'tags/user',
collection: User.desc_tagged_with(tag.name),
as: :user
.a-card
.user-group class="#{users_tags_gradation(tag.count, @top3_tags_counts[0])}"
header.user-group__header
h2.user-group__title.is-inline
= link_to users_tag_path(tag.name), class: 'user-group__title-link'
- rank = users_tags_rank(tag.count, @top3_tags_counts)
- if rank.present?
span.user-group__title-icon(class="#{rank}")
i.fa-solid.fa-crown
span.user-group__title-label
| #{tag.name}
span.user-group__count
| (#{tag.count}
.a-user-icons
.a-user-icons__items
= render partial: 'tags/user',
collection: User.desc_tagged_with(tag.name),
as: :user
4 changes: 3 additions & 1 deletion app/views/users/areas/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ main.page-main
.user-group
header.user-group__header
h2.user-group__title
= link_to users_group_by_area[:area], users_area_path(area_name: users_group_by_area[:area]), class: 'user-group__title-link'
= link_to users_area_path(area_name: users_group_by_area[:area]), class: 'user-group__title-link' do
span.user-group__title-label
= users_group_by_area[:area]
.a-user-icons
.a-user-icons__items
- users_group_by_area[:users].each do |user|
Expand Down
3 changes: 1 addition & 2 deletions app/views/users/tags/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ main.page-main
.container.is-lg
- if @tags.present?
= paginate @tags
.a-card
= render partial: 'tags/tag', collection: @tags, as: :tag
= render partial: 'tags/tag', collection: @tags, as: :tag
= paginate @tags
- else
.o-empty-message
Expand Down

0 comments on commit 775cd7a

Please sign in to comment.