From 6c250deca88d08a32464fa3d5d470a4e840a2604 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 16 Apr 2015 13:19:26 +0200 Subject: [PATCH] [ADD] highlighted table to double entry document --- _static/accounting.css | 15 ++++++--- _static/misc.js | 20 +++++++++++- double-entry.rst | 70 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 92 insertions(+), 13 deletions(-) diff --git a/_static/accounting.css b/_static/accounting.css index a08136ab6..df279a479 100644 --- a/_static/accounting.css +++ b/_static/accounting.css @@ -13,8 +13,9 @@ background-color: hsl(219, 67%, 94%); } -#chart-controls label:hover, -#entries-control label:hover { +label:hover, +label:hover, +.highlighter-list li:hover { background-color: hsl(0, 0%, 94%); cursor: pointer; } @@ -86,15 +87,19 @@ } @media (min-width: 992px) { - .accounts-table { + .accounts-table, .force-right .highlighter-target { font-size: 90%; color: #888 !important; } - .accounts-table .related { + .force-right .highlighter-target th { + font-weight: normal; + font-size: 110%; + } + .accounts-table .related, .force-right .highlighter-target .related { background-color: transparent !important; color: #eee !important; } - .accounts-table .secondary { + .accounts-table .secondary, .force-right .highlighter-target .secondary { background-color: transparent !important; color: #aaa !important; } diff --git a/_static/misc.js b/_static/misc.js index f139777ff..b432df5ab 100644 --- a/_static/misc.js +++ b/_static/misc.js @@ -1,9 +1,27 @@ (function () { document.addEventListener('DOMContentLoaded', function () { - alternatives() + alternatives(); + highlight(); checks_handling(); }); + function highlight() { + $('.highlighter-list').each(function () { + var $this = $(this), + $target = $($this.data('target')); + $this.on('mouseout', 'li', function (e) { + $(e.currentTarget).removeClass('secondary'); + $target.find('.related').removeClass('related'); + }).on('mouseover', 'li', function (e) { + if (!e.currentTarget.contains(e.target)) { return; } + + var $li = $(e.currentTarget); + console.log($li, $li.data('highlight'), $target.find($li.data('highlight'))); + $li.addClass('secondary'); + $target.find($li.data('highlight')).addClass('related'); + }); + }); + } /** alternatives display: * - prepend control for each
* - radio input with link to following dd diff --git a/double-entry.rst b/double-entry.rst index d6d76f5b4..d055bdcd3 100644 --- a/double-entry.rst +++ b/double-entry.rst @@ -50,13 +50,69 @@ products cost). For each inventory location, multiple data points can be analysed: -* inventory valuation -* value creation (difference between the value of manufactured products and - the cost of raw materials used during manufacturing) -* value of lost/stolen products -* value of scrapped products -* value of products delivered to clients over a period -* value of products in transit between locations +.. raw:: html + + + +.. h:div:: force-right analysis-table + + .. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Location Value
Physical Locations $1,000
 Warehouse 1 $600
 Warehouse 2 $400
Partner Locations - $1,500
 Customers $2,000
 Suppliers - $3,500
Virtual Locations $500
 Transit Location $600
 Initial Inventory $0
 Inventory Loss $350
 Scraped $550
 Manufacturing - $1,000
Procurements & Procurement Rules ================================