module Platformx # Layout helpers # @author Tim Mushen module LayoutHelpers # Panel top view helper # @param title [String] the title of the panel # @param panel_class [String] the panel html classes # @return [String] rendered panel top html def x_panel_top(title: "", panel_class: "") if title != "" title=<

#{title}

EOS end panel =< #{title}
EOS return panel end # Panel bttom view helper # @return [String] rendered panel bottom html def x_panel_bottom panel =<
EOS return panel end # Card (top) view helper # @param title [String] title of the card # @param subtitle [String] subtitle of the card # @param card_class [String] card html classes # @param header_css [String] header css of the card # @param buttons [String] card buttons # @return [String] rendered card top html def x_card_top(title: "",subtitle: "", card_class: "", header_css: "", buttons: "", modal_cog_url: "") modal_cog_html = "" unless modal_cog_url == "" modal_cog_html = "" end if title != "" title =<

#{title}

#{buttons} #{modal_cog_html}

#{subtitle}

EOS end panel =< #{title}
EOS return panel end # Card (bottom) view helper # @return [String] rendered card bottom html def x_card_bottom panel =<
EOS return panel end # Accordian (top) view helper def x_accordian_top(tag: "p", id: "accordian", title: "") panel =<
<#{tag} class=""> #{title}
EOS return panel end # Accordian (bottom) view helper # @return [String] accordian card bottom html def x_accordian_bottom panel =<
EOS return panel end # Gravitar view helper # @param email [String] email of the user to show the garvitar # @return [String] gravitar image uri def x_gravitar(email: "") hash = "" if !email.nil? # get the email from URL-parameters or what have you and make lowercase email_address = email.downcase # create the md5 hash hash = Digest::MD5.hexdigest(email_address) end # compile URL which can be used in #{t[:name]} EOS tab_builder << s end tab_wrapper =< EOS return tab_wrapper end # Dashboard Number Widget # @param label [String] number widget label # @param value [String] number widget value # @param icon [String] number widget icon # @return [String] rendered number widget def x_number_widget(label: "", value: "", icon: "", info_modal: "") icon_html = "" unless icon == "" icon_html = " " end info_modal_html = "" unless info_modal == "" info_modal_html = "" end widget =<
#{value}
#{icon_html}#{label} #{info_modal_html}
EOS return widget end end end