diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..4850832c632ba449d65ad2030c1327b03f675929 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,30 @@ +prod: + stage: deploy + script: + - echo "pipeline started" + - cp -r ckanext-theme_hft/* /usr/lib/ckan/default/src/ckanext-theme_hft/ + - source /usr/lib/ckan/default/bin/activate + - cd /usr/lib/ckan/default/src/ckanext-theme_hft + - python setup.py develop + - deactivate + - supervisorctl restart all + tags: + - production + only: + - master + +devel: + stage: deploy + script: + - echo "pipeline started" + - cp -r ckanext-theme_hft/* /usr/lib/ckan/default/src/ckanext-theme_hft/ + - . /usr/lib/ckan/default/bin/activate + - cd /usr/lib/ckan/default/src/ckanext-theme_hft + - python setup.py develop + - deactivate + - supervisorctl restart all + tags: + - testing + only: + - testing + diff --git a/README.md b/README.md index 4639189da5df221a76eeb60af5376444bce56213..7b5d2becb0360757d1f7e6d0b63ade860ad7f283 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ -# 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 + - *.html + - plugin.py + - setup.py -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`_ +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 setup.py 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 diff --git a/ckanext-theme_hft/ckanext/theme_hft/assets/theme.css b/ckanext-theme_hft/ckanext/theme_hft/assets/theme.css new file mode 100644 index 0000000000000000000000000000000000000000..7c476206a0efc69856bfdb71c643d06876c00495 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/assets/theme.css @@ -0,0 +1,54 @@ +/* ======================================================================== + 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 li.active 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("https://m4lab.hft-stuttgart.de/katalog/header.jpg"); + } +} + +/* ==================================== + The footer at the bottom of the site + ==================================== */ + +.site-footer, +body { + background-color: #ffffff; +} +/* The text in the footer. */ +.site-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); +} diff --git a/ckanext-theme_hft/ckanext/theme_hft/assets/webassets.yml b/ckanext-theme_hft/ckanext/theme_hft/assets/webassets.yml new file mode 100644 index 0000000000000000000000000000000000000000..ad0ffa039ddd2d9aca3e1488171f3b9f836cbe44 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/assets/webassets.yml @@ -0,0 +1,3 @@ +theme: + output: theme_hft/theme.css + contents: theme.css diff --git a/ckanext-theme_hft/ckanext/theme_hft/plugin.py b/ckanext-theme_hft/ckanext/theme_hft/plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..db33b6fbe2c6b786e6f8b3f7c4b0583080cce0bb --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/plugin.py @@ -0,0 +1,14 @@ +import ckan.plugins as plugins +import ckan.plugins.toolkit as toolkit + + +class ThemeHftPlugin(plugins.SingletonPlugin): + plugins.implements(plugins.IConfigurer) + + # IConfigurer + + def update_config(self, config): + toolkit.add_template_directory(config, 'templates') + toolkit.add_public_directory(config, 'public') + toolkit.add_resource('assets', 'theme_hft') + diff --git a/ckanext-theme_hft/ckanext/theme_hft/public/header.jpg b/ckanext-theme_hft/ckanext/theme_hft/public/header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b880b3fa9652d3de68a15988cce3063ea176eb63 Binary files /dev/null and b/ckanext-theme_hft/ckanext/theme_hft/public/header.jpg differ diff --git a/ckanext-theme_hft/ckanext/theme_hft/public/logo.png b/ckanext-theme_hft/ckanext/theme_hft/public/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d43b1064e25d4b7454cd4533fd2215f4f0823f12 Binary files /dev/null and b/ckanext-theme_hft/ckanext/theme_hft/public/logo.png differ diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/base.html b/ckanext-theme_hft/ckanext/theme_hft/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..17a85c54e8d89a2d5c776e4718f7a24a27ca72af --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/base.html @@ -0,0 +1,9 @@ +{% ckan_extends %} + +{# Add HFT assets (figures, footer, css, etc.) #} + +{% block styles %} + {{ super() }} + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> + {% asset 'theme_hft/theme' %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/footer.html b/ckanext-theme_hft/ckanext/theme_hft/templates/footer.html new file mode 100644 index 0000000000000000000000000000000000000000..28ba32b674a97f426dee0e2cef2f48f95bec0347 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/footer.html @@ -0,0 +1,44 @@ +{% ckan_extends %} + +{# Override footer.html to put M4_LAB footer #} + +{% block footer_content %} + <div class="row"> + <div class="col-md-4 attribution"> + <img src="https://m4lab.hft-stuttgart.de/img/footer/Innovative_Hochschule_Initiative_BMBF_GWK_RGB.png" height='90'/> + </div> + <div class="col-md-2 attribution"> + <img src="https://m4lab.hft-stuttgart.de/img/footer/M4_LAB_LOGO_Graustufen.png" height='80'/> + </div> + <div class="col-md-3 footer-links"> + <a href="https://twitter.com/InnolabM4"> + <i class="fa fa-twitter fa-3x"></i> + </a> + <a href="https://wwww.facebook.com/HfTStuttgart/"> + <i class="fa fa-facebook-square fa-3x"></i> + </a> + <a href="https://www.instagram.com/m4_lab/"> + <i class="fa fa-instagram fa-3x"></i> + </a> + <a href="https://de.linkedin.com/school/hochschule-f%C3%BCr-technik-stuttgart-%E2%80%93-university-of-applied-sciences/"> + <i class="fa fa-linkedin fa-3x"></i> + </a> + <a href="https://www.youtube.com/channel/UCi0_JfF2qMZbOhOnNH5PyHA"> + <i class="fa fa-youtube-play fa-3x"></i> + </a> + </div> + <div class="col-md-3 footer-links"> + <div class="row"> + <div class="col">Hochschule für Technik Stuttgart</div> + </div> + <div class="row"> + <div class="col-md-6"> + <a href="https://www.hft-stuttgart.de/impressum">Impressum</a> + </div> + <div class="col-md-6"> + <a href="https://www.hft-stuttgart.de/datenschutz">Datenschutz</a> + </div> + </div> + </div> + </div> +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/group/read_base.html b/ckanext-theme_hft/ckanext/theme_hft/templates/group/read_base.html new file mode 100644 index 0000000000000000000000000000000000000000..96d998309b245c66b700a1e98a8bdb47ace9db42 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/group/read_base.html @@ -0,0 +1,7 @@ +{% ckan_extends %} + +{# Remove Activity Stream #} +{% block content_primary_nav %} + {{ h.build_nav_icon(group_type + '.read', _('Datasets'), id=group_dict.name, icon='sitemap') }} + {{ h.build_nav_icon(group_type + '.about', _('About'), id=group_dict.name, icon='info-circle') }} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/header.html b/ckanext-theme_hft/ckanext/theme_hft/templates/header.html new file mode 100644 index 0000000000000000000000000000000000000000..deb2436b073c52af28b7ae04f64c63d31ab2f4d1 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/header.html @@ -0,0 +1,12 @@ +{% ckan_extends %} + +{# Remove access to Profile Setting #} +{% block header_account_settings_link %} +{% endblock %} + +{# Exclude About and Organizations #} +{% block header_site_navigation_tabs %} + {{ h.build_nav_main( + ('dataset.search', _('Datasets')), + ('group.index', _('Groups')) ) }} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/home/layout2.html b/ckanext-theme_hft/ckanext/theme_hft/templates/home/layout2.html new file mode 100644 index 0000000000000000000000000000000000000000..e4352551bdb2d33bf6f47024ea1011e07a4ecf9a --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/home/layout2.html @@ -0,0 +1,6 @@ +{% ckan_extends %} + +{% block featured_group %} + {% snippet 'snippets/most_popular_groups.html', + groups=h.hft_theme_most_popular_groups() %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/promoted.html b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/promoted.html new file mode 100644 index 0000000000000000000000000000000000000000..9166e5c07d2e4fc6ad3911a17b10d4ecc5d9b22e --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/promoted.html @@ -0,0 +1,4 @@ +{% ckan_extends %} + +{# remove promoted image #} +{% block home_image %}{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/search.html b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/search.html new file mode 100644 index 0000000000000000000000000000000000000000..7da0854af1f2f034916ac04f0f827b266fc6f015 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/search.html @@ -0,0 +1,16 @@ +{% set placeholder = _('E.g. environment') %} + +{# Remove tags #} + +<div class="module module-search module-narrow module-shallow box"> + <form class="module-content search-form" method="get" action="{% url_for 'dataset.search' %}"> + <h3 class="heading">{{ _("Search data") }}</h3> + <div class="search-input form-group search-giant"> + <input aria-label="{% block header_site_search_label %}{{ _('Search datasets') }}{% endblock %}" id="field-main-search" type="text" class="form-control" name="q" value="" autocomplete="off" placeholder="{% block search_placeholder %}{{ placeholder }}{% endblock %}" /> + <button type="submit" aria-labelledby="search-label"> + <i class="fa fa-search"></i> + <span class="sr-only" id="search-label">{{ _('Search') }}</span> + </button> + </div> + </form> +</div> diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/stats.html b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/stats.html new file mode 100644 index 0000000000000000000000000000000000000000..02701750945750597e6a56fc788f87ed5a48e18f --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/home/snippets/stats.html @@ -0,0 +1,18 @@ +{% ckan_extends %} + +{# Remove Organization #} + + {% block stats_group %} + <li> + <a href="{{ h.url_for('dataset.search') }}"> + <strong>{{ h.SI_number_span(stats.dataset_count) }}</strong> + {{ _('dataset') if stats.dataset_count == 1 else _('datasets') }} + </a> + </li> + <li> + <a href="{{ h.url_for(controller='group', action='index') }}"> + <strong>{{ h.SI_number_span(stats.group_count) }}</strong> + {{ _('group') if stats.group_count == 1 else _('groups') }} + </a> + </li> + {% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/package/group_list.html b/ckanext-theme_hft/ckanext/theme_hft/templates/package/group_list.html new file mode 100644 index 0000000000000000000000000000000000000000..594e2a1c6434b680201f1249369355ad276bc3ad --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/package/group_list.html @@ -0,0 +1,8 @@ +{% ckan_extends %} + +{% block primary_content_inner %} + {{ super() }} + + {% if (group_dropdown) and (c.userobj) %} + {% endif %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/package/read_base.html b/ckanext-theme_hft/ckanext/theme_hft/templates/package/read_base.html new file mode 100644 index 0000000000000000000000000000000000000000..92e9214b7bf9c2ae4694f006bfd60932fb80c7d0 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/package/read_base.html @@ -0,0 +1,7 @@ +{% ckan_extends %} + +{# Remove Activity Stream #} +{% block content_primary_nav %} + {{ h.build_nav_icon(dataset_type ~ '.read', _('Dataset'), id=pkg.id if is_activity_archive else pkg.name, icon='sitemap') }} + {{ h.build_nav_icon(dataset_type ~ '.groups', _('Groups'), id=pkg.id if is_activity_archive else pkg.name, icon='users') }} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_basic_fields.html b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_basic_fields.html new file mode 100644 index 0000000000000000000000000000000000000000..730df1f37c6ad137fa74ccfb0441d8e98ba1e2f3 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_basic_fields.html @@ -0,0 +1,10 @@ +{% ckan_extends %} + +{# Simplifies the form for adding datasets by removing Tags. Titel field is marked as *Pflichtfeld (mandatory) #} + +{% block package_basic_fields_title %} +{{ form.input('title', id='field-title', label=_('Title'), placeholder=_('eg. A descriptive title'), value=data.title, error=errors.title, classes=['control-full', 'control-large'], attrs={'data-module': 'slug-preview-target', 'class': 'form-control'}, is_required=true) }} +{% endblock %} + +{% block package_basic_fields_tags %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_metadata_fields.html b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_metadata_fields.html new file mode 100644 index 0000000000000000000000000000000000000000..3bf12812f134090020a157875992a5db10a74d66 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/package_metadata_fields.html @@ -0,0 +1,16 @@ +{% ckan_extends %} + +{# Remove Custom Fields and marks Autor, Verantwortlicher, and their emails fields as *Pflichtfeld (mandatory) #} + +{% block package_metadata_author %} + {{ form.input('author', label=_('Author'), id='field-author', placeholder=_('Joe Bloggs'), value=data.author, error=errors.author, classes=['control-medium'], is_required=true) }} + {{ form.input('author_email', label=_('Author Email'), id='field-author-email', placeholder=_('joe@example.com'), value=data.author_email, error=errors.author_email, classes=['control-medium'], is_required=true) }} +{% endblock %} + +{% block package_metadata_fields_maintainer %} + {{ form.input('maintainer', label=_('Maintainer'), id='field-maintainer', placeholder=_('Joe Bloggs'), value=data.maintainer, error=errors.maintainer, classes=['control-medium'], is_required=true) }} + {{ form.input('maintainer_email', label=_('Maintainer Email'), id='field-maintainer-email', placeholder=_('joe@example.com'), value=data.maintainer_email, error=errors.maintainer_email, classes=['control-medium'], is_required=true) }} +{% endblock %} + +{% block package_metadata_fields_custom %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/resource_form.html b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/resource_form.html new file mode 100644 index 0000000000000000000000000000000000000000..a7ef2242f07c950f9eebe4eb548b3c4d196d2f0b --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/package/snippets/resource_form.html @@ -0,0 +1,10 @@ +{% ckan_extends %} + +{# Add a label: maximum data size #} + +{% block basic_fields_url %} + {% set is_upload = (data.url_type == 'upload') %} + {{ form.image_upload(data, errors, field_url='url', field_upload='upload', field_clear='clear_upload', + is_upload_enabled=h.uploads_enabled(), is_url=data.url and not is_upload, is_upload=is_upload, + upload_label=_('Data (max. 150MB)'), url_label=_('URL'), placeholder=_('http://example.com/external-data.csv'), field_name='name') }} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/activity_stream.html b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/activity_stream.html new file mode 100644 index 0000000000000000000000000000000000000000..bf8074eed6fa3379477d4852c0d9d555eb567e27 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/activity_stream.html @@ -0,0 +1,21 @@ +{% ckan_extends %} + +{# Remove all activity records #} + +{% macro actor(activity) %} +{% endmacro %} + +{% macro dataset(activity) %} +{% endmacro %} + +{% macro organization(activity) %} +{% endmacro %} + +{% macro user(activity) %} +{% endmacro %} + +{% macro group(activity) %} +{% endmacro %} + +{% block activity_stream %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/facet_list.html b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/facet_list.html new file mode 100644 index 0000000000000000000000000000000000000000..2aa64969ecff1e93dff0c92aadd1bff6e3fea125 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/facet_list.html @@ -0,0 +1,17 @@ +{% ckan_extends %} +{% block facet_list %} + {# hide empty facet (Organizations and Tags) #} + {% set hide_empty = hide_empty or true %} + {% with items = items or h.get_facet_items_dict(name, search_facets or c.search_facets) %} + {% if items or not hide_empty %} + {% if within_tertiary %} + {% set nav_class = 'nav nav-pills nav-stacked' %} + {% set nav_item_class = ' ' %} + {% set wrapper_class = 'nav-facet nav-facet-tertiary' %} + {% endif %} + {% block facet_list_item %} + {{ super() }} + {% endblock %} + {% endif %} + {% endwith %} +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/most_popular_groups.html b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/most_popular_groups.html new file mode 100644 index 0000000000000000000000000000000000000000..b425f59691cb4ad5177900b978a5a2b2db56f558 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/snippets/most_popular_groups.html @@ -0,0 +1,29 @@ +{# Renders a list of the site's most popular groups. #} +<div class="box"> + <header class="module-heading"> + <h3>Most popular topics</h3> + </header> + <section class="module-content"> + <ul class="list-unstyled"> + {% for group in 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>{{ _('This group has no description') }}</p> + {% endif %} + {% if group.package_count %} + <strong>{{ ungettext('{num} Dataset', '{num} Datasets', group.package_count).format(num=group.package_count) }}</strong> + {% else %} + <span>{{ _('0 Datasets') }}</span> + {% endif %} + </li> + {% endfor %} + </ul> + </section> +</div> diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/user/dashboard.html b/ckanext-theme_hft/ckanext/theme_hft/templates/user/dashboard.html new file mode 100644 index 0000000000000000000000000000000000000000..b21438c8631be1f573c83e8df9b40cfdee041df2 --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/user/dashboard.html @@ -0,0 +1,14 @@ +{% ckan_extends %} + +{# Remove activity stream tab #} + +{% block page_header %} + <header class="module-content page-header hug"> + {% block content_primary_nav %} + <ul class="nav nav-tabs"> + {{ h.build_nav_icon('dashboard.index', _('News feed'), icon='list') }} + {{ h.build_nav_icon('dashboard.datasets', _('My Datasets'), icon='sitemap') }} + </ul> + {% endblock %} + </header> +{% endblock %} diff --git a/ckanext-theme_hft/ckanext/theme_hft/templates/user/read_base.html b/ckanext-theme_hft/ckanext/theme_hft/templates/user/read_base.html new file mode 100644 index 0000000000000000000000000000000000000000..1bbf72b24e4c4bc37fff5ec94d10a8b0cb05ac3b --- /dev/null +++ b/ckanext-theme_hft/ckanext/theme_hft/templates/user/read_base.html @@ -0,0 +1,30 @@ +{% ckan_extends %} + +{# Remove access to see all users #} +{% block breadcrumb_content %} + {{ h.build_nav('user.read', user.display_name|truncate(35), id=user.name) }} +{% endblock %} + +{# Remove access to edit user profile #} +{% block content_action %} +{% endblock %} + +{# Remove user API tokens and Activity Stream #} +{% block content_primary_nav %} + {{ h.build_nav_icon('user.read', _('Datasets'), id=user.name, icon='sitemap') }} +{% endblock %} + +{# Remove biography #} +{% block user_about %} +{% endblock %} + +{% block user_info %} + <div class="info"> + {% if is_myself %} + <dl> + <dt>{{ _('Email') }} <span class="label label-default" title="{{ _('This means only you can see this') }}">{{ _('Private') }}</span></dt> + <dd>{{ user.email }}</dd> + </dl> + {% endif %} + </div> +{% endblock %} diff --git a/ckanext-theme_hft/setup.py b/ckanext-theme_hft/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..fdfee06e615db3b6bde893eb0a6d68f0dbf97fd8 --- /dev/null +++ b/ckanext-theme_hft/setup.py @@ -0,0 +1,97 @@ +# -*- 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, 'README.md'), encoding='utf-8') as f: + long_description = f.read() + +setup( + name='''ckanext-theme_hft''', + + # Versions should comply with PEP440. For a discussion on single-sourcing + # the version across setup.py and the project code, see + # http://packaging.python.org/en/latest/tutorial.html#version + version='0.0.1', + + description=''' Customized UI of CKAN of HFT Stuttgart''', + long_description=long_description, + long_description_content_type="text/markdown", + + # Choose your license + license='AGPL', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + # 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*']), + namespace_packages=['ckanext'], + + install_requires=[ + # CKAN extensions should not list dependencies here, but in a separate + # ``requirements.txt`` file. + # + # http://docs.ckan.org/en/latest/extensions/best-practices.html + # 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 MANIFEST.in as well. + include_package_data=True, + package_data={ + }, + + # Although 'package_data' is the preferred approach, in some case you may + # need to place data files outside of your packages. + # see http://docs.python.org/3.4/distutils/setupscript.html + # installing-additional-files + # In this case, 'data_file' will be installed into '<sys.prefix>/my_data' + data_files=[], + + # 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. + entry_points=''' + [ckan.plugins] + theme_hft=ckanext.theme_hft.plugin:ThemeHftPlugin + + [babel.extractors] + 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 + # http://babel.pocoo.org/docs/messages/#extraction-method-mapping-and-configuration + message_extractors={ + 'ckanext': [ + ('**.py', 'python', None), + ('**.js', 'javascript', None), + ('**/templates/**.html', 'ckan', None), + ], + } +)