diff options
Diffstat (limited to 'src/guff/views/dropdown/icon.cr')
-rw-r--r-- | src/guff/views/dropdown/icon.cr | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/guff/views/dropdown/icon.cr b/src/guff/views/dropdown/icon.cr new file mode 100644 index 0000000..8d30b6e --- /dev/null +++ b/src/guff/views/dropdown/icon.cr @@ -0,0 +1,11 @@ +module Guff::Views::Dropdown::Icon + ICON_TEMPLATE = "<i class='fa fa-fw %s'></i>" + + def self.icon(id : String?) + if id && id.size > 0 + ICON_TEMPLATE % [HTML.escape(id.not_nil!)] + else + "" + end + end +end |