element_list.erl 451 B

12345678910111213141516171819202122
  1. -module(element_list).
  2. %%-author('Rusty Klophaus').
  3. -include_lib("nitro/include/nitro.hrl").
  4. -export([
  5. render_element/1
  6. ]).
  7. render_element(Record = #list{}) ->
  8. Tag = case Record#list.numbered of
  9. true -> <<"ol">>;
  10. _ -> <<"ul">>
  11. end,
  12. wf_tags:emit_tag(Tag, nitro:render(Record#list.body), [
  13. {<<"id">>, Record#list.id},
  14. {<<"class">>, Record#list.class},
  15. {<<"style">>, Record#list.style} | Record#list.data_fields
  16. ]).