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

Commit

Permalink
Merge pull request #177 from billybonks/bind-attr
Browse files Browse the repository at this point in the history
Replacing {{bind-attr}}
  • Loading branch information
jkleinsc committed Sep 28, 2015
2 parents 8659cd3 + 36b8f3b commit bccf5b8
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 119 deletions.
2 changes: 1 addition & 1 deletion app/appointments/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{view Ember.Select viewName="select" content=minuteList optionLabelPath="content" optionValuePath="content" value=startMinute class="form-control"}}
</div>
</div>
<div {{bind-attr class=":form-group :col-sm-3 :required :has-feedback endTimeHasError:has-error"}}>
<div class="form-group col-sm-3 required has-feedback {{if endTimeHasError 'has-error'}}">
<label class="control-label" for="endTime">End Time</label>
<div class="input-group">
{{view Ember.Select viewName="select" content=hourList optionLabelPath="content.name" optionValuePath="content.value" value=endHour id="endTime" class="form-control"}}
Expand Down
6 changes: 3 additions & 3 deletions app/dialog/template.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#if showProgress}}
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" {{bind-attr aria-valuenow="progressBarValue"}}
aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}>
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow={{progressBarValue}}
aria-valuemin="0" aria-valuemax="100" style={{progressBarStyle}}>
<span class="sr-only">{{progressBarValue}}% Complete</span>
</div>
</div>
{{/if}}
{{message}}
{{message}}
2 changes: 1 addition & 1 deletion app/inventory/barcode/template.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="panel panel-default">
<div class="panel-body">
<img {{bind-attr src=barcodeUri}}/>
<img src={{barcodeUri}}>
</div>
</div>

Expand Down
28 changes: 14 additions & 14 deletions app/inventory/reports/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div class="panel-body">
{{#em-form model=this submit_button=false }}
<div class="row">
{{em-select class="col-xs-6" label="Report Type"
{{em-select class="col-xs-6" label="Report Type"
property="reportType" content=reportTypes
optionValuePath="content.value" optionLabelPath="content.name"
selected=reportType
}}
{{#unless hideLocationFilter}}
{{em-select class="col-xs-6" label="Location"
{{em-select class="col-xs-6" label="Location"
property="filterLocation" content=warehouseList.value
optionValuePath="content" optionLabelPath="content"
prompt=" "
Expand All @@ -22,7 +22,7 @@
{{date-picker property="startDate" label="Start Date" class="col-sm-4"}}
{{date-picker property="endDate" label="End Date" class="col-sm-4"}}
{{/if}}
</div>
</div>
{{#if useFieldPicker}}
<h3>Fields to Include</h3>
<div class="row">
Expand All @@ -33,19 +33,19 @@
{{em-checkbox label=reportColumns.id.label property="reportColumns.id.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.name.label property="reportColumns.name.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.description.label property="reportColumns.description.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.type.label property="reportColumns.type.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.type.label property="reportColumns.type.include" class="col-xs-2"}}
</div>
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-1"></div>
{{em-checkbox label=reportColumns.quantity.label property="reportColumns.quantity.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.unit.label property="reportColumns.unit.include" class="col-xs-2"}}
{{#if includeCostFields}}
{{#if includeCostFields}}
{{em-checkbox label=reportColumns.total.label property="reportColumns.total.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.unitcost.label property="reportColumns.unitcost.include" class="col-xs-2"}}
{{/if}}
{{#if includeDaysLeft}}
{{em-checkbox label=reportColumns.consumedPerDay.label property="reportColumns.consumedPerDay.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.daysLeft.label property="reportColumns.daysLeft.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.daysLeft.label property="reportColumns.daysLeft.include" class="col-xs-2"}}
{{/if}}
{{em-checkbox label=reportColumns.price.label property="reportColumns.price.include" class="col-xs-2"}}
</div>
Expand All @@ -56,21 +56,21 @@
{{em-checkbox label=reportColumns.locations.label property="reportColumns.locations.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.aisle.label property="reportColumns.aisle.include" class="col-xs-2"}}
{{em-checkbox label=reportColumns.xref.label property="reportColumns.xref.include" class="col-xs-2"}}

</div>
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-1"></div>
{{em-checkbox label=reportColumns.vendor.label property="reportColumns.vendor.include" class="col-xs-2"}}
{{#if includeExpenseAccount}}
{{em-checkbox label=reportColumns.expenseAccount.label property="reportColumns.expenseAccount.include" class="col-xs-2"}}
{{/if}}

{{#if includeTransactionType}}
{{em-checkbox label=reportColumns.transactionType.label property="reportColumns.transactionType.include" class="col-xs-2"}}
{{/if}}
</div>
{{/if}}

{{/em-form}}
</div>
<div class="panel-footer">
Expand All @@ -95,8 +95,8 @@
</table>
</div>
<div class="panel-footer">
<a {{bind-attr href="csvExport"}} target="_blank" download="report.csv" class="btn btn-default">Export Report</a>
<a href={{csvExport}} target="_blank" download="report.csv" class="btn btn-default">Export Report</a>

</div>
</div>
</div>
{{/if}}
{{/if}}
36 changes: 18 additions & 18 deletions app/invoices/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
<div class="form-group col-xs-2">
<label>Invoice Id</label>
<p class="form-control-static">{{id}}</p>
</div>
</div>
{{/unless}}
{{date-picker property="billDate" label="Bill Date" class="col-xs-2"}}
{{#if isNew}}
{{patient-typeahead property="patientTypeAhead" label="Patient" content=patientList selection=selectedPatient class="col-xs-4 required"}}
{{em-select class="col-xs-4 required" label="Visit"
{{em-select class="col-xs-4 required" label="Visit"
property="visit" content=patientVisits
optionValuePath="content" optionLabelPath="content.visitDescription"
optionValuePath="content" optionLabelPath="content.visitDescription"
selected=visit
prompt='Please select a visit'
}}
}}
{{else}}
<div class="form-group col-xs-3">
<label>Visit</label>
<p class="form-control-static">{{visit.visitDescription}}</p>
</div>
</div>
{{/if}}
</div>
<div class="row">
Expand Down Expand Up @@ -59,8 +59,8 @@
<th class="text-right">Excess</th>
<th class="text-right">Action</th>
</tr>
{{#each lineItemsByCategory as |categoryGroup|}}

{{#each lineItemsByCategory as |categoryGroup|}}
<tr>
<td class="col-xs-12">
<strong>{{categoryGroup.category}}</strong>
Expand All @@ -71,11 +71,11 @@
<td class="col-xs-5">
<div class="form-group">
<div class="input-group">
<span {{bind-attr class=":input-group-addon :glyphicon showDetails:glyphicon-minus:glyphicon-plus"}}
<span class="input-group-addon glyphicon {{unless showDetails 'glyphicon-minus' 'glyphicon-plus'}}"
{{action "toggleDetails" item bubbles=false }}> </span>
<strong>{{input class="form-control" value=item.name }}</strong>
</div>
</div>
</div>
</td>
<td class="col-xs-1 text-right">
{{number-format item.total}}
Expand All @@ -97,7 +97,7 @@
</td>
<td class="col-xs-1 text-right">{{number-format item.amountOwed}}</td>
<td class="col-xs-2">
{{#if canAddCharge}}
{{#if canAddCharge}}
<button class="btn btn-default warning" {{action "showDeleteLineItem" item bubbles=false }}>
<span class="octicon octicon-x"></span>Delete
</button>
Expand Down Expand Up @@ -127,7 +127,7 @@
{{input class="form-control" value=detail.name }}
</div>
</div>
</td>
</td>
<td class="col-xs-1">
<div class="form-group">
{{input class="form-control" value=detail.quantity }}
Expand All @@ -151,7 +151,7 @@
{{number-format detail.amountOwed}}
</td>
<td class="col-xs-2">
{{#if canAddCharge}}
{{#if canAddCharge}}
<button class="btn btn-default warning" {{action "showDeleteItem" detail item.details bubbles=false }}>
<span class="octicon octicon-x"></span>Delete
</button>
Expand All @@ -169,7 +169,7 @@
<td class="text-right">{{number-format categoryGroup.discount}}</td>
<td class="text-right">{{number-format categoryGroup.nationalInsurance}}</td>
<td class="text-right">{{number-format categoryGroup.privateInsurance}}</td>
<td class="text-right">{{number-format categoryGroup.amountOwed }}</td>
<td class="text-right">{{number-format categoryGroup.amountOwed }}</td>
<td></td>
</tr>
{{/each}}
Expand All @@ -181,23 +181,23 @@
<td class="text-right">{{number-format model.discount}}</td>
<td class="text-right">{{number-format model.nationalInsurance}}</td>
<td class="text-right">{{number-format model.privateInsurance}}</td>
<td class="text-right">{{number-format model.patientResponsibility}}</td>
<td class="text-right">{{number-format model.patientResponsibility}}</td>
<td></td>
</tr>
<tr>
<td>
<strong>Payments/Deposits</strong>
</td>
<td colspan="4"></td>
<td class="text-right">-{{number-format paidTotal}}</td>
<td class="text-right">-{{number-format paidTotal}}</td>
<td></td>
</tr>
<tr>
<td>
<strong>Grand Total</strong>
</td>
<td colspan="4"></td>
<td class="text-right">{{number-format remainingBalance}}</td>
<td class="text-right">{{number-format remainingBalance}}</td>
<td></td>
</tr>
</table>
Expand All @@ -207,7 +207,7 @@
<div class="panel detail-section">
<div class="panel-heading">
<h3 class="panel-title">
Remarks
Remarks
</h3>
</div>
<div class="panel-body detail-section-content">
Expand Down Expand Up @@ -252,4 +252,4 @@
{{/each}}
</table>
</div>
</div>
</div>
12 changes: 6 additions & 6 deletions app/medication/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
{{patient-typeahead property="patientTypeAhead" label="Patient" content=patientList selection=selectedPatient class="col-xs-6 required"}}
{{/if}}
{{#if isNew}}
{{em-select class="col-xs-4 required" label="Visit"
{{em-select class="col-xs-4 required" label="Visit"
property="visit" content=patientVisits
optionValuePath="content" optionLabelPath="content.visitDescription"
prompt="--Add New Outpatient Visit--"
selected=visit
}}
}}
{{else}}
<div class="form-group col-xs-3">
<label>Visit</label>
Expand All @@ -23,7 +23,7 @@
{{#if isFulfilledOrRequested}}
<div class="form-group">
<label class="control-label">Medication</label>
<p class="form-control-static">{{inventoryItem.name}}</p>
<p class="form-control-static">{{inventoryItem.name}}</p>
</div>
{{else}}
{{inventory-typeahead property="inventoryItemTypeAhead" label="Medication" content=medicationList selection=selectedInventoryItem class="required"}}
Expand All @@ -43,13 +43,13 @@
{{date-picker property="prescriptionDate" label="Prescription Date" class="col-sm-4"}}
</div>
<div class="row">
{{em-input property="quantity" label=quantityLabel class=quantityClass }}
{{em-input property="quantity" label=quantityLabel class=quantityClass }}
{{em-input property="refills" label="Refills" class="col-xs-3"}}
</div>
{{#unless hideFulfillRequest}}
{{#if isNew}}
{{#if canFulfill}}
<div class="form-group">
<div class="form-group">
<label class="control-label">Fulfill Request</label>
</div>
{{em-checkbox label="Fulfill Request Now" property="shouldFulfillRequest"}}
Expand All @@ -64,4 +64,4 @@
}}
{{/if}}
{{/if}}
{{/em-form}}
{{/em-form}}
15 changes: 7 additions & 8 deletions app/medication/route.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import AbstractModuleRoute from 'hospitalrun/routes/abstract-module-route';
import Ember from 'ember';
export default AbstractModuleRoute.extend({
addCapability: 'add_medication',
addCapability: 'add_medication',
moduleName: 'medication',
newButtonText: '+ new request',
sectionTitle: 'Medication',

additionalButtons: function() {
var additionalButtons = [];
if (this.currentUserCan('fulfill_medication')) {
Expand All @@ -15,7 +15,7 @@ export default AbstractModuleRoute.extend({
buttonText: 'dispense medication',
class: 'btn btn-primary'
});
}
}
if (this.currentUserCan(this.get('addCapability'))) {
additionalButtons.push({
buttonIcon: 'octicon octicon-mail-reply',
Expand All @@ -29,7 +29,7 @@ export default AbstractModuleRoute.extend({
}
}.property(),

additionalModels: [{
additionalModels: [{
name: 'aisleLocationList',
findArgs: ['lookup','aisle_location_list']
}, {
Expand All @@ -39,27 +39,26 @@ export default AbstractModuleRoute.extend({
name: 'warehouseList',
findArgs: ['lookup','warehouse_list']
}],

subActions: [{
text: 'Requests',
linkTo: 'medication.index'
}, {
text: 'Completed',
linkTo: 'medication.completed'
}],

actions: {
dispenseMedication: function() {
if (this.currentUserCan('fulfill_medication')) {
this.transitionTo('medication.edit', 'dispense');
}
},

returnMedication: function(){
if (this.currentUserCan(this.get('addCapability'))) {
this.transitionTo('medication.return', 'new');
}
}
}
});

6 changes: 3 additions & 3 deletions app/patients/photo/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{{take-photo photoFile=photoFile }}
{{else}}
<div class="thumbnail">
<img {{bind-attr alt="caption" src="url"}} class="img-responsive" >
<img alt={{caption}} src={{url}} class="img-responsive" >
</div>
{{/if}}
<div class="row">
<div class="row">
{{em-input property="caption" label="Caption"}}
</div>
{{/em-form}}
{{/em-form}}
Loading

0 comments on commit bccf5b8

Please sign in to comment.