Skip to content

Commit

Permalink
Update twitter dashboard approval css (#3973)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIvanoff authored Nov 3, 2023
1 parent 1ef3136 commit d6bb661
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"mix.exs",
".formatter.exs"
],
# plugins: [Phoenix.LiveView.HTMLFormatter],
plugins: [Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
]
2 changes: 1 addition & 1 deletion lib/sanbase_web/components/layouts/app.html.heex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="px-4 sm:px-6 lg:px-8">
</header>
<main class="px-4 py-20 sm:px-6 lg:px-8">
<div class="mx-auto max-w-2xl">
<div class="mx-auto">
<.flash_group flash={@flash} />
<%= @inner_content %>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,41 @@ defmodule SanbaseWeb.MonitoredTwitterHandleLive do
def render(assigns) do
~H"""
<div>
<div class="flex-1 p:2 sm:p-6 justify-between flex flex-col-reverse scrolling-auto">
<div class="flex-1 p:2 sm:p-6 justify-center flex flex-col-reverse scrolling-auto">
<.table id="monitored_twitter_handles" rows={@handles}>
<:col :let={row} label="Status"><p class={row.status_color}-600><%= row.status |> String.replace("_", " ") |> String.upcase() %></p></:col>
<:col :let={row} label="Twitter Handle (Clickable link)"><.link class="underline text-blue-600" href={"https://x.com/#{row.handle}"}><%= row.handle %></.link></:col>
<:col :let={row} label="Status">
<p class={row.status_color} -600>
<%= row.status |> String.replace("_", " ") |> String.upcase() %>
</p>
</:col>
<:col :let={row} label="Twitter Handle (Clickable link)">
<.link class="underline text-blue-600" href={"https://x.com/#{row.handle}"}>
<%= row.handle %>
</.link>
</:col>
<:col :let={row} label="Notes"><%= row.notes %></:col>
<:col :let={row} label="User ID"><%= row.user_id %></:col>
<:col :let={row} label="Username"><%= row.user_username %></:col>
<:col :let={row} label="Email"><%= row.user_email %></:col>
<:col :let={row} label="Moderator comment"><%= row.comment %></:col>
<:action :let={row}>
<.form for={@form} phx-submit="update_status">
<.input type="text" field={@form[:comment]} placeholder="Comment..." />
<.input type="text" class="" field={@form[:comment]} placeholder="Comment..." />
<input type="hidden" name="record_id" value={row.id} />
<.button name="status" value="approved">Approve</.button>
<.button name="status" value="declined">Decline</.button>
<.button
name="status"
value="approved"
class="my-1 focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800"
>
Approve
</.button>
<.button
name="status"
value="declined"
class="my-1 focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"
>
Decline
</.button>
</.form>
</:action>
</.table>
Expand Down

0 comments on commit d6bb661

Please sign in to comment.