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

管理者側のユーザー一覧にある項目を変更 #7509

Merged
merged 4 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@
.admin-table__user
display: inline-flex
align-items: center
flex-wrap: wrap
gap: .25rem .25rem

.admin-table__user-icon
+size(2.125rem)
display: inline-block
flex: 0 0 2.125rem
&:not(:last-child)
margin-right: .5rem

Expand Down
58 changes: 27 additions & 31 deletions app/views/admin/users/_table.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
th.admin-table__label
| 企業
= render 'sort_column', order_by: 'company_id', direction: direction, target: @target
th.admin-table__label 職業
th.admin-table__label Discord
th.admin-table__label
|
Expand All @@ -19,15 +20,14 @@
th.admin-table__label
| 登録日時
= render 'sort_column', order_by: 'created_at', direction: direction, target: @target
th.admin-table__label 相談部屋
th.admin-table__label カード登録
th.admin-table__label サブスク
th.admin-table__label 卒業
th.admin-table__label 外部サービス
th.admin-table__label 操作
tbody.admin-table__items
- users.each do |user|
- next if params[:target] == 'campaign' && user.adviser?
tr.admin-table__item class="#{user.retired_on? ? 'is-retired' : ''} #{user.hibernated? ? 'is-retired' : ''}"
tr.admin-table__item class="text-center #{user.retired_on? ? 'is-retired' : ''} #{user.hibernated? ? 'is-retired' : ''}"
td.admin-table__item-value
- if user.admin? && user.mentor?
span.admin-table__role
Expand Down Expand Up @@ -63,39 +63,52 @@
span.admin-table__role
| 現役生
- if !user.active? && (!user.hibernated? || !user.retired_on?)
br
span.a-badge.is-secondary.is-xs
| 非ア
td.admin-table__item-value
td.admin-table__item-value.text-left
= link_to user, class: 'admin-table__user', target: '_blank', rel: 'noopener' do
span(class="a-user-role is-#{user.primary_role}")
= image_tag user.avatar_url, title: user.icon_title, class: 'admin-table__user-icon a-user-icon'
span.admin-table__user-icon
span(class="a-user-role is-#{user.primary_role}")
= image_tag user.avatar_url, title: user.icon_title, class: 'admin-table__user-icon a-user-icon'
span.admin-table__user-login-name
= user.login_name
| (#{user.name})
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
= user.email
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
- if user.company.present?
= user.company.name
- else
| -
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
span.whitespace-nowrap
- if user.job
= t("activerecord.enums.user.job.#{user.job}")
- else
| 回答なし
td.admin-table__item-value.text-center
- if user.discord_profile.present?
= user.discord_profile.account_name || '-'
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
- if user.last_activity_at?
= l user.last_activity_at
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
= l user.created_at
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
- if user.talk
= link_to '相談部屋', talk_url(user.talk, anchor: 'latest-comment'), class: 'whitespace-nowrap'
- else
| -
td.admin-table__item-value.text-center
- if user.card?
= link_to user.customer_url,
class: 'a-button is-sm is-success is-icon',
target: '_blank', rel: 'noopener' do
i.fa-solid.fa-credit-card
- else
| -
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
- if user.subscription_id?
= link_to user.subscription_url,
class: 'subscription-status',
Expand All @@ -105,24 +118,7 @@
i.fa-solid.fa-spinner.fa-pulse
- else
| -
td.admin-table__item-value.is-text-align-center
- if user.graduated_on?
.a-button.is-sm.is-disabled
| 卒業済
- else
= link_to '卒業', user_graduation_path(user), method: :patch, data: { confirm: '本当によろしいですか?' }, class: 'a-button is-sm is-primary'
td.admin-table__item-value.is-text-align-center
- if user.github_collaborator?
= link_to 'https://github.com/orgs/fjordllc/people', class: 'a-button is-sm is-warning is-icon', target: '_blank', rel: 'noopener' do
i.fa-brands.fa-github-alt
- else
.a-button.is-sm.is-disabled.is-icon
i.fa-brands.fa-github-alt
- if user.retired_on? && user.github_collaborator?
.admin-table__item-block-link-container
= link_to edit_admin_user_path(user, anchor: 'external-services') do
| 外部サービス設定変更
td.admin-table__item-value.is-text-align-center
td.admin-table__item-value.text-center
= link_to edit_admin_user_path(user), id: "edit-#{user.id}", class: 'a-button is-sm is-secondary is-icon' do
i.fa-solid.fa-pen

Expand Down