diff --git a/ckan/public/base/less/module.less b/ckan/public/base/less/module.less index 63e2cbc8885..471fff25637 100644 --- a/ckan/public/base/less/module.less +++ b/ckan/public/base/less/module.less @@ -14,6 +14,11 @@ #gradient > .vertical(@moduleHeadingBackgroundColorStart, @moduleHeadingBackgroundColorEnd); } +.module-heading-secondary { + .border-radius(0); + border-top: 1px solid @moduleHeadingBorderColor; +} + .module-heading [class^=icon]:before { font-size: 1.2em; line-height: 1; @@ -189,3 +194,9 @@ overflow: hidden; } } + +.package-info { + h4 { + margin-bottom: 10px; + } +} diff --git a/ckan/templates/package/edit.html b/ckan/templates/package/edit.html index 722df8812a9..e90e7c2a6af 100644 --- a/ckan/templates/package/edit.html +++ b/ckan/templates/package/edit.html @@ -15,3 +15,7 @@ {% block actions_content %} {% snippet 'package/snippets/back_to_package_action.html', pkg=pkg %} {% endblock %} + +{% block secondary_content %} + {% snippet 'package/snippets/info.html', pkg=pkg, action='package_edit' %} +{% endblock %} diff --git a/ckan/templates/package/new_resource.html b/ckan/templates/package/new_resource.html index 52a114e39a9..969aa5d086f 100644 --- a/ckan/templates/package/new_resource.html +++ b/ckan/templates/package/new_resource.html @@ -11,14 +11,16 @@ {% block form %}{% snippet 'package/snippets/resource_form.html', data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=logged_in %}{% endblock %} {% block secondary_content %} -
-

{{ _('What is data?') }}

-
-

{{ _('Data can be any file or link to a file containing useful data.') }}

-
-
- - {% snippet 'package/snippets/resources.html', pkg=pkg_dict, action='resource_edit', active=data.id %} + {% if pkg_dict %} + {% snippet 'package/snippets/info.html', pkg=pkg_dict, action='resource_new' %} + {% else %} +
+

{{ _('What\'s a resource?') }}

+
+

{{ _('A resource can be any file or link to a file containing useful data.') }}

+
+
+ {% endif %} {% endblock %} {% block scripts %} diff --git a/ckan/templates/package/read.html b/ckan/templates/package/read.html index ab2fa6589a8..b59c2604cde 100644 --- a/ckan/templates/package/read.html +++ b/ckan/templates/package/read.html @@ -15,10 +15,7 @@ {# NOTE: Not implemented in stage 1 #} {#
  • {% link_for _('History'), controller='package', action='history', id=pkg.name, class_='btn', icon='undo' %}
  • #} {% if h.check_access('package_update', {'id':pkg.id }) %} -
  • {% link_for _('Edit'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %}
  • - {% endif %} - {% if h.check_access('package_update', {'id':pkg.id }) %} -
  • {% link_for _('Add resource'), controller='package', action='new_resource', id=pkg.name, class_='btn', icon='plus' %}
  • +
  • {% link_for _('Edit'), controller='package', action='edit', id=pkg.name, class_='btn btn-primary', icon='wrench' %}
  • {% endif %} {% endblock %} diff --git a/ckan/templates/package/resource_edit.html b/ckan/templates/package/resource_edit.html index b0cde7beb0d..701b751d23d 100644 --- a/ckan/templates/package/resource_edit.html +++ b/ckan/templates/package/resource_edit.html @@ -12,8 +12,12 @@ {% endblock %} {% block actions_content %} -
  • {% link_for _('Back to resource'), controller='package', action='resource_read', id=pkg_dict.name, resource_id=res.id, class_='btn', icon='caret-left' %}
  • +
  • {% link_for _('View resource'), controller='package', action='resource_read', id=pkg_dict.name, resource_id=res.id, class_='btn', icon='eye-open' %}
  • {% endblock %} {# logged_in is defined in new_resource.html #} {% block form %}{{ h.snippet('package/snippets/resource_edit_form.html', data=data, errors=errors, error_summary=error_summary, pkg_name=pkg_dict.name, form_action=c.form_action, allow_upload=logged_in) }}{% endblock %} + +{% block secondary_content %} + {% snippet 'package/snippets/info.html', pkg=pkg_dict, active=data.id, action='resource_edit' %} +{% endblock %} \ No newline at end of file diff --git a/ckan/templates/package/snippets/back_to_package_action.html b/ckan/templates/package/snippets/back_to_package_action.html index 81e0e968a14..c16c20d9ddb 100644 --- a/ckan/templates/package/snippets/back_to_package_action.html +++ b/ckan/templates/package/snippets/back_to_package_action.html @@ -1 +1 @@ -
  • {% link_for _('Back to dataset'), controller='package', action='read', id=pkg.name, class_='btn', icon='caret-left' %}
  • +
  • {% link_for _('View dataset'), controller='package', action='read', id=pkg.name, class_='btn', icon='eye-open' %}
  • diff --git a/ckan/templates/package/snippets/info.html b/ckan/templates/package/snippets/info.html new file mode 100644 index 00000000000..52bdc13a462 --- /dev/null +++ b/ckan/templates/package/snippets/info.html @@ -0,0 +1,32 @@ +{# +Displays a sidebard module with information for given package + +pkg - The package dict that owns the resources. +active - The active resource. +action - The action that this is coming from. + +Example: + + {% snippet "package/snippets/info.html", pkg=pkg %} + +#} +{% if pkg and h.check_access('package_update', {'id':pkg.id }) %} +
    +

    {{ _("Edit Dataset") }}

    + + {% set resources = pkg.resources or [] %} +

    {{ _("Edit Resources") }}

    + +
    +{% endif %} \ No newline at end of file diff --git a/ckan/templates/package/snippets/resources.html b/ckan/templates/package/snippets/resources.html index b6585018dc2..91939dc4cb3 100644 --- a/ckan/templates/package/snippets/resources.html +++ b/ckan/templates/package/snippets/resources.html @@ -14,7 +14,7 @@ {% set resources = pkg.resources or [] %} {% if resources %}
    -

    {{ _("Resources") }}

    +

    {{ _("Resources") }}