neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
index liveview
d8c2cda · gmorell · 2022-07-31 05:16
Files changed
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_query_live/index.ex
+4
−0
@@ -43,4 +43,8 @@ defmodule RoomSanctumWeb.QueryLive.Index do
| 43 | 43 | defp list_cfg_queries(uid) do |
| 44 | 44 | Configuration.list_cfg_queries({:user, uid}) |
| 45 | 45 | end |
| 46 | + | |
| 47 | + defp icon(type) do | |
| 48 | + RoomSanctumWeb.IconHelpers.icon(type) | |
| 49 | + end | |
| 46 | 50 | end |
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_query_live/index.html.heex
+6
−1
@@ -27,7 +27,12 @@
| 27 | 27 | <tbody id="cfg_queries"> |
| 28 | 28 | <%= for query <- @cfg_queries do %> |
| 29 | 29 | <tr id={"query-#{query.id}"}> |
| 30 | − <td><%= query.source.name %></td> | |
| 30 | + <td> | |
| 31 | + <span class="tooltip tooltip-primary" data-tip={query.source.type}> | |
| 32 | + <i class={"fas fa-fw #{icon(query.source.type)}"}></i> | |
| 33 | + </span> | |
| 34 | + <%= query.source.name %> | |
| 35 | + </td> | |
| 31 | 36 | <td><%= query.name %></td> |
| 32 | 37 | |
| 33 | 38 | <td> |
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_source_live/index.html.heex
+1
−1
@@ -30,7 +30,7 @@ current_user={@current_user}
| 30 | 30 | <tr id={"source-#{source.id}"}> |
| 31 | 31 | <td><%= source.name %></td> |
| 32 | 32 | <td> |
| 33 | − <span class="tooltip" data-tip={source.type}> | |
| 33 | + <span class="tooltip tooltip-primary" data-tip={source.type}> | |
| 34 | 34 | <i class={"fas #{icon(source.type)}"}></i> |
| 35 | 35 | </span> |
| 36 | 36 | </td> |
added
apps/room_sanctum/lib/room_sanctum_web/live/landing_live/index.ex
+22
−0
@@ -0,0 +1,22 @@
| 1 | +defmodule RoomSanctumWeb.LandingLive.Index do | |
| 2 | + use RoomSanctumWeb, :live_view_a | |
| 3 | + | |
| 4 | + alias RoomSanctum.Configuration | |
| 5 | + alias RoomSanctum.Configuration.Query | |
| 6 | + | |
| 7 | + @impl true | |
| 8 | + def mount(_params, _session, socket) do | |
| 9 | + {:ok, assign(socket, :queries, [])} | |
| 10 | + end | |
| 11 | + | |
| 12 | + @impl true | |
| 13 | + def handle_params(params, _url, socket) do | |
| 14 | + {:noreply, apply_action(socket, socket.assigns.live_action, params)} | |
| 15 | + end | |
| 16 | + | |
| 17 | + defp apply_action(socket, :index, _params) do | |
| 18 | + socket | |
| 19 | + |> assign(:page_title, "Apollo's Crib") | |
| 20 | + end | |
| 21 | + | |
| 22 | +end |
added
apps/room_sanctum/lib/room_sanctum_web/live/landing_live/index.html.heex
+75
−0
@@ -0,0 +1,75 @@
| 1 | +<div class="hero min-h-[80%] bg-accent-100 m-10 pt-12"> | |
| 2 | + <div class="hero-content text-center"> | |
| 3 | + <div class="max-w-md"> | |
| 4 | + <h1 class="text-5xl font-bold text-accent">Hello there</h1> | |
| 5 | + <p class="py-6">Welcome to the crib. Check out a preview of what's happening below, or...</p> | |
| 6 | + <%= if @current_user do %> | |
| 7 | + <%= link "Offerings", to: Routes.source_index_path(@socket, :index), class: "btn btn-primary" %> | |
| 8 | + <%= link "Queries", to: Routes.query_index_path(@socket, :index), class: "btn btn-primary" %> | |
| 9 | + <%= link "Visions", to: Routes.vision_index_path(@socket, :index), class: "btn btn-primary" %> | |
| 10 | + <%= link "Foci", to: Routes.foci_index_path(@socket, :index), class: "btn btn-primary" %> | |
| 11 | + <% else %> | |
| 12 | + <button class="btn btn-primary"> | |
| 13 | + <%= link "Log in", to: Routes.user_session_path(@socket, :new) %> | |
| 14 | + </button> | |
| 15 | + <% end %> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | +</div> | |
| 19 | +<div class="carousel rounded-box"> | |
| 20 | + <div class="carousel-item w-1/5"> | |
| 21 | + <div class="card bg-base-100 shadow-xl m-4"> | |
| 22 | + <div class="card-body"> | |
| 23 | + <h2 class="card-title">DATA!</h2> | |
| 24 | + <p>If a dog chews shoes whose shoes does he choose?</p> | |
| 25 | + <div class="card-actions justify-end"> | |
| 26 | + <button class="btn btn-primary">Buy Now</button> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + <div class="carousel-item w-1/5"> | |
| 32 | + <div class="card bg-base-100 shadow-xl m-4"> | |
| 33 | + <div class="card-body"> | |
| 34 | + <h2 class="card-title">DATA!</h2> | |
| 35 | + <p>If a dog chews shoes whose shoes does he choose?</p> | |
| 36 | + <div class="card-actions justify-end"> | |
| 37 | + <button class="btn btn-primary">Buy Now</button> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="carousel-item w-1/5"> | |
| 43 | + <div class="card bg-base-100 shadow-xl m-4"> | |
| 44 | + <div class="card-body"> | |
| 45 | + <h2 class="card-title">DATA!</h2> | |
| 46 | + <p>If a dog chews shoes whose shoes does he choose?</p> | |
| 47 | + <div class="card-actions justify-end"> | |
| 48 | + <button class="btn btn-primary">Buy Now</button> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + <div class="carousel-item w-1/5"> | |
| 54 | + <div class="card bg-base-100 shadow-xl m-4"> | |
| 55 | + <div class="card-body"> | |
| 56 | + <h2 class="card-title">DATA!</h2> | |
| 57 | + <p>If a dog chews shoes whose shoes does he choose?</p> | |
| 58 | + <div class="card-actions justify-end"> | |
| 59 | + <button class="btn btn-primary">Buy Now</button> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + <div class="carousel-item w-1/5"> | |
| 65 | + <div class="card bg-base-100 shadow-xl m-4"> | |
| 66 | + <div class="card-body"> | |
| 67 | + <h2 class="card-title">DATA!</h2> | |
| 68 | + <p>If a dog chews shoes whose shoes does he choose?</p> | |
| 69 | + <div class="card-actions justify-end"> | |
| 70 | + <button class="btn btn-primary">Buy Now</button> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | +</div> |
modified
apps/room_sanctum/lib/room_sanctum_web/router.ex
+1
−1
@@ -22,7 +22,7 @@ defmodule RoomSanctumWeb.Router do
| 22 | 22 | |
| 23 | 23 | scope "/", RoomSanctumWeb do |
| 24 | 24 | pipe_through [:browser] |
| 25 | − get "/", PageController, :index | |
| 25 | + live "/", LandingLive.Index, :index | |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | scope "/", RoomSanctumWeb do |
Parents: ae8662f