diff --git a/app/models/property.js b/app/models/property.js index d7dc082..b9b6bd7 100644 --- a/app/models/property.js +++ b/app/models/property.js @@ -6,6 +6,7 @@ export default DS.Model.extend({ values: DS.attr(), timestamp: DS.attr('date'), visible: DS.attr('boolean', { defaultValue: false }), + source: DS.attr('string'), entity: DS.belongsTo('entity'), category: DS.belongsTo('category') }); diff --git a/app/serializers/application.js b/app/serializers/application.js index 22d028d..98e9a6a 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -80,18 +80,23 @@ export default DS.RESTSerializer.extend({ if (item.contextElement.attributes) { item.contextElement.attributes.forEach(function(attribute) { if (attribute.type !== 'category') { - // find timestamp data + // find metadata var timestamp = 0; + var source = ""; attribute.metadatas.forEach(function(metadata) { if (metadata.name === 'timestamp') { timestamp = Date.parse(metadata.value); + } else if (metadata.name === 'source') { + source = metadata.value; } }); if (timestamp === 0) { timestamp = (new Date()).getTime(); + console.log('Use local timestamp'); } + // create property var property = { @@ -102,6 +107,7 @@ export default DS.RESTSerializer.extend({ type: attribute.type, timestamp: timestamp, visible: false, + source: source, values: [] }, relationships: { diff --git a/app/styles/app.css b/app/styles/app.css index c39cc6f..2f2d5a6 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -101,13 +101,6 @@ footer { padding: 0; } -.column-right h4 { - text-align: right; - - margin: 0; - padding: 0; -} - .layout-page { background-color: #fff; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), @@ -184,3 +177,21 @@ footer { height: 50px !important; } + +.label-source { + text-align: left; + + margin: 0; + padding: 0; + + float: left; +} + +.label-type { + text-align: right; + + margin: 0; + padding: 0; + + float: right; +} diff --git a/app/templates/components/entity-chart.hbs b/app/templates/components/entity-chart.hbs index e9212ec..54c4b7c 100644 --- a/app/templates/components/entity-chart.hbs +++ b/app/templates/components/entity-chart.hbs @@ -20,7 +20,8 @@ {{line-chart data=visibleProperty.values}} {{#if visibleProperty}} -