[ckan-changes] commit/ckan: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Sep 7 16:58:26 UTC 2011
2 new changesets in ckan:
http://bitbucket.org/okfn/ckan/changeset/61adc4dde07e/
changeset: 61adc4dde07e
branch: feature-1294-ux-improvements-dataset
user: zephod
date: 2011-09-07 15:44:54
summary: [ux,package/edit][xs]: (refs #1296) Rearranged instruction text.
affected #: 1 file (127 bytes)
--- a/ckan/templates/package/new_package_form.html Wed Sep 07 14:12:33 2011 +0100
+++ b/ckan/templates/package/new_package_form.html Wed Sep 07 14:44:54 2011 +0100
@@ -28,7 +28,7 @@
<dd class="hints">2+ characters, lowercase, using only 'a-z0-9' and '-_'</dd><dd class="field_error" py:if="errors.get('name', '')">${errors.get('name', '')}</dd>
- <dt><label class="field_opt" for="url">URL</label></dt>
+ <dt><label class="field_opt" for="url">Home Page</label></dt><dd><input id="url" name="url" type="text" value="${data.get('url', '')}"/></dd><dd class="instructions basic">The URL for the web page describing the data (not the data itself).</dd><dd class="hints">e.g. http://www.example.com/growth-figures.html</dd>
@@ -71,6 +71,7 @@
</fieldset><fieldset id="resources">
+ <div class="instructions basic"><h3>Resources: the files and APIs associated with this dataset</h3></div><table class="flexitable"><thead><tr>
@@ -103,10 +104,12 @@
</tbody></table>
+ <!--
<div class="instructions basic">The files containing the data or address of the APIs for accessing it.</div><div class="instructions further"><br />These can be repeated as required. For example if the data is being supplied in multiple formats, or split into different areas or time periods, each file is a different 'resource' which should be described differently. They will all appear on the dataset page on CKAN together.<br /><br /><b>URL:</b> This is the Internet link directly to the data - by selecting this link in a web browser, the user will immediately download the full dataset. Note that datasets are not hosted on this site, but by the publisher of the data. Alternatively the URL can point to an API server such as a SPARQL endpoint or JSON-P service.<br /><b>Format:</b> This should give the file format in which the data is supplied. <br /><b>Description</b> Any information you want to add to describe the resource.<br /></div><div class="hints">Format choices: CSV | RDF | XML | XBRL | SDMX | HTML+RDFa | Other as appropriate</div><div class="field_error" py:if="errors.get('resources', '')">Dataset resource(s) incomplete.</div>
+ --></fieldset><fieldset id="groups">
http://bitbucket.org/okfn/ckan/changeset/71096cd7b27d/
changeset: 71096cd7b27d
branch: feature-1294-ux-improvements-dataset
user: zephod
date: 2011-09-07 15:58:58
summary: [ux,tidy][s]: (refs: #1297) Minor refactor of markdown editor js code.
affected #: 1 file (116 bytes)
--- a/ckan/public/scripts/application.js Wed Sep 07 14:44:54 2011 +0100
+++ b/ckan/public/scripts/application.js Wed Sep 07 14:58:58 2011 +0100
@@ -5,6 +5,7 @@
CKAN.Utils.setupPackageAutocomplete($('input.autocomplete-dataset'));
CKAN.Utils.setupTagAutocomplete($('input.autocomplete-tag'));
CKAN.Utils.setupFormatAutocomplete($('input.autocomplete-format'));
+ CKAN.Utils.setupMarkdownEditor($('.markdown-editor a, .markdown-editor .markdown-preview'));
CKAN.Utils.setupDatasetEditNavigation();
var isDatasetNew = $('body.package.new').length > 0;
@@ -15,33 +16,6 @@
$('#save').val("Add Dataset")
}
- // Markdown editor hooks
- var converter=new Showdown.converter();
- $('.markdown-editor a, .markdown-preview').live('click', function(e) {
- e.preventDefault();
- var $el = $(e.target);
- var action = $el.attr('action') || 'write';
- // Extract neighbouring elements
- var div=$el.closest('.markdown-editor')
- div.find('.tabs a').removeClass('selected');
- div.find('.tabs a[action='+action+']').addClass('selected');
- var textarea = div.find('.markdown-input');
- var preview = div.find('.markdown-preview');
- // Toggle the preview
- if (action=='preview') {
- preview.html(converter.makeHtml(textarea.val()));
- preview.width(textarea.width())
- preview.height(textarea.height())
- textarea.hide();
- preview.show();
- } else {
- textarea.show();
- preview.hide();
- textarea.focus();
- }
- return false;
- });
-
var isPackageRead = $('body.package.read').length > 0;
var config = {
endpoint: '/'
@@ -221,6 +195,35 @@
});
};
+ my.setupMarkdownEditor = function(elements) {
+ // Markdown editor hooks
+ var converter=new Showdown.converter();
+ elements.live('click', function(e) {
+ e.preventDefault();
+ var $el = $(e.target);
+ var action = $el.attr('action') || 'write';
+ // Extract neighbouring elements
+ var div=$el.closest('.markdown-editor')
+ div.find('.tabs a').removeClass('selected');
+ div.find('.tabs a[action='+action+']').addClass('selected');
+ var textarea = div.find('.markdown-input');
+ var preview = div.find('.markdown-preview');
+ // Toggle the preview
+ if (action=='preview') {
+ preview.html(converter.makeHtml(textarea.val()));
+ preview.width(textarea.width())
+ preview.height(textarea.height())
+ textarea.hide();
+ preview.show();
+ } else {
+ textarea.show();
+ preview.hide();
+ textarea.focus();
+ }
+ return false;
+ });
+ };
+
// Show/hide fieldset sections from the edit dataset form.
my.setupDatasetEditNavigation = function() {
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