h1
  = @study_group
  - if policy(@study_group).edit?
    = render('shared/edit_button', object: @study_group)

= row(label: 'study_group.name', value: @study_group.name)
= row(label: 'study_group.external_id') do
  code = @study_group.external_id
= row(label: 'study_group.consumer', value: link_to_if(policy(@study_group).show?, @study_group.consumer, @study_group.consumer))
= row(label: 'study_group.member_count', value: @study_group.user_count)


h2.mt-4 = t('activerecord.attributes.study_group.members')
.table-responsive
  table.table class="#{@study_group.users.present? ? 'sortable' : ''}"
    thead
      tr
        th =  t('navigation.sections.users')
    - @study_group.users.each do |user|
      tr
        td = link_to_if(policy(user).show?, user.displayname, user)
