summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-14 16:07:55 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-14 16:07:55 +0100
commit7d6e3a14327c738ed70b9e167a1859c0438d8bfe (patch)
tree1b076bfa0daeefdddaa944149d64102135df3130 /templates
parentf264e83839bdb7a3a6d584d4f1b0a0da89b97259 (diff)
downloadstock-7d6e3a14327c738ed70b9e167a1859c0438d8bfe.tar.gz
stock-7d6e3a14327c738ed70b9e167a1859c0438d8bfe.tar.bz2
stock-7d6e3a14327c738ed70b9e167a1859c0438d8bfe.zip
Add parsed_data, counts and kitlocker data to StockAssembly::getList()
- getList() now provides per-row: parsed_data (via parseDataHash), part_number (#SUP first), klid, component_count (BOM lines), prebuild_count (PBLD kit total for assembly owner) as correlated subqueries — removes need for supplementary queries in callers - list_assemblies.php: remove batch query block now redundant - user_galleries.tpl: show parsed_data in .content div; dl counts moved to panel-footer with margin-bottom:0; klid in panel-title second line; panel-heading tidied to title only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/user_galleries.tpl67
1 files changed, 23 insertions, 44 deletions
diff --git a/templates/user_galleries.tpl b/templates/user_galleries.tpl
index ddf4e4e..bda5520 100755
--- a/templates/user_galleries.tpl
+++ b/templates/user_galleries.tpl
@@ -1,66 +1,45 @@
{strip}
<div class="listing stock">
<header>
- <div class="floaticon">
+ <div class="floaticon hidden-print">
+ <button type="button" class="btn btn-link" onclick="window.print()">{biticon ipackage="icons" iname="document-print" iexplain="Print"}</button>
+ {if $gBitUser->mUserId eq $gQueryUserId}
+ {if $gBitUser->hasPermission('p_stock_create')}
+ <a href="{$smarty.const.STOCK_PKG_URL}add_prebuild.php">{biticon ipackage="icons" iname="package-x-generic" iexplain="Add Prebuild"}</a>
+ {/if}
+ <a href="{$smarty.const.STOCK_PKG_URL}list_stock.php?user_id={$gQueryUserId}">{biticon ipackage="icons" iname="view-form-table" iexplain="Stock Levels"}</a>
+ {/if}
{minifind prompt="Assemblies"}
</div>
- <h1>{tr}Assemblies{/tr}{if $gQueryUserId} {tr}by{/tr} {displayname user_id=$gQueryUserId}{/if}</h1>
+ <h1>{tr}Assemblies{/tr} {tr}by{/tr} {displayname user_id=$gQueryUserId}</h1>
+ <small><a href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php">{tr}Assemblies{/tr}</a></small>
</header>
<section class="body">
- {if !$gQueryUserId}
- <ul class="list-inline sortby">
- <li>{biticon ipackage="icons" iname="go-next" iexplain="sort by" iforce="icon"}</li>
- {if $gBitSystem->isFeatureActive('stock_list_title')}
- <li>{smartlink ititle="Name" isort="title"}</li>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_user')}
- <li>{smartlink ititle="Owner" isort=$gBitSystem->getConfig('users_display_name')}</li>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_created')}
- <li>{smartlink ititle="Created" isort="created"}</li>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_lastmodif')}
- <li>{smartlink ititle="Last Modified" isort="last_modified"}</li>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_hits')}
- <li>{smartlink ititle="Hits" isort="hits"}</li>
- {/if}
- </ul>
- {/if}
-
<div class="row assemblies">
{foreach from=$galleryList key=galleryId item=gal}
- <div class="col-xs-6 col-sm-4 col-md-3">
+ <div class="col-xs-12 col-sm-6 col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a href="{$gal.display_url|escape}">
- {if $gBitSystem->isFeatureActive('stock_list_title')}
- {$gal.title|truncate|escape}
- {else}
- {tr}Assembly{/tr} {$gal.content_id}
- {/if}
+ {$gal.title|truncate|escape}<br />
+ <small class="text-muted">{tr}Kitlocker{/tr}: {$gal.klid|escape}</small>
</a>
- {if $gal.is_hidden|default:'n' == 'y' || $gal.is_private|default:'n' == 'y' || $gal.access_answer|default:false}
- {biticon ipackage="icons" iname="lock" iexplain="Restricted"}
- {/if}
</h3>
</div>
<div class="panel-body">
- {if $gBitSystem->isFeatureActive('stock_list_user')}
- <small>{displayname hash=$gal nolink=true}</small>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_created')}
- <div class="text-muted small">{$gal.created|bit_short_date}</div>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_list_lastmodif')}
- <div class="text-muted small">{tr}Modified:{/tr} {$gal.last_modified|bit_short_date}</div>
+ {if $gal.parsed_data}
+ <div class="content">{$gal.parsed_data}</div>
{/if}
- {if $gBitSystem->isFeatureActive('stock_list_hits')}
- <div class="text-muted small">{tr}Hits:{/tr} {$gal.hits}</div>
- {/if}
- {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gal}
+ </div>
+ <div class="panel-footer">
+ <dl class="dl-horizontal small" style="margin-bottom:0">
+ <dt>{tr}Components{/tr}</dt>
+ <dd>{$gal.component_count}</dd>
+ <dt>{tr}Prebuilt{/tr}</dt>
+ <dd>{$gal.prebuild_count|string_format:"%.0f"}</dd>
+ </dl>
</div>
</div>
</div>