diff options
| author | spiderr <spiderr@bitweaver.org> | 2022-03-30 15:11:06 -0400 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2022-03-30 15:11:06 -0400 |
| commit | 393501a7ca52108984aafc272c4a98d1a718031c (patch) | |
| tree | f9a1455741629084cb85fa21592a21e5e26a206b /templates | |
| parent | f0be374506ee67c414c19ba627ed56b05ca0fdba (diff) | |
| download | stats-393501a7ca52108984aafc272c4a98d1a718031c.tar.gz stats-393501a7ca52108984aafc272c4a98d1a718031c.tar.bz2 stats-393501a7ca52108984aafc272c4a98d1a718031c.zip | |
major refactor of referrer stats
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/referrer_stats.tpl | 50 | ||||
| -rw-r--r-- | templates/referrer_stats_ctm_inc.tpl | 28 |
2 files changed, 39 insertions, 39 deletions
diff --git a/templates/referrer_stats.tpl b/templates/referrer_stats.tpl index fd513bc..1067f98 100644 --- a/templates/referrer_stats.tpl +++ b/templates/referrer_stats.tpl @@ -24,7 +24,7 @@ <div class="body"> - <table class="table data"> + <table class="table data referrer-stats"> {assign var=refCount value=0} {foreach from=$referers key=host item=reg} {assign var=hostKey value=$host|strip:'.':''} @@ -37,8 +37,8 @@ <th class="text-right"><div class="floaticon"> [{math equation="round((x / y) * 100)" x=$reg|@count y=$totalRegistrations}% ] <a href="{$smarty.server.SCRIPT_NAME}?period={$smarty.request.period}&find={$host|escape}">{booticon iname='icon-clock'}</a></div></th> {if $aggregateStats.$host} <th class="text-right">{$reg|@count} {booticon iname="icon-user"}</th> - <th class="text-right">{$aggregateStats.$host.orders|default:"0"} {booticon iname="icon-shopping-cart"}</th> - <th class="text-right">{$gCommerceCurrencies->format($aggregateStats.$host.revenue|default:"0.00")}</th> + <th class="text-right">{$aggregateStats.$host.info.orders|default:"0"} {booticon iname="icon-shopping-cart"}</th> + <th class="text-right">{$gCommerceCurrencies->format($aggregateStats.$host.info.revenue|default:"0.00")}</th> {/if} </tr> @@ -48,47 +48,19 @@ {foreach from=$aggregateStats.$host.values item=paramValues key=paramKey} <div class="panel panel-default"> <div class="panel-heading" role="tab" id="accordion-{$paramKey}"> - <div class="pull-right">{$paramValues.registrations} {booticon iname="icon-user"} {$paramValues.orders} {booticon iname="icon-shopping-cart"} {$gCommerceCurrencies->format($paramValues.revenue)}</div> + <div class="pull-right">{$paramValues.info.registrations} {booticon iname="icon-user"} {$paramValues.info.orders} {booticon iname="icon-shopping-cart"} {$gCommerceCurrencies->format($paramValues.info.revenue)}</div> <h4 class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion-{$hostHash}" href="#collapse-{$hostHash}-{$paramKey}" aria-expanded="false" aria-controls="collapse-{$hostHash}-{$paramKey}">{$paramKey}</a> </h4> </div> {if $paramValues.values} <div id="collapse-{$hostHash}-{$paramKey}" class="panel-collapse collapse" role="tabpanel"> - <div class="panel-body"> - <div class="panel-group" id="accordion-{$hostHash}-{$paramKey}" role="tablist" aria-multiselectable="true"> -<table data-toggle="table"> -<thead> -<tr> - <th>{$paramKey}</th> - <th class="text-center" data-field="registrations" data-sortable="true">{booticon iname="icon-user"}</th> - <th class="text-center" data-field="order_count" data-sortable="true">{booticon iname="icon-shopping-cart"}</th> - <th class="text-center" data-field="revenue" data-sortable="true" data-sorter="priceSorter">Revenue</th> -</tr> -</thead> -<tbody> - {foreach from=$paramValues.values item=valueHash key=valueKey name=paramval} -<tr> - <td><a href="#" onclick="BitBase.toggleElementDisplay('order-list-{$hostHash}-{$paramKey}-{$valueKey}','block');return false;">{$valueKey|default:"unknown"}</a> - <ol class="data" id="order-list-{$hostHash}-{$paramKey}-{$valueKey}" style="display:none"> - {foreach from=$valueHash.users item=userHash} - <li class="item width100p" style="border-bottom:1px solid #cccccc;"> - <div class="inline-block width10p date">{$userHash.registration_date|bit_date_format}</div> - <div class="inline-block width65p">{if $userHash.referer_url}<a href="{$userHash.referer_url|escape}">{$userHash.referer_url|stats_referer_display_short}</a><br/>{/if}{BitUser::getDisplayLinkFromHash($userHash,1)} - {$userHash.email}</div> - <div class="inline-block text-right width10p">{if $userHash.revenue.total_orders}<a target="_new" href="{$smarty.const.BITCOMMERCE_PKG_URL}admin/list_orders.php?user_id={$userHash.user_id}">{$userHash.revenue.total_orders} {tr}orders{/tr}</a>{/if}</div> - <div class="inline-block text-right width10p">{if $userHash.revenue.total_revenue}{$gCommerceCurrencies->format($userHash.revenue.total_revenue)}{/if}</div> - </li> - {/foreach} - </ol> - </td> - <td class="text-right">{if $valueHash.users}{$valueHash.users|count}{/if}</td> - <td class="text-right">{if $valueHash.orders}{$valueHash.orders}{/if}</td> - <td class="text-right">{if $valueHash.revenue}{$gCommerceCurrencies->format($valueHash.revenue)}{/if}</td> -</tr> - {/foreach} -</tbody> + <div class="panel-body" style="padding:0"> +<table class="table"> + {foreach from=$paramValues.values item=subHash} + {include file="bitpackage:stats/referrer_stats_ctm_inc.tpl" tableHash=$subHash depth=1} + {/foreach} </table> - </div> </div> </div> {/if} @@ -108,7 +80,7 @@ </div> {if $reg} <div id="collapse-{$hostHash}-{$paramKey}" class="panel-collapse collapse" role="tabpanel"> - <div class="panel-body"> + <div class="panel-body" style="padding:0"> <div class="panel-group" id="accordion-{$hostHash}-{$paramKey}" role="tablist" aria-multiselectable="true"> <table data-toggle="table"> <thead> @@ -124,7 +96,7 @@ <tr class="{cycle values='odd,even'}"> <td class="date">{$user.registration_date|bit_date_format}</td> <td><strong style="font-size:larger">{displayname hash=$user}</strong>{if $user.referer_url}<br/><a href="{$user.referer_url|escape}">{$user.referer_url|stats_referer_display_short}</a>{/if}</td> - <td class="text-right">{if $user.revenue.total_orders}{$user.revenue.total_orders}{/if}</td> + <td class="text-right">{if $user.revenue.total_orders}<a target="_new" href="{$smarty.const.BITCOMMERCE_PKG_URL}admin/list_orders.php?user_id={$user.user_id}">{$user.revenue.total_orders}</a>{/if}</td> <td class="text-right">{if $user.revenue.total_revenue}{$gCommerceCurrencies->format($user.revenue.total_revenue)}{/if}</td> </tr> {/foreach} diff --git a/templates/referrer_stats_ctm_inc.tpl b/templates/referrer_stats_ctm_inc.tpl new file mode 100644 index 0000000..bb30742 --- /dev/null +++ b/templates/referrer_stats_ctm_inc.tpl @@ -0,0 +1,28 @@ +{assign var="titleHash" value="`$parentHash``$tableHash.info.title`"|md5} +<tbody style="{if $depth>1}display:none;{/if}" class="group-body-{$parentHash} depth-{$depth}"> +<tr> + <th style="padding-left:{$depth|default:1}em;"><a href="#" onclick="$('.group-body-{$titleHash}.depth-{$depth+1}').toggle();return false;">{$tableHash.info.title|default:"unknown"}</a></th> + <th class="text-right width10p"><a href="#" onclick="BitBase.toggleElementDisplay('user-list-{$titleHash}','block');return false;">{$tableHash.info.users|count|default:"0"} {booticon iname="icon-user"}</a></th> + <th class="text-right width10p">{$tableHash.info.orders|default:"0"} {booticon iname="icon-shopping-cart"}</th> + <th class="text-right width10p">{$gCommerceCurrencies->format($tableHash.info.revenue)}</th> +</tr> +<tr> + <td colspan="4" id="user-list-{$titleHash}" style="display:none"> + <ol class="data" id="user-list-{$hostHash}-{$paramKey}-{$valueKey}"> + {foreach from=$tableHash.info.users item=userHash} + <li class="item width100p" style="border-bottom:1px solid #cccccc;"> + <div class="inline-block width10p date">{$userHash.registration_date|bit_date_format}</div> + <div class="inline-block width65p">{if $userHash.referer_url}<a href="{$userHash.referer_url|escape}">{$userHash.referer_url|stats_referer_display_short}</a><br/>{/if}{BitUser::getDisplayLinkFromHash($userHash,1)} - {$userHash.email}</div> + <div class="inline-block text-right width10p">{if $userHash.revenue.total_orders}<a target="_new" href="{$smarty.const.BITCOMMERCE_PKG_URL}admin/list_orders.php?user_id={$userHash.user_id}">{$userHash.revenue.total_orders} {tr}orders{/tr}</a>{/if}</div> + <div class="inline-block text-right width10p">{if $userHash.revenue.total_revenue}{$gCommerceCurrencies->format($userHash.revenue.total_revenue)}{/if}</div> + </li> + {/foreach} + </ol> + </td> +</tr> +</tbody> +{if $tableHash.values} + {foreach from=$tableHash.values item=subHash} + {include file="bitpackage:stats/referrer_stats_ctm_inc.tpl" tableHash=$subHash depth=$depth+1 parentHash=$titleHash} + {/foreach} +{/if} |
