Skip to content
Snippets Groups Projects
Commit baa09e18 authored by Benjamin Becker's avatar Benjamin Becker
Browse files

adds basic list of collection members

parent d58d5cab
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@ class CollectionsPlugin(plugins.SingletonPlugin, DefaultDatasetForm):
plugins.implements(plugins.IDatasetForm, inherit=True)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.ITemplateHelpers)
plugins.implements(plugins.IConfigurer)
# IDataSetForm
......@@ -59,13 +58,7 @@ class CollectionsPlugin(plugins.SingletonPlugin, DefaultDatasetForm):
return {
'get_collection': collection_helpers.get_collection,
'get_collection_info': collection_helpers.get_collection_info,
'url_from_id': collection_helpers.url_from_id,
}
\ No newline at end of file
# IConfigurer
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
# 'templates' is the path to the templates dir, relative to this
# plugin.py file.
toolkit.add_template_directory(config, 'templates_collections')
......@@ -2787,3 +2787,7 @@ body.filters-modal div.row > aside.secondary.span3 {
margin-right: 6px;
}
}
.tpsh-collection-list {
list-style-type: none;
}
Test
\ No newline at end of file
{% extends "package/read.html" %}
{% block package_resources %}
{% endblock package_resources %}
{% block collection %}
{% set collection_id = pkg.get('id') %}
{% set collection = h.get_collection_info(collection_id) %}
{% set collection_title = collection['title'] if collection else None %}
{% if collection['members'] %}
<p>
Dies ist die Übersichtsseite der Dokumentensammlung {{ collection_title }}.
Sie enthält folgende Dokumente (neuere Dokumente zuerst):
</p>
<ul>
{% for m in collection['members'] | reverse() %}
<li class="tpsh-collection-list">
<a href= {{ h.url_from_id(m['id']) }}>
{{ m['title'] }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock collection %}
......@@ -23,7 +23,7 @@
<li>{% link_for _('Documents'), controller='package', action='search' %}</li>
<li class="active"><a href="">{{ _('Create Dataset') }}</a></li>
{% endif %}
{% endblock %}
{% endblock breadcrumb_content %}
{% block primary_content_inner %}
{{ super() }}
......@@ -38,7 +38,7 @@
{% if pkg.state == 'deleted' %}
[{{ _('Deleted') }}]
{% endif %}
{% endblock %}
{% endblock page_heading%}
<div class="odsh-dataset-edit-button">
{% if h.check_access('package_update', {'id':pkg.id }) %}
<div>
......@@ -78,7 +78,7 @@
{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% endblock %}
{% endblock package_resources %}
{% block thumbnail %}
{% set thumbnail = pkg.get('thumbnail') %}
......@@ -146,5 +146,5 @@
{% endfor %}
</div>
{% endblock %}
{% endblock primary_content_inner %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment