-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06dbde8
commit ccb868a
Showing
2 changed files
with
48 additions
and
4 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
48 changes: 48 additions & 0 deletions
48
ckanext/dms/templates/scheming/package/snippets/resource_form.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,48 @@ | ||
{% ckan_extends %} | ||
|
||
{% block basic_fields %} | ||
{% asset 'dms/FileInputComponentStyles' %} | ||
{% set dataset = h.get_dataset_from_id(pkg_name) %} | ||
<div | ||
id="FileInputComponent" | ||
data-lfsServer="{{ h.blob_storage_server_url() }}" | ||
data-maxResourceSize="{{ h.max_resource_size() }}" | ||
data-orgId="{{ dataset.organization.name }}" | ||
data-datasetName="{{ dataset.name }}" | ||
data-existingUrlType="{{ data.url_type if data else '' }}" | ||
data-existingUrl="{{ data.url if data else '' }}" | ||
data-existingSha256="{{ data.sha256 if data else '' }}" | ||
data-existingFileName="{{ h.blob_storage_resource_filename(data) if data else '' }}" | ||
data-existingSize="{{ data.size if data else '' }}" | ||
> | ||
{% if data.url %} | ||
{% if data.url_type == 'upload' %} | ||
<h3 class="text-muted"> | ||
<span><i class="fa fa-spinner fa-spin"></i> {{ _('Loading') }}</span> | ||
</h3> | ||
{% else %} | ||
<div> | ||
<label class="control-label">{{ _('URL')}}</label> | ||
<div class="input-group field-url-input-group"> | ||
<input | ||
type="text" | ||
placeholder="{{ _('Loading') }}..." | ||
class="form-control" | ||
/> | ||
<span class="input-group-btn"> | ||
<button class="btn btn-danger" type="button">{{ _('Remove') }}</button> | ||
</span> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% else %} | ||
<div class="dropzone text-muted"> | ||
<h3><i class="fa fa-spinner fa-spin"></i> {{ _('Loading') }}</h3> | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% asset 'dms/FileInputComponentScripts' %} | ||
|
||
{{ super() }} | ||
|
||
{% endblock %} |