Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
- [x] Reverted changes on BooleanFieldView.getReadWidget
- [x] Fixed display on directive boolean-column
  • Loading branch information
djhi committed Sep 25, 2015
1 parent e4f1e32 commit 03f46fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/javascripts/ng-admin/Crud/column/maBooleanColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define(function (require) {
link: function(scope) {
scope.value = scope.value();
},
template: '<span class="glyphicon" ng-class="{\'glyphicon-ok\': value === true, \'glyphicon-remove\': value === false }"></span>'
template: '<span class="glyphicon" ng-class="{\'glyphicon-ok\': !!value, \'glyphicon-remove\': !value }"></span>'
};
}

Expand Down
12 changes: 5 additions & 7 deletions src/javascripts/ng-admin/Crud/fieldView/BooleanFieldView.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module.exports = {
getReadWidget: () => '<ma-boolean-column value="::field.getLabelForChoice(entry.values[field.name()], entry)"></ma-boolean-column>',
getReadWidget: () => '<ma-boolean-column value="::entry.values[field.name()]"></ma-boolean-column>',
getLinkWidget: () => '<a ng-click="gotoDetail()">' + module.exports.getReadWidget() + '</a>',
getFilterWidget: () => `<ma-choice-field field="::field" value="values[field.name()]" choices="[{value: 'true', label: 'true' }, { value: 'false', label: 'false' }]"></ma-choice-field>`,
getWriteWidget: () => {
return `<div class="row">
<ma-choice-field class="col-sm-4 col-md-3" ng-if="!field.validation().required" field="::field" value="entry.values[field.name()]"></ma-choice-field>
<ma-checkbox-field class="col-sm-4 col-md-3" ng-if="!!field.validation().required" field="::field" value="entry.values[field.name()]"></ma-checkbox-field>
</div>`;
}
getWriteWidget: () => `<div class="row">
<ma-choice-field class="col-sm-4 col-md-3" ng-if="!field.validation().required" field="::field" value="entry.values[field.name()]"></ma-choice-field>
<ma-checkbox-field class="col-sm-4 col-md-3" ng-if="!!field.validation().required" field="::field" value="entry.values[field.name()]"></ma-checkbox-field>
</div>`
}

0 comments on commit 03f46fb

Please sign in to comment.