Sha256: 0feca0ae525b0619abca99d3d4c79cf412f0665844904fa9e652bafcd9ddcc78

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

module LogsViewer
  class DisplayHelper

    def self.get_nested_logs(list)
      html = "<ul style='list-style-type:none'>"
      list.each do |(item)|
        icon_file = '<i class="glyphicon glyphicon-file"></i>'
        icon_dir = '<i class="glyphicon glyphicon-folder-open"></i>'
        link = "<a href='/logs?file=#{item}&number_lines=#{LogsViewer::Config.number_lines}'>#{icon_file} #{item}</a>"
        html += (LogsViewer::Handler.is_file? item) ? "<li>#{link}": "<li>#{icon_dir} #{item}"
        html +="  #{self.get_nested_logs(LogsViewer::Handler.list(item))}" if LogsViewer::Handler.is_directory? item
        html +="</li>"
      end
      html += "</ul>"
      html
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logs_viewer-0.2.0 lib/logs_viewer/display_helper.rb