-
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.
Browse files
Browse the repository at this point in the history
* [Fixes #7194] Add new append_layer html * [Fixes #7194] Test helper utility for create single layer * [Fixes #7194] Add append data to existing edit layer html * [Fixes #7194] Flake8 formatting * [Fixes #7194] New layer_append url map * [Fixes #7194]Validation helper function for replace and appen layer * [Fixes #7194] Add view for layer_append feature * [Fixes #7194] Test coverage for new validation function (cherry picked from commit b404e0d)
- Loading branch information
1 parent
1b50ad6
commit 94676a2
Showing
7 changed files
with
453 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{% extends "upload/layer_upload_base.html" %} | ||
{% load i18n %} | ||
{% load staticfiles %} | ||
{% load dialogos_tags %} | ||
{% load pinax_ratings_tags %} | ||
{% load bootstrap_tags %} | ||
{% load pagination_tags %} | ||
{% load base_tags %} | ||
{% load guardian_tags %} | ||
|
||
{% block title %} {% trans "Append to Layer" %} - {{ block.super }} {% endblock %} | ||
|
||
{% block body_class %}{% trans "layers append" %}{% endblock %} | ||
|
||
|
||
{% block head %} | ||
|
||
{{ block.super }} | ||
{% endblock %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<a href="{% url "layer_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}" class="btn btn-primary pull-right" style="margin-left: 3px;">{% trans "Explore Layers" %}</a> | ||
<a href="{% url 'layer_detail' layername=resource.service_typename %}" class="btn btn-primary pull-right" style="margin-left: 3px;">{% trans "Return to Layer" %}</a> | ||
<h2 class="page-title">{% trans "Append to Layer" %} <small><a href="{{ resource.get_absolute_url }}">{{ resource.title }}</a><small></h2> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
{% if incomplete %} | ||
<section class="widget" id="incomplete-download-list"> | ||
<h3>{% trans "Incomplete Uploads" %}</h3> | ||
<p>{% trans "You have the following incomplete uploads" %}:</p> | ||
{% for u in incomplete %} | ||
<div class="clearfix uip" id="incomplete-{{ u.import_id }}"> | ||
<div class="pull-left">{{ u.name }}, {% trans "last updated on" %} {{ u.date }}</div> | ||
<div class="upload_actions pull-right"> | ||
<a class="btn btn-mini" href="#" id="resume-{{ u.import_id }}">{% trans "Resume" %}</a> | ||
<a class="btn btn-mini" href="#" id="delete-{{ u.import_id }}"><i class="icon-trash"></i> {% trans "Delete" %}</a> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</section> | ||
<div id="confirm-delete" class="hidden alert alert-warning"> | ||
{% trans "Are you sure you want to delete this upload?" %} | ||
<a href="#y" class="btn btn-danger">{% trans "Delete" %}</a> | ||
<a href="#n" class="btn btn-default">{% trans "Cancel" %}</a> | ||
<a href="#yy">{% trans "Delete, and don't ask me again." %}</a> | ||
</div> | ||
{% endif %} | ||
|
||
{% 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"> | ||
<!-- 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="{% trans "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="metadata_uploaded_preserve_check"> | ||
{% trans "Preserve Metadata XML" %} <input type="checkbox" name="metadata_uploaded_preserve" id="id_metadata_uploaded_preserve"/> | ||
</div> | ||
</section> | ||
|
||
<section class="charset"> | ||
<p>{% trans "Select the charset or leave default" %}</p> | ||
<select id="charset"> | ||
{% for charset in charsets %} | ||
{% if charset.0 == 'UTF-8' %} | ||
<option selected='selected' value={{ charset.0 }}>{{ charset.1 }}</option> | ||
{% else %} | ||
<option value={{ charset.0 }}>{{ charset.1 }}</option> | ||
{% endif %} | ||
{% endfor %} | ||
</select> | ||
</section> | ||
|
||
<section> | ||
<a href="#" id="clear-button" class="btn btn-default">{% trans "Clear" %}</a> | ||
<a href="#" id="upload-button" class="btn btn-danger">{% trans "Append to Layer" %}</a> | ||
</section> | ||
</div> | ||
|
||
{% if GEOSERVER_BASE_URL %} | ||
{% get_obj_perms request.user for resource.layer as "layer_perms" %} | ||
{% endif %} | ||
|
||
</div> | ||
{% endblock %} | ||
|
||
|
||
{% block extra_script %} | ||
{{ block.super }} | ||
<script data-main="{% static 'geonode/js/upload/main.js' %}" | ||
src="{% static 'lib/js/require.js' %}"> | ||
</script> | ||
<script type="text/javascript"> | ||
{% autoescape off %} | ||
|
||
csrf_token = "{{ csrf_token }}", | ||
form_target = "{% url "layer_append" resource.service_typename %}", | ||
time_enabled = {{ TIME_ENABLED|lower }}, | ||
mosaic_enabled = {{ MOSAIC_ENABLED|lower }}, | ||
userLookup = "{% url "account_ajax_lookup" %}" | ||
|
||
{% endautoescape %} | ||
|
||
</script> | ||
{% if GEONODE_SECURITY_ENABLED %} | ||
{% with resource=layer %} | ||
{% include "_permissions_form_js.html" %} | ||
{% endwith %} | ||
{% endif %} | ||
{% 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
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.