diff --git a/landmapper/app/static/landmapper/css/report.css b/landmapper/app/static/landmapper/css/report.css index 4c444e6..9d55a3b 100644 --- a/landmapper/app/static/landmapper/css/report.css +++ b/landmapper/app/static/landmapper/css/report.css @@ -34,7 +34,10 @@ p { margin: 4px 0; } - .action-wrap button:disabled { + .action-wrap .disabled, + .action-wrap :disabled { + background: rgba(60, 60, 60, 0.2); + opacity: 0.5; pointer-events: none; } diff --git a/landmapper/app/static/landmapper/js/report.js b/landmapper/app/static/landmapper/js/report.js index cc3c28e..0431e4b 100644 --- a/landmapper/app/static/landmapper/js/report.js +++ b/landmapper/app/static/landmapper/js/report.js @@ -36,6 +36,7 @@ if (copyToAccountBtn) { */ function exportLayerHandler() { const propertyPk = this.getAttribute('data-property-id'); + const propertyName = this.getAttribute('data-property-name'); const exportLayerButton = this; // Disable the button to prevent multiple clicks @@ -53,7 +54,7 @@ if (copyToAccountBtn) { const a = document.createElement('a'); a.style.display = 'none'; a.href = url; - a.download = `${propertyPk}.zip`; + a.download = `${propertyName}.zip`; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); diff --git a/landmapper/app/templates/landmapper/report/report-overview.html b/landmapper/app/templates/landmapper/report/report-overview.html index 11d39bc..c877d97 100644 --- a/landmapper/app/templates/landmapper/report/report-overview.html +++ b/landmapper/app/templates/landmapper/report/report-overview.html @@ -50,16 +50,15 @@

Export your property data

{% if user.is_authenticated and property.user_id == user_id %} - - {% elif user.is_authenticated and property.user_id != user_id %} - - @@ -68,11 +67,12 @@

Export your property data

{% else %} - + Login to download + {% endif %} @@ -94,7 +94,6 @@

Download and share your report

PDF icon - {% comment %} PDF {% endcomment %} Login to download diff --git a/landmapper/app/views.py b/landmapper/app/views.py index 3423725..1f3a35f 100644 --- a/landmapper/app/views.py +++ b/landmapper/app/views.py @@ -771,7 +771,7 @@ def export_layer(request, property_pk): database_name = settings.DATABASES['default']['NAME'] sanitized_name = re.sub(r'[^a-zA-Z0-9_-]', '_', property_record.name) filename = f"{sanitized_name}" - shpdir = os.path.join(settings.SHAPEFILE_EXPORT_DIR, property_pk) + shpdir = os.path.join(settings.SHAPEFILE_EXPORT_DIR, sanitized_name) os.makedirs(shpdir, exist_ok=True) try: