Skip to content

Commit c09286c

Browse files
author
Olivier Bonnaure
committed
feat: update widgets and add caption to table
1 parent a5de2a5 commit c09286c

File tree

12 files changed

+715
-1046
lines changed

12 files changed

+715
-1046
lines changed

app/views/errors/index.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="container mx-auto py-10 px-2">
1+
<div class="col-span-12 container mx-auto py-10 px-2">
22
<h1>Error <%= Params.status %></h1>
33

44
<p><%= Params.message %></p>

app/views/layouts/app/css_tw_src.css

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
42

53
input[type="text"],
64
textarea {
@@ -37,11 +35,18 @@ a {
3735
@apply text-purple-400 hover:text-blue-900;
3836
}
3937

40-
.material-icons-outlined.md-18 { font-size: 18px; }
41-
.material-icons-outlined.md-24 { font-size: 24px; }
42-
.material-icons-outlined.md-36 { font-size: 36px; }
43-
.material-icons-outlined.md-48 { font-size: 48px; }
44-
38+
.material-icons-outlined.md-18 {
39+
font-size: 18px;
40+
}
41+
.material-icons-outlined.md-24 {
42+
font-size: 24px;
43+
}
44+
.material-icons-outlined.md-36 {
45+
font-size: 36px;
46+
}
47+
.material-icons-outlined.md-48 {
48+
font-size: 48px;
49+
}
4550

4651
table {
4752
@apply w-full border-collapse border;
@@ -52,11 +57,11 @@ table td {
5257
@apply border p-2;
5358
}
5459

55-
table th, table tfoot td {
60+
table th,
61+
table tfoot td {
5662
@apply bg-gray-800 text-white;
5763
}
5864

5965
table tr:nth-child(odd) {
6066
@apply bg-gray-50;
6167
}
62-

app/views/partials/components/bignumber.html.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<% if component.title then %> <h1 class="uppercase text-sm text-<%= component.color or "green" %>-600 font-bold upercase"><%= component.title %></h1> <% end %>
1212
<% if component.value then %>
1313
<h2 class="font-bold text-4xl">
14-
<span id="counter_<%= id %>" data-target="<%= component.value %>">0</span>
14+
<span id="counter_<%= id %>" data-target="<%= component.value %>"><%= component.value %></span>
1515
<% if component.extra then %><span><%= component.extra %></span><% end %>
1616
</h2>
1717
<script>

app/views/partials/components/card.html.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% component.width = component.width or {4, 6, 12} %>
22

3-
<div class="border relative shadow-md rounded-md lg:col-span-<%= component.width[1] or 4 %> md:col-span-<%= component.width[2] or 6 %> col-span-<%= component.width[3] or 12%>">
3+
<div class="border border-gray-300 relative shadow-md rounded-md lg:col-span-<%= component.width[1] or 4 %> md:col-span-<%= component.width[2] or 6 %> col-span-<%= component.width[3] or 12%>">
44
<% if component.icon then %>
55
<div class="absolute -top-2 right-2 ">
66
<span class="material-icons-outlined border border-<%= component.color or "yellow" %>-600 text-<%= component.color or "yellow" %>-900 bg-<%= component.color or "yellow" %>-50 p-2 shadow-md">

app/views/partials/components/datagrid.html.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
</div>
1818

19-
<div class="border border-gray-300 rounded-b-md p-4">
19+
<div class="border border-gray-300 rounded-b-md p-4 shadow-md">
2020
<div class="grid grid-cols-<%= #component.items %> gap-4">
2121
<% for i, item in ipairs(component.items) do %>
2222
<div class="flex flex-col">

app/views/partials/components/object.html.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% component.width = component.width or {4, 6, 12} %>
22
<% component.keys = component.keys or table.keys(component.data) or {} %>
3-
<div class="relative border rounded-md shadow-md flex flex-col gap-4 p-4 item-center lg:col-span-<%= component.width[1] or 4 %> md:col-span-<%= component.width[2] or 6 %> col-span-<%= component.width[3] or 12%>">
3+
<div class="relative border border-gray-300 rounded-md shadow-md flex flex-col gap-4 p-4 item-center lg:col-span-<%= component.width[1] or 4 %> md:col-span-<%= component.width[2] or 6 %> col-span-<%= component.width[3] or 12%>">
44
<% if component.icon then %>
55
<div class="absolute -top-2 right-2 ">
66
<span class="material-icons-outlined border border-<%= component.color or "yellow" %>-600 text-<%= component.color or "yellow" %>-900 bg-<%= component.color or "yellow" %>-50 p-2 shadow-md">

app/views/partials/components/table.html.etlua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
<div class="lg:col-span-<%= component.width[1] or 4 %> md:col-span-<%= component.width[2] or 6 %> col-span-<%= component.width[3] or 12%>">
33
<h1 class="text-2xl font-bold"><%= component.title %></h1>
44
<table class="w-full border-collapse border">
5+
<% if component.caption then %>
6+
<caption class="text-sm text-gray-500" style="caption-side: <%= component.caption.position or 'top' %>;"><%= component.caption.title %></caption>
7+
<% end %>
58
<% if component.headers then %>
69
<thead>
710
<tr>
811
<% for _, cell in pairs(component.headers) do %>
9-
<th class="text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
12+
<th class="border border-gray-300 text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
1013
<%= cell.title %>
1114
</th>
1215
<% end %>
@@ -19,7 +22,7 @@
1922
<% for _, row in pairs(component.rows) do %>
2023
<tr>
2124
<% for _, cell in pairs(row) do %>
22-
<td class="text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
25+
<td class="border border-gray-300 text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
2326
<%= cell.title %>
2427
</td>
2528
<% end %>
@@ -33,7 +36,7 @@
3336
<% for _, row in pairs(component.footer) do %>
3437
<tr>
3538
<% for _, cell in pairs(row) do %>
36-
<td class="text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
39+
<td class="border border-gray-300 text-<%= cell.align or 'left' %> text-<%= cell.color or 'black' %>-600">
3740
<%= cell.title %>
3841
</td>
3942
<% end %>

app/views/welcome/index.etlua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h1>Welcome aboard</h1>
1+
<div class="col-span-12"><h1>Welcome aboard</h1></div>

aqlpages/demo.aql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ LET table = {
173173
component: 'table',
174174
title: 'Table',
175175
width: [12, 12, 12], // [lg, md, sm]
176+
caption: { title: 'this is a caption for the table', position: 'bottom' },
176177
headers: [{ title: 'Header 1', align: 'left' }, { title: 'Header 2', align: 'center' }, { title: 'Header 3', align: 'right' }],
177178
rows: [
178179
[{ title: 'Data 1', align: 'left', color: 'red' }, { title: 'Data 2', align: 'center', color: 'blue' }, { title: 'Data 3', align: 'right', color: 'green' }],
@@ -225,4 +226,4 @@ RETURN [
225226
map,
226227
table,
227228
object
228-
]
229+
]

0 commit comments

Comments
 (0)