Current section

16 Versions

Jump to

Compare versions

9 files changed
+532 additions
-29 deletions
  @@ -1,6 +1,28 @@
1 - # Changelog for Cldr_HTML v1.0.0
1 + # Changelog
2 2
3 - This is the changelog for Cldr HTML v1.0.0 released on November 1st, 2020. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_numbers/tags)
3 + # Cldr_HTML v0.3.0
4 +
5 + This is the changelog for Cldr HTML v0.3.0 released on May 23rd, 2021. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_html/tags)
6 +
7 + ### Enhancements
8 +
9 + * Add `Cldr.HTML.Territory.select/3` to select territories
10 +
11 + * Add support for `:style` option in `Cldr.HTML.Unit.select/3`
12 +
13 + # Cldr_HTML v0.2.0
14 +
15 + This is the changelog for Cldr HTML v0.2.0 released on February 7th, 2021. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_html/tags)
16 +
17 + ### Enhancements
18 +
19 + * Add `Cldr.HTML.Unit.unit_select/3`
20 +
21 + * Use `Cldr.get_locale/0` not `Cldr.default_locale/0` as default parameter
22 +
23 + # Cldr_HTML v0.1.0
24 +
25 + This is the changelog for Cldr HTML v0.1.0 released on November 1st, 2020. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_html/tags)
4 26
5 27 ### Enhancements
  @@ -6,20 +6,30 @@ HTML helper functions for CLDR.
6 6
7 7 * [Implemented] Select currencies - by default the currencies of the locales configured in the default backend
8 8
9 + * [Implemented] Select units - by default the units returned by `Cldr.Unit.known_units/0`
10 +
9 11 * [Not Implemented] Select territories
10 12
11 13 * [Not Implemented] Select languages
12 14
13 15 * [Not Implemented] Select days of the week and months of the year in a given locale
14 16
17 + ## Examples
18 +
19 + ```elixir
20 + iex> import Phoenix.HTML
21 + iex> safe_to_string Cldr.HTML.Currency.select(:my_form, :currency, selected: :USD, currencies: ~w(usd eur jpy cop))
22 + "<select id=\"my_form_currency\" name=\"my_form[currency]\" selected=\"USD\"><option value=\"COP\">COP - Colombian Peso</option><option value=\"EUR\">EUR - Euro</option><option value=\"JPY\">JPY - Japanese Yen</option><option value=\"USD\">USD - US Dollar</option></select>"
23 + ```
24 +
15 25 ## Installation
16 26
17 - `CldrHtml` can be installed by adding `ex_cldr_html` to your list of dependencies in `mix.exs`:
27 + `Cldr.HTML` can be installed by adding `ex_cldr_html` to your list of dependencies in `mix.exs`:
18 28
19 29 ```elixir
20 30 def deps do
21 31 [
22 - {:ex_cldr_html, "~> 0.1"}
32 + {:ex_cldr_html, "~> 1.0"}
23 33 ]
24 34 end
25 35 ```
  @@ -1,4 +1,5 @@
1 1 use Mix.Config
2 2
3 3 config :ex_cldr,
4 - default_locale: "en-001"
4 + default_locale: "en-001",
5 + default_backend: MyApp.Cldr
  @@ -4,24 +4,25 @@
4 4 <<"HTML helper functions for the Common Locale Data\nRepository (CLDR).">>}.
5 5 {<<"elixir">>,<<"~> 1.8">>}.
6 6 {<<"files">>,
7 - [<<"lib">>,<<"lib/cldr_html.ex">>,<<"lib/cldr_html_currencies.ex">>,
8 - <<"config">>,<<"config/dev.exs">>,<<"config/config.exs">>,
9 - <<"config/test.exs">>,<<"config/release.exs">>,<<"mix.exs">>,
10 - <<"README.md">>,<<"CHANGELOG.md">>,<<"LICENSE.md">>]}.
7 + [<<"lib">>,<<"lib/cldr_html.ex">>,<<"lib/cldr_html_territories.ex">>,
8 + <<"lib/cldr_html_units.ex">>,<<"lib/cldr_html_currencies.ex">>,<<"config">>,
9 + <<"config/dev.exs">>,<<"config/config.exs">>,<<"config/test.exs">>,
10 + <<"config/release.exs">>,<<"mix.exs">>,<<"README.md">>,<<"CHANGELOG.md">>,
11 + <<"LICENSE.md">>]}.
11 12 {<<"licenses">>,[<<"Apache 2.0">>]}.
12 13 {<<"links">>,
13 14 [{<<"Changelog">>,
14 - <<"https://github.com/elixir-cldr/cldr_html/blob/v0.1.0/CHANGELOG.md">>},
15 + <<"https://github.com/elixir-cldr/cldr_html/blob/v0.3.0/CHANGELOG.md">>},
15 16 {<<"GitHub">>,<<"https://github.com/elixir-cldr/cldr_html">>},
16 17 {<<"Readme">>,
17 - <<"https://github.com/elixir-cldr/cldr_html/blob/v0.1.0/README.md">>}]}.
18 + <<"https://github.com/elixir-cldr/cldr_html/blob/v0.3.0/README.md">>}]}.
18 19 {<<"name">>,<<"cldr_html">>}.
19 20 {<<"requirements">>,
20 21 [[{<<"app">>,<<"ex_cldr">>},
21 22 {<<"name">>,<<"ex_cldr">>},
22 23 {<<"optional">>,false},
23 24 {<<"repository">>,<<"hexpm">>},
24 - {<<"requirement">>,<<"~> 2.18">>}],
25 + {<<"requirement">>,<<"~> 2.22">>}],
25 26 [{<<"app">>,<<"phoenix_html">>},
26 27 {<<"name">>,<<"phoenix_html">>},
27 28 {<<"optional">>,false},
  @@ -32,11 +33,21 @@
32 33 {<<"optional">>,true},
33 34 {<<"repository">>,<<"hexpm">>},
34 35 {<<"requirement">>,<<"~> 2.8">>}],
36 + [{<<"app">>,<<"ex_cldr_territories">>},
37 + {<<"name">>,<<"ex_cldr_territories">>},
38 + {<<"optional">>,true},
39 + {<<"repository">>,<<"hexpm">>},
40 + {<<"requirement">>,<<"~> 2.2">>}],
35 41 [{<<"app">>,<<"ex_money">>},
36 42 {<<"name">>,<<"ex_money">>},
37 43 {<<"optional">>,true},
38 44 {<<"repository">>,<<"hexpm">>},
39 45 {<<"requirement">>,<<"~> 5.0">>}],
46 + [{<<"app">>,<<"ex_cldr_units">>},
47 + {<<"name">>,<<"ex_cldr_units">>},
48 + {<<"optional">>,true},
49 + {<<"repository">>,<<"hexpm">>},
50 + {<<"requirement">>,<<"~> 3.5">>}],
40 51 [{<<"app">>,<<"jason">>},
41 52 {<<"name">>,<<"jason">>},
42 53 {<<"optional">>,true},
  @@ -52,4 +63,4 @@
52 63 {<<"optional">>,false},
53 64 {<<"repository">>,<<"hexpm">>},
54 65 {<<"requirement">>,<<"~> 0.18">>}]]}.
55 - {<<"version">>,<<"0.1.0">>}.
66 + {<<"version">>,<<"0.3.0">>}.
  @@ -8,4 +8,13 @@ defmodule Cldr.HTML do
8 8 if Cldr.Code.ensure_compiled?(Cldr.Currency) do
9 9 defdelegate currency_select(form, field, options), to: Cldr.HTML.Currency, as: :select
10 10 end
11 +
12 + if Cldr.Code.ensure_compiled?(Cldr.Unit) do
13 + defdelegate unit_select(form, field, options), to: Cldr.HTML.Unit, as: :select
14 + end
15 +
16 + if Cldr.Code.ensure_compiled?(Cldr.Territory) do
17 + defdelegate territory_select(form, field, options), to: Cldr.HTML.Territory, as: :select
18 + end
19 +
11 20 end
Loading more files…