Commit f58a815a authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

initial commit

parent 0787bd66
# ckan theme
# Customized Theme of CKAN Data Catalog of HFT Stuttgart
The extension and files for the customization are structured as follows in the **`ckan`** source code's parent directory:
- ckanext-theme_hft
- ckanext
- theme_hft
- assets
- theme.css
- webassets.yml
- public
- (pictures).jpg/png
- templates
- home
- index.html
- snippets
- promoted.html
- base.html
- header.html
- footer.html
The theme for the Data Catalog of HFT Stuttgart
\ No newline at end of file
### Steps to implement the customized theme
1. Run the following command to create a new extension and place its directory in the **`ckan`** source code's parent directory:
> ckan generate extension
- New extension name: _`ckanext-theme_hft`_
- theme name: _`theme_hft`_
1. Put the files in this repo to the their respective directories.
1. Go to **`ckanext-theme_hft`** directory and run the following command:
> python develop
1. Add the new plugin to the ckan.plugins setting in `/etc/ckan/default/ckan.ini` file:
> ckan.plugins = stats text_view recline_view theme_hft
1. Start CKAN
> ckan -c /etc/ckan/default/ckan.ini run
/* ========================================================================
The main masthead bar that contains the site logo, nav links, and search
======================================================================== */
.masthead {
background-color: #ffffff;
color: black;
.masthead .nav > li > a {
color: black;
text-shadow: none;
/* The "navigation pills" in the masthead (the links to Datasets,
Organizations, etc) when the user's pointer hovers over them. */
.masthead .navigation .nav-pills li a:hover {
background-color: #C14531;
color: black;
/* The "active" navigation pill (for example, when you're on the /dataset page
the "Datasets" link is active). */
.masthead .navigation .nav-pills a {
background-color: #C14531;
/* The "box shadow" effect that appears around the search box when it
has the keyboard cursor's focus. */
.masthead input[type="text"]:focus {
-webkit-box-shadow: inset 0px 0px 2px 0px rgba(0, 0, 0, 0.7);
box-shadow: inset 0px 0px 2px 0px rgba(0, 0, 0, 0.7);
@media (min-width: 768px) {
.hero {
background: url("/header.jpg");
/* ====================================
The footer at the bottom of the site
==================================== */
body {
background-color: #ffffff;
/* The text in the footer. */
.site-footer label,
.site-footer small {
color: rgba(128, 128, 128, 1);
/* The link texts in the footer. */
.site-footer a {
color: rgba(128, 128, 128, 1);
filters: cssrewrite
output: assets/%(version)s_theme.css
contents: theme.css
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
class ThemeHftPlugin(plugins.SingletonPlugin):
# IConfigurer
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public')
toolkit.add_resource('assets', 'theme_hft')
{% ckan_extends %}
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
{% asset 'theme_hft/theme' %}
{% endblock %}
{% ckan_extends %}
{# override footer.html #}
{% block footer_content %}
<div class="row">
<div class="col-md-4 attribution">
<img src="/Innovative_Hochschule_Initiative_BMBF_GWK_RGB.png" height='90'/>
<div class="col-md-2 attribution">
<img src="/M4_LAB_LOGO_Graustufen.png" height='80'/>
<div class="col-md-3 footer-links">
<a href="">
<i class="fa fa-twitter fa-3x"></i>
<a href="">
<i class="fa fa-facebook-square fa-3x"></i>
<a href="">
<i class="fa fa-instagram fa-3x"></i>
<a href="">
<i class="fa fa-linkedin fa-3x"></i>
<a href="">
<i class="fa fa-youtube-play fa-3x"></i>
<div class="col-md-3 footer-links">
<div class="row">
<div class="col">Hochschule für Technik Stuttgart</div>
<div class="row">
<div class="col-md-6">
<a href="">Impressum</a>
<div class="col-md-6">
<a href="">Datenschutz</a>
{% endblock %}
{% ckan_extends %}
{# exclude About #}
{% block header_site_navigation_tabs %}
{{ h.build_nav_main(
('', _('Datasets')),
('organization.index', _('Organizations')),
('group.index', _('Groups')) ) }}
{% endblock %}
{# process the default index.html first #}
{% ckan_extends %}
{% ckan_extends %}
{# remove promoted image #}
{% block home_image %}{% endblock %}
# -*- coding: utf-8 -*-
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, ''), encoding='utf-8') as f:
long_description =
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across and the project code, see
description=''' Customized UI of CKAN of HFT Stuttgart''',
# Choose your license
# See
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2.7',
# What does your project relate to?
keywords='''data catalog''',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
# CKAN extensions should not list dependencies here, but in a separate
# ``requirements.txt`` file.
# add-third-party-libraries-to-requirements-txt
# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
# have to be included in as well.
# Although 'package_data' is the preferred approach, in some case you may
# need to place data files outside of your packages.
# see
# installing-additional-files
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
# To provide executable scripts, use entry points in preference to the
# "scripts" keyword. Entry points provide cross-platform support and allow
# pip to create the appropriate form of executable for the target platform.
ckan = ckan.lib.extract:extract_ckan
# If you are changing from the default layout of your extension, you may
# have to change the message extractors, you can read more about babel
# message extraction at
'ckanext': [
('**.py', 'python', None),
('**.js', 'javascript', None),
('**/templates/**.html', 'ckan', None),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment