Skip to content

Instantly share code, notes, and snippets.

@marzdgzmn
Created September 6, 2018 13:35
Show Gist options
  • Save marzdgzmn/3b2668db8c05f1064e45cb17022c8984 to your computer and use it in GitHub Desktop.
Save marzdgzmn/3b2668db8c05f1064e45cb17022c8984 to your computer and use it in GitHub Desktop.
class Formatter
def self.slim_template(mirrors, time)
sync_report_template = RiseMirrorApp::PROJECT_ROOT_DIR + 'templates/sync_report.slim'
#layout = Slim::Template.new { sync_report_template }
puts Slim::Template.new(sync_report_template).render(mirrors)
end
doctype html
html
head
title Sync Report
meta name='author' content='riseops'
body
- if mirrors.any?
table#mirrors
- for mirror in mirrors
tr
td.name = mirror.name
td.last_successful_sync = mirror.last_successful_sync
td.start_sync = mirror.start_sync
td.end_sync = mirror.end_sync
td.status = mirror.status
td.total_bandwidth = mirror.total_bandwidth
- else
p No mirror information found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment