Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

server: fix layouts

+504 -477
+1 -5
apps/sower/lib/sower_web/components/layouts.ex
··· 14 14 15 15 ## Examples 16 16 17 - <Layouts.app flash={@flash}> 17 + <Layouts.app flash={@flash} current_user={@current_user}> 18 18 <h1>Content</h1> 19 19 </Layouts.app> 20 20 21 21 """ 22 22 attr :flash, :map, required: true, doc: "the map of flash messages" 23 - 24 - attr :current_scope, :map, 25 - default: nil, 26 - doc: "the current [scope](https://hexdocs.pm/phoenix/scopes.html)" 27 23 28 24 attr :current_user, :map, default: nil 29 25
+1 -1
apps/sower/lib/sower_web/controllers/page_html/home.html.heex
··· 1 - <Layouts.app flash={@flash}> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 2 <div> 3 3 <p> 4 4 Then he told them many things in parables, saying: “A farmer went out to sow his seed. As he was scattering the seed, some fell along the path, and the birds came and ate it up. Some fell on rocky places, where it did not have much soil. It sprang up quickly, because the soil was shallow. But when the sun came up, the plants were scorched, and they withered because they had no root. Other seed fell among thorns, which grew up and choked the plants. Still other seed fell on good soil, where it produced a crop—a hundred, sixty or thirty times what was sown. Whoever has ears, let them hear.”
+49 -47
apps/sower/lib/sower_web/live/agent_live/index.html.heex
··· 1 - <.header> 2 - Listing Agents 3 - <:actions> 4 - <.link patch={~p"/agents/new"}> 5 - <.button>New Agent</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Listing Agents 4 + <:actions> 5 + <.link patch={~p"/agents/new"}> 6 + <.button>New Agent</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.table 11 - id="agents" 12 - rows={@streams.agents} 13 - row_click={fn {_id, agent} -> JS.navigate(~p"/agents/#{agent}") end} 14 - > 15 - <:col :let={{_id, agent}} label="Online">{agent.sid in Map.keys(@agent_presence)}</:col> 16 - <:col :let={{_id, agent}} label="Name">{agent.name}</:col> 17 - <:col :let={{_id, agent}} label="sid">{agent.sid}</:col> 18 - <:col :let={{_id, agent}} label="Local sid">{agent.local_sid}</:col> 19 - <:action :let={{_id, agent}}> 20 - <div class="sr-only"> 21 - <.link navigate={~p"/agents/#{agent}"}>Show</.link> 22 - </div> 23 - <.link patch={~p"/agents/#{agent}/edit"}>Edit</.link> 24 - </:action> 25 - <:action :let={{id, agent}}> 26 - <.link 27 - phx-click={JS.push("delete", value: %{id: agent.id}) |> hide("##{id}")} 28 - data-confirm="Are you sure?" 29 - > 30 - Delete 31 - </.link> 32 - </:action> 33 - </.table> 11 + <.table 12 + id="agents" 13 + rows={@streams.agents} 14 + row_click={fn {_id, agent} -> JS.navigate(~p"/agents/#{agent}") end} 15 + > 16 + <:col :let={{_id, agent}} label="Online">{agent.sid in Map.keys(@agent_presence)}</:col> 17 + <:col :let={{_id, agent}} label="Name">{agent.name}</:col> 18 + <:col :let={{_id, agent}} label="sid">{agent.sid}</:col> 19 + <:col :let={{_id, agent}} label="Local sid">{agent.local_sid}</:col> 20 + <:action :let={{_id, agent}}> 21 + <div class="sr-only"> 22 + <.link navigate={~p"/agents/#{agent}"}>Show</.link> 23 + </div> 24 + <.link patch={~p"/agents/#{agent}/edit"}>Edit</.link> 25 + </:action> 26 + <:action :let={{id, agent}}> 27 + <.link 28 + phx-click={JS.push("delete", value: %{id: agent.id}) |> hide("##{id}")} 29 + data-confirm="Are you sure?" 30 + > 31 + Delete 32 + </.link> 33 + </:action> 34 + </.table> 34 35 35 - <.modal 36 - :if={@live_action in [:new, :edit]} 37 - id="agent-modal" 38 - show 39 - on_cancel={JS.patch(~p"/agents")} 40 - > 41 - <.live_component 42 - module={SowerWeb.AgentLive.FormComponent} 43 - id={@agent.id || :new} 44 - title={@page_title} 45 - action={@live_action} 46 - agent={@agent} 47 - patch={~p"/agents"} 48 - /> 49 - </.modal> 36 + <.modal 37 + :if={@live_action in [:new, :edit]} 38 + id="agent-modal" 39 + show 40 + on_cancel={JS.patch(~p"/agents")} 41 + > 42 + <.live_component 43 + module={SowerWeb.AgentLive.FormComponent} 44 + id={@agent.id || :new} 45 + title={@page_title} 46 + action={@live_action} 47 + agent={@agent} 48 + patch={~p"/agents"} 49 + /> 50 + </.modal> 51 + </Layouts.app>
+47 -45
apps/sower/lib/sower_web/live/agent_live/show.html.heex
··· 1 - <.header> 2 - Agent: {@agent.name} 3 - <:actions> 4 - <.link patch={~p"/agents/#{@agent}/show/edit"} phx-click={JS.push_focus()}> 5 - <.button>Edit agent</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Agent: {@agent.name} 4 + <:actions> 5 + <.link patch={~p"/agents/#{@agent}/show/edit"} phx-click={JS.push_focus()}> 6 + <.button>Edit agent</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.list> 11 - <:item title="Online">{@online}</:item> 12 - <:item title="sid">{@agent.sid}</:item> 13 - <:item title="Local sid">{@agent.local_sid}</:item> 14 - <:item title="Current Generation"> 15 - <%= if Map.has_key?(@current_generation, :path) do %> 16 - {@current_generation.path} 17 - <% end %> 18 - </:item> 19 - <:item title="subscriptions"> 20 - <.table 21 - id="subscriptions" 22 - rows={@agent.subscriptions} 23 - row_click={fn subscription -> JS.navigate(~p"/subscriptions/#{subscription.sid}") end} 24 - > 25 - <:col :let={subscription}>{subscription.seed_name}</:col> 26 - <:col :let={subscription}>{subscription.seed_type}</:col> 27 - <:col :let={subscription}>{subscription.updated_at}</:col> 28 - </.table> 29 - </:item> 30 - </.list> 11 + <.list> 12 + <:item title="Online">{@online}</:item> 13 + <:item title="sid">{@agent.sid}</:item> 14 + <:item title="Local sid">{@agent.local_sid}</:item> 15 + <:item title="Current Generation"> 16 + <%= if Map.has_key?(@current_generation, :path) do %> 17 + {@current_generation.path} 18 + <% end %> 19 + </:item> 20 + <:item title="subscriptions"> 21 + <.table 22 + id="subscriptions" 23 + rows={@agent.subscriptions} 24 + row_click={fn subscription -> JS.navigate(~p"/subscriptions/#{subscription.sid}") end} 25 + > 26 + <:col :let={subscription}>{subscription.seed_name}</:col> 27 + <:col :let={subscription}>{subscription.seed_type}</:col> 28 + <:col :let={subscription}>{subscription.updated_at}</:col> 29 + </.table> 30 + </:item> 31 + </.list> 31 32 32 - <.back navigate={~p"/agents"}>Back to agents</.back> 33 + <.back navigate={~p"/agents"}>Back to agents</.back> 33 34 34 - <.modal 35 - :if={@live_action == :edit} 36 - id="agent-modal" 37 - show 38 - on_cancel={JS.patch(~p"/agents/#{@agent}")} 39 - > 40 - <.live_component 41 - module={SowerWeb.AgentLive.FormComponent} 42 - id={@agent.id} 43 - title={@page_title} 44 - action={@live_action} 45 - agent={@agent} 46 - patch={~p"/agents/#{@agent}"} 47 - /> 48 - </.modal> 35 + <.modal 36 + :if={@live_action == :edit} 37 + id="agent-modal" 38 + show 39 + on_cancel={JS.patch(~p"/agents/#{@agent}")} 40 + > 41 + <.live_component 42 + module={SowerWeb.AgentLive.FormComponent} 43 + id={@agent.id} 44 + title={@page_title} 45 + action={@live_action} 46 + agent={@agent} 47 + patch={~p"/agents/#{@agent}"} 48 + /> 49 + </.modal> 50 + </Layouts.app>
+1 -1
apps/sower/lib/sower_web/live/deployment_live/form.ex
··· 7 7 @impl true 8 8 def render(assigns) do 9 9 ~H""" 10 - <Layouts.app flash={@flash}> 10 + <Layouts.app flash={@flash} current_user={@current_user}> 11 11 <.header> 12 12 {@page_title} 13 13 <:subtitle>Use this form to manage deployment records in your database.</:subtitle>
+1 -1
apps/sower/lib/sower_web/live/deployment_live/index.ex
··· 7 7 @impl true 8 8 def render(assigns) do 9 9 ~H""" 10 - <Layouts.app flash={@flash}> 10 + <Layouts.app flash={@flash} current_user={@current_user}> 11 11 <.header> 12 12 Listing Deployments 13 13 <:actions>
+1 -1
apps/sower/lib/sower_web/live/deployment_live/show.ex
··· 6 6 @impl true 7 7 def render(assigns) do 8 8 ~H""" 9 - <Layouts.app flash={@flash}> 9 + <Layouts.app flash={@flash} current_user={@current_user}> 10 10 <.header> 11 11 Deployment {@deployment.id} 12 12 <:subtitle>This is a deployment record from your database.</:subtitle>
+48 -46
apps/sower/lib/sower_web/live/forge/connection_live/index.html.heex
··· 1 - <.header> 2 - Listing Forges 3 - <:actions> 4 - <.link patch={~p"/forges/new"}> 5 - <.button>New Connection</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Listing Forges 4 + <:actions> 5 + <.link patch={~p"/forges/new"}> 6 + <.button>New Connection</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.table 11 - id="forges" 12 - rows={@streams.forges} 13 - row_click={fn {_id, connection} -> JS.navigate(~p"/forges/#{connection}") end} 14 - > 15 - <:col :let={{_id, connection}} label="Name">{connection.name}</:col> 16 - <:col :let={{_id, connection}} label="Url">{connection.url}</:col> 17 - <:col :let={{_id, connection}} label="Type">{connection.type}</:col> 18 - <:action :let={{_id, connection}}> 19 - <div class="sr-only"> 20 - <.link navigate={~p"/forges/#{connection}"}>Show</.link> 21 - </div> 22 - <.link patch={~p"/forges/#{connection}/edit"}>Edit</.link> 23 - </:action> 24 - <:action :let={{id, connection}}> 25 - <.link 26 - phx-click={JS.push("delete", value: %{id: connection.id}) |> hide("##{id}")} 27 - data-confirm="Are you sure?" 28 - > 29 - Delete 30 - </.link> 31 - </:action> 32 - </.table> 11 + <.table 12 + id="forges" 13 + rows={@streams.forges} 14 + row_click={fn {_id, connection} -> JS.navigate(~p"/forges/#{connection}") end} 15 + > 16 + <:col :let={{_id, connection}} label="Name">{connection.name}</:col> 17 + <:col :let={{_id, connection}} label="Url">{connection.url}</:col> 18 + <:col :let={{_id, connection}} label="Type">{connection.type}</:col> 19 + <:action :let={{_id, connection}}> 20 + <div class="sr-only"> 21 + <.link navigate={~p"/forges/#{connection}"}>Show</.link> 22 + </div> 23 + <.link patch={~p"/forges/#{connection}/edit"}>Edit</.link> 24 + </:action> 25 + <:action :let={{id, connection}}> 26 + <.link 27 + phx-click={JS.push("delete", value: %{id: connection.id}) |> hide("##{id}")} 28 + data-confirm="Are you sure?" 29 + > 30 + Delete 31 + </.link> 32 + </:action> 33 + </.table> 33 34 34 - <.modal 35 - :if={@live_action in [:new, :edit]} 36 - id="connection-modal" 37 - show 38 - on_cancel={JS.patch(~p"/forges")} 39 - > 40 - <.live_component 41 - module={SowerWeb.Forge.ConnectionLive.FormComponent} 42 - id={@connection.id || :new} 43 - title={@page_title} 44 - action={@live_action} 45 - connection={@connection} 46 - patch={~p"/forges"} 47 - /> 48 - </.modal> 35 + <.modal 36 + :if={@live_action in [:new, :edit]} 37 + id="connection-modal" 38 + show 39 + on_cancel={JS.patch(~p"/forges")} 40 + > 41 + <.live_component 42 + module={SowerWeb.Forge.ConnectionLive.FormComponent} 43 + id={@connection.id || :new} 44 + title={@page_title} 45 + action={@live_action} 46 + connection={@connection} 47 + patch={~p"/forges"} 48 + /> 49 + </.modal> 50 + </Layouts.app>
+57 -55
apps/sower/lib/sower_web/live/forge/connection_live/show.html.heex
··· 1 - <.header> 2 - Forge {@connection.id} 3 - <:actions> 4 - <.link patch={~p"/forges/#{@connection}/show/edit"} phx-click={JS.push_focus()}> 5 - <.button>Edit forge</.button> 6 - </.link> 7 - <.link 8 - :if={!@logged_in} 9 - navigate={~p"/forges/#{@connection}/login"} 10 - phx-click={JS.push_focus()} 11 - > 12 - <.button>Login</.button> 13 - </.link> 14 - </:actions> 15 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Forge {@connection.id} 4 + <:actions> 5 + <.link patch={~p"/forges/#{@connection}/show/edit"} phx-click={JS.push_focus()}> 6 + <.button>Edit forge</.button> 7 + </.link> 8 + <.link 9 + :if={!@logged_in} 10 + navigate={~p"/forges/#{@connection}/login"} 11 + phx-click={JS.push_focus()} 12 + > 13 + <.button>Login</.button> 14 + </.link> 15 + </:actions> 16 + </.header> 16 17 17 - <.list> 18 - <:item title="Name">{@connection.name}</:item> 19 - <:item title="Url">{@connection.url}</:item> 20 - <:item title="Type">{@connection.type}</:item> 21 - <:item title="Client ID">{@connection.client_id}</:item> 18 + <.list> 19 + <:item title="Name">{@connection.name}</:item> 20 + <:item title="Url">{@connection.url}</:item> 21 + <:item title="Type">{@connection.type}</:item> 22 + <:item title="Client ID">{@connection.client_id}</:item> 22 23 23 - <:item title="Repositories"> 24 - <.table id="repositories" rows={@connection.repositories}> 25 - <:col :let={repository}>{repository.owner}/{repository.repo}</:col> 26 - <:action :let={repository}> 27 - <button phx-click={JS.push("remove_repo", value: %{repo_id: repository.id})}> 28 - Remove Repository 29 - </button> 30 - </:action> 31 - </.table> 32 - </:item> 33 - </.list> 24 + <:item title="Repositories"> 25 + <.table id="repositories" rows={@connection.repositories}> 26 + <:col :let={repository}>{repository.owner}/{repository.repo}</:col> 27 + <:action :let={repository}> 28 + <button phx-click={JS.push("remove_repo", value: %{repo_id: repository.id})}> 29 + Remove Repository 30 + </button> 31 + </:action> 32 + </.table> 33 + </:item> 34 + </.list> 34 35 35 - <.table :if={@logged_in} id="repositories" rows={@repositories} row_click={false}> 36 - <:col :let={repository}>{repository["full_name"]}</:col> 37 - <:action :let={repository}> 38 - <button phx-click={JS.push("add_repo", value: repository)}> 39 - Add Repository 40 - </button> 41 - </:action> 42 - </.table> 36 + <.table :if={@logged_in} id="repositories" rows={@repositories} row_click={false}> 37 + <:col :let={repository}>{repository["full_name"]}</:col> 38 + <:action :let={repository}> 39 + <button phx-click={JS.push("add_repo", value: repository)}> 40 + Add Repository 41 + </button> 42 + </:action> 43 + </.table> 43 44 44 - <.back navigate={~p"/forges"}>Back to forges</.back> 45 + <.back navigate={~p"/forges"}>Back to forges</.back> 45 46 46 - <.modal 47 - :if={@live_action == :edit} 48 - id="connection-modal" 49 - show 50 - on_cancel={JS.patch(~p"/forges/#{@connection}")} 51 - > 52 - <.live_component 53 - module={SowerWeb.Forge.ConnectionLive.FormComponent} 54 - id={@connection.id} 55 - title={@page_title} 56 - action={@live_action} 57 - connection={@connection} 58 - patch={~p"/forges/#{@connection}"} 59 - /> 60 - </.modal> 47 + <.modal 48 + :if={@live_action == :edit} 49 + id="connection-modal" 50 + show 51 + on_cancel={JS.patch(~p"/forges/#{@connection}")} 52 + > 53 + <.live_component 54 + module={SowerWeb.Forge.ConnectionLive.FormComponent} 55 + id={@connection.id} 56 + title={@page_title} 57 + action={@live_action} 58 + connection={@connection} 59 + patch={~p"/forges/#{@connection}"} 60 + /> 61 + </.modal> 62 + </Layouts.app>
+47 -45
apps/sower/lib/sower_web/live/nix/cache_live/index.html.heex
··· 1 - <.header> 2 - Listing Nix caches 3 - <:actions> 4 - <.link patch={~p"/nix/caches/new"}> 5 - <.button>New Cache</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Listing Nix caches 4 + <:actions> 5 + <.link patch={~p"/nix/caches/new"}> 6 + <.button>New Cache</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.table 11 - id="nix_caches" 12 - rows={@streams.nix_caches} 13 - row_click={fn {_id, cache} -> JS.navigate(~p"/nix/caches/#{cache}") end} 14 - > 15 - <:col :let={{_id, cache}} label="Url">{cache.url}</:col> 16 - <:col :let={{_id, cache}} label="Public key">{cache.public_key}</:col> 17 - <:action :let={{_id, cache}}> 18 - <div class="sr-only"> 19 - <.link navigate={~p"/nix/caches/#{cache}"}>Show</.link> 20 - </div> 21 - <.link patch={~p"/nix/caches/#{cache}/edit"}>Edit</.link> 22 - </:action> 23 - <:action :let={{id, cache}}> 24 - <.link 25 - phx-click={JS.push("delete", value: %{id: cache.id}) |> hide("##{id}")} 26 - data-confirm="Are you sure?" 27 - > 28 - Delete 29 - </.link> 30 - </:action> 31 - </.table> 11 + <.table 12 + id="nix_caches" 13 + rows={@streams.nix_caches} 14 + row_click={fn {_id, cache} -> JS.navigate(~p"/nix/caches/#{cache}") end} 15 + > 16 + <:col :let={{_id, cache}} label="Url">{cache.url}</:col> 17 + <:col :let={{_id, cache}} label="Public key">{cache.public_key}</:col> 18 + <:action :let={{_id, cache}}> 19 + <div class="sr-only"> 20 + <.link navigate={~p"/nix/caches/#{cache}"}>Show</.link> 21 + </div> 22 + <.link patch={~p"/nix/caches/#{cache}/edit"}>Edit</.link> 23 + </:action> 24 + <:action :let={{id, cache}}> 25 + <.link 26 + phx-click={JS.push("delete", value: %{id: cache.id}) |> hide("##{id}")} 27 + data-confirm="Are you sure?" 28 + > 29 + Delete 30 + </.link> 31 + </:action> 32 + </.table> 32 33 33 - <.modal 34 - :if={@live_action in [:new, :edit]} 35 - id="cache-modal" 36 - show 37 - on_cancel={JS.patch(~p"/nix/caches")} 38 - > 39 - <.live_component 40 - module={SowerWeb.Nix.CacheLive.FormComponent} 41 - id={@cache.id || :new} 42 - title={@page_title} 43 - action={@live_action} 44 - cache={@cache} 45 - patch={~p"/nix/caches"} 46 - /> 47 - </.modal> 34 + <.modal 35 + :if={@live_action in [:new, :edit]} 36 + id="cache-modal" 37 + show 38 + on_cancel={JS.patch(~p"/nix/caches")} 39 + > 40 + <.live_component 41 + module={SowerWeb.Nix.CacheLive.FormComponent} 42 + id={@cache.id || :new} 43 + title={@page_title} 44 + action={@live_action} 45 + cache={@cache} 46 + patch={~p"/nix/caches"} 47 + /> 48 + </.modal> 49 + </Layouts.app>
+31 -29
apps/sower/lib/sower_web/live/nix/cache_live/show.html.heex
··· 1 - <.header> 2 - Cache {@cache.id} 3 - <:subtitle>This is a cache record from your database.</:subtitle> 4 - <:actions> 5 - <.link patch={~p"/nix/caches/#{@cache}/show/edit"} phx-click={JS.push_focus()}> 6 - <.button>Edit cache</.button> 7 - </.link> 8 - </:actions> 9 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Cache {@cache.id} 4 + <:subtitle>This is a cache record from your database.</:subtitle> 5 + <:actions> 6 + <.link patch={~p"/nix/caches/#{@cache}/show/edit"} phx-click={JS.push_focus()}> 7 + <.button>Edit cache</.button> 8 + </.link> 9 + </:actions> 10 + </.header> 10 11 11 - <.list> 12 - <:item title="Url">{@cache.url}</:item> 13 - <:item title="Public key">{@cache.public_key}</:item> 14 - </.list> 12 + <.list> 13 + <:item title="Url">{@cache.url}</:item> 14 + <:item title="Public key">{@cache.public_key}</:item> 15 + </.list> 15 16 16 - <.back navigate={~p"/nix/caches"}>Back to Nix Caches</.back> 17 + <.back navigate={~p"/nix/caches"}>Back to Nix Caches</.back> 17 18 18 - <.modal 19 - :if={@live_action == :edit} 20 - id="cache-modal" 21 - show 22 - on_cancel={JS.patch(~p"/nix/caches/#{@cache}")} 23 - > 24 - <.live_component 25 - module={SowerWeb.Nix.CacheLive.FormComponent} 26 - id={@cache.id} 27 - title={@page_title} 28 - action={@live_action} 29 - cache={@cache} 30 - patch={~p"/nix/caches/#{@cache}"} 31 - /> 32 - </.modal> 19 + <.modal 20 + :if={@live_action == :edit} 21 + id="cache-modal" 22 + show 23 + on_cancel={JS.patch(~p"/nix/caches/#{@cache}")} 24 + > 25 + <.live_component 26 + module={SowerWeb.Nix.CacheLive.FormComponent} 27 + id={@cache.id} 28 + title={@page_title} 29 + action={@live_action} 30 + cache={@cache} 31 + patch={~p"/nix/caches/#{@cache}"} 32 + /> 33 + </.modal> 34 + </Layouts.app>
+20 -18
apps/sower/lib/sower_web/live/seed_live/index.html.heex
··· 1 - <.header> 2 - Listing Seeds 3 - <:subtitle>A seed is an installable configuration.</:subtitle> 4 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Listing Seeds 4 + <:subtitle>A seed is an installable configuration.</:subtitle> 5 + </.header> 5 6 6 - <.table 7 - id="seeds" 8 - rows={@streams.seeds} 9 - row_click={fn {_id, seed} -> JS.navigate(~p"/seeds/#{seed}") end} 10 - > 11 - <:col :let={{_id, seed}} label="name">{seed.name}</:col> 12 - <:col :let={{_id, seed}} label="seed_type">{seed.seed_type}</:col> 13 - <:col :let={{_id, seed}} label="updated">{seed.updated_at}</:col> 14 - <:action :let={{_id, seed}}> 15 - <div class="sr-only"> 16 - <.link navigate={~p"/seeds/#{seed}"}>Show</.link> 17 - </div> 18 - </:action> 19 - </.table> 7 + <.table 8 + id="seeds" 9 + rows={@streams.seeds} 10 + row_click={fn {_id, seed} -> JS.navigate(~p"/seeds/#{seed}") end} 11 + > 12 + <:col :let={{_id, seed}} label="name">{seed.name}</:col> 13 + <:col :let={{_id, seed}} label="seed_type">{seed.seed_type}</:col> 14 + <:col :let={{_id, seed}} label="updated">{seed.updated_at}</:col> 15 + <:action :let={{_id, seed}}> 16 + <div class="sr-only"> 17 + <.link navigate={~p"/seeds/#{seed}"}>Show</.link> 18 + </div> 19 + </:action> 20 + </.table> 21 + </Layouts.app>
+13 -11
apps/sower/lib/sower_web/live/seed_live/show.html.heex
··· 1 - <.header> 2 - {@seed.name} 3 - <:subtitle>{@seed.seed_type}</:subtitle> 4 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + {@seed.name} 4 + <:subtitle>{@seed.seed_type}</:subtitle> 5 + </.header> 5 6 6 - <.list> 7 - <:item title="seed type">{@seed.seed_type}</:item> 8 - <:item title="artifact">{@seed.artifact}</:item> 9 - <:item title="created">{@seed.inserted_at}</:item> 10 - <:item title="updated">{@seed.updated_at}</:item> 11 - </.list> 7 + <.list> 8 + <:item title="seed type">{@seed.seed_type}</:item> 9 + <:item title="artifact">{@seed.artifact}</:item> 10 + <:item title="created">{@seed.inserted_at}</:item> 11 + <:item title="updated">{@seed.updated_at}</:item> 12 + </.list> 12 13 13 - <.back navigate={~p"/seeds"}>Back to seeds</.back> 14 + <.back navigate={~p"/seeds"}>Back to seeds</.back> 15 + </Layouts.app>
+51 -49
apps/sower/lib/sower_web/live/settings/access_token_live/index.html.heex
··· 1 - <.header> 2 - My Tokens 3 - <:actions> 4 - <.link patch={~p"/settings/access-tokens/new"}> 5 - <.button>New Token</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + My Tokens 4 + <:actions> 5 + <.link patch={~p"/settings/access-tokens/new"}> 6 + <.button>New Token</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.table 11 - id="access-tokens" 12 - rows={@streams.access_tokens} 13 - row_click={ 14 - fn {_id, access_token} -> JS.navigate(~p"/settings/access-tokens/#{access_token}") end 15 - } 16 - > 17 - <:action :let={{_id, access_token}}> 18 - <div class="sr-only"> 19 - <.link navigate={~p"/settings/access-tokens/#{access_token}"}>Show</.link> 20 - </div> 21 - <.link patch={~p"/settings/access-tokens/#{access_token}/edit"}>Edit</.link> 22 - </:action> 23 - <:action :let={{id, access_token}}> 24 - <.link 25 - phx-click={JS.push("delete", value: %{id: access_token.id}) |> hide("##{id}")} 26 - data-confirm="Are you sure?" 27 - > 28 - Delete 29 - </.link> 30 - </:action> 11 + <.table 12 + id="access-tokens" 13 + rows={@streams.access_tokens} 14 + row_click={ 15 + fn {_id, access_token} -> JS.navigate(~p"/settings/access-tokens/#{access_token}") end 16 + } 17 + > 18 + <:action :let={{_id, access_token}}> 19 + <div class="sr-only"> 20 + <.link navigate={~p"/settings/access-tokens/#{access_token}"}>Show</.link> 21 + </div> 22 + <.link patch={~p"/settings/access-tokens/#{access_token}/edit"}>Edit</.link> 23 + </:action> 24 + <:action :let={{id, access_token}}> 25 + <.link 26 + phx-click={JS.push("delete", value: %{id: access_token.id}) |> hide("##{id}")} 27 + data-confirm="Are you sure?" 28 + > 29 + Delete 30 + </.link> 31 + </:action> 31 32 32 - <:col :let={{_id, access_token}} label="Description">{access_token.description}</:col> 33 - <:col :let={{_id, access_token}} label="Token">sower_{access_token.sid}_...</:col> 34 - <:col :let={{_id, access_token}} label="Expires">{access_token.expires_at}</:col> 35 - </.table> 33 + <:col :let={{_id, access_token}} label="Description">{access_token.description}</:col> 34 + <:col :let={{_id, access_token}} label="Token">sower_{access_token.sid}_...</:col> 35 + <:col :let={{_id, access_token}} label="Expires">{access_token.expires_at}</:col> 36 + </.table> 36 37 37 - <.modal 38 - :if={@live_action in [:new, :edit]} 39 - id="access_token-modal" 40 - show 41 - on_cancel={JS.patch(~p"/settings/access-tokens")} 42 - > 43 - <.live_component 44 - module={SowerWeb.Settings.AccessTokenLive.FormComponent} 45 - id={@access_token.id || :new} 46 - title={@page_title} 47 - action={@live_action} 48 - access_token={@access_token} 49 - current_user={@current_user} 50 - patch={~p"/settings/access-tokens"} 51 - /> 52 - </.modal> 38 + <.modal 39 + :if={@live_action in [:new, :edit]} 40 + id="access_token-modal" 41 + show 42 + on_cancel={JS.patch(~p"/settings/access-tokens")} 43 + > 44 + <.live_component 45 + module={SowerWeb.Settings.AccessTokenLive.FormComponent} 46 + id={@access_token.id || :new} 47 + title={@page_title} 48 + action={@live_action} 49 + access_token={@access_token} 50 + current_user={@current_user} 51 + patch={~p"/settings/access-tokens"} 52 + /> 53 + </.modal> 54 + </Layouts.app>
+46 -44
apps/sower/lib/sower_web/live/settings/access_token_live/show.html.heex
··· 1 - <.header> 2 - Token - {@access_token.sid} 3 - <:actions> 4 - <.link 5 - patch={~p"/settings/access-tokens/#{@access_token}/show/edit"} 6 - phx-click={JS.push_focus()} 7 - > 8 - <.button>Edit</.button> 9 - </.link> 10 - <.link 11 - phx-click={JS.push("delete", value: %{id: @access_token.id})} 12 - data-confirm="Are you sure?" 13 - > 14 - <.button class="bg-red-500 dark:bg-red-500">Delete</.button> 15 - </.link> 16 - </:actions> 17 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Token - {@access_token.sid} 4 + <:actions> 5 + <.link 6 + patch={~p"/settings/access-tokens/#{@access_token}/show/edit"} 7 + phx-click={JS.push_focus()} 8 + > 9 + <.button>Edit</.button> 10 + </.link> 11 + <.link 12 + phx-click={JS.push("delete", value: %{id: @access_token.id})} 13 + data-confirm="Are you sure?" 14 + > 15 + <.button class="bg-red-500 dark:bg-red-500">Delete</.button> 16 + </.link> 17 + </:actions> 18 + </.header> 18 19 19 - <.flash_token flash={@flash} /> 20 + <.flash_token flash={@flash} /> 20 21 21 - <.list> 22 - <:item title="description">{@access_token.description}</:item> 23 - <:item title="expiration date">{@access_token.expires_at}</:item> 24 - <:item title="token">sower_{@access_token.sid}_...</:item> 25 - <:item title="roles"> 26 - <.table id="permissions" rows={@access_token.permissions}> 27 - <:col :let={permission}>{permission.role}</:col> 28 - </.table> 29 - </:item> 30 - </.list> 22 + <.list> 23 + <:item title="description">{@access_token.description}</:item> 24 + <:item title="expiration date">{@access_token.expires_at}</:item> 25 + <:item title="token">sower_{@access_token.sid}_...</:item> 26 + <:item title="roles"> 27 + <.table id="permissions" rows={@access_token.permissions}> 28 + <:col :let={permission}>{permission.role}</:col> 29 + </.table> 30 + </:item> 31 + </.list> 31 32 32 - <.back navigate={~p"/settings/access-tokens"}>Back to access-tokens</.back> 33 + <.back navigate={~p"/settings/access-tokens"}>Back to access-tokens</.back> 33 34 34 - <.modal 35 - :if={@live_action == :edit} 36 - id="access_token-modal" 37 - show 38 - on_cancel={JS.patch(~p"/settings/access-tokens/#{@access_token}")} 39 - > 40 - <.live_component 41 - module={SowerWeb.Settings.AccessTokenLive.FormComponent} 42 - id={@access_token.id} 43 - title={@page_title} 44 - action={@live_action} 45 - access_token={@access_token} 46 - patch={~p"/settings/access-tokens/#{@access_token}"} 47 - /> 48 - </.modal> 35 + <.modal 36 + :if={@live_action == :edit} 37 + id="access_token-modal" 38 + show 39 + on_cancel={JS.patch(~p"/settings/access-tokens/#{@access_token}")} 40 + > 41 + <.live_component 42 + module={SowerWeb.Settings.AccessTokenLive.FormComponent} 43 + id={@access_token.id} 44 + title={@page_title} 45 + action={@live_action} 46 + access_token={@access_token} 47 + patch={~p"/settings/access-tokens/#{@access_token}"} 48 + /> 49 + </.modal> 50 + </Layouts.app>
+8 -6
apps/sower/lib/sower_web/live/settings/index_live.ex
··· 3 3 4 4 def render(assigns) do 5 5 ~H""" 6 - <.header class="text-center"> 7 - Account Settings 8 - </.header> 6 + <Layouts.app flash={@flash} current_user={@current_user}> 7 + <.header class="text-center"> 8 + Account Settings 9 + </.header> 9 10 10 - <div class="space-y-12 divide-y"> 11 - <.link navigate={~p"/settings/access-tokens"}>Access Tokens</.link> 12 - </div> 11 + <div class="space-y-12 divide-y"> 12 + <.link navigate={~p"/settings/access-tokens"}>Access Tokens</.link> 13 + </div> 14 + </Layouts.app> 13 15 """ 14 16 end 15 17
+46 -39
apps/sower/lib/sower_web/live/subscription_live/index.html.heex
··· 1 - <.header> 2 - Listing Subscriptions 3 - <:actions> 4 - <.link patch={~p"/subscriptions/new"}> 5 - <.button>New Subscription</.button> 6 - </.link> 7 - </:actions> 8 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Listing Subscriptions 4 + <:actions> 5 + <.link patch={~p"/subscriptions/new"}> 6 + <.button>New Subscription</.button> 7 + </.link> 8 + </:actions> 9 + </.header> 9 10 10 - <.table 11 - id="subscriptions" 12 - rows={@streams.subscriptions} 13 - row_click={fn {_id, subscription} -> JS.navigate(~p"/subscriptions/#{subscription}") end} 14 - > 15 - <:col :let={{_id, subscription}} label="Sid">{subscription.sid}</:col> 16 - <:action :let={{_id, subscription}}> 17 - <div class="sr-only"> 18 - <.link navigate={~p"/subscriptions/#{subscription}"}>Show</.link> 19 - </div> 20 - <.link patch={~p"/subscriptions/#{subscription}/edit"}>Edit</.link> 21 - </:action> 22 - <:action :let={{id, subscription}}> 23 - <.link 24 - phx-click={JS.push("delete", value: %{id: subscription.id}) |> hide("##{id}")} 25 - data-confirm="Are you sure?" 26 - > 27 - Delete 28 - </.link> 29 - </:action> 30 - </.table> 11 + <.table 12 + id="subscriptions" 13 + rows={@streams.subscriptions} 14 + row_click={fn {_id, subscription} -> JS.navigate(~p"/subscriptions/#{subscription}") end} 15 + > 16 + <:col :let={{_id, subscription}} label="Sid">{subscription.sid}</:col> 17 + <:action :let={{_id, subscription}}> 18 + <div class="sr-only"> 19 + <.link navigate={~p"/subscriptions/#{subscription}"}>Show</.link> 20 + </div> 21 + <.link patch={~p"/subscriptions/#{subscription}/edit"}>Edit</.link> 22 + </:action> 23 + <:action :let={{id, subscription}}> 24 + <.link 25 + phx-click={JS.push("delete", value: %{id: subscription.id}) |> hide("##{id}")} 26 + data-confirm="Are you sure?" 27 + > 28 + Delete 29 + </.link> 30 + </:action> 31 + </.table> 31 32 32 - <.modal :if={@live_action in [:new, :edit]} id="subscription-modal" show on_cancel={JS.patch(~p"/subscriptions")}> 33 - <.live_component 34 - module={SowerWeb.SubscriptionLive.FormComponent} 35 - id={@subscription.id || :new} 36 - title={@page_title} 37 - action={@live_action} 38 - subscription={@subscription} 39 - patch={~p"/subscriptions"} 40 - /> 41 - </.modal> 33 + <.modal 34 + :if={@live_action in [:new, :edit]} 35 + id="subscription-modal" 36 + show 37 + on_cancel={JS.patch(~p"/subscriptions")} 38 + > 39 + <.live_component 40 + module={SowerWeb.SubscriptionLive.FormComponent} 41 + id={@subscription.id || :new} 42 + title={@page_title} 43 + action={@live_action} 44 + subscription={@subscription} 45 + patch={~p"/subscriptions"} 46 + /> 47 + </.modal> 48 + </Layouts.app>
+36 -34
apps/sower/lib/sower_web/live/subscription_live/show.html.heex
··· 1 - <.header> 2 - Subscription {@subscription.id} 3 - <:subtitle>This is a subscription record from your database.</:subtitle> 4 - <:actions> 5 - <.link patch={~p"/subscriptions/#{@subscription}/show/edit"} phx-click={JS.push_focus()}> 6 - <.button>Edit subscription</.button> 7 - </.link> 8 - </:actions> 9 - </.header> 1 + <Layouts.app flash={@flash} current_user={@current_user}> 2 + <.header> 3 + Subscription {@subscription.id} 4 + <:subtitle>This is a subscription record from your database.</:subtitle> 5 + <:actions> 6 + <.link patch={~p"/subscriptions/#{@subscription}/show/edit"} phx-click={JS.push_focus()}> 7 + <.button>Edit subscription</.button> 8 + </.link> 9 + </:actions> 10 + </.header> 10 11 11 - <.list> 12 - <:item title="Agent"> 13 - <.link patch={~p"/agents/#{@subscription.agent}"}> 14 - {@subscription.agent.name} 15 - </.link> 16 - </:item> 17 - <:item title="Seed Name">{@subscription.seed_name}</:item> 18 - <:item title="Seed Type">{@subscription.seed_type}</:item> 19 - </.list> 12 + <.list> 13 + <:item title="Agent"> 14 + <.link patch={~p"/agents/#{@subscription.agent}"}> 15 + {@subscription.agent.name} 16 + </.link> 17 + </:item> 18 + <:item title="Seed Name">{@subscription.seed_name}</:item> 19 + <:item title="Seed Type">{@subscription.seed_type}</:item> 20 + </.list> 20 21 21 - <.back navigate={~p"/subscriptions"}>Back to subscriptions</.back> 22 + <.back navigate={~p"/subscriptions"}>Back to subscriptions</.back> 22 23 23 - <.modal 24 - :if={@live_action == :edit} 25 - id="subscription-modal" 26 - show 27 - on_cancel={JS.patch(~p"/subscriptions/#{@subscription}")} 28 - > 29 - <.live_component 30 - module={SowerWeb.SubscriptionLive.FormComponent} 31 - id={@subscription.id} 32 - title={@page_title} 33 - action={@live_action} 34 - subscription={@subscription} 35 - patch={~p"/subscriptions/#{@subscription}"} 36 - /> 37 - </.modal> 24 + <.modal 25 + :if={@live_action == :edit} 26 + id="subscription-modal" 27 + show 28 + on_cancel={JS.patch(~p"/subscriptions/#{@subscription}")} 29 + > 30 + <.live_component 31 + module={SowerWeb.SubscriptionLive.FormComponent} 32 + id={@subscription.id} 33 + title={@page_title} 34 + action={@live_action} 35 + subscription={@subscription} 36 + patch={~p"/subscriptions/#{@subscription}"} 37 + /> 38 + </.modal> 39 + </Layouts.app>