diff --git a/ckanext/knowledgehub/controllers/package.py b/ckanext/knowledgehub/controllers/package.py index b6908312..bdee4715 100644 --- a/ckanext/knowledgehub/controllers/package.py +++ b/ckanext/knowledgehub/controllers/package.py @@ -184,7 +184,7 @@ def pager_url(q=None, page=None): default_facet_titles = { 'organization': _('Organizations'), - 'groups': _('Groups'), + 'groups': _('Joint Analysis'), 'tags': _('Tags'), 'res_format': _('Formats'), 'license_id': _('Licenses'), diff --git a/ckanext/knowledgehub/templates/group/index.html b/ckanext/knowledgehub/templates/group/index.html new file mode 100644 index 00000000..1d7729a8 --- /dev/null +++ b/ckanext/knowledgehub/templates/group/index.html @@ -0,0 +1,43 @@ +{% extends "page.html" %} + +{% block subtitle %}{{ _('Joint Analysis') }}{% endblock %} + +{% block breadcrumb_content %} +
+ {{ _('There are currently no joint analysis for this site') }}. + {% if h.check_access('group_create') %} + {% link_for _('How about creating one?'), controller='group', action='new' %}. + {% endif %} +
+ {% endif %} + {% endblock %} + {% block page_pagination %} + {{ c.page.pager(q=c.q or '', sort=c.sort_by_selected or '') }} + {% endblock %} +{% endblock %} + +{% block secondary_content %} + {% snippet "group/snippets/helper.html" %} +{% endblock %} diff --git a/ckanext/knowledgehub/templates/group/new.html b/ckanext/knowledgehub/templates/group/new.html new file mode 100644 index 00000000..f95b093b --- /dev/null +++ b/ckanext/knowledgehub/templates/group/new.html @@ -0,0 +1,13 @@ +{% extends "group/base_form_page.html" %} + +{% block subtitle %}{{ _('Create a Joint Analysis') }}{% endblock %} + +{% block breadcrumb_link %}{{ h.nav_link(_('Create a Joint Analysis'), controller='group', action='edit', id=c.group.name) }}{% endblock %} + +{% block page_heading %}{{ _('Create a Joint Analysis') }}{% endblock %} + +{% block page_header %}{% endblock %} + +{% block secondary_content %} + {% snippet "group/snippets/helper.html" %} +{% endblock %} diff --git a/ckanext/knowledgehub/templates/group/new_group_form.html b/ckanext/knowledgehub/templates/group/new_group_form.html new file mode 100644 index 00000000..3018ea43 --- /dev/null +++ b/ckanext/knowledgehub/templates/group/new_group_form.html @@ -0,0 +1,25 @@ +{% extends "group/snippets/group_form.html" %} + +{# +As the form is rendered as a seperate page we take advantage of this by +overriding the form blocks depending on the current context +#} +{% block dataset_fields %} + {% if action == "edit" %}{{ super() }}{% endif %} +{% endblock %} + +{% block custom_fields %} + {% if action == "edit" %}{{ super() }}{% endif %} +{% endblock %} + +{% block save_text %} + {%- if action == "edit" -%} + {{ _('Update Joint Analysis') }} + {%- else -%} + {{ _('Create Joint Analysis') }} + {%- endif -%} +{% endblock %} + +{% block delete_button %} + {% if action == "edit" %}{{ super() }}{% endif %} +{% endblock %} diff --git a/ckanext/knowledgehub/templates/group/snippets/group_form.html b/ckanext/knowledgehub/templates/group/snippets/group_form.html new file mode 100644 index 00000000..ae24c87b --- /dev/null +++ b/ckanext/knowledgehub/templates/group/snippets/group_form.html @@ -0,0 +1,42 @@ +{% import 'macros/form.html' as form %} + + diff --git a/ckanext/knowledgehub/templates/group/snippets/helper.html b/ckanext/knowledgehub/templates/group/snippets/helper.html new file mode 100644 index 00000000..f8c2a319 --- /dev/null +++ b/ckanext/knowledgehub/templates/group/snippets/helper.html @@ -0,0 +1,16 @@ ++ {% trans %} + You can use joint analysis to create and manage collections of datasets. + This could be to catalogue datasets for a particular project or team, + or on a particular theme, or as a very simple way to help people find + and search your own published datasets. + {% endtrans %} +
+