Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Localization for Admin Module
Browse files Browse the repository at this point in the history
Closes #320
Resolves #281
Thanks for the PR @renato04
  • Loading branch information
jkleinsc committed Mar 1, 2016
1 parent f042966 commit e3df4c7
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 74 deletions.
3 changes: 2 additions & 1 deletion app/admin/address/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default AbstractEditController.extend({
updateCapability: 'update_config',

afterUpdate: function() {
this.displayAlert('Options Saved', 'The address options have been saved');
this.displayAlert(this.get('i18n').t('admin.address.titles.options_saved'),
this.get('i18n').t('admin.address.messages.address_saved'));
}
});
16 changes: 8 additions & 8 deletions app/admin/address/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div class="panel panel-primary">
<div class="panel-body">
{{#em-form model=model submitButton=false }}
{{em-input label="Address 1 Label" property="value.address1Label"}}
{{em-checkbox label="Include address 1" property="value.address1Include"}}
{{em-input label="Address 2 Label" property="value.address2Label"}}
{{em-checkbox label="Include address 2" property="value.address2Include"}}
{{em-input label="Address 3 Label" property="value.address3Label"}}
{{em-checkbox label="Include address 3" property="value.address3Include"}}
{{em-input label="Address 4 Label" property="value.address4Label"}}
{{em-checkbox label="Include address 4" property="value.address4Include"}}
{{em-input label=(t 'admin.address.address1_label') property="value.address1Label"}}
{{em-checkbox label=(t 'admin.address.include1_label') property="value.address1Include"}}
{{em-input label=(t 'admin.address.address2_label') property="value.address2Label"}}
{{em-checkbox label=(t 'admin.address.include2_label') property="value.address2Include"}}
{{em-input label=(t 'admin.address.address3_label') property="value.address3Label"}}
{{em-checkbox label=(t 'admin.address.include3_label') property="value.address3Include"}}
{{em-input label=(t 'admin.address.address4_label') property="value.address4Label"}}
{{em-checkbox label=(t 'admin.address.include4_label') property="value.address4Include"}}
{{/em-form}}
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions app/admin/loaddb/template.hbs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<div class="panel panel-primary">
<div class="panel-body">
{{#em-form model=model submitButton=false }}
{{file-upload label="File To Load" property="importFileName" selectedFile=importFile }}
<button class="btn btn-default" {{action 'loadFile'}}>Load File</button>
{{file-upload label=(t 'labels.file_to_Load') property="importFileName" selectedFile=importFile }}
<button class="btn btn-default" {{action 'loadFile'}}>{{t 'buttons.load_file'}}</button>
{{/em-form}}
{{#if syncResults}}
<h4>File Load Successful</h4>
<h4>{{t 'labels.file_load_successful'}}</h4>
<div class="form-group col-xs-3">
<label>Start Time</label>
<label>{{t 'labels.start_time'}}</label>
<p class="form-control-static">{{date-format syncResults.start_time format="l h:mm A"}}</p>
</div>
<div class="form-group col-xs-3">
<label>End Time</label>
<label>{{t 'labels.end_time'}}</label>
<p class="form-control-static">{{date-format syncResults.end_time format="l h:mm A"}}</p>
</div>
<div class="form-group col-xs-3">
<label>Docs Read</label>
<label>{{t 'labels.doc_read'}}</label>
<p class="form-control-static">{{syncResults.docs_read}}</p>
</div>
<div class="form-group col-xs-3">
<label>Docs Written</label>
<label>{{t 'labels.doc_written'}}</label>
<p class="form-control-static">{{syncResults.docs_written}}</p>
</div>
{{/if}}
Expand Down
53 changes: 27 additions & 26 deletions app/admin/lookup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,59 @@ import VisitTypes from 'hospitalrun/mixins/visit-types';
export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
ModalHelper, ImagingPricingTypes, InventoryTypeList, UnitTypes, VisitTypes, {
fileSystem: Ember.inject.service('filesystem'),
lookupTypes: [{
name: 'Anesthesia Types',
lookupTypes: Ember.computed(function() {
return [{
name: this.get('i18n').t('admin.lookup.anesthesia_types'),
value: 'anesthesia_types',
model: {
procedure: 'anesthesiaType'
}
}, {
name: 'Anesthesiologists',
name: this.get('i18n').t('admin.lookup.anesthesiologists'),
value: 'anesthesiologists',
model: {
procedure: 'anesthesiologist'
}
}, {
defaultValues: 'defaultBillingCategories',
name: 'Billing Categories',
name: this.get('i18n').t('admin.lookup.billing_categories'),
value: 'billing_categories',
models: {
'billing-line-item': 'category'
}
}, {
name: 'Clinic Locations',
name: this.get('i18n').t('admin.lookup.clinic_list'),
value: 'clinic_list',
models: { // Models that use this lookup -- use this later to update models on lookup changes
patient: 'clinic'
}
}, {
name: 'Countries',
name: this.get('i18n').t('admin.lookup.country_list'),
value: 'country_list',
models: {
patient: 'country'
}
}, {
name: 'Diagnoses',
name: this.get('i18n').t('admin.lookup.diagnosis_list'),
value: 'diagnosis_list',
models: {
visit: 'primaryDiagnosis'
}
}, {
name: 'CPT Codes',
name: this.get('i18n').t('admin.lookup.cpt_code_list'),
value: 'cpt_code_list',
models: {
procedure: 'cptCode'
}
}, {
name: 'Expense Accounts',
name: this.get('i18n').t('admin.lookup.expense_account_list'),
value: 'expense_account_list',
models: {
'inv-request': 'expenseAccount',
pricing: 'expenseAccount'
}
}, {
name: 'Inventory Aisle Locations',
name: this.get('i18n').t('admin.lookup.aisle_location_list'),
value: 'aisle_location_list',
models: {
inventory: 'aisleLocation',
Expand All @@ -72,7 +73,7 @@ export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
]
}
}, {
name: 'Inventory Locations',
name: this.get('i18n').t('admin.lookup.warehouse_list'),
value: 'warehouse_list',
models: {
inventory: 'location',
Expand All @@ -85,33 +86,33 @@ export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
}
}, {
defaultValues: 'defaultInventoryTypes',
name: 'Inventory Types',
name: this.get('i18n').t('admin.lookup.inventory_types'),
value: 'inventory_types',
models: {
inventory: 'inventoryType'
}
}, {
defaultValues: 'defaultImagingPricingTypes',
name: 'Imaging Pricing Types',
name: this.get('i18n').t('admin.lookup.imaging_pricing_types'),
value: 'imaging_pricing_types',
models: {
pricing: 'pricingType'
}
}, {
defaultValues: 'defaultLabPricingTypes',
name: 'Lab Pricing Types',
name: this.get('i18n').t('admin.lookup.lab_pricing_types'),
value: 'lab_pricing_types',
models: {
pricing: 'pricingType'
}
}, {
name: 'Patient Status List',
name: this.get('i18n').t('admin.lookup.patient_status_list'),
value: 'patient_status_list',
models: {
patient: 'status'
}
}, {
name: 'Physicians',
name: this.get('i18n').t('admin.lookup.physician_list'),
value: 'physician_list',
models: {
appointment: 'provider',
Expand All @@ -122,25 +123,25 @@ export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
]
}
}, {
name: 'Procedures',
name: this.get('i18n').t('admin.lookup.procedure_list'),
value: 'procedure_list',
models: {
procedure: 'description'
}
}, {
name: 'Procedure Locations',
name: this.get('i18n').t('admin.lookup.procedure_locations'),
value: 'procedure_locations',
models: {
procedure: 'location'
}
}, {
name: 'Procedure Pricing Types',
name: this.get('i18n').t('admin.lookup.procedure_pricing_types'),
value: 'procedure_pricing_types',
models: {
pricing: 'pricingType'
}
}, {
name: 'Radiologists',
name: this.get('i18n').t('admin.lookup.radiologists'),
value: 'radiologists',
model: {
imaging: 'radiologist'
Expand All @@ -153,39 +154,39 @@ export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
}
}, {
defaultValues: 'defaultUnitList',
name: 'Unit Types',
name: this.get('i18n').t('admin.lookup.unit_types'),
value: 'unit_types',
models: {
inventory: 'distributionUnit',
'inv-purchase': 'distributionUnit'
}
}, {
name: 'Vendor',
name: this.get('i18n').t('admin.lookup.vendor_list'),
value: 'vendor_list',
models: {
'inv-purchase': 'vendor'
}
}, {
name: 'Visit Locations',
name: this.get('i18n').t('admin.lookup.visit_location_list'),
value: 'visit_location_list',
models: {
appointment: 'location',
visit: 'location'
}
}, {
defaultValues: 'defaultVisitTypes',
name: 'Visit Types',
name: this.get('i18n').t('admin.lookup.visit_types'),
value: 'visit_types',
models: {
visit: 'visitType'
}
}, {
name: 'Ward Pricing Types',
name: this.get('i18n').t('admin.lookup.visit_types'),
value: 'ward_pricing_types',
models: {
pricing: 'pricingType'
}
}],
}];}),

importFile: Ember.computed.alias('lookupTypeList.importFile'),

Expand Down
14 changes: 7 additions & 7 deletions app/admin/lookup/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="panel-body">
{{#em-form model=model submitButton=false }}
<div class="row">
{{em-select class="col-xs-3 lookup-type" label="Lookup Type"
{{em-select class="col-xs-3 lookup-type" label=(t 'labels.lookup_type')
property="lookupType" content=lookupTypes
optionValuePath="value" optionLabelPath="name"
selected=model.lookupType
Expand All @@ -18,7 +18,7 @@
<div class="panel-body">
<table class="table">
<tr class="table-header">
<th>Value</th>
<th>{{t 'labels.value'}}</th>
<th>{{t 'labels.actions'}}</th>
</tr>
{{#each lookupTypeValues as |lookupTypeValue|}}
Expand All @@ -33,19 +33,19 @@
</table>
</div>
<div class="panel-footer">
<button class="btn btn-default neutral" {{action 'addValue'}}>Add Value</button>
<button class="btn btn-default neutral" {{action 'addValue'}}>{{t 'buttons.add_value'}}</button>
{{#em-form model=model submitButton=false }}
<div class="row">
<div class="col-sm-4">
{{em-checkbox label="User Can Add New Values" property="userCanAdd"}}
<button class="btn btn-default" {{action 'updateList'}}>Update</button>
{{em-checkbox label=(t 'labels.user_can_add_new_value') property="userCanAdd"}}
<button class="btn btn-default" {{action 'updateList'}}>{{t 'buttons.update'}}</button>
</div>
{{#if showOrganizeByType}}
{{em-checkbox label="Organize Pricing By Type" property="organizeByType" class="col-sm-4"}}
{{/if}}
<div class="col-sm-4">
{{file-upload label="Import File" property="importFileName" selectedFile=importFile }}
<button class="btn btn-default" {{action 'importList'}}>Import</button>
{{file-upload label=(t 'labels.import_file') property="importFileName" selectedFile=importFile }}
<button class="btn btn-default" {{action 'importList'}}>{{t 'buttons.import'}}</button>
</div>
</div>
{{/em-form}}
Expand Down
8 changes: 4 additions & 4 deletions app/admin/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ export default AbstractModuleRoute.extend({
sectionTitle: 'Admin',
subActions: function() {
var options = [{
text: 'Address Options',
text: this.get('i18n').t('admin.address_options'),
linkTo: 'admin.address'
}, {
text: 'Lookup Lists',
text: this.get('i18n').t('admin.lookup_lists'),
linkTo: 'admin.lookup'
}];
if (this.currentUserCan('load_db')) {
options.push({
text: 'Load DB',
text: this.get('i18n').t('admin.load_db'),
linkTo: 'admin.loaddb'
});
}
options.push({
text: 'Users',
text: this.get('i18n').t('admin.users'),
linkTo: 'users.index'
});
return options;
Expand Down
Loading

0 comments on commit e3df4c7

Please sign in to comment.