diff --git a/.gitignore b/.gitignore index 36729c2a32..7f505cbbbb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *.xslx arches.egg-info eamena/eamena/settings_local.py -eamena/eamena/media/js/views/crypto eamena/eamena/elasticsearch eamena/eamena/logs eamena/eamena/uploadedfiles diff --git a/arches/app/media/css/app.css b/arches/app/media/css/app.css index 935a1cee18..8bb9d2d44d 100755 --- a/arches/app/media/css/app.css +++ b/arches/app/media/css/app.css @@ -7,7 +7,7 @@ */ /*Import Google Font*/ -@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400); +@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400); /*Reset Styles ------------------------------------*/ @@ -2775,4 +2775,4 @@ img.img-circle { -o-transform: scale(2) rotate(5deg); -ms-transform: scale(2) rotate(5deg); transform: scale(2) rotate(5deg); -} \ No newline at end of file +} diff --git a/arches/app/media/css/main.css b/arches/app/media/css/main.css index ce4b34bc95..4aef1dc271 100644 --- a/arches/app/media/css/main.css +++ b/arches/app/media/css/main.css @@ -292,10 +292,22 @@ body { padding: 0 10px 0px; } +@media (max-width: 1200px) { + .header .navbar-brand { + top: -20px; + } +} + @media (max-width: 992px) { .header .navbar-brand { - top: 0; - height: 80px; + top: -40px; + } +} + +@media (max-width: 767px) { + .header .navbar-brand { + height: auto; + top: -10px; } } diff --git a/arches/app/media/img/BahlaFort_Oman_2015_JB_cropped.jpg b/arches/app/media/img/BahlaFort_Oman_2015_JB_cropped.jpg new file mode 100644 index 0000000000..5850a648bc Binary files /dev/null and b/arches/app/media/img/BahlaFort_Oman_2015_JB_cropped.jpg differ diff --git a/arches/app/media/img/Libya_Sabratha_Temple_of_Isis_small.jpg b/arches/app/media/img/Libya_Sabratha_Temple_of_Isis_small.jpg new file mode 100644 index 0000000000..2ac118fb39 Binary files /dev/null and b/arches/app/media/img/Libya_Sabratha_Temple_of_Isis_small.jpg differ diff --git a/arches/app/media/img/Persepolis_ApadanaPalace_AZ_small.jpg b/arches/app/media/img/Persepolis_ApadanaPalace_AZ_small.jpg new file mode 100644 index 0000000000..7aaf40d74a Binary files /dev/null and b/arches/app/media/img/Persepolis_ApadanaPalace_AZ_small.jpg differ diff --git a/arches/app/media/img/Petra_AZ_cropped.jpg b/arches/app/media/img/Petra_AZ_cropped.jpg new file mode 100644 index 0000000000..e1f1080a6c Binary files /dev/null and b/arches/app/media/img/Petra_AZ_cropped.jpg differ diff --git a/arches/app/media/img/Tunisia_Dougga_Capitolium_NS_cropped.jpg b/arches/app/media/img/Tunisia_Dougga_Capitolium_NS_cropped.jpg new file mode 100644 index 0000000000..e021cee675 Binary files /dev/null and b/arches/app/media/img/Tunisia_Dougga_Capitolium_NS_cropped.jpg differ diff --git a/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_200.jpg b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_200.jpg new file mode 100644 index 0000000000..63fe4b4411 Binary files /dev/null and b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_200.jpg differ diff --git a/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_409.jpg b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_409.jpg new file mode 100644 index 0000000000..c81fe1861a Binary files /dev/null and b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_409.jpg differ diff --git a/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_578.jpg b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_578.jpg new file mode 100644 index 0000000000..1d74988adc Binary files /dev/null and b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_578.jpg differ diff --git a/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_746.jpg b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_746.jpg new file mode 100644 index 0000000000..3e85667a53 Binary files /dev/null and b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_746.jpg differ diff --git a/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_830.jpg b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_830.jpg new file mode 100644 index 0000000000..12efd5a613 Binary files /dev/null and b/arches/app/media/img/responsive/eamena_logo_wqdwpt_c_scale,w_830.jpg differ diff --git a/arches/app/media/js/search.js b/arches/app/media/js/search.js index 40a425b3eb..09c0c4a9c0 100644 --- a/arches/app/media/js/search.js +++ b/arches/app/media/js/search.js @@ -42,6 +42,7 @@ require(['jquery', initialize: function(options) { var self = this; + myself = self; var query = this.getQueryFromUrl(); if('termFilter' in query){ query.termFilter = JSON.parse(query.termFilter); @@ -56,26 +57,6 @@ require(['jquery', // searchboxes for advanced search should be at least one, even for a new search this.initializeSearchBoxes(); - this.mapFilter = new MapFilter({ - el: $('#map-filter-container')[0] - }); - this.mapFilter.on('enabled', function(enabled, inverted){ - if(enabled){ - // this.termFilter[0].addTag(this.mapFilterText, inverted); - $("#map-filter-button").addClass("enabled"); - }else{ - // this.termFilter[0].removeTag(this.mapFilterText); - $("#map-filter-button").removeClass("enabled"); - // this.mapFilter.clear(); - } - this.mapFilter.inverted = inverted; - if(inverted){ - $("#map-filter-button").addClass("inverted"); - }else{ - $("#map-filter-button").removeClass("inverted"); - } - }, this); - this.booleanSearch = "and"; this.searchRelatedResources = false; this.advancedSearch = false; @@ -83,50 +64,39 @@ require(['jquery', this.searchResults = new SearchResults({ el: $('#search-results-container')[0] }); - this.searchResults.on('mouseover', function(resourceid){ - this.mapFilter.selectFeatureById(resourceid); - }, this); - this.searchResults.on('mouseout', function(){ - this.mapFilter.unselectAllFeatures(); - }, this); - this.searchResults.on('find_on_map', function(resourceid, data){ - var extent, - expand = !this.mapFilter.expanded(); - if (expand) { - this.mapFilter.expanded(true); - } - - _.each(data.geometries, function (geometryData) { - var geomExtent = wkt.readGeometry(geometryData.label).getExtent(); - geomExtent = ol.extent.applyTransform(geomExtent, ol.proj.getTransform('EPSG:4326', 'EPSG:3857')); - extent = extent ? ol.extent.extend(extent, geomExtent) : geomExtent; - }); - if (extent) { - _.delay(function() { - self.mapFilter.zoomToExtent(extent); - }, expand ? 700 : 0); - } - }, this); - - this.mapFilterText = this.mapFilter.$el.data().filtertext; this.timeFilterText = $('#time-filter-container-template').data().filtertext; - self.isNewQuery = true; - this.searchQuery = { + myself.isNewQuery = true; + myself.searchQuery = this.generateSearchQuery(false); + this.getSearchQuery(); + + this.searchResults.page.subscribe(function(){ + myself.doQuery(); + }); + + myself.searchQuery.changed.subscribe(function(){ + myself.isNewQuery = true; + myself.searchResults.page(1); + myself.doQuery(); + }); + }, + + generateSearchQuery: function(hasmap) { + return { queryString: function(){ - if (self.advancedSearch) { + if (myself.advancedSearch) { var termFilters = []; var timeFilters = []; var termFiltersLen = 0; var timeFiltersLen = 0; - var termFilterAndOr = self.termFilterAndOr; - var termFilterCombineWithPrev = self.termFilterCombineWithPrev; - var termFilterGroup = self.termFilterGroup; - _.each(self.termFilter,function (term, i) { + var termFilterAndOr = myself.termFilterAndOr; + var termFilterCombineWithPrev = myself.termFilterCombineWithPrev; + var termFilterGroup = myself.termFilterGroup; + _.each(myself.termFilter,function (term, i) { termFiltersLen += term.query.filter.terms().length; termFilters.push(term.query.filter.terms()); - }) - _.each(self.timeFilter,function (timeFilter, i) { + }); + _.each(myself.timeFilter,function (timeFilter, i) { timeFilters.push({ year_min_max: timeFilter.query.filter.year_min_max(), filters: timeFilter.query.filter.filters(), @@ -134,39 +104,51 @@ require(['jquery', }); timeFiltersLen += timeFilter.query.filter.year_min_max().length; timeFiltersLen += timeFilter.query.filter.filters().length; - }) + }); + var map = {}; + var mapexpanded = false; + if(hasmap){ + var map = myself.mapFilter.query.filter; + var mapexpanded = myself.mapFilter.expanded(); + } } else { - var termFilters = [self.termFilterSimple.query.filter.terms()]; - var termFiltersLen = self.termFilterSimple.query.filter.terms().length; - var termFilterCombineWithPrev = [self.termFilterCombineWithPrev]; - var termFilterAndOr = [self.termFilterAndOrSimple]; - var termFilterGroup = [self.termFilterGroupSimple]; + var termFilters = [myself.termFilterSimple.query.filter.terms()]; + var termFiltersLen = myself.termFilterSimple.query.filter.terms().length; + var termFilterCombineWithPrev = [myself.termFilterCombineWithPrev]; + var termFilterAndOr = [myself.termFilterAndOrSimple]; + var termFilterGroup = [myself.termFilterGroupSimple]; var timeFilters = [{ - year_min_max: self.timeFilterSimple.query.filter.year_min_max(), - filters: self.timeFilterSimple.query.filter.filters(), - inverted: self.timeFilterSimple.query.filter.inverted() + year_min_max: myself.timeFilterSimple.query.filter.year_min_max(), + filters: myself.timeFilterSimple.query.filter.filters(), + inverted: myself.timeFilterSimple.query.filter.inverted() }] - termFiltersLen = self.timeFilterSimple.query.filter.year_min_max().length; - timeFiltersLen += self.timeFilterSimple.query.filter.filters().length; + termFiltersLen = myself.timeFilterSimple.query.filter.year_min_max().length; + timeFiltersLen += myself.timeFilterSimple.query.filter.filters().length; + var map = {}; + var mapexpanded = false; + if(hasmap){ + var map = myself.mapFilter.query.filter; + var mapexpanded = myself.mapFilter.expanded(); + } } var params = { - page: self.searchResults.page(), + page: myself.searchResults.page(), termFilter: ko.toJSON(termFilters), temporalFilter: ko.toJSON(timeFilters), - spatialFilter: ko.toJSON(self.mapFilter.query.filter), - mapExpanded: self.mapFilter.expanded(), + spatialFilter: ko.toJSON(map), + mapExpanded: mapexpanded, timeExpanded: false, - booleanSearch: self.booleanSearch, - searchRelatedResources: self.searchRelatedResources, + booleanSearch: myself.booleanSearch, + searchRelatedResources: myself.searchRelatedResources, termFilterAndOr: ko.toJSON(termFilterAndOr), termFilterCombineWithPrev: ko.toJSON(termFilterCombineWithPrev), termFilterGroup: ko.toJSON(termFilterGroup), - advancedSearch: self.advancedSearch ? "true" : "false", + advancedSearch: myself.advancedSearch ? "true" : "false", }; - + if (termFiltersLen === 0 && timeFiltersLen === 0 && - self.mapFilter.query.filter.geometry.coordinates().length === 0) { + myself.mapFilter.query.filter.geometry.coordinates().length === 0) { params.no_filters = true; } @@ -175,27 +157,77 @@ require(['jquery', }, changed: ko.pureComputed(function(){ var ret = ko.toJSON(this.timeFilterSimple.query.changed()); - _.each(self.timeFilter,function (timeFilter, i) { + _.each(myself.timeFilter,function (timeFilter, i) { ret = ret + ko.toJSON(timeFilter.query.changed()); - }) + }); ret = ret + ko.toJSON(this.termFilterSimple.query.changed()); - _.each(self.termFilter,function (termFilter, i) { + _.each(myself.termFilter,function (termFilter, i) { ret = ret + ko.toJSON(termFilter.query.changed()); - }) - ret = ret + ko.toJSON(this.mapFilter.query.changed()); + }); + if(hasmap) { + ret = ret + ko.toJSON(myself.mapFilter.query.changed()); + } return ret; }, this).extend({ rateLimit: 200 }) }; - this.getSearchQuery(); - this.searchResults.page.subscribe(function(){ - self.doQuery(); + }, + + initializeMapFilter: function() { + myself.mapFilter = new MapFilter({ + el: $('#map-filter-container')[0] }); + myself.mapFilter.on('enabled', function(enabled, inverted){ + if(enabled){ + // this.termFilter[0].addTag(this.mapFilterText, inverted); + $("#map-filter-button").addClass("enabled"); + }else{ + // this.termFilter[0].removeTag(this.mapFilterText); + $("#map-filter-button").removeClass("enabled"); + // this.mapFilter.clear(); + } + myself.mapFilter.inverted = inverted; + if(inverted){ + $("#map-filter-button").addClass("inverted"); + }else{ + $("#map-filter-button").removeClass("inverted"); + } + }, myself); + myself.mapFilterText = myself.mapFilter.$el.data().filtertext; + - this.searchQuery.changed.subscribe(function(){ - self.isNewQuery = true; - self.searchResults.page(1); - self.doQuery(); + this.searchResults.on('mouseover', function(resourceid){ + myself.mapFilter.selectFeatureById(resourceid); + }, this); + this.searchResults.on('mouseout', function(){ + myself.mapFilter.unselectAllFeatures(); + }, this); + this.searchResults.on('find_on_map', function(resourceid, data){ + var extent, + expand = !this.mapFilter.expanded(); + if (expand) { + this.mapFilter.expanded(true); + } + + _.each(data.geometries, function (geometryData) { + var geomExtent = wkt.readGeometry(geometryData.label).getExtent(); + geomExtent = ol.extent.applyTransform(geomExtent, ol.proj.getTransform('EPSG:4326', 'EPSG:3857')); + extent = extent ? ol.extent.extend(extent, geomExtent) : geomExtent; + }); + if (extent) { + _.delay(function() { + myself.mapFilter.zoomToExtent(extent); + }, expand ? 700 : 0); + } + }, this); + + myself.searchQuery = this.generateSearchQuery(true); + + myself.searchQuery.changed.subscribe(function(){ + myself.isNewQuery = true; + myself.searchResults.page(1); + myself.doQuery(); }); + }, @@ -215,8 +247,10 @@ require(['jquery', data: queryString, success: function(results){ var data = self.searchResults.updateResults(results); - self.mapFilter.highlightFeatures(data, $('.search-result-all-ids').data('results')); - self.mapFilter.applyBuffer(); + if(self.mapFilter){ + self.mapFilter.highlightFeatures(data, $('.search-result-all-ids').data('results')); + self.mapFilter.applyBuffer(); + } self.isNewQuery = false; $('.loading-mask').hide(); }, @@ -239,6 +273,10 @@ require(['jquery', // clickMapFilter opens map filter if closed, toggles the invert map filter if open clickMapFilter: function () { + if(this.mapFilter == null) { + this.initializeMapFilter(); + this.doQuery(); + } if($('#saved-searches').is(":visible")){ this.isNewQuery = true; this.doQuery(); @@ -500,8 +538,11 @@ require(['jquery', query.mapExpanded = JSON.parse(query.mapExpanded); doQuery = true; } - this.mapFilter.restoreState(query.spatialFilter, query.mapExpanded); - + + if(myself.mapFilter) { + // This is unlikely to ever be called as the mapfilter isn't available on first load + myself.mapFilter.restoreState(query.spatialFilter, query.mapExpanded); + } if(doQuery){ this.isNewQuery = true; diff --git a/arches/app/templates/base.htm b/arches/app/templates/base.htm index ba94ee969d..f190990c8a 100644 --- a/arches/app/templates/base.htm +++ b/arches/app/templates/base.htm @@ -18,14 +18,14 @@ {% block css %} - + - - - + + + - + @@ -80,7 +80,7 @@

Reference Data Manager (RDM)

{% block javascript %} - + {% block pre_require_js %} {% endblock pre_require_js %} -{% endif %} + {% block title %}{{ APP_NAME }}{% endblock %} @@ -18,14 +15,14 @@ {% block css %} - + - - - + + + - + @@ -74,7 +71,7 @@

Reference Data Manager (RDM)

{% block javascript %} - + @@ -87,29 +84,29 @@

Reference Data Manager (RDM)

baseUrl: '{{ STATIC_URL }}js', paths: { 'plugins': '{{ STATIC_URL }}plugins', - 'async': 'http://cdnjs.cloudflare.com/ajax/libs/requirejs-async/0.1.1/async', - 'jquery': 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min', - 'select2': 'http://cdnjs.cloudflare.com/ajax/libs/select2/3.5.1/select2.min', - 'bootstrap': 'http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/js/bootstrap.min', - 'jquery-ui': 'http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min', - 'flexslider': 'http://cdnjs.cloudflare.com/ajax/libs/flexslider/2.2.2/jquery.flexslider-min', + 'async': 'https://cdnjs.cloudflare.com/ajax/libs/requirejs-async/0.1.1/async', + 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min', + 'select2': 'https://cdnjs.cloudflare.com/ajax/libs/select2/3.5.1/select2.min', + 'bootstrap': 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/js/bootstrap.min', + 'jquery-ui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min', + 'flexslider': 'https://cdnjs.cloudflare.com/ajax/libs/flexslider/2.2.2/jquery.flexslider-min', 'openlayers': '{{ STATIC_URL }}plugins/openlayers/ol', - 'easing': 'http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min', - 'backbone': 'http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min', - //'underscore': 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min', + 'easing': 'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min', + 'backbone': 'https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min', + //'underscore': 'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min', 'underscore': 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min', - 'jquery-validate': 'http://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.11.1/jquery.validate.min', - 'd3': 'http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min', - 'dropzone': 'http://cdnjs.cloudflare.com/ajax/libs/dropzone/3.8.4/dropzone-amd-module.min', - 'summernote': 'http://cdnjs.cloudflare.com/ajax/libs/summernote/0.5.10/summernote.min', - 'knockout': 'http://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min', - //'knockout': 'http://knockoutjs.com/downloads/knockout-3.3.0.debug', - 'knockout-mapping': 'http://cdnjs.cloudflare.com/ajax/libs/knockout.mapping/2.4.1/knockout.mapping.min', - 'moment': 'http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min', - 'bootstrap-datetimepicker': 'http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/3.1.3/js/bootstrap-datetimepicker.min', + 'jquery-validate': 'https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.11.1/jquery.validate.min', + 'd3': 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min', + 'dropzone': 'https://cdnjs.cloudflare.com/ajax/libs/dropzone/3.8.4/dropzone-amd-module.min', + 'summernote': 'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.5.10/summernote.min', + 'knockout': 'https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min', + //'knockout': 'https://knockoutjs.com/downloads/knockout-3.3.0.debug', + 'knockout-mapping': 'https://cdnjs.cloudflare.com/ajax/libs/knockout.mapping/2.4.1/knockout.mapping.min', + 'moment': 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min', + 'bootstrap-datetimepicker': 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/3.1.3/js/bootstrap-datetimepicker.min', 'shp': 'https://raw.githubusercontent.com/wavded/js-shapefile-to-geojson/master/shapefile', 'blueimp-gallery': 'https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.15.2/js/blueimp-gallery', - 'blueimp-jquery': 'http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery', + 'blueimp-jquery': 'https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery', 'blueimp-helper': 'https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.15.2/js/blueimp-helper.min', 'gmjs': 'https://maps.googleapis.com/maps/api/js?v=3&key=AIzaSyBPUB3B5aiHQDVyIuhDqDp500IUCIEDdtM', 'Highcharts': 'https://code.highcharts.com/highcharts.src', @@ -254,4 +251,4 @@

Reference Data Manager (RDM)

{% endif %} - \ No newline at end of file + diff --git a/eamena/eamena/templates/header.htm b/eamena/eamena/templates/header.htm index 71e3278017..0fa6598f90 100755 --- a/eamena/eamena/templates/header.htm +++ b/eamena/eamena/templates/header.htm @@ -69,7 +69,21 @@ - + + Logo + diff --git a/eamena/eamena/templates/index.htm b/eamena/eamena/templates/index.htm index a991efe45b..72f9880ba3 100755 --- a/eamena/eamena/templates/index.htm +++ b/eamena/eamena/templates/index.htm @@ -51,7 +51,7 @@
{% trans 'How to use the Database' %}
- Slide background + Slide background @@ -71,7 +71,7 @@
{% trans 'How to use the Database' %}
- Slide background + Slide background @@ -92,7 +92,7 @@
{% trans 'How to use the Database' %}
- Slide background + Slide background @@ -109,32 +109,12 @@
{% trans 'How to use the Database' %}
- -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا - -
- - - - {% trans 'Photo: Temple of the Obelisks (Byblos, Lebanon) ' %}{% trans '© Jennie Bradbury' %} - - -
-
- Slide background + Slide background @@ -155,7 +135,7 @@
{% trans 'How to use the Database' %}
- Slide background + Slide background @@ -172,109 +152,7 @@
{% trans 'How to use the Database' %}
- -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا - -
- - - - {% trans 'Photo: Nymphaeum (Gadara/Umm Qais, Jordan) ' %}{% trans '© Andrea Zerbini' %} - - -
- - - -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا - -
- - - - {% trans 'Photo: Rock art in wadi Matkhandouch (Libya) ' %}{% trans '© Julia Nikolaus' %} - - -
- - - -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا -
- - - - {% trans 'Photo: Qasr Bounou (Morocco) ' %}{% trans '© The Middle Draa Project - Nichole Sheldrick' %} - - -
- - - -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا - -
- - - - {% trans 'Photo: Carthage (Tunisia) ' %}{% trans '© Julia Nikolaus' %} - - -
- - -
- - - Slide background - - - - {% trans 'Endangered Archaeology in the Middle East and North Africa' %}
- الآثار المهددة في الشرق الأوسط و شمال إفريقيا - -
- - - - {% trans 'Photo: Historic buildings in Ghadames (Libya) ' %}{% trans '© Julia Nikolaus' %} - - -
- {% endblock %} \ No newline at end of file diff --git a/eamena/eamena/templates/views/reports/sections/CARTOGRAPHY_REPORT.htm b/eamena/eamena/templates/views/reports/sections/CARTOGRAPHY_REPORT.htm new file mode 100644 index 0000000000..a17c00e087 --- /dev/null +++ b/eamena/eamena/templates/views/reports/sections/CARTOGRAPHY_REPORT.htm @@ -0,0 +1,221 @@ +{% load i18n %} + + + +
+
+
+
{% trans "Sheet details" %}
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} + + {% trans "No Sheet details recorded" %} + + {% else %} +
+
+
{% trans "Sheet number" %}
{% trans "Sheet name" %}
+
+
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'TILE_SQUARE_DETAILS_E44' in PUBLICATION_ASSIGNMENT_E17 %} + {% for TILE_SQUARE_DETAILS_E44 in PUBLICATION_ASSIGNMENT_E17.TILE_SQUARE_DETAILS_E44 %} +
{{ TILE_SQUARE_DETAILS_E44.TILE_SQUARE_DETAILS_E44__value }}
+ {% endfor %} + + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
+
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'TILE_SQUARE_APPELLATION_E44' in PUBLICATION_ASSIGNMENT_E17 %} + {% for TILE_SQUARE_APPELLATION_E44 in PUBLICATION_ASSIGNMENT_E17.TILE_SQUARE_APPELLATION_E44 %} +
{{ TILE_SQUARE_APPELLATION_E44.TILE_SQUARE_APPELLATION_E44__value }}
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
+
+
+ {% endif %} + +
+
+
+ + + + +
+
+
+
+
{% trans "Scale" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Scale recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'SCALE_TYPE_E55' in PUBLICATION_ASSIGNMENT_E17 %} + {% for SCALE_TYPE_E55 in PUBLICATION_ASSIGNMENT_E17.SCALE_TYPE_E55 %} +
+ {{ SCALE_TYPE_E55.SCALE_TYPE_E55__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + +
+
+
+
+
{% trans "Projection/Grid" %}
+
+ + {% if 'RESOURCE_CREATION_EVENT_E65' not in report_info.source.graph %} +
+ {% trans "No Projection/Grid recorded" %} +
+ {% else %} + {% for RESOURCE_CREATION_EVENT_E65 in report_info.source.graph.RESOURCE_CREATION_EVENT_E65 %} + {% if 'PROJECTION_TYPE_E55' in RESOURCE_CREATION_EVENT_E65 %} + {% for PROJECTION_TYPE_E55 in RESOURCE_CREATION_EVENT_E65.PROJECTION_TYPE_E55 %} +
+ {{PROJECTION_TYPE_E55.PROJECTION_TYPE_E55__value}} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+
+
+ + + + + + +
+
+
+
{% trans "Publication details" %}
+
+
+
{% trans "Map Series" %}
{% trans "Map Source" %}
{% trans "Edition" %}
{% trans "Producer" %}
{% trans "Production date" %}
+
+ {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} + + {% trans "No Sheet details recorded" %} + + {% else %} + +
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'SERIES_TYPE_E55' in PUBLICATION_ASSIGNMENT_E17 %} + {% for SERIES_TYPE_E55 in PUBLICATION_ASSIGNMENT_E17.SERIES_TYPE_E55 %} + +
{{ SERIES_TYPE_E55.SERIES_TYPE_E55__value }}
+ + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
+
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'MAP_SOURCE_TYPE_E55' in PUBLICATION_ASSIGNMENT_E17 %} + {% for MAP_SOURCE_TYPE_E55 in PUBLICATION_ASSIGNMENT_E17.MAP_SOURCE_TYPE_E55 %} + +
{{ MAP_SOURCE_TYPE_E55.MAP_SOURCE_TYPE_E55__value }}
+ + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
+
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLICATION_ASSIGNMENT_E17' in PUBLICATION_EVENT_E12 %} + {% for PUBLICATION_ASSIGNMENT_E17 in PUBLICATION_EVENT_E12.PUBLICATION_ASSIGNMENT_E17 %} + {% if 'EDITION_E62' in PUBLICATION_ASSIGNMENT_E17 %} + {% for EDITION_E62 in PUBLICATION_ASSIGNMENT_E17.EDITION_E62 %} + +
{{ EDITION_E62.EDITION_E62__value }}
+ + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +
+ {% endif %} +
+ {% if 'RESOURCE_CREATION_EVENT_E65' in report_info.source.graph %} + {% for RESOURCE_CREATION_EVENT_E65 in report_info.source.graph.RESOURCE_CREATION_EVENT_E65 %} + {% if 'CONTRIBUTOR_E39' in RESOURCE_CREATION_EVENT_E65 %} + {% for CONTRIBUTOR_E39 in RESOURCE_CREATION_EVENT_E65.CONTRIBUTOR_E39 %} + {% if 'CONTRIBUTOR_APPELLATION_E82' in CONTRIBUTOR_E39 %} + {% for CONTRIBUTOR_APPELLATION_E82 in CONTRIBUTOR_E39.CONTRIBUTOR_APPELLATION_E82 %} +
+ {{ CONTRIBUTOR_APPELLATION_E82.CONTRIBUTOR_APPELLATION_E82__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+
+ {% if 'RESOURCE_CREATION_EVENT_E65' in report_info.source.graph %} + {% for RESOURCE_CREATION_EVENT_E65 in report_info.source.graph.RESOURCE_CREATION_EVENT_E65 %} + {% if 'TIME___SPAN_RESOURCE_CREATION_EVENT_E52' in RESOURCE_CREATION_EVENT_E65 %} + {% for TIME___SPAN_RESOURCE_CREATION_EVENT_E52 in RESOURCE_CREATION_EVENT_E65.TIME___SPAN_RESOURCE_CREATION_EVENT_E52 %} + {% if 'DATE_OF_CREATION_E50' in TIME___SPAN_RESOURCE_CREATION_EVENT_E52 %} + {% for DATE_OF_CREATION_E50 in TIME___SPAN_RESOURCE_CREATION_EVENT_E52.DATE_OF_CREATION_E50 %} +
+ {{ DATE_OF_CREATION_E50.DATE_OF_CREATION_E50__value|cut:"T00:00:00" }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+
+
+
+
+ + + diff --git a/eamena/eamena/templates/views/reports/sections/OTHER_INFO_RES.htm b/eamena/eamena/templates/views/reports/sections/OTHER_INFO_RES.htm new file mode 100644 index 0000000000..bfbdb669a0 --- /dev/null +++ b/eamena/eamena/templates/views/reports/sections/OTHER_INFO_RES.htm @@ -0,0 +1,302 @@ +{% load i18n %} + + +
+
+
+
+
{% trans "Author" %}
+
+ + {% if 'RESOURCE_CREATION_EVENT_E65' not in report_info.source.graph %} +
+ {% trans "No Author recorded" %} +
+ {% else %} + {% for RESOURCE_CREATION_EVENT_E65 in report_info.source.graph.RESOURCE_CREATION_EVENT_E65 %} + {% if 'CREATOR_E39' in RESOURCE_CREATION_EVENT_E65 %} + {% for CREATOR_E39 in RESOURCE_CREATION_EVENT_E65.CREATOR_E39 %} + {% if 'CREATOR_APPELLATION_E82' in CREATOR_E39 %} + {% for CREATOR_APPELLATION_E82 in CREATOR_E39.CREATOR_APPELLATION_E82 %} +
+ {{ CREATOR_APPELLATION_E82.CREATOR_APPELLATION_E82__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + + +
+
+
+
+
{% trans "Date of Publication" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Date recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'TIME___SPAN_PUBLICATION_EVENT_E52' in PUBLICATION_EVENT_E12 %} + {% for TIME___SPAN_PUBLICATION_EVENT_E52 in PUBLICATION_EVENT_E12.TIME___SPAN_PUBLICATION_EVENT_E52 %} + {% if 'DATE_OF_PUBLICATION_E50' in TIME___SPAN_PUBLICATION_EVENT_E52 %} + {% for DATE_OF_PUBLICATION_E50 in TIME___SPAN_PUBLICATION_EVENT_E52.DATE_OF_PUBLICATION_E50 %} +
+ {{ DATE_OF_PUBLICATION_E50.DATE_OF_PUBLICATION_E50__value|slice:"4" }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + + +
+
+
+
+
{% trans "Title" %}
+
+ + {% if 'TITLE_E41' not in report_info.source.graph %} +
+ {% trans "No Title recorded" %} +
+ {% else %} + {% for TITLE_E41 in report_info.source.graph.TITLE_E41 %} +
+ {{ TITLE_E41.TITLE_E41__value|title }} +
+ {% endfor %} + {% endif %} + +
+
+
+ + + +
+
+
+
+
{% trans "Editor" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Editor recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'EDITOR_E39' in PUBLICATION_EVENT_E12 %} + {% for EDITOR_E39 in PUBLICATION_EVENT_E12.EDITOR_E39 %} + {% if 'EDITOR_APPELLATION_E82' in EDITOR_E39 %} + {% for EDITOR_APPELLATION_E82 in EDITOR_E39.EDITOR_APPELLATION_E82 %} +
+ {{ EDITOR_APPELLATION_E82.EDITOR_APPELLATION_E82__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + +
+
+
+
+
{% trans "Source (e.g. Journal/Edited Volume Title)" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Source recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'SOURCE_E39' in PUBLICATION_EVENT_E12 %} + {% for SOURCE_E39 in PUBLICATION_EVENT_E12.SOURCE_E39 %} + {% if 'SOURCE_APPELLATION_E82' in SOURCE_E39 %} + {% for SOURCE_APPELLATION_E82 in SOURCE_E39.SOURCE_APPELLATION_E82 %} +
+ {{ SOURCE_APPELLATION_E82.SOURCE_APPELLATION_E82__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + + +
+
+
+
+
{% trans "Place of Publication" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Place recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PLACE_OF_PUBLICATION_E53' in PUBLICATION_EVENT_E12 %} + {% for PLACE_OF_PUBLICATION_E53 in PUBLICATION_EVENT_E12.PLACE_OF_PUBLICATION_E53 %} + {% if 'BIBLIO_PLACE_APPELLATION_E44' in PLACE_OF_PUBLICATION_E53 %} + {% for BIBLIO_PLACE_APPELLATION_E44 in PLACE_OF_PUBLICATION_E53.BIBLIO_PLACE_APPELLATION_E44 %} +
+ {{ BIBLIO_PLACE_APPELLATION_E44.BIBLIO_PLACE_APPELLATION_E44__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + +
+
+
+
+
{% trans "Publisher" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No Publisher recorded" %} +
+ {% else %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PUBLISHER_E39' in PUBLICATION_EVENT_E12 %} + {% for PUBLISHER_E39 in PUBLICATION_EVENT_E12.PUBLISHER_E39 %} + {% if 'PUBLISHER_APPELLATION_E82' in PUBLISHER_E39 %} + {% for PUBLISHER_APPELLATION_E82 in PUBLISHER_E39.PUBLISHER_APPELLATION_E82 %} +
+ {{ PUBLISHER_APPELLATION_E82.PUBLISHER_APPELLATION_E82__value }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + +
+
+
+ + + +
+
+
+
+
{% trans "Volume & Issue" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No volume/issue recorded" %} +
+ {% else %} +
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + + {% if 'VOLUME_E62' in PUBLICATION_EVENT_E12 %} + {% for VOLUME_E62 in PUBLICATION_EVENT_E12.VOLUME_E62 %} + + {{ VOLUME_E62.VOLUME_E62__value }} ({% trans "Volume" %}) + {% endfor %} + {% endif %} + {% endfor %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'ISSUE_E62' in PUBLICATION_EVENT_E12 %} + {% for ISSUE_E62 in PUBLICATION_EVENT_E12.ISSUE_E62 %} + {{ ISSUE_E62.ISSUE_E62__value }} ({% trans "Issue" %}) + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+
+
+
+ + + + +
+
+
+
+
{% trans "Pages & Figures" %}
+
+ + {% if 'PUBLICATION_EVENT_E12' not in report_info.source.graph %} +
+ {% trans "No pages/figures recorded" %} +
+ {% else %} +
+ {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'PAGES_E62' in PUBLICATION_EVENT_E12 %} + {% for PAGES_E62 in PUBLICATION_EVENT_E12.PAGES_E62 %} + {{ PAGES_E62.PAGES_E62__value }} ({% trans "Pages" %}) + {% endfor %} + {% endif %} + {% endfor %} + {% for PUBLICATION_EVENT_E12 in report_info.source.graph.PUBLICATION_EVENT_E12 %} + {% if 'FIGURE_E62' in PUBLICATION_EVENT_E12 %} + {% for FIGURE_E62 in PUBLICATION_EVENT_E12.FIGURE_E62 %} + {{ FIGURE_E62.FIGURE_E62__value }} ({% trans "Figures" %}) + {% endfor %} + {% endif %} + {% endfor %} +
+ {% endif %} + +
+
+
+ + diff --git a/eamena/eamena/views/bulk_upload.py b/eamena/eamena/views/bulk_upload.py index c3429417fa..93b51973bb 100644 --- a/eamena/eamena/views/bulk_upload.py +++ b/eamena/eamena/views/bulk_upload.py @@ -22,6 +22,7 @@ from django import forms from django.conf import settings from django.core.management import call_command +from django.contrib.auth.decorators import login_required, user_passes_test from django.template import RequestContext from django.shortcuts import render_to_response from django.http import HttpResponse @@ -47,6 +48,8 @@ def get_archesfile_path(filepath): return destpath +@login_required +@user_passes_test(lambda u: u.groups.filter(name='edit').count() != 0, login_url='/auth/') def new_upload(request): ''' nothing special here, everything is handled with ajax''' @@ -54,11 +57,13 @@ def new_upload(request): {'active_page': 'Bulk Upload'}, # not sure if this is necessary context_instance=RequestContext(request) # or this ) - + +@login_required +@user_passes_test(lambda u: u.groups.filter(name='edit').count() != 0, login_url='/auth/') def main(request): ''' nothing special here, everything is handled with ajax''' - loadlog = os.path.join(settings.BULK_UPLOAD_DIR,"_loadlog.txt") + loadlog = settings.BULK_UPLOAD_LOG_FILE if os.path.isfile(loadlog): with open(loadlog,'rb') as loadlog: loads = loadlog.readlines() @@ -145,14 +150,16 @@ def import_archesfile(request): append = request.POST.get('append', 'false') output = StringIO() - - call_command('packages', - operation='load_resources', - source=fullpath, - appending=append, - run_internal=True, - stdout = output, - ) + try: + call_command('packages', + operation='load_resources', + source=fullpath, + appending=append, + run_internal=True, + stdout = output, + ) + except Exception as e: + print e val = output.getvalue().strip() return HttpResponse(json.dumps({'load_id': val}), content_type="application/json") @@ -170,8 +177,8 @@ def upload_attachments(request): if request.method == 'POST': resdict = json.loads(request.POST['resdict']) - f = request._files['attachments[]'] + filename, ext = os.path.splitext(os.path.basename(str(f))) if ext == '.xlsx': return HttpResponse(json.dumps({}), content_type="application/json") @@ -182,7 +189,7 @@ def upload_attachments(request): for l in ins: if 'FILE_PATH' in l: data = l.split('|') - if data[3] == str(f): + if data[3] == f._name.replace(" ","_"): if data[0] not in resdict: response_data['foldervalid'] = False resid = resdict[data[0]] @@ -192,5 +199,11 @@ def upload_attachments(request): if thumb != None: res.set_entity_value('THUMBNAIL.E62', thumb) res.save() + + ## reset the file names as the paths may have been modified + ## by django during the above save process + res.set_entity_value('FILE_PATH.E62', str(f).replace(" ","_")) + res.set_entity_value('THUMBNAIL.E62', str(thumb).replace(" ","_")) + res.save() return HttpResponse(json.dumps(response_data), content_type="application/json") diff --git a/tests/fixtures/viewer.html b/tests/fixtures/viewer.html index feb38ce7e8..70536d0ab0 100644 --- a/tests/fixtures/viewer.html +++ b/tests/fixtures/viewer.html @@ -7,14 +7,14 @@ - - - + + + - - - - + + + +