diff --git a/ckan/public/base/less/homepage.less b/ckan/public/base/less/homepage.less
index 0aaa8a839ab..02574845817 100644
--- a/ckan/public/base/less/homepage.less
+++ b/ckan/public/base/less/homepage.less
@@ -1,26 +1,24 @@
-.hero {
- background: url("@{imagePath}/background-tile.png");
- padding: 20px 0;
- min-height: 0;
- > .container {
- position: relative;
- padding-bottom: 0;
- }
- .search-giant {
- margin-bottom: 10px;
- input {
- border-color: darken(@mastheadBackgroundColorEnd, 5);
- }
+.homepage {
+
+ [role=main] {
+ padding: 20px 0;
}
- .page-heading {
- font-size: 18px;
- margin-bottom: 0;
+
+ .row {
+ position: relative;
}
- .module-dark {
+
+ .module-search {
padding: 5px;
margin-bottom: 0;
color: @mastheadTextColor;
background: @layoutTrimBackgroundColor;
+ .search-giant {
+ margin-bottom: 10px;
+ input {
+ border-color: darken(@mastheadBackgroundColorEnd, 5);
+ }
+ }
.module-content {
.border-radius(3px 3px 0 0);
background-color: @mastheadBackgroundColor;
@@ -32,66 +30,38 @@
line-height: 40px;
}
}
- }
- .tags {
- .clearfix();
- padding: 5px 10px 10px 10px;
- background-color: darken(@mastheadBackgroundColor, 10%);
- .border-radius(0 0 3px 3px);
- h3,
- .tag {
- display: block;
- float: left;
- margin: 5px 10px 0 0;
- }
- h3 {
- font-size: @baseFontSize;
- line-height: @baseLineHeight;
- padding: 2px 8px;
+ .tags {
+ .clearfix();
+ padding: 5px 10px 10px 10px;
+ background-color: darken(@mastheadBackgroundColor, 10%);
+ .border-radius(0 0 3px 3px);
+ h3,
+ .tag {
+ display: block;
+ float: left;
+ margin: 5px 10px 0 0;
+ }
+ h3 {
+ font-size: @baseFontSize;
+ line-height: @baseLineHeight;
+ padding: 2px 8px;
+ }
}
}
-}
-.hero-primary,
-.hero-secondary {
- .makeColumn(6);
-}
-
-.hero-primary {
- margin-left: 0; // Remove grid margin.
- margin-bottom: 0;
-}
+ .group-list {
+ margin: 0;
+ }
-.hero-secondary {
- position: absolute;
- bottom: 0;
- right: 0;
- .hero-secondary-inner {
+ .slot2 {
+ position: absolute;
bottom: 0;
- left: 0;
right: 0;
- }
-}
-
-.main.homepage {
- padding-top: 20px;
- padding-bottom: 20px;
- border-top: 1px solid @layoutTrimBorderColor;
- .module-heading .media-image {
- margin-right: 15px;
- max-height: 53px;
- .box-shadow(0 0 0 2px rgba(255, 255, 255, 0.5));
- }
- .group-listing .box {
- min-height: 275px;
- }
- .group-list {
- margin-bottom: 0;
- .dataset-content {
- min-height: 70px;
+ .module-search {
+ bottom: 0;
+ left: 0;
+ right: 0;
}
}
- .box .module {
- margin-top: 0;
- }
+
}
diff --git a/ckan/templates/home/index.html b/ckan/templates/home/index.html
index 2508f8b8508..ee1d1f4c8ae 100644
--- a/ckan/templates/home/index.html
+++ b/ckan/templates/home/index.html
@@ -3,98 +3,13 @@
{% block subtitle %}{{ _("Welcome") }}{% endblock %}
{% block maintag %}{% endblock %}
+{% block toolbar %}{% endblock %}
{% block content %}
-
+
- {{ self.secondary_content() }}
-
-
-{% endblock %}
-
-{% block primary_content %}
-
-
-
- {% block home_secondary_content %}
-
- {% block home_search %}
-
- {% endblock %}
- {% block home_tags %}
-
- {% endblock %}
-
- {% endblock %}
+ {{ self.flash() }}
+ {% block primary_content %}{% endblock %}
{% endblock %}
-
-{% block secondary_content %}
-
- {% for group in c.group_package_stuff %}
-
-
- {% snippet 'snippets/group_item.html', group=group.group_dict, truncate=50, truncate_title=35 %}
-
-
- {% endfor %}
-
-{% endblock %}
-
-{# Remove the toolbar. #}
-
-{% block toolbar %}{% endblock %}
diff --git a/ckanext/homepage/__init__.py b/ckanext/homepage/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/ckanext/homepage/plugin.py b/ckanext/homepage/plugin.py
new file mode 100644
index 00000000000..ef429f0457d
--- /dev/null
+++ b/ckanext/homepage/plugin.py
@@ -0,0 +1,24 @@
+import logging
+
+import ckan.plugins as p
+
+log = logging.getLogger(__name__)
+
+class HomepagePlugin(p.SingletonPlugin):
+ p.implements(p.IConfigurer, inherit=True)
+ p.implements(p.IConfigurable, inherit=True)
+
+ def update_config(self, config):
+ p.toolkit.add_template_directory(config, 'theme/templates')
+
+ def get_featured_organization(self):
+ return
+
+ def get_featured_group(self):
+ return
+
+ def get_helpers(self):
+ return {
+ 'get_featured_organization': self.get_featured_organization,
+ 'get_featured_group': self.get_featured_group,
+ }
diff --git a/ckanext/homepage/theme/templates/home/index.html b/ckanext/homepage/theme/templates/home/index.html
new file mode 100644
index 00000000000..0a9d0de727b
--- /dev/null
+++ b/ckanext/homepage/theme/templates/home/index.html
@@ -0,0 +1,36 @@
+{% ckan_extends %}
+
+{% block primary_content %}
+
+
+
+
{{ self.homepage_slot_1() }}
+
{{ self.homepage_slot_2() }}
+
+
+
+
+
+
+
{{ self.homepage_slot_3() }}
+
{{ self.homepage_slot_4() }}
+
+
+
+{% endblock %}
+
+{% block homepage_slot_1 %}
+ {% snippet 'home/snippets/promoted.html', intro=g.site_intro_text %}
+{% 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') %}
+{% endblock %}
+
+{% block homepage_slot_3 %}
+ {% snippet 'home/snippets/featured_group.html', group=h.get_featured_group() %}
+{% endblock %}
+
+{% block homepage_slot_4 %}
+ {% snippet 'home/snippets/featured_organization.html', organization=h.get_featured_organization() %}
+{% endblock %}
diff --git a/ckanext/homepage/theme/templates/home/snippets/featured_group.html b/ckanext/homepage/theme/templates/home/snippets/featured_group.html
new file mode 100644
index 00000000000..bdd20fafdbe
--- /dev/null
+++ b/ckanext/homepage/theme/templates/home/snippets/featured_group.html
@@ -0,0 +1,3 @@
+
+ {% snippet 'snippets/group_item.html', group=group, truncate=50, truncate_title=35 %}
+
diff --git a/ckanext/homepage/theme/templates/home/snippets/featured_organization.html b/ckanext/homepage/theme/templates/home/snippets/featured_organization.html
new file mode 100644
index 00000000000..760f8b5e479
--- /dev/null
+++ b/ckanext/homepage/theme/templates/home/snippets/featured_organization.html
@@ -0,0 +1,3 @@
+
+ {% snippet 'snippets/organization_item.html', organization=organization, truncate=50, truncate_title=35 %}
+
diff --git a/ckanext/homepage/theme/templates/home/snippets/promoted.html b/ckanext/homepage/theme/templates/home/snippets/promoted.html
new file mode 100644
index 00000000000..287083a51b0
--- /dev/null
+++ b/ckanext/homepage/theme/templates/home/snippets/promoted.html
@@ -0,0 +1,20 @@
+
diff --git a/ckanext/homepage/theme/templates/home/snippets/search.html b/ckanext/homepage/theme/templates/home/snippets/search.html
new file mode 100644
index 00000000000..586ae5dba6a
--- /dev/null
+++ b/ckanext/homepage/theme/templates/home/snippets/search.html
@@ -0,0 +1,18 @@
+
diff --git a/setup.py b/setup.py
index f4e97942047..958db3cf788 100644
--- a/setup.py
+++ b/setup.py
@@ -173,6 +173,7 @@
[ckan.system_plugins]
domain_object_mods = ckan.model.modification:DomainObjectModificationExtension
+ homepage = ckanext.homepage.plugin:HomepagePlugin
[ckan.test_plugins]
routes_plugin=tests.ckantestplugins:RoutesPlugin