wp-content

wordpress/hph
Log | Files | Refs | README | LICENSE

commit ea6fa2d3e6056a6961a9c454f50f025c151ef1ba
parent 05ea6cdad648d7ee9738fa66efa0c72a8082d0b0
Author: Sean Enck <sean@ttypty.com>
Date:   Sun,  2 Nov 2025 14:22:31 -0500

generator to help with tables

Diffstat:
Aplugins/hphp/utils/data-counter-table-generator | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aplugins/hphp/utils/data-counter-tables.css | 39+++++++++++++++++++++++++++++++++++++++
2 files changed, 94 insertions(+), 0 deletions(-)

diff --git a/plugins/hphp/utils/data-counter-table-generator b/plugins/hphp/utils/data-counter-table-generator @@ -0,0 +1,55 @@ +#!/bin/sh -e +[ -z "$1" ] && echo "no file given" && exit 1 +[ ! -e "$1" ] && echo "file does not exist" && exit 1 +TARGET="target" +mkdir -p "$TARGET" + +{ + cat << EOF +<table class="hphp-data-table-display"> +<tbody> +EOF + for f in $(jq -r '.counters | keys_unsorted[]' "$1"); do + fa="" + disp="" + case "$f" in + "cats_adopted") + fa="cat" + disp="Cats Adopted" + ;; + "dogs_adopted") + fa="dog" + disp="Dogs Adopted" + ;; + "pocket_pets_adopted") + fa="otter" + disp="Pocket Pets Adopted" + ;; + "sanctuary_animals") + fa="store-alt" + disp="Sanctuary Animals" + ;; + "total_animals_adopted_matcher") + fa="home" + disp="Total Animals Adopted" + ;; + "trap_neuter_return") + fa="paw" + disp="Trap-Neuter-Return (TNR)" + ;; + *) + echo "unknown type for mapping" >&2 + ;; + esac + cat << EOF +<tr> +<td class="hphp-value-cell"><span id="hphp_counter_${f}_display">0</span><i class="fa fa-$fa hphp-icon-counter"></i></td> +<td class="hphp-label-cell">$disp</td> +</tr> +EOF + done + cat << EOF +</tbody> +</table> +EOF +} > "$TARGET/table.html" diff --git a/plugins/hphp/utils/data-counter-tables.css b/plugins/hphp/utils/data-counter-tables.css @@ -0,0 +1,39 @@ +.hphp-data-table-display { + border: none !important; + border-collapse: collapse !important; + border-spacing: 0 !important; + margin: 20px auto !important; + width: 80% !important; + font-family: Arial, sans-serif !important; +} + +.hphp-bar-data-table-display tr { + padding: 0 !important; + margin: 0 !important; + border: none !important; + vertical-align: middle !important; +} + +.hphp-bar-data-table-display td { + border: none !important; + padding: 5px !important; + margin: 0 !important; + height: 25px !important; + box-shadow: none !important; + background-color: transparent !important; +} + +.hphp-icon-counter { + padding-right: 20px !important; + padding-left: 10px; +} + +.hphp-label-cell { + text-align: left !important; + font-weight: bold !important; +} + +.hphp-value-cell { + text-align: right !important; + font-weight: bold !important; +}