diff options
author | href <href@random.sh> | 2020-07-07 21:39:10 +0200 |
---|---|---|
committer | href <href@random.sh> | 2020-07-07 21:39:51 +0200 |
commit | d6ee134a5957e299c3ad59011df320b3c41e6e61 (patch) | |
tree | 29567e6635466f8a3415a935b3cc8a777019f5bc /lib/lsg_web/templates/irc | |
parent | bleh (diff) |
pouet
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_web/templates/irc/index.html.eex | 30 | ||||
-rw-r--r-- | lib/lsg_web/templates/irc/txt.html.eex | 7 | ||||
-rw-r--r-- | lib/lsg_web/templates/irc/txts.html.eex | 14 |
3 files changed, 15 insertions, 36 deletions
diff --git a/lib/lsg_web/templates/irc/index.html.eex b/lib/lsg_web/templates/irc/index.html.eex index f127101..9e4f724 100644 --- a/lib/lsg_web/templates/irc/index.html.eex +++ b/lib/lsg_web/templates/irc/index.html.eex @@ -1,23 +1,4 @@ <style type="text/css"> -h1 small { - font-size: 14px; -} -</style> - -<h1><%= Keyword.get(Application.get_env(:lsg, :irc), :name, "ircbot") %></h1> - -<!--<p> -Serveur IRC: <a href="irc://irc.quakenet.org/lsg">irc.quakenet.org #lsg</a>. - Matrix: <a href="https://matrix.random.sh/riot/#rooms/#lsg:random.sh">#lsg:random.sh</a>. -<br /> -<a href="https://115ans.net/irc/">Webchat</a>. -<br /> -<a href="/irc/stats/">Statistiques</a>. -</del> -</p>--> - - -<style type="text/css"> .help-entry h1 { font-size: 18px; } @@ -29,15 +10,22 @@ Serveur IRC: <a href="irc://irc.quakenet.org/lsg">irc.quakenet.org #lsg</a>. <p> <% list = for {identifier, _} <- @commands do %> <% name = String.replace(identifier, "_", " ") %> - <%= link(name, to: "##{identifier}") #raw("<a href='##{identifier}'>#{name}</a>") %> + <%= link(name, to: "##{identifier}") %> <% end %> <small><%= Enum.intersperse(list, " - ") %></small> </p> +<%= if @members != [] do %> +<% users = for {_acc, user, nick} <- @members, do: if(user, do: nick, else: content_tag(:i, nick)) %> +<%= for u <- Enum.intersperse(users, ", ") do %> + <%= u %> +<% end %> +<% end %> + <div class="irchelps"> <%= for {identifier, help} <- @commands do %> <%= if help do %> - <div class="help-entry" id="<%= identifier %>"><%= help |> Earmark.as_html! |> raw() %></div> + <div class="help-entry" id="<%= identifier %>"><%= LSGWeb.LayoutView.liquid_markdown(@conn, help) %></div> <% end %> <% end %> </div> diff --git a/lib/lsg_web/templates/irc/txt.html.eex b/lib/lsg_web/templates/irc/txt.html.eex index 5b31320..e9df681 100644 --- a/lib/lsg_web/templates/irc/txt.html.eex +++ b/lib/lsg_web/templates/irc/txt.html.eex @@ -1,16 +1,9 @@ <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> › <a href="/irc/txt">txt</a> ›</small><br/> - <%= @name %>.txt</h1> - <ol> <%= for {txt, id} <- Enum.with_index(@data) do %> <li id="<%= @name %>-<%= id %>"><%= txt %></li> diff --git a/lib/lsg_web/templates/irc/txts.html.eex b/lib/lsg_web/templates/irc/txts.html.eex index 28d0220..5971ffa 100644 --- a/lib/lsg_web/templates/irc/txts.html.eex +++ b/lib/lsg_web/templates/irc/txts.html.eex @@ -5,13 +5,7 @@ .help-entry h2 { font-size: 16px; } -h1 small { - font-size: 14px; -} </style> -<h1> - <small><a href="/irc"><%= Keyword.get(Application.get_env(:lsg, :irc), :name, "ircbot") %></a> › </small><br/> - txt</h1> <p><strong><%= @lines %></strong> lignes dans <strong><%= @files %></strong> fichiers. <a href="#help">Aide</a>. @@ -19,9 +13,13 @@ h1 small { <ul> <%= for {txt, data} <- @data do %> - <li><a href="/irc/txt/<%= txt %>"><%= txt %></a> <i>(<%= Enum.count(data) %>)</i></li> + <% base_url = cond do + @conn.assigns[:chan] -> "/#{@conn.assigns.network}/#{LSGWeb.format_chan(@conn.assigns.chan)}" + true -> "/-" + end %> + <li><a href="<%= base_url %>/txt/<%= txt %>"><%= txt %></a> <i>(<%= Enum.count(data) %>)</i></li> <% end %> </ul> -<div class="help-entry" id="help"><%= @doc |> Earmark.as_html! |> raw() %></div> +<div class="help-entry" id="help"><%= LSGWeb.LayoutView.liquid_markdown(@conn, @doc) %></div> |