-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement metadata collection list/view UIs
- Loading branch information
1 parent
97bad6e
commit bd06ba6
Showing
12 changed files
with
172 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ckanext/metadata/templates/metadata_collection/snippets/breadcrumb_content_item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<li class="active">{% link_for h.get_translated(c.group_dict, 'title') or c.group_dict.display_name |truncate(35), | ||
controller='ckanext.metadata.controllers.metadata_collection:MetadataCollectionController', | ||
action='read', id=c.group_dict.name, organization_id=c.org_dict.name %}</li> |
4 changes: 4 additions & 0 deletions
4
ckanext/metadata/templates/metadata_collection/snippets/breadcrumb_content_outer.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<li>{% link_for _('Organizations'), controller='organization', action='index' %}</li> | ||
<li>{% link_for c.org_dict.display_name|truncate(35), controller='organization', action='read', id=c.org_dict.name %}</li> | ||
<li>{% link_for _('Metadata Collections'), controller='ckanext.metadata.controllers.metadata_collection:MetadataCollectionController', | ||
action='index', organization_id=c.org_dict.name %}</li> |
4 changes: 4 additions & 0 deletions
4
ckanext/metadata/templates/metadata_collection/snippets/group_action_manage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% if h.check_access('metadata_collection_update', {'id': c.group_dict.id}) %} | ||
{% link_for _('Manage'), controller='ckanext.metadata.controllers.metadata_collection:MetadataCollectionController', | ||
action='edit', id=c.group_dict.name, organization_id=c.org_dict.name, class_='btn', icon='wrench' %} | ||
{% endif %} |
3 changes: 3 additions & 0 deletions
3
ckanext/metadata/templates/metadata_collection/snippets/group_content_nav.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ h.build_nav_icon('metadata_collection_read', _('Datasets'), id=c.group_dict.name, organization_id=c.org_dict.name) }} | ||
{{ h.build_nav_icon('metadata_collection_activity', _('Activity Stream'), id=c.group_dict.name, offset=0, organization_id=c.org_dict.name) }} | ||
{{ h.build_nav_icon('metadata_collection_about', _('About'), id=c.group_dict.name, organization_id=c.org_dict.name) }} |
44 changes: 44 additions & 0 deletions
44
ckanext/metadata/templates/metadata_collection/snippets/group_item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{# | ||
Renders a media item for a metadata collection. This should be used in a list. | ||
Copied from ckan/templates/group/snippets/group_item.html; modified {% set url = ... %}. | ||
|
||
group - A group dict. | ||
organization_id - id/name of the owner org | ||
|
||
#} | ||
{% set url = h.url_for('metadata_collection_read', action='read', id=group.name, organization_id=organization_id) %} | ||
{% block item %} | ||
<li class="media-item"> | ||
{% block item_inner %} | ||
{% block image %} | ||
<img src="{{ group.image_display_url or h.url_for_static('/base/images/placeholder-group.png') }}" alt="{{ group.name }}" class="media-image"> | ||
{% endblock %} | ||
{% block title %} | ||
<h3 class="media-heading">{{ h.get_translated(group, 'title') or group.display_name }}</h3> | ||
{% endblock %} | ||
{% block description %} | ||
{% if h.get_translated(group, 'description') %} | ||
<p>{{ h.markdown_extract(h.get_translated(group, 'description'), extract_length=80) }}</p> | ||
{% endif %} | ||
{% endblock %} | ||
{% block datasets %} | ||
{% if group.package_count %} | ||
<strong class="count">{{ ungettext('{num} Dataset', '{num} Datasets', group.package_count).format(num=group.package_count) }}</strong> | ||
{% elif group.package_count == 0 %} | ||
<span class="count">{{ _('0 Datasets') }}</span> | ||
{% endif %} | ||
{% endblock %} | ||
{% block link %} | ||
<a href="{{ url }}" title="{{ _('View {name}').format(name=h.get_translated(group, 'title') or group.display_name) }}" class="media-view"> | ||
<span>{{ _('View {name}').format(name=h.get_translated(group, 'title') or group.display_name) }}</span> | ||
</a> | ||
{% endblock %} | ||
{% if group.user_member %} | ||
<input name="group_remove.{{ group.id }}" value="{{ _('Remove') }}" type="submit" class="btn btn-danger btn-small media-edit" title="{{ _('Remove dataset from this group') }}"/> | ||
{% endif %} | ||
{% endblock %} | ||
</li> | ||
{% endblock %} | ||
{% if position is divisibleby 3 %} | ||
<li class="clearfix js-hide"></li> | ||
{% endif %} |
7 changes: 7 additions & 0 deletions
7
ckanext/metadata/templates/metadata_collection/snippets/group_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "group/snippets/group_list.html" %} | ||
|
||
{% block group_list_inner %} | ||
{% for group in groups %} | ||
{% snippet "metadata_collection/snippets/group_item.html", group=group, organization_id=organization_id, position=loop.index %} | ||
{% endfor %} | ||
{% endblock %} |