-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fixes #3621] Improve Documents Thumbnail generation...
- Loading branch information
Alessio Fabiani
committed
Feb 14, 2018
1 parent
459c0ce
commit c5d7ea5
Showing
16 changed files
with
326 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
geonode/documents/templates/documents/document_thumb_upload.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{% extends "documents/document_upload_base.html" %} | ||
{% load staticfiles %} | ||
{% load bootstrap_tags %} | ||
{% load i18n %} | ||
|
||
{% block title %} {% trans "Upload Document's Thumbnail" %} - {{ block.super }} {% endblock %} | ||
|
||
{% block body_class %}data documents upload{% endblock body_class %} | ||
|
||
{% block head %} | ||
{% include "geoext/ext_header.html" %} | ||
{% include "geoext/app_header.html" %} | ||
{{ block.super }} | ||
{% endblock %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<a href="{% url "document_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}" class="btn btn-primary pull-right">{% trans "Explore Documents" %}</a> | ||
<h2 class="page-title">{% trans "Upload Document's Thumbnail" %}</h2> | ||
</div> | ||
|
||
<div class="row"> | ||
{% block body %} | ||
<div class="col-md-8"> | ||
{% block additional_info %}{% endblock %} | ||
|
||
{% if errors %} | ||
<div id="errors" class="alert alert-danger"> | ||
{% for error in errors %} | ||
<p>{{ error }}</p> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
<div id="upload-status"></div> | ||
|
||
<section id="drop-zone"> | ||
<h3><i class="fa fa-cloud-upload"></i><br />{% trans "Drop files here" %}</h3> | ||
</section> | ||
|
||
<p>{% trans " or select them one by one:" %}</p> | ||
|
||
<form id="file-uploader" method="post" enctype="multipart/form-data"> | ||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" /> | ||
<!-- UI change to hide the list of previously uploaded files from the user --> | ||
<input type="file" id="file-input" style="display: none;" multiple> | ||
<input class="btn btn-default" type="button" value="Choose Files" onclick="document.getElementById('file-input').click();"> | ||
</form> | ||
|
||
<section class="widget"> | ||
<ul id="global-errors"></ul> | ||
<h4>{% trans "Files to be uploaded" %}</h4> | ||
<div id="file-queue"></div> | ||
<div class="checkbox" style="display:none;" id="style_upload_form_check"> | ||
Is Upload Metadata XML Form <input type="checkbox" name="style_upload_form" id="id_style_upload_form" checked="true"/> | ||
<input type="text" name="layer_title" id="id_layer_title" value="{{ resource.alternate }}"/> | ||
</div> | ||
</section> | ||
|
||
<section> | ||
<a href="{% url "document_thumb_upload" resource.id %}" id="clear-button" class="btn btn-default">{% trans "Clear" %}</a> | ||
<a href="#" id="upload-button" class="btn btn-danger">{% trans "Upload files" %}</a> | ||
</section> | ||
</div> | ||
|
||
{% endblock %} | ||
|
||
{% block sidebar %} | ||
<div class="col-md-4"> | ||
<h3>{% trans "Permissions" %}</h3> | ||
<form id="permission_form"> | ||
{% include "_permissions.html" %} | ||
</form> | ||
</div> | ||
{% endblock %} | ||
</div> | ||
</div> | ||
{% endblock body_outer %} | ||
|
||
{% block extra_script %} | ||
{{ block.super }} | ||
<script data-main="{% static 'geonode/js/upload/main' %}" | ||
src="{% static 'lib/js/require.js' %}"> | ||
</script> | ||
<script type="text/javascript"> | ||
{% autoescape off %} | ||
csrf_token = "{{ csrf_token }}", | ||
form_target = "{% url "document_thumb_upload" docid=resource.id %}", | ||
geogig_enabled = {{ GEOGIG_ENABLED|lower }}, | ||
time_enabled = false, | ||
mosaic_enabled = false, | ||
userLookup = "{% url "geonode.views.ajax_lookup" %}" | ||
{% endautoescape %} | ||
</script> | ||
{% if GEONODE_SECURITY_ENABLED %} | ||
{% include "_permissions_form_js.html" %} | ||
{% endif %} | ||
|
||
<script type="text/javascript"> | ||
$('#id_doc_file').on('change', function(){ | ||
if($('#id_title').val() == ''){ | ||
$('#id_title').val($('#id_doc_file').val().replace("C:\\fakepath\\", "")); | ||
} | ||
}); | ||
$("#id_links").select2({ | ||
width: '100%' | ||
}); | ||
$('#upload_form').submit(function(){ | ||
$('#permissions').val(JSON.stringify(permissionsString($('#permission_form'),'base'))); | ||
}); | ||
</script> | ||
{% endblock extra_script %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
geonode/documents/templates/documents/document_upload_base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.