Skip to content

Commit

Permalink
fix(template): Updating the template, following th new standard of Bh…
Browse files Browse the repository at this point in the history
…ima registry
  • Loading branch information
DedrickEnc committed Sep 26, 2017
1 parent 5974bc8 commit ca42be8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 43 deletions.
83 changes: 48 additions & 35 deletions client/src/modules/stock/inventories/registry.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,78 @@
<div class="flex-header static">
<div class="flex-header">
<div class="bhima-title">
<ol class="headercrumb">
<li class="static" translate>TREE.STOCK</li>
<li class="title" translate>TREE.STOCK_INVENTORY</li>
</ol>

<div class="toolbar">
<div class="toolbar-item">
<div uib-dropdown dropdown-append-to-body data-action="open-menu">
<a class="btn btn-default" uib-dropdown-toggle>
<span class="fa fa-bars"></span> <span class="hidden-xs" translate>FORM.LABELS.MENU</span> <span class="caret"></span>
</a>

<ul uib-dropdown-menu role="menu" class="dropdown-menu-right">
<li role="menuitem">
<a href data-method="configure" ng-click="StockCtrl.openColumnConfigModal()">
<i class="fa fa-columns"></i> <span translate>FORM.LABELS.COLUMNS</span>
</a>
</li>

<li role="separator" class="divider"></li>
<li role="menuitem">
<a href data-method="save-state" ng-click="StockCtrl.saveGridState()">
<i class="fa fa-save"></i> <span translate>FORM.BUTTONS.SAVE_GRID_CONFIGURATION</span>
</a>
</li>

<li role="menuitem">
<a href data-method="clear-state" ng-click="StockCtrl.clearGridState()">
<i class="fa fa-close"></i> <span translate>FORM.BUTTONS.CLEAR_GRID_CONFIGURATION</span>
</a>
</li>

<li role="separator" class="divider"></li>
<li role="menuitem">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.download('pdf') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<span class="fa fa-file-pdf-o"></span> <span translate>DOWNLOADS.PDF</span>
</a>
</li>
<li role="menuitem">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.download('csv') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<span class="fa fa-file-excel-o"></span> <span translate>DOWNLOADS.CSV</span>
</a>
</li>
</ul>
</div>
</div>

<div class="toolbar-item">
<button
ng-click="StockCtrl.search()"
data-method="search"
class="btn btn-default">
<i class="fa fa-search"></i> <span translate>FORM.BUTTONS.SEARCH</span>
<span class="fa fa-search"></span> <span class="hidden-xs" translate>FORM.BUTTONS.SEARCH</span>
</button>
</div>
<div class="toolbar-item">
<bh-pdf-print
pdf-url="/reports/stock/inventories"
options="StockCtrl.filters"
disable-cache="true">
</bh-pdf-print>
</div>

<div class="toolbar-item">
<bh-renderer-dropdown
report-url="/reports/stock/inventories"
report-options="StockCtrl.filters">
</bh-renderer-dropdown>
</div>
</div>
</div>
</div>

<!-- util bar -->
<div class="flex-util">
<bh-filters-applied
style="max-width:90%"
filters="StockCtrl.formatedFilters"
<div class="flex-util bh-filter-bar">
<bh-filters
filters="StockCtrl.latestViewFilters"
on-remove-filter="StockCtrl.onRemoveFilter(filter)">
</bh-filters-applied>

<a
href
ng-click="StockCtrl.clearFilters()"
ng-show="StockCtrl.formatedFilters.length > 0"
class="text-danger"
data-method="clear">
<i class="fa fa-ban text-danger"></i>
<span translate>FORM.INFO.CLEAR_FILTERS</span>
</a>
</bh-filters>
</div>

<!--the grid -->
<div class="flex-content">
<div class="container-fluid">

<div
id="stock-inventory-grid"
class="grid-full-height-with-filters"
ui-grid="StockCtrl.gridOptions"
class="grid-util-full-height"
ui-grid-resize-columns
ui-grid-auto-resize
ui-grid-grouping>
Expand All @@ -68,6 +82,5 @@
error-state="StockCtrl.hasError">
</bh-grid-loading-indicator>
</div>

</div>
</div>
17 changes: 9 additions & 8 deletions client/src/modules/stock/inventories/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ StockInventoriesController.$inject = [
'StockService', 'NotifyService',
'uiGridConstants', '$translate', 'StockModalService',
'SearchFilterFormatService', 'LanguageService', 'SessionService',
'GridGroupingService', 'bhConstants',
'GridGroupingService', 'bhConstants', 'GridStateService', '$state'
];

/**
* Stock movements Controller
* This module is a registry page for stock movements
* Stock Inventory Controller
* This module is a registry page for stock inventories
*/
function StockInventoriesController(Stock, Notify,
uiGridConstants, $translate, Modal,
SearchFilterFormat, Languages, Session, Grouping, bhConstants) {
SearchFilterFormat, Languages, Session, Grouping, bhConstants, GridStateService, $state) {
var vm = this;

var cacheKey = 'stock-inventory-grid';

// global variables
vm.filters = { lang: Languages.key };
vm.formatedFilters = [];
// vm.filters = { lang: Languages.key };
// vm.formatedFilters = [];
vm.enterprise = Session.enterprise;

// grid columns
var columns = [
{ field : 'depot_text',
displayName : 'STOCK.DEPOT',
Expand Down Expand Up @@ -108,7 +109,7 @@ function StockInventoriesController(Stock, Notify,
enableColumnMenus : false,
columnDefs : columns,
enableSorting : true,
showColumnFooter : true,
// showColumnFooter : true,
fastWatch : true,
flatEntityAccess : true,
};
Expand Down

0 comments on commit ca42be8

Please sign in to comment.