defmodule GitSyncWeb.Layouts do @moduledoc """ This module holds layouts and related functionality used by your application. """ use GitSyncWeb, :html # Embed all files in layouts/* within this module. # The default root.html.heex file contains the HTML # skeleton of your application, namely HTML headers # and other static content. embed_templates "layouts/*" @doc """ Renders your app layout. This function is typically invoked from every template, and it often contains your application menu, sidebar, or similar. ## Examples

Content

""" attr :flash, :map, required: true, doc: "the map of flash messages" attr :current_operator, :string, default: nil, doc: "the signed-in operator, if any" attr :active_page, :atom, default: nil, values: [nil, :overview, :sources, :connections] slot :inner_block, required: true def app(assigns) do ~H"""
Skip to content
<%= if @current_operator do %> Workspace / {case @active_page do :overview -> "Overview" :sources -> "Sources" :connections -> "Connections" nil -> "Mirror operations" end} Operator {@current_operator} <% else %> git-sync Repository mirror operations <% end %>
<.flash_group flash={@flash} />
{render_slot(@inner_block)}
""" end @doc """ Shows the flash group with standard titles and content. ## Examples <.flash_group flash={@flash} /> """ attr :flash, :map, required: true, doc: "the map of flash messages" attr :id, :string, default: "flash-group", doc: "the optional id of flash container" def flash_group(assigns) do ~H"""
<.flash kind={:info} flash={@flash} /> <.flash kind={:error} flash={@flash} />
""" end end