Skip to content

Commit

Permalink
truncate table columns via css (#507)
Browse files Browse the repository at this point in the history
- closes #506

Co-authored-by: robs <[email protected]>
  • Loading branch information
robertkleinschuster and robs authored Dec 13, 2024
1 parent 5371b5d commit 01c9afa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ defmodule Pinchflat.Pages.HistoryTableLive do
</span>
<div class="max-w-full overflow-x-auto">
<.table rows={@records} table_class="text-white">
<:col :let={media_item} label="Title">
<:col :let={media_item} label="Title" class="truncate max-w-xs">
<.subtle_link href={~p"/sources/#{media_item.source_id}/media/#{media_item}"}>
{StringUtils.truncate(media_item.title, 35)}
{media_item.title}
</.subtle_link>
</:col>
<:col :let={media_item} label="Upload Date">
Expand All @@ -42,9 +42,9 @@ defmodule Pinchflat.Pages.HistoryTableLive do
<:col :let={media_item} label="Downloaded At">
{format_datetime(media_item.media_downloaded_at)}
</:col>
<:col :let={media_item} label="Source">
<:col :let={media_item} label="Source" class="truncate max-w-xs">
<.subtle_link href={~p"/sources/#{media_item.source_id}"}>
{StringUtils.truncate(media_item.source.custom_name, 35)}
{media_item.source.custom_name}
</.subtle_link>
</:col>
</.table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ defmodule Pinchflat.Pages.JobTableLive do
<:col :let={task} label="Task">
{worker_to_task_name(task.job.worker)}
</:col>
<:col :let={task} label="Subject">
<:col :let={task} label="Subject" class="truncate max-w-xs">
<.subtle_link href={task_to_link(task)}>
{StringUtils.truncate(task_to_record_name(task), 35)}
{task_to_record_name(task)}
</.subtle_link>
</:col>
<:col :let={task} label="Attempt No.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<div class="flex flex-col gap-10 dark:text-white">
<%= if match?([_|_], @search_results) do %>
<.table rows={@search_results} table_class="text-black dark:text-white">
<:col :let={result} label="Title">
<:col :let={result} label="Title" class="truncate max-w-xs">
<.subtle_link href={~p"/sources/#{result.source_id}/media/#{result.id}"}>
{StringUtils.truncate(result.title, 35)}
{result.title}
</.subtle_link>
</:col>
<:col :let={result} label="Excerpt">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ defmodule PinchflatWeb.Sources.IndexTableLive do
def render(assigns) do
~H"""
<.table rows={@sources} table_class="text-white">
<:col :let={source} label="Name">
<:col :let={source} label="Name" class="truncate max-w-xs">
<.subtle_link href={~p"/sources/#{source.id}"}>
{StringUtils.truncate(source.custom_name || source.collection_name, 35)}
{source.custom_name || source.collection_name}
</.subtle_link>
</:col>
<:col :let={source} label="Pending">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ defmodule PinchflatWeb.Sources.MediaItemTableLive do
</div>
</header>
<.table rows={@records} table_class="text-white">
<:col :let={media_item} label="Title">
<:col :let={media_item} label="Title" class="truncate max-w-xs">
<.subtle_link href={~p"/sources/#{@source.id}/media/#{media_item.id}"}>
{StringUtils.truncate(media_item.title, 50)}
{media_item.title}
</.subtle_link>
</:col>
<:col :let={media_item} :if={@media_state == "other"} label="Manually Ignored?">
Expand Down

0 comments on commit 01c9afa

Please sign in to comment.