|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
defmodule DecentralisedBookIndexWeb.PublisherLive.Show do
|
|
|
|
|
use DecentralisedBookIndexWeb, :live_view
|
|
|
|
|
|
|
|
|
|
alias DecentralisedBookIndex.Accounts.Role
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
def render(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
@ -18,6 +20,27 @@ defmodule DecentralisedBookIndexWeb.PublisherLive.Show do
|
|
|
|
|
</:actions>
|
|
|
|
|
</.header>
|
|
|
|
|
|
|
|
|
|
<%= if not is_nil(@publisher.dbi_server) do %>
|
|
|
|
|
<div>
|
|
|
|
|
<dl>
|
|
|
|
|
<dt class="mt-4 mb-2 font-semibold leading-none text-gray-900 dark:text-white">
|
|
|
|
|
From Server
|
|
|
|
|
</dt>
|
|
|
|
|
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">
|
|
|
|
|
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %>
|
|
|
|
|
<.link navigate={~p"/servers/#{@publisher.dbi_server.id}/"} class="hover:underline">
|
|
|
|
|
{@publisher.dbi_server.name}
|
|
|
|
|
</.link>
|
|
|
|
|
<% else %>
|
|
|
|
|
<.link navigate={@publisher.dbi_server.url} class="hover:underline">
|
|
|
|
|
{@publisher.dbi_server.name}
|
|
|
|
|
</.link>
|
|
|
|
|
<% end %>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<.back navigate={~p"/publishers"}>Back to publishers</.back>
|
|
|
|
|
"""
|
|
|
|
|
end
|
|
|
|
|