Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1126] Simplified snippets and added temporary homepage layour variable
- Loading branch information
1 parent
7910f78
commit a957533
Showing
7 changed files
with
45 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,52 @@ | ||
{% ckan_extends %} | ||
|
||
{% set homepage_layout = 1 %} | ||
|
||
{% block homepage_layout_class %} homepage-{{ homepage_layout }}{% endblock %} | ||
|
||
{% block primary_content %} | ||
<div role="main" class="hero"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="span6 slot1">{{ self.homepage_slot_1() }}</div> | ||
<div class="span6 slot2">{{ self.homepage_slot_2() }}</div> | ||
<div class="row row1"> | ||
<div class="span6 col1">{{ self.row1_col1() }}</div> | ||
<div class="span6 col2">{{ self.row1_col2() }}</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div role="main"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="span6 slot3">{{ self.homepage_slot_3() }}</div> | ||
<div class="span6 slot4">{{ self.homepage_slot_4() }}</div> | ||
<div class="row row2"> | ||
<div class="span6 col1">{{ self.row2_col1() }}</div> | ||
<div class="span6 col2">{{ self.row2_col2() }}</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block homepage_slot_1 %} | ||
{% snippet 'home/snippets/promoted.html', intro=g.site_intro_text %} | ||
{% block row1_col1 %} | ||
{% if homepage_layout == 1 %} | ||
{% snippet 'home/snippets/promoted.html' %} | ||
{% elif homepage_layout == 2 %} | ||
{% snippet 'home/snippets/search.html' %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block homepage_slot_2 %} | ||
{% snippet 'home/snippets/search.html', query=c.q, tags=h.get_facet_items_dict('tags', limit=3), placeholder=_('eg. Gold Prices') %} | ||
{% block row1_col2 %} | ||
{% if homepage_layout == 1 %} | ||
{% snippet 'home/snippets/search.html' %} | ||
{% elif homepage_layout == 2 %} | ||
{% snippet 'home/snippets/featured_dataset.html' %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block homepage_slot_3 %} | ||
{% snippet 'home/snippets/featured_group.html', group=h.get_featured_group() %} | ||
{% block row2_col1 %} | ||
{% if homepage_layout == 1 %} | ||
{% snippet 'home/snippets/featured_group.html' %} | ||
{% elif homepage_layout == 2 %} | ||
{% snippet 'home/snippets/stats.html' %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block homepage_slot_4 %} | ||
{% snippet 'home/snippets/featured_organization.html', organization=h.get_featured_organization() %} | ||
{% block row2_col2 %} | ||
{% snippet 'home/snippets/featured_organization.html' %} | ||
{% endblock %} |
2 changes: 2 additions & 0 deletions
2
ckanext/homepage/theme/templates/home/snippets/featured_group.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,3 +1,5 @@ | ||
{% set group = h.get_featured_group() %} | ||
|
||
<div class="box"> | ||
{% snippet 'snippets/group_item.html', group=group, truncate=50, truncate_title=35 %} | ||
</div> |
2 changes: 2 additions & 0 deletions
2
ckanext/homepage/theme/templates/home/snippets/featured_organization.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,3 +1,5 @@ | ||
{% set organization = h.get_featured_organization() %} | ||
|
||
<div class="box"> | ||
{% snippet 'snippets/organization_item.html', organization=organization, truncate=50, truncate_title=35 %} | ||
</div> |
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,3 +1,5 @@ | ||
{% set intro = g.site_intro_text %} | ||
|
||
<div class="module-content box"> | ||
<header> | ||
{% if intro %} | ||
|
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