Tarea #62 link a la foto

This commit is contained in:
Javi Gallego 2018-02-14 10:06:51 +01:00
parent 595cbfbed6
commit 48f0554a6a
8 changed files with 25 additions and 26 deletions

View File

@ -5,3 +5,4 @@ import './validation';
import './acl';
import './on-error-src';
import './zoom-image';
import './visible-by';

View File

@ -0,0 +1,17 @@
import ngModule from '../module';
function vnVisibleBy(aclService) {
return {
restrict: 'A',
priority: -1,
link: function($scope, $element, $attrs) {
let acls = $attrs.vnVisibleBy.split(',');
if (!aclService.aclPermission(acls)) {
$element[0].style.visibility = 'hidden';
}
}
};
}
vnVisibleBy.$inject = ['aclService'];
ngModule.directive('vnVisibleBy', vnVisibleBy);

View File

@ -79,17 +79,6 @@
"description": "Botanical",
"icon": "folder"
}
},{
"url" : "/picture",
"state": "item.card.picture",
"component": "vn-item-picture",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Picture",
"icon": "folder"
}
},{
"url" : "/barcode",
"state": "item.card.barcode",

View File

@ -3,10 +3,14 @@
<vn-auto class="descriptor-header pointer" ui-sref="item.index">
<img ng-src="/static/images/icon_item.png"/>
</vn-auto>
<vn-auto pad-medium text-center>
<vn-auto style="position: relative" pad-medium text-center>
<img
ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{$ctrl.item.image}}"
zoom-image="http://verdnatura.es/vn-image-data/catalog/900x900/{{$ctrl.item.image}}" on-error-src/>
ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{::$ctrl.item.image}}"
zoom-image="http://verdnatura.es/vn-image-data/catalog/900x900/{{::$ctrl.item.image}}" on-error-src/>
<a href="https://www.verdnatura.es/#!form=admin/items&filter={{::$ctrl.item.id}}"><vn-float-button icon="edit"
style="position: absolute; bottom: 1em; right: 1em;"
vn-visible-by="administrative"></vn-float-button>
</a>
</vn-auto>
<vn-auto pad-medium>
<div><span translate>Id</span>: <b>{{$ctrl.item.id}}</b></div>

View File

@ -11,6 +11,5 @@ import './tags/item-tags';
import './history/item-history';
import './niche/item-niche';
import './botanical/item-botanical';
import './picture/item-picture';
import './barcode/item-barcode';

View File

@ -13,7 +13,6 @@ Item history: Historial del artículo
Item tags: Tags del artículo
Niche: Nicho
Picture: Foto
Item pictures: Fotos del artículo
Barcode: Código barras
Item barcode: Código de barras del artículo
Changed by: Cambiado por

View File

@ -1,5 +0,0 @@
<vn-card>
<vn-vertical pad-large>
<vn-title>Item pictures</vn-title>
</vn-vertical>
</vn-card>

View File

@ -1,5 +0,0 @@
import ngModule from '../module';
ngModule.component('vnItemPicture', {
template: require('./item-picture.html')
});