Skip to content

Commit

Permalink
[#688] Lot's of more blocks for the package templates
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Mar 26, 2013
1 parent eb0d04b commit cbc72c9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/templates/package/confirm_delete.html
Expand Up @@ -7,13 +7,15 @@
{% block main_content %}
<section class="module span6 offset3">
<div class="module-content">
{% block form %}
<p>{{ _('Are you sure you want to delete dataset - {name}?').format(name=c.pkg_dict.name) }}</p>
<p class="form-actions">
<form action="{% url_for controller='package', action='delete', id=c.pkg_dict.name %}" method="post">
<button class="btn" type="submit" name="cancel" >{{ _('Cancel') }}</button>
<button class="btn btn-primary" type="submit" name="delete" >{{ _('Confirm Delete') }}</button>
</form>
</p>
{% endblock %}
</div>
</section>
{% endblock %}
2 changes: 2 additions & 0 deletions ckan/templates/package/confirm_delete_resource.html
Expand Up @@ -7,13 +7,15 @@
{% block main_content %}
<section class="module span6 offset3">
<div class="module-content">
{% block form %}
<p>{{ _('Are you sure you want to delete resource - {name}?').format(name=h.resource_display_name(c.resource_dict)) }}</p>
<p class="form-actions">
<form action="{% url_for controller='package', action='resource_delete', resource_id=c.resource_dict.id, id=c.pkg_id %}" method="post">
<button class="btn" type="submit" name="cancel" >{{ _('Cancel') }}</button>
<button class="btn btn-primary" type="submit" name="delete" >{{ _('Confirm Delete') }}</button>
</form>
</p>
{% endblock %}
</div>
</section>
{% endblock %}
4 changes: 4 additions & 0 deletions ckan/templates/package/read.html
Expand Up @@ -15,16 +15,20 @@
</span>
{% endif %}
<h1>
{% block page_heading %}
{{ pkg.title or pkg.name }}
{% if pkg.state.startswith('draft') %}
[{{ _('Draft') }}]
{% endif %}
{% endblock %}
</h1>
{% block package_notes %}
{% if c.pkg_notes_formatted %}
<div class="notes embedded-content">
{{ c.pkg_notes_formatted }}
</div>
{% endif %}
{% endblock %}
{# FIXME why is this here? seems wrong #}
<span class="insert-comment-thread"></span>
</section>
Expand Down
2 changes: 2 additions & 0 deletions ckan/templates/package/resource_read.html
Expand Up @@ -16,6 +16,7 @@
<section class="module module-resource">
<div class="module-content">
<div class="actions">
{% block resource_actions %}
<ul>
{% if h.check_access('package_update', {'id':pkg.id }) %}
<li>{% link_for _('Edit'), controller='package', action='resource_edit', id=pkg.name, resource_id=res.id, class_='btn', icon='wrench' %}</li>
Expand All @@ -36,6 +37,7 @@
{% if 'datastore' in g.plugins %}
<li>{% snippet 'package/snippets/data_api_button.html', resource=res, datastore_root_url=c.datastore_api %}</li>
{% endif %}
{% endblock %}
</ul>
</div>
{% block resource_content %}
Expand Down
20 changes: 20 additions & 0 deletions ckan/templates/package/search.html
Expand Up @@ -16,27 +16,39 @@
{% block primary_content %}
<section class="module">
<div class="module-content">
{% block form %}
<form id="dataset-search" class="dataset-search clearfix" method="get" data-module="select-switch">
{% block search_input %}
<span class="control-group search-giant">
<input type="text" class="search" name="q" value="{{ c.q }}" autocomplete="off" placeholder="{{ _('Search...') }}" />
<button type="submit" value="search">{{ _('Submit') }}</button>
</span>
{% endblock %}

{% block package_sortby %}
{{ h.snippet('snippets/sort_by.html', sort=c.sort_by_selected) }}
{% endblock %}

{% block package_search_fields %}
{% if c.fields -%}
<span>
{{ form.hidden_from_list(fields=c.fields) }}
</span>
{%- endif %}
{% endblock %}

<div id="dataset-search-ext">{% block dataset_search_ext %}{% endblock %}</div>
</form>
{% endblock %}
{% block package_search_results %}
<div class="results">
<strong>
{% block package_search_results_text %}
{% snippet 'snippets/search_result_text.html', query=c.q, count=c.page.item_count, type='dataset' %}
{% endblock %}
</strong>
<div class="filter-list">
{% block package_search_results_filter_list %}
{% for field in c.fields_grouped %}
{% set search_facets_items = c.search_facets.get(field)['items'] %}
<span class="facet">{{ c.facet_titles.get(field) }}:</span>
Expand All @@ -52,6 +64,7 @@
</span>
{% endfor %}
{% endfor %}
{% endblock %}
</div>
{% if request.params and c.page.item_count == 0 %}
{% trans %}
Expand All @@ -65,12 +78,18 @@
<p><strong>There was an error while searching.</strong> Please try again.</p>
{% endtrans %}
{% endif %}
{% block package_search_results_list %}
{{ h.snippet('snippets/package_list.html', packages=c.page.items) }}
{% endblock %}
{% endblock %}
</div>

{% block page_pagination %}
{{ c.page.pager(q=c.q) }}
{% endblock %}
</section>

{% block package_search_results_api %}
<section class="module">
<div class="module-content">
<small>
Expand All @@ -89,6 +108,7 @@
</small>
</div>
</section>
{% endblock %}
{% endblock %}

{% block secondary_content %}
Expand Down

0 comments on commit cbc72c9

Please sign in to comment.