(function (angular) { var templates = { 'pre': { 'template': '
', 'attr': function (item, options) { item.removeAttr('ng-model'); if (angular.isDefined(options.key)) { item.html('{{model.' + options.key + '|json}}'); } else { item.html('{{model|json}}'); } } }, 'directive': { 'template': '', 'attr': function (item, options) { item.attr(options.directive, ""); item.attr('ng-model', 'model.' + options.key); } }, 'icon-thumbs': { 'template': '', 'attr': function (item, options) { item.attr('ng-model', 'model.' + options.key); item.attr('positive', (angular.isDefined(options.thumb) && angular.isDefined(options.thumb.positive)) ? options.thumb.positive : 'dostępny'); item.attr('negative', (angular.isDefined(options.thumb) && angular.isDefined(options.thumb.negative)) ? options.thumb.negative : 'niedostępny'); } }, 'link': { 'template': '', 'attr': function (item, options) { item.attr('ng-href', '{{model.' + options.key + '}}'); if (angular.isDefined(options.link)) { if (angular.isDefined(options.link.content)) { item.html(options.link.content); } else if (angular.isDefined(options.link.key)) { item.html('{{model.' + options.link.key + '}}'); } else if (angular.isDefined(options.link.fa)) { item.html(''); } } else { item.html('{{model.' + options.key + '}}'); } } }, 'date': { 'template': '', 'attr': function (item, options) { if (!options.format) { options.format = 'yyyy-MM-dd'; } item.html('{{model.' + options.key + "|date:'" + options.format + "'}}"); } }, 'number': { 'template': '', 'attr': function (item, options) { item.attr('min', angular.isDefined(options.min) ? options.min : 10); item.attr('ng-model', 'model.' + options.key); item.attr('ng-blur', "model.$update()"); item.attr('ng-disabled', 'model.$resolved === false '); } }, 'numeric': { 'template': '', 'attr': function (item, options) { item.html('{{model.' + options.key + '|number:0}}'); } }, 'price': { 'template': '', 'attr': function (item, options) { if (!options.format) { options.format = ''; } item.html('{{model.' + options.key + "|currency:'" + options.format + "'}}"); } }, 'thumbnail': { 'template': '', 'attr': function (item, options) { item.attr('ng-src', '{{model.' + options.key + '.data|pubphoto}}'); } }, 'thumbnail-direct': { 'template': '', 'attr': function (item, options) { item.attr('ng-src', '{{model.' + options.key + '|pubphoto}}'); } }, 'image': { 'template': '', 'attr': function (item, options) { item.attr('ng-src', '{{model.' + options.key + '|pubphoto}}'); }, 'post': function (item) { item.bind('error', function () { item.unbind('error'); item.removeAttr('ng-src'); item.attr('src', '/assets/img/nophoto.png'); let s = item.siblings('.preview'); s.remove(); }); }, 'after': { 'template': '', 'attr': function (item, options) { item.find('img').attr('ng-src', '{{model.' + options.key + '|pubphoto}}'); } } }, 'image_with_params': { 'template': '', 'attr': function (item, options) { item.attr('ng-src', '{{model.' + options.key + '|pubphoto}}'); }, 'post': function (item) { item.bind('error', function () { item.unbind('error'); item.removeAttr('ng-src'); item.attr('src', '/assets/img/nophoto.png'); let s = item.siblings('.preview'); s.remove(); }); }, 'after': { 'template': `