Module: LatoSpaces::MembershipsHelper
- Included in:
- GroupsHelper
- Defined in:
- app/helpers/lato_spaces/memberships_helper.rb
Instance Method Summary collapse
- #lato_spaces_membership_actions(membership) ⇒ Object
- #lato_spaces_membership_user_infos(membership) ⇒ Object
Instance Method Details
#lato_spaces_membership_actions(membership) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/helpers/lato_spaces/memberships_helper.rb', line 17 def lato_spaces_membership_actions(membership) content_tag(:div, class: 'btn-group btn-group-sm') do if membership.lato_invitation concat link_to(I18n.t('lato_spaces.cta_resend'), lato_spaces.memberships_send_invite_action_path(membership), class: 'btn btn-primary', data: { turbo_confirm: 'Are you sure?', turbo_method: :post }) end concat link_to(I18n.t('lato_spaces.cta_delete'), lato_spaces.memberships_destroy_action_path(membership), class: 'btn btn-danger', data: { turbo_confirm: 'Are you sure?', turbo_method: :delete }) end end |
#lato_spaces_membership_user_infos(membership) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/lato_spaces/memberships_helper.rb', line 3 def lato_spaces_membership_user_infos(membership) infos = '' if membership.lato_invitation infos = content_tag(:small, class: 'text-muted d-inline-block ms-1') do "(invited #{time_ago_in_words(membership.lato_invitation.created_at)} ago)" end end content_tag(:div, class: 'd-flex align-items-center') do concat lato_data_user(membership.user_infos_label) concat infos end end |