Sha256: 5a62539c59ac61c531ce853ba095ac19b88c39261a4a51c1ac35fd8ca6ad5bce

Contents?: true

Size: 782 Bytes

Versions: 6

Compression:

Stored size: 782 Bytes

Contents

# Dashboard - My mentorship groups
class EffectiveMentorshipsGroupsDatatable < Effective::Datatable
  datatable do
    order :mentorship_cycle

    col :mentorship_cycle
    col :title

    col :mentorship_group_users, search: :string do |mentorship_group|
      mentorship_group.mentorship_group_users.map do |mentorship_group_user| 
        user = mentorship_group_user.user

        content_tag(:div, class: 'col-resource_item') do
          mentorship_role_badge(mentorship_group_user.mentorship_role) + ' ' + link_to(user, "mailto:#{user.try(:public_email).presence || user.email}")
        end
      end.join.html_safe
    end

    actions_col
  end

  collection do
    EffectiveMentorships.MentorshipGroup.deep.unarchived.where(id: current_user.mentorship_groups)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
effective_mentorships-0.2.4 app/datatables/effective_mentorships_groups_datatable.rb
effective_mentorships-0.2.3 app/datatables/effective_mentorships_groups_datatable.rb
effective_mentorships-0.2.2 app/datatables/effective_mentorships_groups_datatable.rb
effective_mentorships-0.2.1 app/datatables/effective_mentorships_groups_datatable.rb
effective_mentorships-0.2.0 app/datatables/effective_mentorships_groups_datatable.rb
effective_mentorships-0.1.0 app/datatables/effective_mentorships_groups_datatable.rb