Skip to content

money and integer types #362

Closed
wants to merge 1 commit into from

4 participants

@paulsponagl

This needs the modified version of
custom fields with money type and
integer type.

I fixed a few things btw. too
1) datepicker localization
2) german locales
3) localization of toggles

With the money type one can add a
money based field and use
{{ product.price | format_money }}
or
{{ product.price | format_money: 'format:%n %u' ... }}
within liquid templates. (format_money args are the same
as the number_to_currency rails helper args)

currency exchange and calculation filters will follow.

@did
Locomotive member
did commented Apr 16, 2012

very nice work my friend !
I would change only a slight stuff if you don't mind. Actually, I will embed the "data-label-on" / "data-label-off" declaration within the Locomotive::Toggle input so that we don't have to modify all the forms (that's the beauty of the new formtastic inputs).
Other than that, I like the way you handled translations for the datepicker :-)

Waw, that's a very professional amount of code you sent us :-) again thanks !

The big dilemma for us is to know if we are going to embed it in the final 2.0.0 version ;-)

@paulsponagl

thanks for the flowers did:)
i dont mind - of course - in fact i was too lazy to scan where to put those data's :)
i am happy to leave the 'when to merge' descision up to you ;)

@paulsponagl paulsponagl money and integer views
This needs the modified version of
custom fields with money type and
integer type.

I fixed a few things btw. too
1) datepicker localization
2) german locales

With the money type one can add a
money based field and use
{{ product.price | format_money }}
or
{{ product.price | format_money: 'format:%n %u' ... }}
within liquid templates. (format_money args are the same
as the number_to_currency rails helper args)

currency exchange and calculation filters will follow.
d7bf97c
@mariovisic
Locomotive member

Hi Paul

Thanks for the pull request.

Unfortunately I cannot merge this for a couple of reasons. Firstly because there is just too much code that and no tests have been added or modified, with a project of this size we simply cannot start adding new untested code.

Secondly i'm not sure if the majority of users will require this feature. Yes there will be some users that require a money value for custom fields but the majority will not. We cannot just accept every single feature because a few users might benefit, it's not a maintainable approach. We're just going to end up with a CMS that does everything, but not very well. I would prefer doing less things, but doing them well.

I hope you understand but i'm going to have to close this issue. If you still feel as though you want this to be part of the core locomotive CMS engine then i'd suggest starting a topic on the discussion group. If enough users say they require this feature then I will reconsider it. We're still going to nee some cucumber features to cover the new features though.

Cheers
Mario

@mariovisic mariovisic closed this May 6, 2012
@paulsponagl

Hi Mario,

the main testing for the money and integer part is placed within the custom_fields pull request.
I agree - a few additional fields should be added within contents.feature.
At least you should consider cherry picking the german translations and the datepicker translation.

Regarding your fear of the loss of control: I cannot see where additional numeric fields will hurt the cms part.
i'd assume that a lot of content needs pricing information or integers...

Btw. i had a chat with did regarding those types and it seemed that his pov was to include this.
You might consider talking to him too...

Best
Paul

@mariovisic
Locomotive member

If possible, could you please include the translations in a separate commit and pull request? I'll merge them in straight away if you could do so.

It's not an issue about having control over the CMS. The issue is that features that are not beneficial for most still have to be maintained. Locomotive CMS is never going to solve every single problem. It would be better if we could spend our time maintaining the features that users are going to benefit from the most.

I'm not saying this feature isn't important and I obviously there are some users that will want this feature. It might be a good idea to include this code as well as any other code users will need for an e-commerce system in a separate gem.

@johnvejnoska

I would like to upvote a money filter or integer type filter. Shopify has this, http://wiki.shopify.com/Money. At the very least I would like to have a filter that adds a comma, eg 1000 = "1,000", 10000000 = "10,000,000".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.