{{ _('There is no description for this group') }}
{% endif %} {% endblock %} diff --git a/ckan/templates/group/activity_stream.html b/ckan/templates/group/activity_stream.html index 800ed24db9b..47a6d029bb4 100644 --- a/ckan/templates/group/activity_stream.html +++ b/ckan/templates/group/activity_stream.html @@ -1,6 +1,6 @@ {% extends "group/read_base.html" %} -{% block subtitle %}{{ _('Activity Stream') }} - {{ c.group_dict.title or c.group_dict.name }}{% endblock %} +{% block subtitle %}{{ _('Activity Stream') }} - {{ super() }}{% endblock %} {% block primary_content_inner %}{{ _('There are currently no groups for this site') }}. diff --git a/ckan/templates/group/member_new.html b/ckan/templates/group/member_new.html index 6a8fa691c29..f7b24c236fe 100644 --- a/ckan/templates/group/member_new.html +++ b/ckan/templates/group/member_new.html @@ -50,29 +50,18 @@
Admin: Can add/edit and delete datasets, as well as - manage group members.
-Editor: Can add and edit datasets, but not manage - group members.
-Member: Can view the group's private - datasets, but not add new datasets.
+Admin: Can edit group information, as well as + manage organization members.
+Member: Can add/remove datasets from groups
{% endtrans %}
-
-
diff --git a/ckan/templates/organization/members.html b/ckan/templates/organization/members.html
index c5dcd0ebdae..6e3f4446b9f 100644
--- a/ckan/templates/organization/members.html
+++ b/ckan/templates/organization/members.html
@@ -1,6 +1,6 @@
{% extends "organization/edit_base.html" %}
-{% block subtitle %}{{ _('Members') }} - {{ c.group_dict.display_name }}{% endblock %}
+{% block subtitle %}{{ _('Members') }} - {{ super() }}{% endblock %}
{% block page_primary_action %}
{% link_for _('Add Member'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
diff --git a/ckan/templates/organization/read.html b/ckan/templates/organization/read.html
index a702541fd66..e2a6a04b090 100644
--- a/ckan/templates/organization/read.html
+++ b/ckan/templates/organization/read.html
@@ -1,7 +1,7 @@
{% extends "organization/read_base.html" %}
{% block page_primary_action %}
- {% if h.check_access('package_create', {'organization_id': c.group_dict.id}) %}
+ {% if h.check_access('package_create', {'owner_org': c.group_dict.id}) %}
{% link_for _('Add Dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
{% endif %}
{% endblock %}
@@ -15,7 +15,14 @@
'translated_fields': c.translated_fields,
'remove_field': c.remove_field }
%}
- {% snippet 'snippets/search_form.html', type='dataset', query=c.q, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, placeholder=_('Search datasets...'), show_empty=request.params %}
+ {% set sorting = [
+ (_('Relevance'), 'score desc, metadata_modified desc'),
+ (_('Name Ascending'), 'title_string asc'),
+ (_('Name Descending'), 'title_string desc'),
+ (_('Last Modified'), 'metadata_modified desc'),
+ (_('Popular'), 'views_recent desc') if g.tracking_enabled else (false, false) ]
+ %}
+ {% snippet 'snippets/search_form.html', type='dataset', query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, placeholder=_('Search datasets...'), show_empty=request.params %}
{% endblock %}
{% block packages_list %}
{% if c.page.items %}
diff --git a/ckan/templates/organization/read_base.html b/ckan/templates/organization/read_base.html
index d5a0f8120d5..1c9454f4729 100644
--- a/ckan/templates/organization/read_base.html
+++ b/ckan/templates/organization/read_base.html
@@ -1,6 +1,6 @@
{% extends "page.html" %}
-{% block subtitle %}{{ c.group_dict.display_name }}{% endblock %}
+{% block subtitle %}{{ c.group_dict.display_name }} - {{ _('Organizations') }}{% endblock %}
{% block breadcrumb_content %}
{% if notes %}{{ notes|urlize }} - {% else %} -{{ _("This dataset has no description") }} {% endif %} diff --git a/ckan/templates/organization/edit.html b/ckan/templates/organization/edit.html index 06f7c7ee8ed..3fde80a2ab0 100644 --- a/ckan/templates/organization/edit.html +++ b/ckan/templates/organization/edit.html @@ -1,6 +1,6 @@ {% extends "organization/base_form_page.html" %} -{% block subtitle %}{{ _('Edit Organization') }}{% endblock %} +{% block subtitle %}{{ _('Edit') }} - {{ super() }}{% endblock %} {% block page_heading_class %}hide-heading{% endblock %} {% block page_heading %}{{ _('Edit Organization') }}{% endblock %} diff --git a/ckan/templates/organization/edit_base.html b/ckan/templates/organization/edit_base.html index 6f29a82b1f8..daaeef556e5 100644 --- a/ckan/templates/organization/edit_base.html +++ b/ckan/templates/organization/edit_base.html @@ -2,21 +2,20 @@ {% set organization = c.group_dict %} -{% block subtitle %}{{ organization.display_name }}{% endblock %} +{% block subtitle %}{{ c.group_dict.display_name }} - {{ _('Organizations') }}{% endblock %} {% block breadcrumb_content %}{% block page_heading %}{{ _('Organizations') }}{% endblock %}{% block organizations_search_form %} - {% snippet 'snippets/search_form.html', type='organization', query=c.q, sorting_selected=c.sort_by_selected, count=c.page.item_count, placeholder=_('Search organizations...'), show_empty=request.params %} + {% snippet 'snippets/search_form.html', type='organization', query=c.q, sorting_selected=c.sort_by_selected, count=c.page.item_count, placeholder=_('Search organizations...'), show_empty=request.params, no_bottom_border=true if c.page.items %} {% endblock %} {% block organizations_list %} {% if c.page.items or request.params %} - {% snippet "organization/snippets/organization_list.html", organizations=c.page.items %} + {% if c.page.items %} + {% snippet "organization/snippets/organization_list.html", organizations=c.page.items %} + {% endif %} {% else %}{{ _('There are currently no organizations for this site') }}. diff --git a/ckan/templates/organization/member_new.html b/ckan/templates/organization/member_new.html index a121549dab4..cc4ac8c7dd4 100644 --- a/ckan/templates/organization/member_new.html +++ b/ckan/templates/organization/member_new.html @@ -4,7 +4,7 @@ {% set user = c.user_dict %} -{% block subtitle %}{{ _('Members') }} - {{ c.group_dict.display_name }}{% endblock %} +{% block subtitle %}{{ _('Edit Member') if user else _('Add Member') }} - {{ super() }}{% endblock %} {% block primary_content_inner %} {% link_for _('Back to all members'), controller='organization', action='members', id=organization.name, class_='btn pull-right', icon='arrow-left' %} @@ -55,11 +55,11 @@
{% set locale = h.dump_json({'content': _('Are you sure you want to delete this member?')}) %}
{{ _('Delete') }}
|
---|
{{ item.message | urlize }}
-
+
{{ h.time_ago_from_timestamp(item.timestamp) }}
- more info
+ {{ _('Details') }}
{{ _('There is no description for this resource') }}
{% endif %} {% if not res.description and c.package.notes %}{{ _('There is no description for this dataset') }}
{% endif %}{% if res.description %} {{ h.markdown_extract(res.description, extract_length=80) }} - {% else %} - {{ _('No description for this resource') }} {% endif %}
{% block resource_item_explore %} diff --git a/ckan/templates/related/snippets/related_item.html b/ckan/templates/related/snippets/related_item.html index 39231a7a217..2053f7c0406 100644 --- a/ckan/templates/related/snippets/related_item.html +++ b/ckan/templates/related/snippets/related_item.html @@ -11,16 +11,14 @@ #} {% set placeholder_map = { -'application':'/base/images/placeholder-application.png' +'application': h.url_for_static('/base/images/placeholder-application.png') } %} {% set tooltip = _('Go to {related_item_type}').format(related_item_type=related.type|replace('_', ' ')|title) %}{% trans %}Then sign right up, it only takes a minute.{% endtrans %}
- -{% trans %}Then sign right up, it only takes a minute.{% endtrans %}
+ +The title of this site is: {{ app_globals.site_title }}.
+{# End example #} + +{# Jinja for-loop example #} +The currently enabled plugins are:
+CKAN's page-view tracking feature is enabled.
+{% else %} +CKAN's page-view tracking feature is not enabled.
+{% endif %} +{# End example #} + +{# Jinja comment example #} +{# This text will not appear in the output when this template is rendered. #} +{# End example #} diff --git a/ckanext/example_theme/v04_ckan_extends/__init__.py b/ckanext/example_theme/v04_ckan_extends/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ckanext/example_theme/v04_ckan_extends/plugin.py b/ckanext/example_theme/v04_ckan_extends/plugin.py new file mode 120000 index 00000000000..03c7748d253 --- /dev/null +++ b/ckanext/example_theme/v04_ckan_extends/plugin.py @@ -0,0 +1 @@ +../v03_jinja/plugin.py \ No newline at end of file diff --git a/ckanext/example_theme/v04_ckan_extends/templates/home/index.html b/ckanext/example_theme/v04_ckan_extends/templates/home/index.html new file mode 100644 index 00000000000..c58cded7bfa --- /dev/null +++ b/ckanext/example_theme/v04_ckan_extends/templates/home/index.html @@ -0,0 +1 @@ +{% ckan_extends %} diff --git a/ckanext/example_theme/v05_block/__init__.py b/ckanext/example_theme/v05_block/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ckanext/example_theme/v05_block/plugin.py b/ckanext/example_theme/v05_block/plugin.py new file mode 120000 index 00000000000..8fd4d455da5 --- /dev/null +++ b/ckanext/example_theme/v05_block/plugin.py @@ -0,0 +1 @@ +../v04_ckan_extends/plugin.py \ No newline at end of file diff --git a/ckanext/example_theme/v05_block/templates/home/layout1.html b/ckanext/example_theme/v05_block/templates/home/layout1.html new file mode 100644 index 00000000000..0d30ad905df --- /dev/null +++ b/ckanext/example_theme/v05_block/templates/home/layout1.html @@ -0,0 +1,5 @@ +{% ckan_extends %} + +{% block featured_group %} + Hello block world! +{% endblock %} diff --git a/ckanext/example_theme/v06_super/__init__.py b/ckanext/example_theme/v06_super/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ckanext/example_theme/v06_super/plugin.py b/ckanext/example_theme/v06_super/plugin.py new file mode 120000 index 00000000000..2a362269bdb --- /dev/null +++ b/ckanext/example_theme/v06_super/plugin.py @@ -0,0 +1 @@ +../v05_block/plugin.py \ No newline at end of file diff --git a/ckanext/example_theme/v06_super/templates/home/layout1.html b/ckanext/example_theme/v06_super/templates/home/layout1.html new file mode 100644 index 00000000000..8661e1fb28c --- /dev/null +++ b/ckanext/example_theme/v06_super/templates/home/layout1.html @@ -0,0 +1,14 @@ +{% ckan_extends %} + +{% block featured_group %} + +This paragraph will be added to the top of the
+ featured_group
block.
This paragraph will be added to the bottom of the
+ featured_group
block.
+ {{ h.markdown_extract(group.description, extract_length=80) }} +
+ {% else %} +{{ _('This group has no description') }}
+ {% endif %} + {% if group.packages %} + {{ ungettext('{num} Dataset', '{num} Datasets', group.packages).format(num=group.packages) }} + {% else %} + {{ _('0 Datasets') }} + {% endif %} ++ {{ h.markdown_extract(group.description, extract_length=80) }} +
+ {% else %} +{{ _('This group has no description') }}
+ {% endif %} + {% if group.packages %} + {{ ungettext('{num} Dataset', '{num} Datasets', group.packages).format(num=group.packages) }} + {% else %} + {{ _('0 Datasets') }} + {% endif %} +