vol1ura/Sat_9am_5km

View on GitHub
app/views/admin/users/_user.html.arb

Summary

Maintainability
Test Coverage
# frozen_string_literal: true

attributes_table_for user do
  row :first_name
  row :last_name
  row :email
  row(:telegram_user) { |user| telegram_link user }
  row :role
  row :note if current_user.admin?
  row :created_at
  row('Номер паркран') { |u| u.athlete&.parkrun_code }
  row('Номер 5 вёрст') { |u| u.athlete&.fiveverst_code }
  row('Номер RunPark') { |u| u.athlete&.runpark_code }
  row('Пол') { |u| u.athlete&.gender }
  row('Клуб') { |u| u.athlete&.club&.name }
  row :athlete
end

panel 'Правки' do
  render partial: 'admin/audits_table', locals: { object: user }
end