@@ -637,33 +637,42 @@ async function renderInquiries() {
637637 columns : [
638638 { key : 'enquiry_number' , label : 'Inquiry No.' , hide : true , sort : ( e ) => e . enquiry_number ,
639639 cell : ( e ) => `<span class="rec-id">${ escapeHTML ( e . enquiry_number ) } </span>` } ,
640- // Across rather than down, the same as the bookings list. See the note
641- // there; the two screens are read the same way and should look it.
640+ // One heading per thing. The name used to carry the phone number under
641+ // it and "Asked for" carried the hire dates, which left two of the
642+ // enquiry's six facts with no heading at all and put the hire dates
643+ // close enough to Received to be read as the same date. Separate
644+ // columns, and the box scrolls.
642645 { key : 'name' , label : 'Name' , sort : ( e ) => e . name . toLowerCase ( ) ,
643- cell : ( e ) => `<span class="rec-line rec-line-name">
644- <span class="rec-who rec-clip" title="${ escapeHTML ( e . name ) } "
645- >${ escapeHTML ( e . name ) } </span>
646- ${ e . phone ? `<span class="rec-dot" aria-hidden="true">·</span>
647- <span class="rec-note">${ escapeHTML ( e . phone ) } </span>` : '' }
648- </span>
646+ cell : ( e ) => `<span class="rec-who rec-clip" title="${ escapeHTML ( e . name ) } "
647+ >${ escapeHTML ( e . name ) } </span>
649648 <div class="rec-sub rec-id rec-only-sm">${ escapeHTML ( e . enquiry_number ) } </div>` } ,
650- { key : 'vehicle_name' , label : 'Asked for' , hide : true , sort : ( e ) => ( e . vehicle_name || '' ) . toLowerCase ( ) ,
651- cell : ( e ) => `<span class="rec-line">
652- <span class="rec-clip">${ escapeHTML ( e . vehicle_name || 'Not specified' ) } </span>
653- <span class="rec-dot" aria-hidden="true">·</span>
654- <span class="rec-note">${ e . start_date
655- ? ( e . return_date
656- ? formatDateRange ( e . start_date , e . return_date )
657- : formatDate ( e . start_date ) )
658- : 'No dates given' } </span>
659- </span>` } ,
649+ { key : 'phone' , label : 'Contact' , hide : true , sort : ( e ) => e . phone || '' ,
650+ // Not a tel: link: the whole row opens the enquiry, and a link inside
651+ // it would fire both. The dialling is on the handset button at the end
652+ // of the row, where it cannot be hit by accident.
653+ cell : ( e ) => escapeHTML ( e . phone || '—' ) } ,
654+ // The car the visitor chose, which the list could not see until the API
655+ // started sending it. See enquiry_vehicle_asked() for why the vehicle
656+ // join is usually empty and where the name really lives.
657+ { key : 'vehicle_asked' , label : 'Car' , hide : true ,
658+ sort : ( e ) => ( e . vehicle_asked || '' ) . toLowerCase ( ) ,
659+ cell : ( e ) => ( e . vehicle_asked
660+ ? `<span class="rec-clip" title="${ escapeHTML ( e . vehicle_asked ) } "
661+ >${ escapeHTML ( e . vehicle_asked ) } </span>`
662+ : '<span class="rec-none">Not specified</span>' ) } ,
663+ { key : 'start_date' , label : 'Hire dates' , hide : true , sort : ( e ) => e . start_date || '' ,
664+ cell : ( e ) => ( e . start_date
665+ ? ( e . return_date
666+ ? formatDateRange ( e . start_date , e . return_date )
667+ : formatDate ( e . start_date ) )
668+ : '<span class="rec-none">Not given</span>' ) } ,
660669 { key : 'status' , label : 'Status' , sort : ( e ) => e . status ,
661- cell : ( e ) => `<span class="rec-line rec-line-chips">
662- <span class="status-badge status-badge- ${ e . status } "> ${ e . status } </span>
663- ${ e . booking_number
664- ? `<span class="rec-note ">${ escapeHTML ( e . booking_number ) } </span>` : '' }
665- </span>` } ,
666- { key : 'created_at' , label : 'Received ' , cls : 'rec-when' , sort : ( e ) => e . created_at ,
670+ cell : ( e ) => `<span class="status-badge status-badge- ${ e . status } "> ${ e . status } </span>` } ,
671+ { key : 'booking_number' , label : 'Booking' , hide : true , sort : ( e ) => e . booking_number || '' ,
672+ cell : ( e ) => ( e . booking_number
673+ ? `<span class="rec-id ">${ escapeHTML ( e . booking_number ) } </span>`
674+ : '<span class="rec-none">— </span>' ) } ,
675+ { key : 'created_at' , label : 'Enquired on ' , cls : 'rec-when' , sort : ( e ) => e . created_at ,
667676 cell : ( e ) => formatDate ( e . created_at ) } ,
668677 { key : 'action' , label : 'Action' , cls : 'rec-act' , hide : true , sort : ( e ) => e . id ,
669678 cell : ( e ) => `<span class="rec-acts">
@@ -1769,34 +1778,29 @@ async function renderBookingList() {
17691778 columns : [
17701779 { key : 'booking_number' , label : 'Booking No.' , hide : true , sort : ( b ) => b . booking_number ,
17711780 cell : ( b ) => `<span class="rec-id">${ escapeHTML ( b . booking_number ) } </span>` } ,
1772- // Each cell reads across rather than down. Stacked, every booking stood
1773- // three lines tall: four of them filled the screen, and the eye had to
1774- // work out for itself that the number under a name was that customer's
1775- // phone. Side by side with a middot between, a row is one sentence --
1776- // who, what, when -- and twice as many fit above the fold.
1781+ // One heading per thing, the same as the enquiries list. Customer used
1782+ // to carry the phone, Vehicle the registration and Dates the duration,
1783+ // which left three of the booking's facts with no heading over them.
1784+ // The box scrolls, so they can each have a column.
17771785 { key : 'customer_name' , label : 'Customer' , sort : ( b ) => b . customer_name . toLowerCase ( ) ,
1778- cell : ( b ) => `<span class="rec-line">
1779- <span class="rec-who rec-clip" title="${ escapeHTML ( b . customer_name ) } "
1780- >${ escapeHTML ( b . customer_name ) } </span>
1781- ${ b . customer_phone ? `<span class="rec-dot" aria-hidden="true">·</span>
1782- <span class="rec-note">${ escapeHTML ( b . customer_phone ) } </span>` : '' }
1783- </span>
1786+ cell : ( b ) => `<span class="rec-who rec-clip" title="${ escapeHTML ( b . customer_name ) } "
1787+ >${ escapeHTML ( b . customer_name ) } </span>
17841788 <div class="rec-sub rec-id rec-only-sm">${ escapeHTML ( b . booking_number ) } </div>` } ,
1789+ { key : 'customer_phone' , label : 'Contact' , hide : true , sort : ( b ) => b . customer_phone || '' ,
1790+ cell : ( b ) => escapeHTML ( b . customer_phone || '—' ) } ,
17851791 { key : 'vehicle_name' , label : 'Vehicle' , hide : true , sort : ( b ) => ( b . vehicle_name || '' ) . toLowerCase ( ) ,
1786- cell : ( b ) => `<span class="rec-line">
1787- <span class="rec-clip">${ escapeHTML ( b . vehicle_name || '—' ) } </span>
1788- ${ b . vehicle_reg ? `<span class="rec-dot" aria-hidden="true">·</span>
1789- <span class="rec-note">${ escapeHTML ( b . vehicle_reg ) } </span>` : '' }
1790- </span>` } ,
1791- { key : 'start_at' , label : 'Dates' , hide : true , sort : ( b ) => b . start_at ,
1792- cell : ( b ) => `<span class="rec-line">
1793- <span>${ formatDateRange ( b . start_at , b . return_at ) } </span>
1794- <span class="rec-dot" aria-hidden="true">·</span>
1795- <span class="rec-note"
1796- >${ b . duration_days } day${ Number ( b . duration_days ) === 1 ? '' : 's' } </span>
1797- </span>` } ,
1792+ cell : ( b ) => ( b . vehicle_name
1793+ ? `<span class="rec-clip" title="${ escapeHTML ( b . vehicle_name ) } "
1794+ >${ escapeHTML ( b . vehicle_name ) } </span>`
1795+ : '<span class="rec-none">—</span>' ) } ,
1796+ { key : 'vehicle_reg' , label : 'Reg. no.' , hide : true , sort : ( b ) => ( b . vehicle_reg || '' ) . toLowerCase ( ) ,
1797+ cell : ( b ) => escapeHTML ( b . vehicle_reg || '—' ) } ,
1798+ { key : 'start_at' , label : 'Hire dates' , hide : true , sort : ( b ) => b . start_at ,
1799+ cell : ( b ) => formatDateRange ( b . start_at , b . return_at ) } ,
1800+ { key : 'duration_days' , label : 'Days' , hide : true , sort : ( b ) => Number ( b . duration_days ) ,
1801+ cell : ( b ) => `${ b . duration_days } day${ Number ( b . duration_days ) === 1 ? '' : 's' } ` } ,
17981802 { key : 'status' , label : 'Status' , sort : ( b ) => b . status ,
1799- cell : ( b ) => `<span class="rec-line rec-line -chips">
1803+ cell : ( b ) => `<span class="rec-line-chips">
18001804 <span class="status-badge status-badge-${ b . status } ">${ b . status } </span>
18011805 ${ scheduleChipHTML ( b , { quiet : true } ) }
18021806 </span>` } ,
0 commit comments