feat: more UI cleanup

This commit is contained in:
2026-04-24 18:34:01 +02:00
parent 6824b89691
commit d4b0213a55
6 changed files with 407 additions and 105 deletions

View File

@@ -10,10 +10,11 @@ defmodule BDS.UI.ShellPage do
def render do
bootstrap = bootstrap()
ui_language = get_in(bootstrap, [:i18n, :ui_language]) || "en"
[
"<!DOCTYPE html>",
"<html lang=\"en\">",
"<html lang=\"#{ui_language}\">",
"<head>",
" <meta charset=\"utf-8\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">",
@@ -58,6 +59,10 @@ defmodule BDS.UI.ShellPage do
title: Application.get_env(:bds, :desktop)[:title] || "Blogging Desktop Server",
i18n: %{
ui_language: ui_language,
catalogs:
Enum.into(I18n.supported_languages(), %{}, fn language ->
{language.code, I18n.get_ui_translations(language.code)}
end),
supported_ui_languages:
Enum.map(I18n.supported_languages(), fn language ->
%{

View File

@@ -183,7 +183,9 @@ defmodule BDS.UI.Workbench do
right: %{
post_status: post_status(state, Keyword.get(opts, :active_post_status)),
post_count: "#{Keyword.get(opts, :post_count, 0)} posts",
post_count_value: Keyword.get(opts, :post_count, 0),
media_count: "#{Keyword.get(opts, :media_count, 0)} media",
media_count_value: Keyword.get(opts, :media_count, 0),
token_usage: token_usage(state, Keyword.get(opts, :token_usage)),
theme_badge: Keyword.get(opts, :theme_badge, "default"),
offline_mode: Keyword.get(opts, :offline_mode, false),
@@ -265,4 +267,4 @@ defmodule BDS.UI.Workbench do
defp clamp_sidebar_width(width), do: max(200, min(width, 500))
defp clamp_assistant_sidebar_width(width), do: max(280, min(width, 640))
end
end