Commit 848e4ff5 authored by Giannis Tsapelas's avatar Giannis Tsapelas
Browse files

minor updates

parent 364adc3b
......@@ -104,7 +104,7 @@ class Dataset(Model):
n += 1
return str(float(int(size) + round(float(reminder*0.001), 1))) + " " + Dic_powerN[n]
except:
return 'undefined'
return '-'
@property
def temporalCoverageBeginTimestamp(self):
......
......@@ -400,7 +400,7 @@ def build_join_clause(c_name, selects, self):
for j in js:
joins_for_check.append(((_from['type'], selects[j[0]]['column']),
(self.document['from'][0]['type'], selects[j[1]]['column'])))
if s.get('aggregate', '') != '':
if s.get('aggregate', '') != '' and selects[j[0]]['column'] in ['time', 'latitude', 'longitude']:
c_name = '%s(%s)' % (s.get('aggregate'), c_name)
joins.append('%s(%s.\"%s\")=%s(%s.\"%s\")' %
(s.get('aggregate'),
......@@ -436,10 +436,10 @@ def build_join_clause(c_name, selects, self):
print('join_clause is not empty')
dataset1 = Variable.objects.get(pk=int(self.document['from'][0]['type'])).dataset
dataset2 = Variable.objects.get(pk=int(self.document['from'][join_from_index]['type'])).dataset
print(long(dataset1.number_of_rows) , long(dataset2.number_of_rows))
if long(dataset2.number_of_rows) > long(dataset1.number_of_rows):
print('needs reorder')
needs_join_reorder = True
# print(long(dataset1.number_of_rows) , long(dataset2.number_of_rows))
# if long(dataset2.number_of_rows) > long(dataset1.number_of_rows):
# print('needs reorder')
# needs_join_reorder = True
print("Joins to check")
print(all_joins_for_check)
......
......@@ -246,10 +246,13 @@ $(document).ready(function() {
// $('#spatial_resolution').val('0.1');
// $('#spatial_resolution').trigger('change');
// }
$('#temporal_resolution').val('hour');
$('#temporal_resolution').trigger('change');
$('#spatial_resolution').val('0.1');
$('#spatial_resolution').trigger('change');
// HERE WE SET RESOLUTIONS AUTOMATICALLY FOR JOINS!!!
// $('#temporal_resolution').val('hour');
// $('#temporal_resolution').trigger('change');
// $('#spatial_resolution').val('0.1');
// $('#spatial_resolution').trigger('change');
if($('#spatial_resolution').val() !== "")
......@@ -912,6 +915,7 @@ $(document).ready(function() {
message += " It will not take long.";
}
message = "We are fetching your data. ";
return message;
}
......
......@@ -2,7 +2,7 @@ var bounds = [-90,-180,90,180];
var startdate = null;
var enddate = null;
var selections = [[30,-6,46,36], [33,22.5316,41.0913,30.3306], [36.409,15.0846,40.5207,23.2247], [52.6535,9.5223,59.9386,23.5117], [40.9088,27.4437,47.3103,42.355], [50.9954,-4.4454,61.017,12.0059], [60.8608,-13.5007,76.5645,25.7887], [37.8015,8.6485,44.1095,16.2231], [51.9041,-6.5691,55.0042,-2.6392], [48.5,-5.7087,51.166,1.9309]]; // configure some predifined places here
var selections = [[30,-6,46,36], [33,22.5316,41.0913,30.3306], [36.409,15.0846,40.5207,23.2247]]; // configure some predifined places here
var areaSelect;
var map, mapprev, init=false;
var area_bounds;
......
......@@ -198,7 +198,10 @@ $(function () {
var $fieldInputShown = $('<input class="form-control" readonly style="width: 100%; height: 100%; margin: 2px 0; padding-left: 5px; background-image: none; border: #b4b4b4; border-width: 1px; border-style: solid; border-radius: 5px"/>')
$fieldInputShown.attr('data-variable-id', config.id);
$fieldInputShown.val(config.title + ' (' + config.unit + ')');
if (config.unit != '')
$fieldInputShown.val(config.title + ' (' + config.unit + ')');
else
$fieldInputShown.val(config.title);
var $fieldInput = $('<input class="hidden" style="width: 100%; height: 100%;"/>').attr('name', 'variable_field');
$fieldInput.attr('data-variable-id', config.id);
......
......@@ -15,13 +15,6 @@
<option value="0">Mediterranean</option>
<option value="1">Aegean Sea</option>
<option value="2">Ionian Sea</option>
<option value="3">Baltic Sea</option>
<option value="4">Black Sea</option>
<option value="5">North Sea</option>
<option value="6">Norwegian Sea</option>
<option value="7">Tyrrhenian Sea</option>
<option value="8">Irish Sea</option>
<option value="9">English Channel</option>
</select>
</div>
</div>
......
......@@ -525,24 +525,16 @@
</tr>
<tr class="dataset-observations" data-observations="{{ dataset.observations }}">
<td>Observation type</td>
<td>{{ dataset.observations }}</td>
</tr>
<tr>
<td>Source</td>
<td>{{ dataset.source }}</td>
<td>{% if dataset.observations is None or dataset.observations == '' %}-{% else %}{{ dataset.observations }}{% endif %}</td>
</tr>
<tr class="dataset-size">
<td>Size</td>
<td>{{ dataset.number_of_rows_formated }}</td>
</tr>
<tr>
<td>Source</td>
<td>{{ dataset.source }}</td>
</tr>
<tr>
<tr class="dataset-last_updated" last_updated="{% if dataset.last_updated is None or dataset.last_updated == '' %}3{% else %}{{ dataset.last_updated }}{% endif %}">
<td>Last updated</td>
<td>{% if dataset.last_updated is None or dataset.last_updated == '' %}0{% else %}{{ dataset.last_updated }}{% endif %}</td>
<td>{% if dataset.last_updated is None or dataset.last_updated == '' %}-{% else %}{{ dataset.last_updated }}{% endif %}</td>
</tr>
{% for key, value in dataset.metadata.items %}
{% if value is not None and value != "" %}
......@@ -598,11 +590,11 @@
<td>Temporal coverage</td>
<td>
<span class="time_from hidden">{% if dataset.temporalCoverageBegin is None or dataset.temporalCoverageBegin == '' %}{{ time_start_timestamp }}{% else %}{{ dataset.temporalCoverageBeginTimestamp }}{% endif %}</span>
{% if dataset.temporalCoverageBegin is None or dataset.temporalCoverageBegin == '' %}-{% else %}{{ dataset.temporalCoverageBegin }}{% endif %}
{% if dataset.temporalCoverageBegin is None or dataset.temporalCoverageBegin == '' %}-{% else %}{{ dataset.temporalCoverageBegin|date:"Y-m-d h:i:s" }}{% endif %}
</td>
<td>
<span class="time_to hidden">{% if dataset.temporalCoverageEnd is None or dataset.temporalCoverageEnd == '' %}{{ time_end_timestamp }}{% else %}{{ dataset.temporalCoverageEndTimestamp }}{% endif %}</span>
{% if dataset.temporalCoverageEnd is None or dataset.temporalCoverageEnd == '' %}-{% else %}{{ dataset.temporalCoverageEnd }}{% endif %}
{% if dataset.temporalCoverageEnd is None or dataset.temporalCoverageEnd == '' %}-{% else %}{{ dataset.temporalCoverageEnd|date:"Y-m-d h:i:s" }}{% endif %}
</td>
</tr>
</tbody>
......@@ -652,7 +644,9 @@
{% endfor %}
</ul>
<span data-dataset={{ dataset.id }} class="variable-title">{{ variable.title }}
(<span class="variable-unit">{{ variable.unit }}</span>)
{% if variable.unit != '' and variable.unit != None %}
(<span class="variable-unit">{{ variable.unit }}</span>)
{% endif %}
{# <span class="variable-info-icon"><i class="fas fa-info"></i></span>#}
<span class="variable-check-icon pull-right"><i class="fas fa-check"></i></span>
</span>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment