-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: link scheduling #75
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything backend-wise is great! Good job!
Now, to represent a scheduled link on the backoffice table, we should probably use JavaScript to make it more interactive and up to date. Learn more about Phoenix hooks here
<:col :let={{_id, link}} label="Name"> | ||
<p class="font-semibold text-zinc-900"><%= link.name %></p> | ||
<p class={"font-semibold text-zinc-900 #{if publish_in_future?(link), do: "opacity-50"}"}><%= link.name %></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid repeating publish_in_future
in every p
pre-calculate this before when you fetch and assign links
<p class={"font-semibold text-zinc-900 #{if publish_in_future?(link), do: "opacity-50"}"}><%= link.name %></p> | |
<p class={"font-semibold text-zinc-900 #{if publish_in_future?(link), do: "opacity-50"}"}><%= link.name %></p> |
@@ -15,30 +15,55 @@ | |||
</.header> | |||
|
|||
<.table id="links" rows={@streams.links} phx-hook="Sorting"> | |||
<:col :let={{_id, _link}}><.icon name="hero-bars-3 cursor-pointer ml-4" class="handle w-5 h-5" /></:col> | |||
<:col :let={{_id, link}}> | |||
<.icon name="hero-bars-3 cursor-pointer ml-4" class={"handle w-5 h-5 #{if publish_in_future?(link), do: "opacity-50"}"} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:col :let={{_id, link}} label="Emoji"> | ||
<.emoji code={link.emoji} /> | ||
<span class={if publish_in_future?(link), do: "opacity-50"}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:col :let={{_id, link}} label="URL"> | ||
<.link target="_blank" class="hover:text-brand hover:underline" navigate={link.url}> | ||
<.link target="_blank" class={"hover:text-brand hover:underline #{if publish_in_future?(link), do: "opacity-50"}"} navigate={link.url}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:col :let={{_id, link}} label="Clicks"><%= link.visits %></:col> | ||
|
||
<:col :let={{_id, link}} label="Time Left"> | ||
<%= if publish_in_future?(link) do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
</:col> | ||
|
||
<:col :let={{_id, link}} label="Clicks"> | ||
<p class={if publish_in_future?(link), do: "opacity-50"}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:col :let={{_id, link}} label="Attention"> | ||
<input type="checkbox" disabled={true} checked={link.attention} class="self-center block rounded-md text-gray-600" /> | ||
<input type="checkbox" disabled={true} checked={link.attention} class={"self-center block rounded-md text-gray-600 #{if publish_in_future?(link), do: "opacity-50"}"} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:action :let={{_id, link}}> | ||
<.link patch={~p"/admin/links/#{link}/edit"}> | ||
<.icon name="hero-pencil" class="w-5 h-5" /> | ||
<.icon name="hero-pencil" class={"w-5 h-5 #{if publish_in_future?(link), do: "opacity-50"}"} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
<:action :let={{_id, link}}> | ||
<.link patch={~p"/admin/links/#{link}/archive"}> | ||
<.icon name="hero-archive-box" class="w-5 h-5" /> | ||
<.icon name="hero-archive-box" class={"w-5 h-5 #{if publish_in_future?(link), do: "opacity-50"}"} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
No description provided.