10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/fuso/views/report_view.rb', line 10
def render(app)
lines = []
lines << ""
lines << Styles.title.render("Fuso — Reports")
lines << ""
tabs = render_tabs(app)
lines << " #{tabs}"
lines << ""
date_label = if app.report_mode == :weekly
monday = app.report_date - ((app.report_date.wday + 6) % 7)
sunday = monday + 6
"Week #{app.report_date.cweek}: #{monday.strftime('%b %d')} — #{sunday.strftime('%b %d, %Y')}"
else
app.report_date.strftime("%B %Y")
end
lines << " " + Styles.dim.render("◀ ") + Styles.active_label.render(date_label) + Styles.dim.render(" ▶")
lines << ""
if app.report_mode == :weekly
lines << render_weekly(app)
else
lines << render_monthly(app)
end
lines << ""
lines << render_help
lines.join("\n")
end
|