diff --git a/dashboard/static/css/dashboard.css b/dashboard/static/css/dashboard.css new file mode 100644 index 0000000..4958490 --- /dev/null +++ b/dashboard/static/css/dashboard.css @@ -0,0 +1,63 @@ +.dashboard-container { + padding: 20px; + background-color: #f5f5f5; +} + +.dashboard-header { + margin-bottom: 20px; +} + +.dashboard-stats { + display: flex; + justify-content: space-between; + margin-bottom: 20px; +} + +.stat-block { + background: white; + border-radius: 8px; + padding: 20px; + text-align: center; + flex: 1; + margin: 0 10px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.stat-block h4 { + margin-bottom: 10px; + font-size: 16px; + color: #333; +} + +.stat-block p { + font-size: 24px; + color: #333; +} + +.dashboard-section { + background: white; + border-radius: 8px; + padding: 20px; + margin-bottom: 20px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.dashboard-section h4 { + margin-bottom: 10px; + font-size: 18px; + color: #333; +} + +#popularItems { + list-style: none; + padding: 0; +} + +#popularItems li { + margin-bottom: 5px; +} + +.chart-container { + position: relative; + height: 600px; +} diff --git a/dashboard/static/js/dashboard-chart.js b/dashboard/static/js/dashboard-chart.js index 0d46665..7dc7b19 100644 --- a/dashboard/static/js/dashboard-chart.js +++ b/dashboard/static/js/dashboard-chart.js @@ -1,10 +1,9 @@ - // Dummy data for demonstration purposes const totalOrders = 100; const acceptedOrders = 90; const rejectedOrders = 10; const totalRevenue = 5000.00; -const popularItems = ['TUNA SAN', 'BERRY GRAPEFUL', 'PEANUT BUTTER COCONUT OATMEAL']; // Dummy popular items + const monthlyRevenueData = { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], datasets: [{ @@ -22,14 +21,6 @@ document.getElementById('acceptedOrders').innerText = acceptedOrders; document.getElementById('rejectedOrders').innerText = rejectedOrders; document.getElementById('totalRevenue').innerText = totalRevenue.toFixed(2); -// Populate popular items -const popularItemsList = document.getElementById('popularItems'); -popularItems.forEach(item => { - const li = document.createElement('li'); - li.textContent = item; - popularItemsList.appendChild(li); -}); - // Render revenue chart const ctx = document.getElementById('revenueChart').getContext('2d'); const revenueChart = new Chart(ctx, { diff --git a/dashboard/templates/dashboard.html b/dashboard/templates/dashboard.html index 6c8ae02..b8a12a2 100644 --- a/dashboard/templates/dashboard.html +++ b/dashboard/templates/dashboard.html @@ -3,57 +3,64 @@ {% load static %} {% block content %} -
-
-

Total Orders

-

- Total number of orders: 0 -

+
+
+

Dashboard

+

Hi, Admin. Welcome back!

-
-

Total Accepted Orders

-

- Total number of accepted orders: 0 -

+
+
+

Total Orders

+

0

+
+
+

Total Accepted

+

0

+
+
+

Total Rejected

+

0

+
+
+

Total Revenue

+

RM 0.00

+
-
-

Total Rejected Orders

-

- Total number of rejected orders: 0 -

+
+

Popular Menu Items

+
    +
  • + TUNA SAN
  • +
  • + BERRY GRAPEFUL
  • +
  • + PEANUT BUTTER COCONUT OATMEAL
  • +
-
-

Total Revenue

-

- Total revenue: RM - 0.00 -

+ +
+

Revenue Chart (Monthly)

+
+ +
- -
-

Popular Menu Items

-
    - -
  • TUNA SAN
  • -
  • BERRY GRAPEFUL
  • -
  • EANUT BUTTER COCONUT OATMEAL
  • - -
-
-
-

Revenue Chart (Monthly)

-
- -
-
-
+ +
{% endblock %} {% block script %} - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/static/assets/css/dashboard.css b/static/assets/css/dashboard.css index 136d254..8f8f093 100644 --- a/static/assets/css/dashboard.css +++ b/static/assets/css/dashboard.css @@ -3,47 +3,29 @@ body { margin: 0; padding: 0; color: black; - background-color: #fff; /* Set background color to white */ - } - header { - background-color: #333; /* Dark gray background for the header */ + background-color: #fff; + /* Set background color to white */ +} + +header { + background-color: #333; + /* Dark gray background for the header */ color: #fff; padding: 20px; text-align: center; - } - .container { +} + +.container { margin: 100px; - } - .section { +} + +.section { margin-bottom: 40px; - background-color: #f2f2f2; + background-color: #f2f2f2; padding: 10px; - } - - .chart-container { +} + +.chart-container { width: 80%; margin: auto; - } - canvas { - display: block; - margin: auto; - } - - /* h4 { - border-bottom: 1px solid black; - padding-bottom: 10px; - } - table { - width: 100%; - border-collapse: collapse; - } - th, - td { - padding: 8px; - text-align: left; - - } - th { - background-color: black; - color: white; - } */ \ No newline at end of file +}