millions-exabyte-27721
05/14/2025, 10:55 AMmillions-exabyte-27721
05/14/2025, 10:56 AMmillions-exabyte-27721
05/14/2025, 10:58 AMmillions-exabyte-27721
05/14/2025, 10:58 AMmillions-exabyte-27721
05/14/2025, 11:16 AMmillions-exabyte-27721
05/14/2025, 11:16 AMloud-jewelry-99127
05/14/2025, 11:31 AMloud-jewelry-99127
05/14/2025, 11:31 AMloud-jewelry-99127
05/14/2025, 11:32 AMmillions-exabyte-27721
05/14/2025, 11:36 AMloud-jewelry-99127
05/14/2025, 11:36 AMmillions-exabyte-27721
05/14/2025, 11:37 AMmillions-exabyte-27721
05/14/2025, 11:38 AMloud-jewelry-99127
05/14/2025, 11:49 AMloud-jewelry-99127
05/14/2025, 11:49 AMloud-jewelry-99127
05/14/2025, 11:51 AMmillions-exabyte-27721
05/14/2025, 11:56 AMrb
class Avo::Filters::EventRegistrations < Avo::Filters::BooleanFilter
self.name = "Event Anmeldungen"
# self.visible = -> do
# true
# end
def apply(request, query, values)
return query if values["registered"] && values["unregistered"]
if values["registered"]
query = query.where.not(registered_at: nil)
elsif values["unregistered"]
query = query.where(registered_at: nil)
end
query
end
def options
{
registered: "Angemeldet",
unregistered: "Nicht Angemeldet"
}
end
end
class Avo::Filters::EventRoles < Avo::Filters::BooleanFilter
self.name = "Event Rollen"
# self.visible = -> do
# true
# end
def apply(request, query, values)
return query if values.values.all? { _1 }
conditions = values
.select { |_, value| value == true }
.keys
.map { |role| "event_roles ->> '#{role}' = 'true'" }
.join(" OR ")
query.where(conditions)
end
def options
roles
end
def roles
Event.find(params[:id])&.roles || {}
end
endmillions-exabyte-27721
05/14/2025, 11:57 AMmillions-exabyte-27721
05/14/2025, 11:57 AMmillions-exabyte-27721
05/14/2025, 11:58 AMloud-jewelry-99127
05/14/2025, 12:10 PMloud-jewelry-99127
05/14/2025, 12:14 PMmillions-exabyte-27721
05/16/2025, 6:33 AMloud-jewelry-99127
05/16/2025, 6:34 AMloud-jewelry-99127
05/16/2025, 6:35 AMmillions-exabyte-27721
05/16/2025, 6:35 AMloud-jewelry-99127
05/16/2025, 6:36 AMavo communitymillions-exabyte-27721
05/16/2025, 6:36 AMloud-jewelry-99127
05/16/2025, 6:36 AMloud-jewelry-99127
05/16/2025, 6:37 AMmillions-exabyte-27721
05/16/2025, 8:10 AMmillions-exabyte-27721
05/16/2025, 8:10 AMloud-jewelry-99127
05/16/2025, 8:53 AMloud-jewelry-99127
05/16/2025, 8:53 AMmillions-exabyte-27721
05/17/2025, 1:23 PMjs
uriParams() {
return URI(window.location.toString()).query(true);
}
we need to check if we're in a Turbo Framemillions-exabyte-27721
05/17/2025, 1:23 PMsrc, not the window.locationmillions-exabyte-27721
05/17/2025, 1:23 PMmillions-exabyte-27721
05/17/2025, 1:33 PMjs
uriParams() {
const turboFrame = this.urlRedirectTarget.dataset.turboFrame;
return URI(
!turboFrame
? window.location.toString()
: this.element.closest(`turbo-frame#${turboFrame}`).src,
).query(true);
}
now I just need to find a way to use your prettier settings 😄millions-exabyte-27721
05/17/2025, 2:32 PMloud-jewelry-99127
05/17/2025, 5:24 PM