[ckan-changes] commit/ckan: rgrp: [js, package/edit/resource][s]: fix up resource form template to have all relevant fields and have them in nice order.
Bitbucket
commits-noreply at bitbucket.org
Tue Sep 13 21:00:25 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/b3d9c038c097/
changeset: b3d9c038c097
branch: feature-1294-ux-improvements-dataset
user: rgrp
date: 2011-09-13 23:00:17
summary: [js,package/edit/resource][s]: fix up resource form template to have all relevant fields and have them in nice order.
affected #: 1 file (819 bytes)
--- a/ckan/public/scripts/templates.js Tue Sep 13 21:51:18 2011 +0100
+++ b/ckan/public/scripts/templates.js Tue Sep 13 22:00:17 2011 +0100
@@ -88,44 +88,61 @@
</td> \
<td class="resource-expanded" colspan="3"> \
<dl> \
- <dt><label class="field_opt">Url</label></dt> \
+ <dt>Name</dt> \
<dd> \
+ <input name="resources__${num}__name" type="text" value="${resource.name}" class="long" /> \
+ </dd> \
+ <dt>Url</dt> \
+ <dd> \
+ {{if resource.resource_type=="file.upload"}} \
+ ${resource.url} \
+ <input name="resources__${num}__url" type="hidden" value="${resource.url}" /> \
+ {{/if}} \
+ {{if resource.resource_type!="file.upload"}} \
<input name="resources__${num}__url" type="text" value="${resource.url}" class="long" /> \
+ {{/if}} \
</dd> \
- <dt>Type</dt> \
+ <dt>Format</dt> \
<dd> \
- ${resource.type} \
+ <input name="resources__${num}__format" type="text" value="${resource.format}" class="long" /> \
+ </dd> \
+ <dt>Description</dt> \
+ <dd> \
+ <input name="resources__${num}__description" type="text" value="${resource.description}" class="long" /> \
+ </dd> \
+ <dt>Size (bytes)</dt> \
+ <dd> \
+ <input name="resources__${num}__size" type="text" value="${resource.size}" class="long" /> \
</dd> \
<dt>Mimetype</dt> \
<dd> \
- ${resource.mimetype} \
+ <input name="resources__${num}__mimetype" type="text" value="${resource.mimetype}" /> \
</dd> \
<dt>Mimetype-inner</dt> \
<dd> \
- ${resource.mimetype_inner} \
+ <input name="resources__${num}__mimetype_inner" type="text" value="${resource.mimetype_inner}" /> \
</dd> \
- <dt>Size</dt> \
+ <dt>Resource Type</dt> \
<dd> \
- ${resource.size} \
+ ${resource.resource_type} \
+ <input name="resources__${num}__resource_type" type="hidden" value="${resource.resource_type}" /> \
+ </dd> \
+ <dt>Hash</dt> \
+ <dd> \
+ ${resource.hash || "Unknown"} \
+ <input name="resources__${num}__hash" type="hidden" value="${resource.hash}" /> \
</dd> \
<dt>Last Modified</dt> \
<dd> \
- ${resource.lastModified} \
+ ${resource.last_modified || "Unknown"} \
+ <input name="resources__${num}__last_modified" type="hidden" value="${resource.last_modified}" /> \
</dd> \
- <dt><label class="field_opt">Format</label></dt> \
+ <dt>ID</dt> \
<dd> \
- <input name="resources__${num}__format" type="text" value="${resource.format}" class="long" /> \
- </dd> \
- <dt><label class="field_opt">Description</label></dt> \
- <dd> \
- <input name="resources__${num}__description" type="text" value="${resource.description}" class="long" /> \
- </dd> \
- <dt><label class="field_opt">Hash</label></dt> \
- <dd> \
- <input name="resources__${num}__hash" type="text" value="${resource.hash}" class="long" /> \
+ ${resource.id} \
+ <input name="resources__${num}__id" type="hidden" value="${resource.id}" /> \
</dd> \
</dl> \
- <input name="resources__${num}__id" type="hidden" value="${resource.id}" class="long disabled" /> \
</td> \
<td class="resource-is-changed"> \
<img src="/images/icons/add.png" title="This resource has unsaved changes." class="resource-is-changed" /> \
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list