Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#847] Update custom snippet example
- Loading branch information
Sean Hammond
committed
Nov 27, 2013
1 parent
9a0b71b
commit cacb133
Showing
6 changed files
with
153 additions
and
70 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
Empty file.
6 changes: 3 additions & 3 deletions
6
..._custom_snippet/templates/home/index.html → ...ustom_snippet/templates/home/layout1.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{% ckan_extends %} | ||
|
||
{% block secondary_content %} | ||
|
||
{% block featured_group %} | ||
{{ h.recently_changed_packages_activity_stream() }} | ||
{% endblock %} | ||
|
||
{% block featured_organization %} | ||
{% snippet 'snippets/example_theme_most_popular_groups.html' %} | ||
|
||
{% endblock %} |
33 changes: 22 additions & 11 deletions
33
...xample_theme/v10_custom_snippet/templates/snippets/example_theme_most_popular_groups.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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
{# Renders a list of the site's most popular groups. #} | ||
|
||
<div class="box"> | ||
<section class="module"> | ||
<header class="module-heading"> | ||
<h3>Most popular groups</h3> | ||
</header> | ||
<div class="module-content"> | ||
{% snippet 'group/snippets/group_list.html', | ||
groups=h.example_theme_most_popular_groups() %} | ||
</div> | ||
</section> | ||
</div> | ||
<h3>Most popular groups</h3> | ||
<ul> | ||
{% for group in h.example_theme_most_popular_groups() %} | ||
<li> | ||
<a href="{{ h.url_for('group_read', action='read', id=group.name) }}"> | ||
<h3>{{ group.display_name }}</h3> | ||
</a> | ||
{% if group.description %} | ||
<p> | ||
{{ h.markdown_extract(group.description, extract_length=80) }} | ||
</p> | ||
{% else %} | ||
<p class="empty">{{ _('This group has no description') }}</p> | ||
{% endif %} | ||
{% if group.packages %} | ||
<strong class="count">{{ ungettext('{num} Dataset', '{num} Datasets', group.packages).format(num=group.packages) }}</strong> | ||
{% else %} | ||
<span class="count">{{ _('0 Datasets') }}</span> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> |
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