Billing Stripe, link regia mobile e staff solo trasmissione.
Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
32
backend/app/helpers/roster_helper.rb
Normal file
32
backend/app/helpers/roster_helper.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
module RosterHelper
|
||||
def roster_person_avatar(person, team, size: 96)
|
||||
primary = team.effective_primary_color
|
||||
secondary = team.effective_secondary_color
|
||||
style = "--avatar-primary:#{primary};--avatar-secondary:#{secondary};width:#{size}px;height:#{size}px"
|
||||
|
||||
if person.photo_url.present?
|
||||
image_tag person.photo_url, alt: person.full_name, class: "roster-avatar roster-avatar--photo",
|
||||
style: style, width: size, height: size
|
||||
else
|
||||
tag.div(
|
||||
person.initials,
|
||||
class: "roster-avatar roster-avatar--placeholder",
|
||||
style: "#{style};font-size:#{(size * 0.34).round}px",
|
||||
aria: { label: person.full_name }
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def roster_category_options
|
||||
TeamRosterMember::DISPLAY_ORDER.map do |cat|
|
||||
[TeamRosterMember::CATEGORY_LABELS[cat], cat]
|
||||
end
|
||||
end
|
||||
|
||||
def roster_player_role_options(selected = nil)
|
||||
options_for_select(
|
||||
[["— Seleziona ruolo —", ""]] + TeamRosterMember::VOLLEYBALL_PLAYER_ROLES.map { |r| [r, r] },
|
||||
selected
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user