[ckan-changes] commit/ckan: 3 new changesets

Bitbucket commits-noreply at bitbucket.org
Mon Sep 26 12:49:29 UTC 2011


3 new changesets in ckan:

http://bitbucket.org/okfn/ckan/changeset/457621fd7eab/
changeset:   457621fd7eab
user:        zephod
date:        2011-09-26 13:53:53
summary:     [bugfix,markdown-editor][m]: Client-side markdown preview (showdown.js) appeared to produce subtly different results to server side python implementation. Now using AJAX to fetch the preview from the server; consistency guaranteed. Also fixed buggy link.
affected #:  7 files (-1 bytes)

--- a/ckan/config/routing.py	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/config/routing.py	Mon Sep 26 12:53:53 2011 +0100
@@ -102,6 +102,8 @@
 
     map.connect('/api/search/{register}', controller='api', action='search')
     map.connect('/api/tag_counts', controller='api', action='tag_counts')
+
+    map.connect('/api/markdown', controller='api', action='markdown')
     
     map.connect('/api/rest', controller='api', action='index')
 


--- a/ckan/controllers/api.py	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/controllers/api.py	Mon Sep 26 12:53:53 2011 +0100
@@ -481,6 +481,12 @@
             raise ValueError, _('Request params must be in form of a json encoded dictionary.')
         return params        
 
+    def markdown(self, ver=None):
+        raw_markdown = request.params.get('q', '')
+        results = ckan.misc.MarkdownFormat().to_html(raw_markdown)
+
+        return self._finish_ok(results)
+
     def tag_counts(self, ver=None):
         c.q = request.params.get('q', '')
 


--- a/ckan/public/css/forms.css	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/public/css/forms.css	Mon Sep 26 12:53:53 2011 +0100
@@ -108,7 +108,10 @@
     vertical-align: middle; }
   form dl dd ul {
     margin: 0.5em 0 0 0;
-    padding: 0; }
+    padding-top: 0; 
+    padding-right: 0; 
+    padding-bottom: 0; 
+  }
   form dl dd.notes, form dl dd.hints, .hints {
     padding: 0 0 0.3em 0;
     color: #555;


--- a/ckan/public/scripts/application.js	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/public/scripts/application.js	Mon Sep 26 12:53:53 2011 +0100
@@ -7,7 +7,7 @@
     $('input.autocomplete-format').live('keyup', function(){
       CKAN.Utils.setupFormatAutocomplete($(this));
     });
-    CKAN.Utils.setupMarkdownEditor($('.markdown-editor a, .markdown-editor .markdown-preview'));
+    CKAN.Utils.setupMarkdownEditor($('.markdown-editor .tabs a, .markdown-editor .markdown-preview'));
     // set up ckan js
     var config = {
       endpoint: '/'
@@ -224,7 +224,11 @@
       var preview = div.find('.markdown-preview');
       // Toggle the preview
       if (action=='preview') {
-        preview.html(converter.makeHtml(textarea.val()));
+        raw_markdown=textarea.val();
+        preview.html("<em>"+CKAN.Strings.loading+"<em>");
+        $.post("/api/markdown", { q: raw_markdown },
+          function(data) { preview.html(data); }
+        );
         preview.width(textarea.width())
         preview.height(textarea.height())
         textarea.hide();


--- a/ckan/templates/js_strings.html	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/templates/js_strings.html	Mon Sep 26 12:53:53 2011 +0100
@@ -20,6 +20,7 @@
   CKAN.Strings.failedToSave = "${_('Failed to save, possibly due to invalid data ')}";
   CKAN.Strings.addDataset = "${_('Add Dataset')}";
   CKAN.Strings.youHaveUnsavedChanges = "${_('You have unsaved changes. Hit Save Changes at the bottom of the page to submit them.')}";
+  CKAN.Strings.loading = "${_('Loading...')}";
 
   /*
    * Used in templates.js.


--- a/ckan/templates/layout_base.html	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/templates/layout_base.html	Mon Sep 26 12:53:53 2011 +0100
@@ -211,6 +211,7 @@
   <!-- for ckanjs etc --><script type="text/javascript" src="${g.site_url}/scripts/vendor/underscore/1.1.6/underscore.js"></script><script type="text/javascript" src="${g.site_url}/scripts/vendor/backbone/0.5.1/backbone.js"></script>
+  <!-- TODO should not be necessary; we use AJAX to produce consistent previews --><script type="text/javascript" src="${g.site_url}/scripts/vendor/showdown/showdown.js"></script><script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.fileupload/20110801/jquery.iframe-transport.js"></script><script type="text/javascript" src="${g.site_url}/scripts/vendor/jquery.fileupload/20110801/jquery.fileupload.js"></script>


--- a/ckan/templates/package/new_package_form.html	Wed Sep 21 17:35:32 2011 +0100
+++ b/ckan/templates/package/new_package_form.html	Mon Sep 26 12:53:53 2011 +0100
@@ -58,7 +58,7 @@
       </ul><textarea class="markdown-input" tabindex="3" name="notes" id="notes" placeholder="${_('Start with a summary sentence ...')}">${data.get('notes','')}</textarea><div class="markdown-preview" style="display: none;"></div>
-      <span class="hints">You can use <a href="http://daringfireball.net/projects/markdown/syntax">Markdown formatting</a> here.</span>
+      <span class="hints">You can use <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown formatting</a> here.</span><!--
       <dd class="instructions basic">The main description of the dataset</dd><dd class="instructions further">It is often displayed with the dataset title. In particular, it should start with a short sentence that describes the dataset succinctly, because the first few words alone may be used in some views of the datasets.</dd>


http://bitbucket.org/okfn/ckan/changeset/4ad0c7d6de96/
changeset:   4ad0c7d6de96
user:        zephod
date:        2011-09-26 14:42:08
summary:     [bugfix,genshi][xs]: Genshi tries to be clever by stripping empty newlines, but this screws up <pre> and <textarea>. It's supposed to detect these but it's buggy so I'm disabling the feature.
affected #:  1 file (-1 bytes)

--- a/ckan/lib/base.py	Mon Sep 26 12:53:53 2011 +0100
+++ b/ckan/lib/base.py	Mon Sep 26 13:42:08 2011 +0100
@@ -63,7 +63,7 @@
         for item in PluginImplementations(IGenshiStreamFilter):
             stream = item.filter(stream)
         
-        return literal(stream.render(method=method, encoding=None))
+        return literal(stream.render(method=method, encoding=None, strip_whitespace=False))
     
     if 'Pragma' in response.headers:
         del response.headers["Pragma"]


http://bitbucket.org/okfn/ckan/changeset/cec0490fabe3/
changeset:   cec0490fabe3
user:        zephod
date:        2011-09-26 14:45:15
summary:     [merge,default]: Maybe I should have glitchfixed on a branch.
affected #:  1 file (-1 bytes)

--- a/doc/install-from-source.rst	Mon Sep 26 13:42:08 2011 +0100
+++ b/doc/install-from-source.rst	Mon Sep 26 13:45:15 2011 +0100
@@ -95,6 +95,8 @@
 
    Choose which version of CKAN to install. Released versions are listed at https://bitbucket.org/okfn/ckan - click on the list of tags. For example: ``ckan-1.4.2``
 
+   ::
+
        pip install --ignore-installed -e hg+http://bitbucket.org/okfn/ckan@ckan-1.4.2#egg=ckan
 
    Alternatively, if you are to develop CKAN, then you will probably want to use the latest 'bleeding edge' code. If using this version, we suggest you `check CKAN has passed the automatic tests <http://buildbot.okfn.org/waterfall>`_. Here is how to install the latest code::
@@ -156,20 +158,15 @@
 
   .. tip ::
 
-      If you choose a database name, user or password which are different from those 
-      suggested below then you'll need to update the configuration file you'll create in
-      the next step.
+      If you choose a database name, user or password which are different from the example values suggested below then you'll need to change the sqlalchemy.url value accordingly in the CKAN configuration file you'll create in the next step.
 
-  Here we choose ``ckantest`` as the database and ``ckanuser`` as the user:
+  Here we create a user called ``ckanuser`` and will enter ``pass`` for the password when prompted:
 
   ::
 
       sudo -u postgres createuser -S -D -R -P ckanuser
 
-  It should prompt you for a new password for the CKAN data in the database.
-  It is suggested you enter ``pass`` for the password.
-
-  Now create the database, which we'll call ``ckantest``:
+  Now create the database (owned by ``ckanuser``), which we'll call ``ckantest``:
 
   ::

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