Sha256: 25a4f3fac39319ca5e46a3cd851f722587c304cd110bf9a7044709876c678146
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorator class << self def collections [ :requested, :waiting, :prev_approved, :without_answer, :approved, :rejected, :all ] end def list_attributes [:list_fields] end end decorate_association :event def title if object.values.present? first_name = object.values['Фамилия'] last_name = object.values['Имя'] patronymic = object.values['Отчество'] "#{first_name} #{last_name} #{patronymic}" end end def list_fields content_tag :table, class: :table do object.event.participant_form_fields.map do |field| if field.options['list_field'] == 'true' concat(content_tag(:tr) do concat(content_tag(:td) do field.title end) concat(content_tag(:td) do object.values[field.title] end) end) end end.compact end end def values content_tag :table, class: :table do object.values&.each do |key, value| concat(content_tag(:tr) do concat(content_tag(:td) do key end) concat(content_tag(:td) do value end) end) end end end def participation_state_button_color(event) case event when :previous_approve, :approve :success when :wait_for_decision, :not_got_answer :warning when :reject :danger end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tramway-event-1.6.1 | app/decorators/tramway/event/participant_decorator.rb |
tramway-event-1.6 | app/decorators/tramway/event/participant_decorator.rb |