summaryrefslogtreecommitdiff
path: root/lib/lsg_web/templates
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lsg_web/templates')
-rw-r--r--lib/lsg_web/templates/alcoolog/auth.html.eex12
-rw-r--r--lib/lsg_web/templates/irc/index.html.eex15
-rw-r--r--lib/lsg_web/templates/layout/app.html.eex4
-rw-r--r--lib/lsg_web/templates/open_id/error.html.eex3
-rw-r--r--lib/lsg_web/templates/page/user.html.eex5
5 files changed, 24 insertions, 15 deletions
diff --git a/lib/lsg_web/templates/alcoolog/auth.html.eex b/lib/lsg_web/templates/alcoolog/auth.html.eex
index af6db53..6e5cedc 100644
--- a/lib/lsg_web/templates/alcoolog/auth.html.eex
+++ b/lib/lsg_web/templates/alcoolog/auth.html.eex
@@ -1,6 +1,11 @@
-<h1>authentication</h1>
+<div class="grid grid-cols-2">
+ <h1 class="text-2xl font-bold">authentication</h1>
+ <div class="text-right">
+ <%= link("connect using random.sh", to: "/login/oidc", class: "inline-block font-medium underline") %>
+ </div>
+</div>
-<div id="authenticator">
+<div id="authenticator" class="mt-12 h-32 place-self-end justify-self-start">
<p>
<%= if @bot, do: "Send this to #{@bot} on #{@network}:", else: "Find your bot nickname and send:" %><br /><br />
<strong>/msg <%= @bot || "the-bot-nickname" %> web</strong>
@@ -12,7 +17,7 @@
<script type="text/javascript">
var authSse = new EventSource("/api/irc-auth.sse?redirect_to=" + window.location.pathname);
authSse.addEventListener("token", function(event) {
- html = "<%= if @bot, do: "Send this to #{@bot} on #{@network}:", else: "Find your bot nickname and send:" %><br /><br /><strong>/msg <%= @bot || "the-bot-nickname" %> "+event.data+"</strong>";
+ html = "<%= if @bot, do: "Send this to #{@bot} on #{@network}:", else: "Find your bot nickname and send:" %><br /><br /><strong class='text-xl font-mono ml-12'>/msg <%= @bot || "<the-bot-nickname>" %> "+event.data+"</strong>";
elem = document.getElementById("authenticator");
elem.innerHTML = html;
});
@@ -36,4 +41,3 @@
};
</script>
-
diff --git a/lib/lsg_web/templates/irc/index.html.eex b/lib/lsg_web/templates/irc/index.html.eex
index f20f444..52372b5 100644
--- a/lib/lsg_web/templates/irc/index.html.eex
+++ b/lib/lsg_web/templates/irc/index.html.eex
@@ -1,22 +1,21 @@
<div class="hidden sm:block">
- <nav class="flex flex-wrap content-center">
- <%= link("live", to: LSGWeb.Router.Helpers.live_path(LSGWeb.Endpoint, LSGWeb.ChatLive, @network, LSGWeb.format_chan(@chan)), class: "px-3 py-2 font-medium text-sm leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50") %>
+ <nav class="flex flex-wrap space-x-4">
+ <%= link("live", to: LSGWeb.Router.Helpers.live_path(LSGWeb.Endpoint, LSGWeb.ChatLive, @network, LSGWeb.format_chan(@chan)), class: "py-4 font-medium leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50", 'data-turbo': false) %>
<% list = for {identifier, _} <- @commands do %>
<% name = String.replace(identifier, "_", " ") %>
- <%= link(name, to: "##{identifier}", class: "px-3 py-2 font-medium text-sm leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50") %>
+ <%= link(name, to: "##{identifier}", class: "py-4 font-medium leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50") %>
<% end %>
<%= list %>
</nav>
</div>
<%= 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 %>
+ <ul class="flex flew-wrap space-x-4 mt-12">
+ <%= for user <- @members do %><li><%= user.nick %></li><% end %>
+ </ul>
<% end %>
-<div class="irchelps space-y-6">
+<div class="irchelps space-y-6 mt-12">
<%= for {identifier, help} <- @commands do %>
<%= if help do %>
<div class="bg-white border-b border-gray-200" id="<%= identifier %>">
diff --git a/lib/lsg_web/templates/layout/app.html.eex b/lib/lsg_web/templates/layout/app.html.eex
index bca1555..b918ca5 100644
--- a/lib/lsg_web/templates/layout/app.html.eex
+++ b/lib/lsg_web/templates/layout/app.html.eex
@@ -107,8 +107,8 @@
<h1 class="text-3xl leading-9 font-bold text-white">
<%= if n = @conn.assigns[:network] do %><a href="/<%= n %>"><%= n %></a> &rsaquo; <% end %>
<%= if c = @conn.assigns[:chan] do %><a href="/<%= @conn.assigns.network %>/<%= LSGWeb.format_chan(c) %>"><%= c %></a> &rsaquo; <% end %>
- <%= for({name, href} <- @conn.assigns[:breadcrumbs]||[], do: [link(name, to: href), raw(" &rsaquo; ")]) %>
- <%= @conn.assigns[:title] || @conn.assigns[:chan] || @conn.assigns[:network] %>
+ <%= for({name, href} <- Enum.uniq(@conn.assigns[:breadcrumbs]||[]), do: [link(name, to: href), raw(" &rsaquo; ")]) %>
+ <%= @conn.assigns[:title] %>
</h1>
</div>
</header>
diff --git a/lib/lsg_web/templates/open_id/error.html.eex b/lib/lsg_web/templates/open_id/error.html.eex
new file mode 100644
index 0000000..d1b35b9
--- /dev/null
+++ b/lib/lsg_web/templates/open_id/error.html.eex
@@ -0,0 +1,3 @@
+<h1 class="text-xl font-bold text-red-800">OpenID authentication error</h1>
+
+<p class="mt-12 text-base prose"><%= @error %></p>
diff --git a/lib/lsg_web/templates/page/user.html.eex b/lib/lsg_web/templates/page/user.html.eex
index 56fc485..6eeb39d 100644
--- a/lib/lsg_web/templates/page/user.html.eex
+++ b/lib/lsg_web/templates/page/user.html.eex
@@ -1,6 +1,9 @@
<div class="prose prose-lg">
<ul>
- <li><%= link("Help", to: "/-") %></li>
+ <li><%= link("Help", to: "/-") %></li>
+ <%= unless List.keyfind(@metas, "identity-id", 0) do %>
+ <li><%= link("Connect with random.sh", to: Routes.open_id_path(@conn, :login)) %></li>
+ <% end %>
</ul>
<h2>channels</h2>