summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-10 10:07:19 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-10 10:07:19 +0100
commitba633c8c0e5b832821814020676bf13605651fb4 (patch)
tree88505609485933a33d2249ed9bf080b9a8948838 /templates
parent2a0ea930de9d59e29bf4ddeb1585e61061109d7d (diff)
downloadstock-ba633c8c0e5b832821814020676bf13605651fb4.tar.gz
stock-ba633c8c0e5b832821814020676bf13605651fb4.tar.bz2
stock-ba633c8c0e5b832821814020676bf13605651fb4.zip
stock: unify view/edit header structure — <header>/<section> pattern, floaticons top right, breadcrumbs below h1; remove assembly_nav and dead mItems table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/edit_assembly.tpl19
-rwxr-xr-xtemplates/edit_component.tpl19
-rwxr-xr-xtemplates/stock_simple_list_inc.tpl83
-rwxr-xr-xtemplates/view_assembly.tpl12
-rwxr-xr-xtemplates/view_component.tpl17
5 files changed, 58 insertions, 92 deletions
diff --git a/templates/edit_assembly.tpl b/templates/edit_assembly.tpl
index c0b5004..eb23741 100755
--- a/templates/edit_assembly.tpl
+++ b/templates/edit_assembly.tpl
@@ -1,6 +1,8 @@
{strip}
<div class="edit stock">
- <div class="header">
+ <header>
+ <div class="floaticon">
+ </div>
<h1>
{if $gContent->getTitle()}
{tr}Edit Assembly{/tr}: {$gContent->getTitle()|escape}
@@ -8,9 +10,14 @@
{tr}Create Assembly{/tr}
{/if}
</h1>
- </div>
+ {if $gContent->isValid()}
+ <small><a href="{$smarty.const.STOCK_PKG_URL}view_assembly.php?content_id={$gContent->mContentId}">{$gContent->getTitle()|escape}</a></small>
+ {else}
+ <small><a href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php">{tr}Assemblies{/tr}</a></small>
+ {/if}
+ </header>
- <div class="body">
+ <section class="body">
{form id="editAssemblyForm" ipackage="stock" ifile="edit_assembly.php"}
{formfeedback error=$errors success=$stockSuccess}
@@ -50,7 +57,6 @@
{/form}
{if $gContent->isValid()}
- {* CSV upload results *}
{if isset($csvLoaded)}
<div class="alert alert-info">
{tr}Loaded{/tr}: <strong>{$csvLoaded}</strong>
@@ -63,7 +69,6 @@
{/if}
{/if}
- {* ── Upload BOM CSV ── *}
{form enctype="multipart/form-data" ipackage="stock" ifile="edit_assembly.php"}
<input type="hidden" name="content_id" value="{$gContent->mContentId|escape}"/>
<div class="form-inline">
@@ -74,6 +79,6 @@
{/form}
{/if}
- </div><!-- end .body -->
-</div><!-- end .stock -->
+ </section>
+</div>
{/strip}
diff --git a/templates/edit_component.tpl b/templates/edit_component.tpl
index 9bf6bcc..d8dad00 100755
--- a/templates/edit_component.tpl
+++ b/templates/edit_component.tpl
@@ -1,11 +1,17 @@
{strip}
-
<div class="edit stock">
- <div class="header">
+ <header>
+ <div class="floaticon">
+ </div>
<h1>{if $gContent->mContentId}{tr}Edit Component{/tr}: {$gContent->getTitle()|escape}{else}{tr}Add New Component{/tr}{/if}</h1>
- </div>
+ {if $gContent->isValid()}
+ <small><a href="{$smarty.const.STOCK_PKG_URL}view_component.php?content_id={$gContent->mContentId}">{$gContent->getTitle()|escape}</a></small>
+ {else}
+ <small><a href="{$smarty.const.STOCK_PKG_URL}list_components.php">{tr}Components{/tr}</a></small>
+ {/if}
+ </header>
- <div class="body">
+ <section class="body">
{form}
{formfeedback error=$errors}
@@ -54,7 +60,6 @@
<input type="submit" class="btn btn-primary" name="save" value="{tr}Save Component{/tr}"/>
</div>
{/form}
- </div><!-- end .body -->
-</div><!-- end .stock -->
-
+ </section>
+</div>
{/strip}
diff --git a/templates/stock_simple_list_inc.tpl b/templates/stock_simple_list_inc.tpl
index 7c46c66..8ff0126 100755
--- a/templates/stock_simple_list_inc.tpl
+++ b/templates/stock_simple_list_inc.tpl
@@ -1,74 +1,43 @@
{strip}
-{include file="bitpackage:stock/assembly_nav.tpl"}
<div class="display stock">
- <div class="header">
- {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <header>
+ <div class="floaticon">
+ {if $gContent->hasUpdatePermission()}
+ <a title="{tr}Edit{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="edit" iexplain="Edit Assembly"}</a>
+ <a title="{tr}Component Order{/tr}" href="{$smarty.const.STOCK_PKG_URL}component_order.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="view-sort-ascending" iexplain="Component Order"}</a>
+ {/if}
+ <a title="{tr}Print Parts List{/tr}" href="{$smarty.const.STOCK_PKG_URL}print_bom.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="document-print" iexplain="Print Parts List"}</a>
+ <a title="{tr}View Stock{/tr}" href="{$smarty.const.STOCK_PKG_URL}list_stock.php?assembly_content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="package-x-generic" iexplain="View Stock"}</a>
+ <a title="{tr}View Movements{/tr}" href="{$smarty.const.STOCK_PKG_URL}list_movements.php?assembly_content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="go-next" iexplain="View Movements"}</a>
+ {if $gContent->hasAdminPermission()}
+ <a title="{tr}Delete Assembly{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gContent->mContentId}&amp;delete=1">{biticon ipackage="icons" iname="user-trash" iexplain="Delete Assembly"}</a>
+ {/if}
+ </div>
<h1>{$gContent->getTitle()|escape}</h1>
- </div>
+ <small>
+ <a href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php">{tr}Assemblies{/tr}</a>
+ {assign var=breadCrumbs value=$gContent->getBreadcrumbLinks(1)}
+ {foreach from=$breadCrumbs item=breadTitle key=breadId}
+ {if $breadId != $gContent->mContentId}
+ &rsaquo; <a href="{$smarty.const.STOCK_PKG_URL}view_assembly.php?content_id={$breadId}">{$breadTitle}</a>
+ {/if}
+ {/foreach}
+ </small>
+ </header>
- <div class="body">
+ <section class="body">
{formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
{if $gContent->mInfo.data}
<p>{$gContent->mInfo.data|escape}</p>
{/if}
-
- <table class="table data">
- <caption>{tr}Components{/tr} <span class="total">[ {$listInfo.total_records|default:0} ]</span></caption>
- <tr>
- <th>{smartlink ititle=Name isort=title icontrol=$listInfo}</th>
- {if $gBitSystem->isFeatureActive('stock_item_list_date') || $gBitSystem->isFeatureActive('stock_item_list_creator')}
- <th>{smartlink ititle=Created isort=created iorder=desc idefault=1 icontrol=$listInfo}</th>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_item_list_hits')}
- <th>{smartlink ititle=Views isort="lch.hits" icontrol=$listInfo}</th>
- {/if}
- <th>{tr}Actions{/tr}</th>
- </tr>
- {foreach from=$gContent->mItems item=galItem}
- <tr class="{cycle values="odd,even"}">
- <td>
- <h3><a href="{$galItem->getDisplayUrl()}">{$galItem->getTitle()|escape}</a></h3>
- {if $gBitSystem->isFeatureActive('stock_item_list_desc') && $galItem->mInfo.data}
- {$galItem->mInfo.parsed_data}
- {/if}
- {if $gBitSystem->isFeatureActive('stock_item_list_attid')}
- <small>{$galItem->mInfo.wiki_plugin_link}</small>
- {/if}
- </td>
- {if $gBitSystem->isFeatureActive('stock_item_list_date') || $gBitSystem->isFeatureActive('stock_item_list_creator')}
- <td>
- {if $gBitSystem->isFeatureActive('stock_item_list_date')}
- {$galItem->mInfo.created|bit_short_date}<br />
- {/if}
- {if $gBitSystem->isFeatureActive('stock_item_list_creator')}
- {tr}by{/tr}: {displayname hash=$galItem->mInfo}
- {/if}
- </td>
- {/if}
- {if $gBitSystem->isFeatureActive('stock_item_list_hits')}
- <td class="text-right">{$galItem->mInfo.hits|default:"{tr}none{/tr}"}</td>
- {/if}
- <td class="actionicon">
- <a href="{$galItem->getDisplayUrl()}">{biticon ipackage="icons" iname="folder-open" iexplain="View"}</a>
- {if $gContent->isOwner($galItem->mInfo) || $gBitUser->isAdmin()}
- <a href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$galItem->mInfo.content_id}">{biticon ipackage="icons" iname="edit" iexplain="Edit"}</a>
- <a href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$galItem->mInfo.content_id}&amp;delete=1">{biticon ipackage="icons" iname="user-trash" iexplain="Remove"}</a>
- {/if}
- </td>
- </tr>
- {/foreach}
- </table>
-
- </div><!-- end .body -->
-
- {pagination content_id=$gContent->mContentId}
+ </section>
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
{if $gContent->getPreference('allow_comments') eq 'y'}
{include file="bitpackage:liberty/comments.tpl"}
{/if}
-</div><!-- end .stock -->
+</div>
{/strip}
diff --git a/templates/view_assembly.tpl b/templates/view_assembly.tpl
index e3ebb94..a9aa818 100755
--- a/templates/view_assembly.tpl
+++ b/templates/view_assembly.tpl
@@ -1,15 +1,3 @@
-<div class="floaticon">
- {if $gContent->hasUpdatePermission()}
- <a title="{tr}Edit{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="edit" iexplain="Edit Assembly"}</a>
- <a title="{tr}Component Order{/tr}" href="{$smarty.const.STOCK_PKG_URL}component_order.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="view-sort-ascending" iexplain="Component Order"}</a>
- {/if}
- <a title="{tr}Print Parts List{/tr}" href="{$smarty.const.STOCK_PKG_URL}print_bom.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="document-print" iexplain="Print Parts List"}</a>
- <a title="{tr}View Stock{/tr}" href="{$smarty.const.STOCK_PKG_URL}list_stock.php?assembly_content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="package-x-generic" iexplain="View Stock"}</a>
- <a title="{tr}View Movements{/tr}" href="{$smarty.const.STOCK_PKG_URL}list_movements.php?assembly_content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="go-next" iexplain="View Movements"}</a>
- {if $gContent->hasAdminPermission()}
- <a title="{tr}Delete Assembly{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gContent->mContentId}&amp;delete=1">{biticon ipackage="icons" iname="user-trash" iexplain="Delete Assembly"}</a>
- {/if}
-</div>
{include file="bitpackage:stock/stock_simple_list_inc.tpl"}
{if $gXrefInfo->mGroups}
diff --git a/templates/view_component.tpl b/templates/view_component.tpl
index 102b911..864cb90 100755
--- a/templates/view_component.tpl
+++ b/templates/view_component.tpl
@@ -1,11 +1,7 @@
{strip}
-{if empty($liberty_preview)}
- {include file="bitpackage:stock/assembly_nav.tpl"}
-{/if}
-
<div class="display stock">
{formfeedback hash=$feedback}
- <div class="header">
+ <header>
{if empty($liberty_preview)}
<div class="floaticon">
{if $gContent->hasUpdatePermission()}
@@ -15,9 +11,12 @@
</div>
{/if}
<h1>{$gContent->getTitle()|escape}</h1>
- </div>
+ {if empty($liberty_preview)}
+ <small><a href="{$smarty.const.STOCK_PKG_URL}list_components.php">{tr}Components{/tr}</a></small>
+ {/if}
+ </header>
- <div class="body">
+ <section class="body">
{if $gContent->mInfo.data ne ''}
<p class="description">{$gContent->mInfo.parsed_data}</p>
{/if}
@@ -70,11 +69,11 @@
<a class="btn btn-default btn-xs" href="{$smarty.const.STOCK_PKG_URL}list_movements.php?component_content_id={$gContent->mContentId}">{tr}Stock history{/tr}</a>
{/jstab}
{/jstabs}
- </div><!-- end .body -->
+ </section>
{if $gGallery && $gGallery->isCommentable()}
{include file="bitpackage:liberty/comments.tpl"}
{/if}
-</div><!-- end .stock -->
+</div>
{/strip}