fix: remove changelog_live with missing ChangelogParser dep

This commit is contained in:
Graham McIntire 2026-02-13 18:45:18 -06:00
parent 010736b555
commit 1d77204769

View file

@ -1,102 +0,0 @@
defmodule ToweropsWeb.ChangelogLive do
@moduledoc """
LiveView for displaying the user-facing changelog ("What's New").
"""
use ToweropsWeb, :live_view
@impl true
def mount(_params, _session, socket) do
entries = ToweropsWeb.ChangelogParser.parse_file()
latest_date = ToweropsWeb.ChangelogParser.latest_date()
socket =
socket
|> assign(:page_title, "What's New")
|> assign(:entries, entries)
|> assign(:latest_date, latest_date)
{:ok, socket}
end
@impl true
def handle_params(_params, _url, socket) do
{:noreply, socket}
end
@impl true
def render(assigns) do
~H"""
<Layouts.authenticated
flash={@flash}
current_scope={@current_scope}
active_page="changelog"
>
<div class="max-w-3xl mx-auto">
<div class="mb-8">
<h1 class="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-3">
<.icon name="hero-sparkles" class="h-7 w-7 text-blue-500" />
What's New
</h1>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
Recent updates, improvements, and fixes to Towerops
</p>
</div>
<div id="changelog-seen" phx-hook="ChangelogSeen" data-latest-date={@latest_date}></div>
<div class="relative">
<div class="absolute left-[15px] top-0 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700">
</div>
<div class="space-y-8">
<%= for entry <- @entries do %>
<div class="relative pl-10">
<div class="absolute left-[9px] top-1.5 h-3.5 w-3.5 rounded-full border-2 border-blue-500 bg-white dark:bg-gray-900">
</div>
<div class="bg-white dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-white/10 overflow-hidden">
<div class="px-5 py-3 border-b border-gray-100 dark:border-white/5 bg-gray-50 dark:bg-gray-800/75">
<div class="flex items-center gap-3">
<time class="text-sm font-semibold text-gray-900 dark:text-white">
{format_date(entry.date)}
</time>
<span :if={entry.title} class="text-sm text-gray-600 dark:text-gray-400">
{entry.title}
</span>
</div>
</div>
<ul class="px-5 py-3 space-y-2">
<%= for item <- entry.items do %>
<li class="flex items-start gap-2 text-sm text-gray-700 dark:text-gray-300">
<span class="flex-shrink-0 mt-0.5">{type_icon(item.type)}</span>
<span>{item.text}</span>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
</div>
</Layouts.authenticated>
"""
end
defp format_date(date_str) do
case Date.from_iso8601(date_str) do
{:ok, date} ->
Calendar.strftime(date, "%B %-d, %Y")
_ ->
date_str
end
end
defp type_icon(:new), do: ""
defp type_icon(:fix), do: "🔧"
defp type_icon(:improvement), do: "📊"
defp type_icon(:security), do: "🔒"
defp type_icon(_), do: ""
end