forked from enterstudio/ckanext-datagovau
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path23.patch
587 lines (537 loc) · 24.2 KB
/
23.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
diff --git a/ckan/config/environment.py b/ckan/config/environment.py
index 1148726..d5ae488 100644
--- a/ckan/config/environment.py
+++ b/ckan/config/environment.py
@@ -351,8 +351,8 @@ def update_config():
extras = {'client_encoding': 'utf8'}
else:
extras = {}
-
- engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.', **extras)
+ from sqlalchemy.pool import NullPool
+ engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.', client_encoding='utf8', poolclass=NullPool)
if not model.meta.engine:
model.init_model(engine)
diff --git a/ckan/config/resource_formats.json b/ckan/config/resource_formats.json
index ae9a821..56c67f5 100644
--- a/ckan/config/resource_formats.json
+++ b/ckan/config/resource_formats.json
@@ -45,7 +45,7 @@
["DOCX", "Word OOXML Document", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", []],
["BIN", "Binary Data", "application/octet-stream", ["bin"]],
["XSLT", "Extensible Stylesheet Language Transformations", "application/xslt+xml", []],
- ["WMS", "Web Mapping Service", "WMS", ["wms"]],
+ ["wms", "Web Mapping Service", "wms", ["WMS"]],
["SVG", "SVG vector image", "image/svg+xml", ["svg"]],
["PPT", "Powerpoint Presentation", "application/vnd.ms-powerpoint", []],
["JPEG", "JPG Image File", "image/jpeg", ["jpeg", "jpg"]],
diff --git a/ckan/controllers/group.py b/ckan/controllers/group.py
index 0f5bc28..af36717 100644
--- a/ckan/controllers/group.py
+++ b/ckan/controllers/group.py
@@ -162,7 +162,7 @@ class GroupController(base.BaseController):
collection=results,
page = self._get_page_number(request.params),
url=h.pager_url,
- items_per_page=21
+ items_per_page=20
)
return render(self._index_template(group_type))
diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py
index bd90e5e..79335d1 100644
--- a/ckan/controllers/package.py
+++ b/ckan/controllers/package.py
@@ -168,7 +168,7 @@ class PackageController(base.BaseController):
c.remove_field = remove_field
- sort_by = request.params.get('sort', None)
+ sort_by = request.params.get('sort', 'extras_harvest_portal asc, score desc, metadata_modified desc')
params_nosort = [(k, v) for k, v in params_nopage if k != 'sort']
def _sort_by(fields):
@@ -190,7 +190,7 @@ class PackageController(base.BaseController):
c.sort_by = _sort_by
if sort_by is None:
- c.sort_by_fields = []
+ c.sort_by_fields = [('extra_harvest_portal', 'asc'),('score', 'desc'), ('metadata_modified', 'desc')]
else:
c.sort_by_fields = [field.split()[0]
for field in sort_by.split(',')]
@@ -209,6 +209,8 @@ class PackageController(base.BaseController):
c.fields_grouped = {}
search_extras = {}
fq = ''
+ if q == '' and not sort_by:
+ sort_by = 'extras_harvest_portal asc, score desc, metadata_modified desc'
for (param, value) in request.params.items():
if param not in ['q', 'page', 'sort'] \
and len(value) and not param.startswith('_'):
@@ -400,6 +402,9 @@ class PackageController(base.BaseController):
# used by disqus plugin
c.current_package_id = c.pkg.id
+ if h.get_pkg_dict_extra(c.pkg_dict,'harvest_portal'):
+ log.info(h.get_pkg_dict_extra(c.pkg_dict,'harvest_portal'))
+ redirect(h.get_pkg_dict_extra(c.pkg_dict,'harvest_url').encode('ascii','ignore'), 301)
c.related_count = c.pkg.related_count
# can the resources be previewed?
diff --git a/ckan/lib/dictization/model_dictize.py b/ckan/lib/dictization/model_dictize.py
index 9af2474..ec7aed6 100644
--- a/ckan/lib/dictization/model_dictize.py
+++ b/ckan/lib/dictization/model_dictize.py
@@ -59,7 +59,6 @@ def group_list_dictize(obj_list, context,
return sorted(group_list, key=sort_key, reverse=reverse)
def resource_list_dictize(res_list, context):
-
active = context.get('active', True)
result_list = []
for res in res_list:
@@ -129,7 +128,18 @@ def resource_dictize(res, context):
return resource
def related_dictize(rel, context):
- return d.table_dictize(rel, context)
+ related = d.table_dictize(rel, context)
+ image_url = related.get('image_url')
+ related['image_display_url'] = image_url
+ if image_url and not image_url.startswith('http'):
+ #munge here should not have an effect only doing it incase
+ #of potential vulnerability of dodgy api input
+ image_url = munge.munge_filename(image_url)
+ related['image_display_url'] = h.url_for_static(
+ 'uploads/related/%s' % related.get('image_url'),
+ qualified=True
+ )
+ return related
def _execute(q, table, context):
@@ -409,7 +419,7 @@ def group_dictize(group, context,
try:
packages_limit = context['limits']['packages']
except KeyError:
- q['rows'] = 1000 # Only the first 1000 datasets are returned
+ q['rows'] = 10 # Only the first 10 datasets are returned
else:
q['rows'] = packages_limit
diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
index 2520566..ccd2c56 100644
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -894,7 +894,7 @@ class Page(paginate.Page):
def pager(self, *args, **kwargs):
kwargs.update(
format=u"<div class='pagination pagination-centered'><ul>$link_previous ~2~ $link_next</ul></div>",
- symbol_previous=u'«', symbol_next=u'»',
+ symbol_previous=u'Previous Page', symbol_next=u'Next Page',
curpage_attr={'class': 'active'}, link_attr={}
)
return super(Page, self).pager(*args, **kwargs)
@@ -914,8 +914,8 @@ class Page(paginate.Page):
html = super(Page, self)._range(regexp_match)
# Convert ..
dotdot = '<span class="pager_dotdot">..</span>'
- dotdot_link = HTML.li(HTML.a('...', href='#'), class_='disabled')
- html = re.sub(dotdot, dotdot_link, html)
+
+ html = re.sub(dotdot, '', html)
# Convert current page
text = '%s' % self.page
@@ -1992,7 +1992,7 @@ def get_organization(org=None, include_datasets=False):
return {}
try:
return logic.get_action('organization_show')({}, {'id': org, 'include_datasets': include_datasets})
- except (NotFound, ValidationError, NotAuthorized):
+ except (logic.NotFound, logic.ValidationError, logic.NotAuthorized):
return {}
# these are the functions that will end up in `h` template helpers
diff --git a/ckan/lib/munge.py b/ckan/lib/munge.py
index 1aec5b3..a6e900b 100644
--- a/ckan/lib/munge.py
+++ b/ckan/lib/munge.py
@@ -114,6 +114,12 @@ def munge_tag(tag):
def munge_filename(filename):
filename = substitute_ascii_equivalents(filename)
filename = filename.strip()
+ try:
+ import ntpath
+ #Internet Explorer provides full paths, not filenames so strip path
+ filename = ntpath.basename(filename)
+ except ImportError:
+ filename = filename
filename = re.sub(r'[^a-zA-Z0-9.\- ]', '', filename).replace(' ', '-')
filename = _munge_to_length(filename, 3, 100)
return filename
diff --git a/ckan/logic/action/create.py b/ckan/logic/action/create.py
index 15e9b40..94b7438 100644
--- a/ckan/logic/action/create.py
+++ b/ckan/logic/action/create.py
@@ -3,7 +3,7 @@
import logging
import random
import re
-
+import json
from pylons import config
import paste.deploy.converters
from sqlalchemy import func
@@ -156,7 +156,7 @@ def package_create(context, data_dict):
try:
check_data_dict(data_dict, schema)
except TypeError:
- # Old plugins do not support passing the schema so we need
+ # Old plugins do not support ssing the schema so we need
# to ensure they still work
package_plugin.check_data_dict(data_dict)
@@ -303,7 +303,11 @@ def resource_create(context, data_dict):
_get_action('package_update')(context, pkg_dict)
context.pop('defer_commit')
except ValidationError, e:
- errors = e.error_dict['resources'][-1]
+ if 'resources' in e.error_dict:
+ errors = e.error_dict['resources'][-1]
+ else:
+ errors = ["Please ensure the metadata details of the dataset are completed and saved before trying to add files/resources " + str(e.error_dict)]
+
raise ValidationError(errors)
## Get out resource_id resource from model as it will not appear in
@@ -498,6 +502,9 @@ def related_create(context, data_dict):
userobj = model.User.get(user)
_check_access('related_create', context, data_dict)
+ upload = uploader.Upload('related')
+ upload.update_data_dict(data_dict, 'image_url',
+ 'image_upload', 'clear_upload')
data_dict["owner_id"] = userobj.id
data, errors = _validate(
@@ -505,7 +512,7 @@ def related_create(context, data_dict):
if errors:
model.Session.rollback()
raise ValidationError(errors)
-
+ upload.upload(uploader.get_max_image_size())
related = model_save.related_dict_save(data, context)
if not context.get('defer_commit'):
model.repo.commit_and_remove()
@@ -1113,6 +1120,7 @@ def _get_random_username_from_email(email):
def package_create_rest(context, data_dict):
_check_access('package_create_rest', context, data_dict)
dictized_package = model_save.package_api_to_dict(data_dict, context)
+ log.info(json.dumps(dictized_package))
dictized_after = _get_action('package_create')(context, dictized_package)
pkg = context['package']
package_dict = model_dictize.package_to_api(pkg, context)
diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py
index ad59266..9c8c8ac 100644
--- a/ckan/logic/action/get.py
+++ b/ckan/logic/action/get.py
@@ -960,8 +960,9 @@ def package_show(context, data_dict):
# If the package_dict came from the Solr cache then each resource dict will
# already have a potentially outdated tracking_summary, this will overwrite
# it with a current one.
- for resource_dict in package_dict['resources']:
- _add_tracking_summary_to_resource_dict(resource_dict, model)
+ if len(package_dict['resources']) < 10:
+ for resource_dict in package_dict['resources']:
+ _add_tracking_summary_to_resource_dict(resource_dict, model)
if context.get('for_view'):
for item in plugins.PluginImplementations(plugins.IPackageController):
@@ -1029,7 +1030,7 @@ def resource_show(context, data_dict):
if resource_dict['id'] == id:
break
else:
- log.error('Could not find resource ' + id)
+ log.info('Could not find resource ' + id)
raise NotFound(_('Resource was not found.'))
return resource_dict
diff --git a/ckan/logic/action/update.py b/ckan/logic/action/update.py
index 9288f50..f409408 100644
--- a/ckan/logic/action/update.py
+++ b/ckan/logic/action/update.py
@@ -59,7 +59,9 @@ def related_update(context, data_dict):
related = model.Related.get(id)
context["related"] = related
-
+ upload = uploader.Upload('related', related.image_url)
+ upload.update_data_dict(data_dict, 'image_url',
+ 'image_upload', 'clear_upload')
if not related:
log.error('Could not find related ' + id)
raise NotFound(_('Item was not found.'))
@@ -96,7 +98,7 @@ def related_update(context, data_dict):
}
_get_action('activity_create')(activity_create_context, activity_dict)
-
+ upload.upload(uploader.get_max_image_size())
if not context.get('defer_commit'):
model.repo.commit()
return model_dictize.related_dictize(related, context)
@@ -155,7 +157,10 @@ def resource_update(context, data_dict):
updated_pkg_dict = _get_action('package_update')(context, pkg_dict)
context.pop('defer_commit')
except ValidationError, e:
- errors = e.error_dict['resources'][n]
+ if 'resources' in e.error_dict:
+ errors = e.error_dict['resources'][-1]
+ else:
+ errors = ["Please ensure the metadata details of the dataset are completed and saved before trying to add files/resources " + json.dumps(e.error_dict)]
raise ValidationError(errors)
upload.upload(id, uploader.get_max_resource_size())
diff --git a/ckan/logic/auth/create.py b/ckan/logic/auth/create.py
index 25ca975..545f3d6 100644
--- a/ckan/logic/auth/create.py
+++ b/ckan/logic/auth/create.py
@@ -48,17 +48,6 @@ def related_create(context, data_dict=None):
To create a featured item the user must be a sysadmin.
'''
- model = context['model']
- user = context['user']
- userobj = model.User.get( user )
-
- if userobj:
- if data_dict.get('featured', 0) != 0:
- return {'success': False,
- 'msg': _('You must be a sysadmin to create a featured '
- 'related item')}
- return {'success': True}
-
return {'success': False, 'msg': _('You must be logged in to add a related item')}
diff --git a/ckan/logic/schema.py b/ckan/logic/schema.py
index 8d1ac11..ec5b9ee 100644
--- a/ckan/logic/schema.py
+++ b/ckan/logic/schema.py
@@ -353,7 +353,7 @@ def default_related_schema():
'title': [not_empty, unicode],
'description': [ignore_missing, unicode],
'type': [not_empty, unicode],
- 'image_url': [ignore_missing, unicode, url_validator],
+ 'image_url': [ignore_missing, unicode],
'url': [ignore_missing, unicode, url_validator],
'owner_id': [not_empty, unicode],
'created': [ignore],
diff --git a/ckan/logic/validators.py b/ckan/logic/validators.py
index 178beef..d264824 100644
--- a/ckan/logic/validators.py
+++ b/ckan/logic/validators.py
@@ -592,8 +592,8 @@ def user_password_validator(key, data, errors, context):
errors[('password',)].append(_('Passwords must be strings'))
elif value == '':
pass
- elif len(value) < 4:
- errors[('password',)].append(_('Your password must be 4 characters or longer'))
+ elif len(value) < 12:
+ errors[('password',)].append(_('Your password must be 12 characters or longer'))
def user_passwords_match(key, data, errors, context):
@@ -823,10 +823,9 @@ def filter_fields_and_values_exist_and_are_valid(key, data, errors, context):
def extra_key_not_in_root_schema(key, data, errors, context):
-
for schema_key in context.get('schema_keys', []):
if schema_key == data[key]:
- raise Invalid(_('There is a schema field with the same name'))
+ raise Invalid(_('There is a schema field with the same name '+schema_key))
def empty_if_not_sysadmin(key, data, errors, context):
diff --git a/ckan/migration/versions/074_remove_resource_groups.py b/ckan/migration/versions/074_remove_resource_groups.py
index c0b26aa..5216cf8 100644
--- a/ckan/migration/versions/074_remove_resource_groups.py
+++ b/ckan/migration/versions/074_remove_resource_groups.py
@@ -20,8 +20,6 @@ def upgrade(migrate_engine):
WHERE R.resource_group_id = G.id;
ALTER TABLE "resource_revision" DROP COLUMN "resource_group_id";
- ALTER TABLE resource_group_revision
- DROP CONSTRAINT resource_group_revision_continuity_id_fkey;
DROP TABLE "resource_group_revision";
DROP TABLE "resource_group";
diff --git a/ckan/public/base/javascript/modules/select-switch.js b/ckan/public/base/javascript/modules/select-switch.js
index 145b33a..1ba629e 100644
--- a/ckan/public/base/javascript/modules/select-switch.js
+++ b/ckan/public/base/javascript/modules/select-switch.js
@@ -15,17 +15,3 @@
*
* Returns .
*/
-this.ckan.module('select-switch', {
-
- options: {
- target: 'select'
- },
-
- initialize: function () {
- var _this = this;
-
- this.el.on('change', this.options.target, function () {
- _this.el.submit();
- });
- }
-});
diff --git a/ckan/public/robots.txt b/ckan/public/robots.txt
index 279a33a..e410bdc 100644
--- a/ckan/public/robots.txt
+++ b/ckan/public/robots.txt
@@ -3,6 +3,50 @@ Disallow: /dataset/rate/
Disallow: /revision/
Disallow: /dataset/*/history
Disallow: /api/
+Disallow: /_tracking
+Disallow: /_tracking
+
+Disallow: /ar/
+Disallow: /bg/
+Disallow: /ca
+Disallow: /cs_CZ/
+Disallow: /da_DK/
+Disallow: /de/
+Disallow: /dv/
+Disallow: /el/
+Disallow: /en_AU/
+Disallow: /en_GB/
+Disallow: /es/
+Disallow: /es_AR/
+Disallow: /fa_IR/
+Disallow: /fi/
+Disallow: /fr/
+Disallow: /hu/
+Disallow: /id/
+Disallow: /is/
+Disallow: /it/
+Disallow: /ja/
+Disallow: /km/
+Disallow: /ko_KR/
+Disallow: /lt/
+Disallow: /lv/
+Disallow: /my_MM/
+Disallow: /nl/
+Disallow: /no/
+Disallow: /pl/
+Disallow: /pt_BR/
+Disallow: /ro/
+Disallow: /ru/
+Disallow: /sk/
+Disallow: /sl/
+Disallow: /sq/
+Disallow: /sr/
+Disallow: /sr_Latn/
+Disallow: /sv/
+Disallow: /tr/
+Disallow: /uk_UA/
+Disallow: /zh_CN/
+Disallow: /zh_TW/
User-Agent: *
Crawl-Delay: 10
diff --git a/ckan/templates/package/snippets/resource_view.html b/ckan/templates/package/snippets/resource_view.html
index 7f99a2a..bbb5683 100644
--- a/ckan/templates/package/snippets/resource_view.html
+++ b/ckan/templates/package/snippets/resource_view.html
@@ -1,14 +1,32 @@
{% import 'macros/form.html' as form %}
<div id="view-{{ resource_view['id'] }}" class="resource-view" data-id="{{ resource_view['id'] }}" data-title="{{ resource_view['title'] }}" data-description="{{ resource_view['descripion'] }}">
+<div class="actions">
+
+ <ul>
+
+
+ <li>
<a class="btn pull-right"
href="#embed-{{ resource_view['id'] }}"
data-module="resource-view-embed"
data-module-id="{{ resource_view['id'] }}"
data-module-url="{{ h.url('resource_view', id=package['name'], resource_id=resource['id'], view_id=resource_view['id'], qualified=True) }}">
<i class="icon-code"></i>
- {{ _("Embed") }}
+ {{ _("Embed this View") }}
+ </a></li><li>
+ <a class="btn pull-right" target="_blank"
+ href="{{ h.url('resource_view', id=package['name'], resource_id=resource['id'], view_id=resource_view['id'], qualified=True) }}">
+ <i class="icon-external-link"></i>
+ {{ _("View Full Screen") }}
</a>
+ </li>
+
+
+
+ </ul>
+
+ </div>
<p class="desc">{{ resource_view['description'] }}</p>
<div class="m-top ckanext-datapreview">
{% if not to_preview and h.resource_view_is_filterable(resource_view) %}
diff --git a/ckan/templates/related/snippets/related_form.html b/ckan/templates/related/snippets/related_form.html
index 23ab88c..2220b9a 100644
--- a/ckan/templates/related/snippets/related_form.html
+++ b/ckan/templates/related/snippets/related_form.html
@@ -1,6 +1,6 @@
{% import 'macros/form.html' as form %}
-<form class="dataset-form form-horizontal" method="post" data-module="basic-form">
+<form class="dataset-form form-horizontal" method="post" data-module="basic-form" enctype="multipart/form-data">
{% block error_summary %}
{% if error_summary | count %}
<div class="alert alert-error error-explanation">
@@ -17,7 +17,10 @@
{% block fields %}
{{ form.input('title', label=_('Title'), id='field-title', placeholder=_('My Related Item'), value=data.title, error=errors.title, classes=['control-full']) }}
{{ form.input('url', label=_('URL'), id='field-url', placeholder=_('http://example.com/'), value=data.url, error=errors.url, classes=['control-full']) }}
- {{ form.input('image_url', label=_('Image URL'), id='field-image-url', placeholder=_('http://example.com/image.png'), value=data.image_url, error=errors.image_url, classes=['control-full']) }}
+ {% set is_upload = data.image_url and not data.image_url.startswith('http') %}
+ {% set is_url = data.image_url and data.image_url.startswith('http') %}
+
+ {{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload) }}
{{ form.markdown('description', label=_('Description'), id='field-description', placeholder=_('A little information about the item...'), value=data.description, error=errors.description) }}
{{ form.select('type', label=_('Type'), id='field-types', selected=data.type, options=c.types, error=errors.type) }}
{% endblock %}
diff --git a/ckanext/datastore/db.py b/ckanext/datastore/db.py
index 1121c9e..becca68 100644
--- a/ckanext/datastore/db.py
+++ b/ckanext/datastore/db.py
@@ -967,7 +967,8 @@ def search_data(context, data_dict):
sort_clause = ''
sql_string = u'''SELECT {distinct} {select}
- FROM "{resource}" {ts_query}
+ FROM "{resource}" ,(SELECT reltuples FROM pg_class
+WHERE relname = '{resource}') as c {ts_query}
{where} {sort} LIMIT {limit} OFFSET {offset}'''.format(
distinct=distinct,
select=select_columns,
diff --git a/ckanext/datastore/plugin.py b/ckanext/datastore/plugin.py
index 2380ce1..9e66177 100644
--- a/ckanext/datastore/plugin.py
+++ b/ckanext/datastore/plugin.py
@@ -384,7 +384,7 @@ class DatastorePlugin(p.SingletonPlugin):
where = self._where(data_dict, fields_types)
select_cols = [u'"{0}"'.format(field_id) for field_id in field_ids] +\
- [u'count(*) over() as "_full_count" %s' % rank_column]
+ [u'c.reltuples AS "_full_count" %s' % rank_column]
query_dict['distinct'] = data_dict.get('distinct', False)
query_dict['select'] += select_cols
diff --git a/ckanext/reclineview/plugin.py b/ckanext/reclineview/plugin.py
index 20e204b..0dee15d 100644
--- a/ckanext/reclineview/plugin.py
+++ b/ckanext/reclineview/plugin.py
@@ -178,7 +178,7 @@ class ReclineMapView(ReclineViewBase):
datastore_fields = []
- datastore_field_types = ['numeric']
+ datastore_field_types = ['text','numeric']
def list_map_field_types(self):
return [t['value'] for t in self.map_field_types]
diff --git a/ckanext/reclineview/theme/public/vendor/recline/recline.js b/ckanext/reclineview/theme/public/vendor/recline/recline.js
index 42be873..6c94b4e 100755
--- a/ckanext/reclineview/theme/public/vendor/recline/recline.js
+++ b/ckanext/reclineview/theme/public/vendor/recline/recline.js
@@ -2283,8 +2283,8 @@ my.Map = Backbone.View.extend({
var self = this;
this.map = new L.Map(this.$map.get(0));
- var mapUrl = "//otile{s}-s.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png";
- var osmAttribution = 'Map data © 2011 OpenStreetMap contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png">';
+ var mapUrl = "//c.tiles.mapbox.com/v3/maxious.gdb67hbh/{z}/{x}/{y}.png";
+ var osmAttribution = "Map data © OpenStreetMap contributors, <a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a> ";
var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'});
this.map.addLayer(bg);
diff --git a/ckanext/resourceproxy/controller.py b/ckanext/resourceproxy/controller.py
index 618d0a6..e4118d0 100644
--- a/ckanext/resourceproxy/controller.py
+++ b/ckanext/resourceproxy/controller.py
@@ -47,7 +47,7 @@ def proxy_resource(context, data_dict):
cl = r.headers.get('content-length')
if cl and int(cl) > MAX_FILE_SIZE:
- base.abort(409, '''Content is too large to be proxied. Allowed
+ base.abort(409, '''Sorry about that, but we cannot show files that are this big right now. Allowed
file size: {allowed}, Content-Length: {actual}.'''.format(
allowed=MAX_FILE_SIZE, actual=cl))
@@ -64,7 +64,7 @@ def proxy_resource(context, data_dict):
if length >= MAX_FILE_SIZE:
base.abort(409, headers={'content-encoding': ''},
- detail='Content is too large to be proxied.')
+ detail='Sorry about that, but we cannot show files that are this big right now. Please download instead.')
except requests.exceptions.HTTPError, error:
details = 'Could not proxy resource. Server responded with %s %s' % (