Skip to content

Commit

Permalink
fix(view): Fix the translation, and the template structure
Browse files Browse the repository at this point in the history
  • Loading branch information
DedrickEnc committed Oct 20, 2017
1 parent 92ccb55 commit 419bb0c
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 163 deletions.
2 changes: 2 additions & 0 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
"DEFINE_UNTIL_DATE": "Define a limit date",
"DEFAULT_QUANTITY": "Default Quantity",
"DEBTOR_BALANCE_REMAINING": "Debtor's Remaining Balance",
"DECREASE" : "Decrease",
"DEPOT": "Depot",
"DESCRIPTION": "Description",
"DESIGNATION": "Designation",
Expand Down Expand Up @@ -319,6 +320,7 @@
"INCLUDE_DATE_INTERVAL": "Include date interval",
"INCOME": "Income",
"INCOME_EXPENSE": "Income and Expense",
"INCREASE" : "Increase",
"INTL": "International",
"INVENTORY": "Inventory",
"INVENTORY_ITEM": "Item",
Expand Down
2 changes: 2 additions & 0 deletions client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"DEBTOR_CREDITOR": "Débiteur/Créditeur",
"DEFINE_UNTIL_DATE": "Définir une date limite",
"DEBTOR_BALANCE_REMAINING": "Solde Restant du Débiteur",
"DECREASE" : "Dimunition",
"DEPOT": "Depot",
"DESCRIPTION": "Description",
"DETAILS": "Details",
Expand Down Expand Up @@ -319,6 +320,7 @@
"ID": "ID",
"INCOME": "Recettes",
"INCOME_EXPENSE": "Recettes et dépenses",
"INCREASE": "Augmentation",
"INCLUDE_DATE_INTERVAL": "Inclure l'intervalle de dates",
"INCLUDE_ZEROES": "Inclure des lignes avec des valeurs zéro",
"INTL": "Internationale",
Expand Down
204 changes: 102 additions & 102 deletions client/src/modules/stock/adjustment/adjustment.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</li>
<li class="title" ng-if="StockCtrl.depot.uuid">
<span>{{ StockCtrl.depot.text }}</span>
<span class="text-uppercase badge badge-primary" ng-show="StockCtrl.adjustmentOption">
{{ StockCtrl.adjustmentOption }}
<span class="text-uppercase badge badge-primary" ng-show="StockCtrl.adjustmentOption" translate>
{{ StockCtrl.adjustmentType}}
</span>
</li>
</ol>
Expand All @@ -35,123 +35,123 @@
<!-- content -->
<div class="flex-content">
<div class="container-fluid">

<form name="StockForm" bh-submit="StockCtrl.submit(StockForm)" novalidate>

<div class="row">
<div class="col-xs-6">
<!-- adjustment type -->
<div class="form-group">
<div class="well well-sm">
<div class="radio">
<label class="radio-inline" style="padding: 0 3em;">
<input type="radio" ng-model="StockCtrl.adjustmentOption" ng-value="'increase'">
<span translate>STOCK.INCREASE</span>
</label>

<label class="radio-inline" style="padding: 0 3em;">
<input type="radio" ng-model="StockCtrl.adjustmentOption" ng-value="'decrease'">
<span translate>STOCK.DECREASE</span>
</label>
<div class="row">
<div class="col-xs-6">
<!-- adjustment type -->
<div class="form-group">
<div class="well well-sm">
<div class="radio">
<label class="radio-inline" style="padding: 0 3em;">
<input type="radio" ng-model="StockCtrl.adjustmentOption" ng-value="'increase'" ng-change="StockCtrl.handleAdjustmentOption()">
<span translate>STOCK.INCREASE</span>
</label>

<label class="radio-inline" style="padding: 0 3em;">
<input type="radio" ng-model="StockCtrl.adjustmentOption" ng-value="'decrease'" ng-change="StockCtrl.handleAdjustmentOption()">
<span translate>STOCK.DECREASE</span>
</label>
</div>
</div>
</div>

<!-- date -->
<bh-date-editor
date-value="StockCtrl.movement.date"
max-date="StockCtrl.timestamp" >
</bh-date-editor>
</div>

<!-- note -->
<div class="form-group"
ng-class="{ 'has-error' : StockForm.$submitted && StockForm.description.$invalid }">
<label class="control-label">
<span translate>FORM.LABELS.DESCRIPTION</span>
</label>
<textarea
class="form-control"
name="description"
ng-model="StockCtrl.movement.description"
placeholder="{{ 'FORM.PLACEHOLDERS.DESCRIPTION' | translate }}"
ng-maxlength="StockCtrl.maxLength"
required>
</textarea>
<div class="help-block" ng-messages="StockForm.description.$error" ng-show="StockForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
<!-- date -->
<bh-date-editor
date-value="StockCtrl.movement.date"
max-date="StockCtrl.timestamp" >
</bh-date-editor>

<!-- note -->
<div class="form-group"
ng-class="{ 'has-error' : StockForm.$submitted && StockForm.description.$invalid }">
<label class="control-label">
<span translate>FORM.LABELS.DESCRIPTION</span>
</label>
<textarea
class="form-control"
name="description"
ng-model="StockCtrl.movement.description"
placeholder="{{ 'FORM.PLACEHOLDERS.DESCRIPTION' | translate }}"
ng-maxlength="StockCtrl.maxLength"
required>
</textarea>
<div class="help-block" ng-messages="StockForm.description.$error" ng-show="StockForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div ng-if="StockCtrl.adjustmentOption === 'increase'" style="margin-top: 0px;">
<h4><i class="fa fa-arrow-circle-up"></i> <span translate>STOCK.INCREASE</span> </h4>
<p translate>STOCK.INCREASE_HELP</p>
</div>

<div class="col-xs-6">
<div ng-if="StockCtrl.adjustmentOption === 'increase'" style="margin-top: 0px;">
<h4><i class="fa fa-arrow-circle-up"></i> <span translate>STOCK.INCREASE</span> </h4>
<p translate>STOCK.INCREASE_HELP</p>
</div>

<div ng-if="StockCtrl.adjustmentOption === 'decrease'" style="margin-top: 0px;">
<h4><i class="fa fa-arrow-circle-down"></i> <span translate>STOCK.DECREASE</span> </h4>
<p translate>STOCK.DECREASE_HELP</p>
<div ng-if="StockCtrl.adjustmentOption === 'decrease'" style="margin-top: 0px;">
<h4><i class="fa fa-arrow-circle-down"></i> <span translate>STOCK.DECREASE</span> </h4>
<p translate>STOCK.DECREASE_HELP</p>
</div>
</div>
</div>
</div>

<!-- add and recovery -->
<div class="row" style="padding-bottom : 5px;">
<div class="col-xs-12">
<!-- info -->
<p
style="padding-top : 10px;"
class="text-info"
ng-show="!StockCtrl.adjustmentOption">
<span class="fa fa-info-circle"></span>
<span translate>FORM.INFO.NO_DESTINATION</span>
</p>

<!-- "Recover Items" button -->
<div class="btn-group pull-right" role="group">
<button
type="button"
class="btn btn-default"
ng-class="{'btn-primary' : StockCtrl.hasCacheAvailable }"
ng-click="StockCtrl.readCache()"
ng-disabled="!StockCtrl.hasCacheAvailable">
<span class="fa fa-recycle"></span>
<span translate>FORM.BUTTONS.RECOVER_ITEMS</span>
</button>
</div>
<!-- add and recovery -->
<div class="row" style="padding-bottom : 5px;">
<div class="col-xs-12">
<!-- info -->
<p
style="padding-top : 10px;"
class="text-info"
ng-show="!StockCtrl.adjustmentOption">
<span class="fa fa-info-circle"></span>
<span translate>FORM.INFO.NO_DESTINATION</span>
</p>

<!-- "Recover Items" button -->
<div class="btn-group pull-right" role="group">
<button
type="button"
class="btn btn-default"
ng-class="{'btn-primary' : StockCtrl.hasCacheAvailable }"
ng-click="StockCtrl.readCache()"
ng-disabled="!StockCtrl.hasCacheAvailable">
<span class="fa fa-recycle"></span>
<span translate>FORM.BUTTONS.RECOVER_ITEMS</span>
</button>
</div>

<!-- "Add number of grid rows" input-group -->
<bh-add-item
disable = "StockCtrl.adjustmentOption"
callback = "StockCtrl.addItems(numItem)">
</bh-add-item>
<!-- "Add number of grid rows" input-group -->
<bh-add-item
disable = "StockCtrl.adjustmentOption"
callback = "StockCtrl.addItems(numItem)">
</bh-add-item>

</div>

</div>

</div>

<!-- grid -->
<div id="stock-adjustment-grid"
ui-grid="StockCtrl.gridOptions"
style="height: 300px; width: 100%;"
ui-grid-auto-resize
ui-grid-resize-columns>
</div>

<!-- footer -->
<div class="row" style="margin-top: 5px;">
<div class="col-xs-6 col-xs-offset-6">
<div class="text-right">
<button class="btn btn-default" ng-click="StockCtrl.suspend(StockForm)" type="button" translate>
FORM.BUTTONS.SUSPEND
</button>
<!-- grid -->
<div id="stock-adjustment-grid"
ui-grid="StockCtrl.gridOptions"
style="height: 300px; width: 100%;"
ui-grid-auto-resize
ui-grid-resize-columns>
</div>

<bh-loading-button loading-state="StockCtrl.$loading" disabled="!StockCtrl.validForSubmit">
<span translate>FORM.BUTTONS.SUBMIT</span>
</bh-loading-button>
<!-- footer -->
<div class="row" style="margin-top: 5px;">
<div class="col-xs-6 col-xs-offset-6">
<div class="text-right">
<button class="btn btn-default" ng-click="StockCtrl.suspend(StockForm)" type="button" translate>
FORM.BUTTONS.SUSPEND
</button>

<bh-loading-button loading-state="StockCtrl.$loading" disabled="!StockCtrl.validForSubmit">
<span translate>FORM.BUTTONS.SUBMIT</span>
</bh-loading-button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
Loading

0 comments on commit 419bb0c

Please sign in to comment.