Commit 4107cf52 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade plantilla para RedPROMAR, renombra genérica

Agrega nuevo helper para parsear los datos de RedPROMAR, en concreto las
imágenes de avistamientos, incluídos en una nueva plantilla a medida.

Renombra plantilla por errata.
parent 9c5510f1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ module.exports = function(grunt) {
						ActivityStarred: true,
						ServiceOGCAttribution: true,
						ServiceOGCLegend: true,
						ServiceOGCImageList: true,

						// string
						Capitalize: true
@@ -171,9 +172,10 @@ module.exports = function(grunt) {
				, 'dist/CitationList.js': 'src/Citation/List.hbs'
				, 'dist/CitationListExpand.js': 'src/Citation/ListExpand.hbs'
				, 'dist/WormsList.js': 'src/Worms/List.hbs'
				, 'dist/AtlasSecundaryList.js': 'src/Atlas/SecundaryList.hbs'
				, 'dist/AtlasSecondaryList.js': 'src/Atlas/SecondaryList.hbs'
				, 'dist/AtlasList.js': 'src/Atlas/List.hbs'
				, 'dist/AtlasPrimaryList.js': 'src/Atlas/PrimaryList.hbs'
				, 'dist/AtlasRedpromarSecondaryList.js': 'src/Atlas/RedpromarSecondaryList.hbs'
				, 'dist/DomainList.js': 'src/Domain/List.hbs'
				, 'dist/CountryList.js': 'src/Country/List.hbs'
				, 'dist/SelectionList.js': 'src/Selection/List.hbs'
+55 −0
Original line number Diff line number Diff line
<span class='spanTemplate'>
	{{#if data.properties.taxondescription}}
	<span class='subtitle'>
		{{bold i18n.scientificName}}: <span class="scientificName">{{data.properties.taxondescription}}</span>
	</span>
	{{/if}}
	{{#if data.properties.collectorname}}
	<span class='subtitle'>
		{{bold i18n.author}}: {{data.properties.collectorname}}
	</span>
	{{/if}}
	{{#if data.properties.date}}
	<span class='subtitle'>
		{{bold i18n.date}}: {{DateTime data.properties.date}}
	</span>
	{{/if}}
	{{#if data.geometry.coordinates}}
	<span class='subtitle'>
		{{bold i18n.x}}: {{toFixed data.geometry.coordinates.[0] 5}}
	</span>
	<span class='subtitle'>
		{{bold i18n.y}}: {{toFixed data.geometry.coordinates.[1] 5}}
	</span>
	{{/if}}
	{{#if data.properties.code}}
	<span class='subtitle'>
		{{bold i18n.code}}: {{data.properties.code}}
	</span>
	{{/if}}
	{{#if data.properties.remark}}
	<span class='subtitle'>
		{{bold i18n.remark}}: {{data.properties.remark}}
	</span>
	{{/if}}
	{{#if data.properties.specimencount}}
	<span class='subtitle'>
		{{bold i18n.count}}: {{data.properties.specimencount}}
	</span>
	{{/if}}
	{{#if data.properties.z}}
	<span class='subtitle'>
		{{bold i18n.z}}: {{data.properties.z}}
	</span>
	{{/if}}
	{{#if data.properties.taxonid}}
	<span class='subtitle'>
		{{bold i18n.taxonid}}: {{data.properties.taxonid}}
	</span>
	{{/if}}
	{{#if data.properties.images}}
	<span class='subtitle'>
		{{ServiceOGCImageList data.properties.images}}
	</span>
	{{/if}}
</span>
+17 −0
Original line number Diff line number Diff line
@@ -146,6 +146,23 @@ define([
			var imgElement = '<img src="' + imgUrl + '" class="' + imgClass + '" />';

			return new handlebars.SafeString(imgElement);
		},

		ServiceOGCImageList: function(images) {

			var containerClass = 'imageListContainer',
				imgClass = 'imageListElement',
				imagesSplit = images.split(','),
				imageElementList = '';

			for (var i = 0; i < imagesSplit.length; i++) {
				var imageSrc = imagesSplit[i];
				imageElementList += '<img src="' + imageSrc + '" class="' + imgClass + '" />';
			}

			var imagesContainer = '<div class="' + containerClass + '">' + imageElementList + '</div>';

			return new handlebars.SafeString(imagesContainer);
		}
	};
});