summaryrefslogtreecommitdiff
path: root/lib/lsg_web/templates/alcoolog/index.html.eex
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/lsg_web/templates/alcoolog/index.html.eex55
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/lsg_web/templates/alcoolog/index.html.eex b/lib/lsg_web/templates/alcoolog/index.html.eex
new file mode 100644
index 0000000..507be71
--- /dev/null
+++ b/lib/lsg_web/templates/alcoolog/index.html.eex
@@ -0,0 +1,55 @@
+<style type="text/css">
+h1 small {
+ font-size: 14px;
+}
+ol li {
+ margin-bottom: 5px
+}
+</style>
+
+<h1>
+ <small><a href="/irc"><%= Keyword.get(Application.get_env(:lsg, :irc), :name, "ircbot") %></a> &rsaquo; </small><br/>
+ alcoolog <%= @channel %>
+</h1>
+
+<ul>
+ <%= for {nick, status} <- @stats do %>
+ <li><strong><%= nick %> <%= status.user_status %> - <%= status.trend_symbol %> <%= status.active %> g/l</strong><br/>
+ &mdash; 15m: <%= status.active15m %> g/l - 30m: <%= status.active30m %> g/l - 1h: <%= status.active1h %> g/l<br />
+ &mdash; dernier verre: <%= status.last_type %> <%= status.last_descr %> (<%= status.last_points %>)
+ <%= LSGWeb.LayoutView.format_time(status.last_at) %>
+ <br />
+ &mdash; sobre dans: <%= status.sober_in_s %>
+ <br />
+ <small>
+ &mdash; aujourd'hui: <%= status.daily_volumes %> points, <%= status.daily_gl %> g/l
+ </small>
+ </li>
+ <% end %>
+</ul>
+
+<p>
+ top consommateur par volume, les 7 derniers jours: <%= Enum.intersperse(for({nick, count} <- @top, do: "#{nick}: #{Float.round(count,4)}"), ", ") %>
+</p>
+
+<table class="table">
+ <thead>
+ <tr>
+ <th scope="col">date</th>
+ <th scope="col">nick</th>
+ <th scope="col">points</th>
+ <th scope="col">nom</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%= for {{nick, date}, points, _, nom, comment} <- @drinks do %>
+ <% date = DateTime.from_unix!(date, :millisecond) %>
+ <th scope="row"><%= LSGWeb.LayoutView.format_time(date, false) %></th>
+ <td><%= nick %></td>
+ <td><%= Float.round(points+0.0, 5) %></td>
+ <td><%= nom||"" %> <%= comment||"" %></td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+