woylie / flop_phoenix

Components for pagination, sortable tables and filter forms using Phoenix, Ecto and Flop
MIT License
354 stars 37 forks source link

Allow to pass list directly to config #351

Closed ponychicken closed 2 weeks ago

ponychicken commented 2 weeks ago

In the docs you suggest to set up a new module that will provide the config. For just changing one config item its a bit much boilerplate. This change allows one to just put the config like this:

config :flop_phoenix,
  pagination: [opts: [
    wrapper_attrs: [class: "flex"],
    pagination_list_attrs: [class: "order-2"],
    previous_link_attrs: [class: "order-1"],
    next_link_attrs: [class: "order-3"]
  ]]
coveralls commented 2 weeks ago

Coverage Status

coverage: 98.608% (-0.2%) from 98.805% when pulling 92e89ccf7d9fdc1d98bd38f4854b58367f8862ca on ponychicken:patch-1 into dad6a180f2320da1110c177cdffbf196523edb38 on woylie:main.

woylie commented 2 weeks ago

I usually put those functions into my CoreComponents module.

Thanks!

coveralls commented 2 weeks ago

Coverage Status

coverage: 98.608% (-0.2%) from 98.805% when pulling 7b2fb31ac6a059160b9e846d83af4978dba03696 on ponychicken:patch-1 into b4723e45a841b505b2ed6cf26c9b1301c51cb925 on woylie:main.