diff --git a/ckan/public/css/style.css b/ckan/public/css/style.css index 22b5d433273..b9d2f291dc6 100644 --- a/ckan/public/css/style.css +++ b/ckan/public/css/style.css @@ -1046,14 +1046,6 @@ body.editresources #sidebar { display: none; } -.dataset-editresources-form .resource-add { - background: #eee; - padding-top: 10px; - padding-bottom: 5px; - border: 1px solid #e0e0e0; - border-left: none; - border-right: none; -} .dataset-editresources-form .resource-add li h4 { display: inline; padding-right: 20px; @@ -1520,6 +1512,12 @@ body.authz form button { /* Dev */ +fieldset#resources { + min-height: 380px; + margin-bottom: 40px; + position: relative; + padding: 0; +} .resource-list { list-style-type: none; padding: 0; @@ -1531,6 +1529,8 @@ body.authz form button { border-radius: 4px; border: 1px solid #eee; position: relative; + margin-right: 20px; + z-index: 1; } .resource-list li a { display: block; @@ -1539,43 +1539,46 @@ body.authz form button { .resource-list li:hover { border-color: #ccc; } +.resource-list li.active { + border-color: #888; + border-right: 0; + background: #f9f9f9; + margin-right: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +hr.resource-list-divide { + margin: 10px 0; + width: 380px; + background: #eee; +} -fieldset#resources { - position: relative; - padding: 0; + +/* While dragging.... */ +.resource-list-edit li.ui-sortable-helper { + box-shadow: 2px 2px 2px rgba(0,0,0,0.1); +} +.resource-list-edit li.ui-sortable-helper.active { + margin-right: 20px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + border-right: 1px solid #888; } + .dataset-editresources-form .resource-list { width: 400px; - min-height: 300px; - margin-bottom: 40px; -} -li.resource-edit { - margin-right: 20px; - position: relative; - z-index: 1; - background: #fff; } -li.resource-edit:hover { - margin-right: 1px; - border-right: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; +.resource-list-add li a { + padding-left: 43px; } -li.resource-edit a { +.resource-list-edit li a { padding-left: 0; } -li.resource-edit:hover .drag-bars { +.resource-list-edit li:hover .drag-bars { color: #999; } -li.resource-edit.active { - border-color: #888; - border-right: 0; - background: #f9f9f9; - margin-right: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} + .resource-details-container { background: #f9f9f9; @@ -1586,6 +1589,7 @@ li.resource-edit.active { left: 399px; top: 0px; padding: 10px; + min-height: 300px; } .resource-details-container .resource-details-close { position: absolute; diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js index f305700d576..57d042cc4c4 100644 --- a/ckan/public/scripts/application.js +++ b/ckan/public/scripts/application.js @@ -620,12 +620,24 @@ CKAN.View.DatasetEditResourcesForm = Backbone.View.extend({ resources.bind('remove', flashWarning); // Table for editing resources - var $el = this.el.find('.js-resource-list'); + var $el = this.el.find('.resource-list-edit'); this.resourceList=new CKAN.View.ResourceEditList({ collection: resources, el: $el }); + // Trigger the Add Resource pane + var $a = this.el.find('.js-resource-add'); + $a.click(function(e) { + e.preventDefault(); + $('.resource-list li').removeClass('active'); + $('.resource-list-add li').addClass('active'); + $('.js-resource-details').hide(); + $('.js-resource-details.resource-add').show(); + $('.js-resource-details-container').show(); + return false; + }); + // Tabbed view for adding resources var $el = this.el.find('.resource-add'); this.addView=new CKAN.View.ResourceAddTabs({ @@ -636,7 +648,7 @@ CKAN.View.DatasetEditResourcesForm = Backbone.View.extend({ // Close details button $('.resource-details-close').click(function(e) { e.preventDefault(); - $('.js-resource-list li').removeClass('active'); + $('.resource-list li').removeClass('active'); $('.resource-details-container').hide(); return false; }); @@ -715,9 +727,9 @@ CKAN.View.ResourceEditList = Backbone.View.extend({ var container = $('.js-resource-details-container'); container.find('.js-resource-details').hide(); container.show(); - self.el.find('li.active').removeClass('active'); - - $li.data('table').show(); + $('.resource-list li').removeClass('active'); + $table.show(); + $table.find('.js-resource-edit-name').focus(); $li.addClass('active'); }; diff --git a/ckan/templates/package/new_package_form.html b/ckan/templates/package/new_package_form.html index a177df980e9..881e5ac59e2 100644 --- a/ckan/templates/package/new_package_form.html +++ b/ckan/templates/package/new_package_form.html @@ -82,18 +82,22 @@

Errors in form

-