From dbb6f7bda9177ad154c4c59a169dab1b56f720db Mon Sep 17 00:00:00 2001 From: GuwandykA Date: Fri, 7 Aug 2026 11:30:20 +0500 Subject: [PATCH] Remove Latest news section from the admin dashboard. Drop the news list and news stat card so the dashboard only shows category, banner, static, and currency counts. Co-authored-by: Cursor --- backend/web/admin/assets/js/dashboard.js | 33 +------------------ .../web/admin/templates/pages/dashboard.html | 23 +------------ 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/backend/web/admin/assets/js/dashboard.js b/backend/web/admin/assets/js/dashboard.js index c574c99..ee52058 100644 --- a/backend/web/admin/assets/js/dashboard.js +++ b/backend/web/admin/assets/js/dashboard.js @@ -1,11 +1,10 @@ /** - * Dashboard: content count cards and the latest news list. + * Dashboard: content count cards. */ (function () { "use strict"; const CARDS = [ - { id: "stat-news", endpoint: "/api/v1/admin/news", listKey: "news" }, { id: "stat-categories", endpoint: "/api/v1/admin/categories", listKey: "categories" }, { id: "stat-banners", endpoint: "/api/v1/admin/banner", listKey: "banners" }, { id: "stat-static", endpoint: "/api/v1/admin/static", listKey: "statics" }, @@ -29,35 +28,5 @@ valueEl.textContent = "—"; } }); - - loadLatestNews(); }); - - async function loadLatestNews() { - const container = document.getElementById("latest-news"); - if (!container) return; - try { - const data = await Api.get("/api/v1/admin/news", { limit: 6, page: 1 }); - const items = (data && data.news) || []; - if (!items.length) { - container.innerHTML = - '
  • No news yet.
  • '; - return; - } - container.innerHTML = items - .map( - (item) => ` -
  • - ${item.imagePath ? `` : ""} -
    - ${UI.escapeHtml(langText(item.title))} - ${UI.escapeHtml(UI.formatDate(item.dateRelease))} -
    -
  • ` - ) - .join(""); - } catch (error) { - container.innerHTML = `
  • ${UI.escapeHtml(error.message)}
  • `; - } - } })(); diff --git a/backend/web/admin/templates/pages/dashboard.html b/backend/web/admin/templates/pages/dashboard.html index c98200f..6b14ba8 100644 --- a/backend/web/admin/templates/pages/dashboard.html +++ b/backend/web/admin/templates/pages/dashboard.html @@ -1,14 +1,7 @@ {{define "pages/dashboard"}} {{template "partials/layout-top" .}} -
    -
    -
    -
    News
    -
    - -
    -
    +
    Categories
    @@ -39,19 +32,5 @@
    -
    -
    -
    -

    Latest news

    - Add news -
    -
      -
    • -
    • -
    • -
    -
    -
    - {{template "partials/layout-bottom" .}} {{end}}