diff --git a/ckanext/odsh/fanstatic/odsh.js b/ckanext/odsh/fanstatic/odsh.js new file mode 100644 index 0000000000000000000000000000000000000000..af5b78e36c6c2d410c9c79470de60ae6cb9a68eb --- /dev/null +++ b/ckanext/odsh/fanstatic/odsh.js @@ -0,0 +1,8 @@ +$(document).ready(function() { + $('.mylabel').click(function() { + console.log($(this).siblings()); + window.location = $(this).siblings('a').attr('href'); + }); +}); + + diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo index 99420a5d1bf773835f32e7241ce3097dcaf1eb4b..4d7b80af0180fb7b351aae69e49127f8953c2914 100644 Binary files a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo and b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo differ diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po index e3aa49ec38d954cef90af6c80e5a406c9e90074e..a24a2df6b310ab7ad650cad8dac13689baedf402 100644 --- a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po +++ b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po @@ -39,3 +39,13 @@ msgstr "Namensnennung" msgid "Spatial extension" msgstr "räumliche Ausdehnung" + +msgid "{number} dataset found" +msgid_plural "{number} datasets found" +msgstr[0] "{number} Datensatz gefunden X" +msgstr[1] "{number} Datensätze gefunden X" + +msgid "{number} dataset found for \"{query}\"" +msgid_plural "{number} datasets found for \"{query}\"" +msgstr[0] "{number} Ergebnis für \"{query}\"" +msgstr[1] "{number} Ergebnisse für \"{query}\"" diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 159da80757ea2f5fcd11bc5f2bf551251553a6ba..8a441626caed4bbffcb39b8021085d1e75b6f683 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -6,8 +6,22 @@ from ckan.lib.plugins import DefaultDatasetForm from ckan.common import OrderedDict import ckan.lib.helpers as helpers +import logging + +log = logging.getLogger(__name__) + _ = toolkit._ +def odsh_get_facet_items_dict(name, limit=None): + ''' + Gets all facets like 'get_facet_items_dict' but sorted alphabetically + instead by count. + ''' + facets = helpers.get_facet_items_dict(name, limit) + facets.sort(key=lambda it: (it['display_name'].lower(), -it['count'])) + log.info(facets) + return facets + def odsh_main_groups(): '''Return a list of the groups to be shown on the start page.''' @@ -66,15 +80,19 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm # extension they belong to, to avoid clashing with functions from # other extensions. return {'odsh_main_groups': odsh_main_groups, - 'odsh_now':odsh_now, - 'odsh_group_id_selected':odsh_group_id_selected} + 'odsh_now': odsh_now, + 'odsh_group_id_selected': odsh_group_id_selected, + 'odsh_get_facet_items_dict': odsh_get_facet_items_dict, + } def before_map(self, map): map.connect('info_page', '/info_page', controller='ckanext.odsh.controller:OdshRouteController', action='info_page') return map def dataset_facets(self, facets_dict, package_type): - return OrderedDict({'groups': _('Groups')}) + # TODO: Frage von Pascal 12.10.2018: warum ist die Ordnung hier genau umgekehrt (von hinten nach vorne?) + return OrderedDict({'res_format': _('Dateiformat'), + 'groups': _('Kategorie')}) def organization_facets(self, facets_dict, organization_type, package_type): return facets_dict diff --git a/ckanext/odsh/public/base/fonts/Fonts/905300/1d3191cd-ae8c-45e2-bb04-11e96d8fa974.woff2 b/ckanext/odsh/public/base/fonts/Fonts/905300/1d3191cd-ae8c-45e2-bb04-11e96d8fa974.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..48e04bf7d746f13a9c4c43f652efb8a5dcf217f8 Binary files /dev/null and b/ckanext/odsh/public/base/fonts/Fonts/905300/1d3191cd-ae8c-45e2-bb04-11e96d8fa974.woff2 differ diff --git a/ckanext/odsh/public/base/fonts/Fonts/905300/b252d464-65cb-4950-88f7-ac0a1bf79b75.woff b/ckanext/odsh/public/base/fonts/Fonts/905300/b252d464-65cb-4950-88f7-ac0a1bf79b75.woff new file mode 100644 index 0000000000000000000000000000000000000000..756d3c3d45e856091c5c76f9b8979348de65666e Binary files /dev/null and b/ckanext/odsh/public/base/fonts/Fonts/905300/b252d464-65cb-4950-88f7-ac0a1bf79b75.woff differ diff --git a/ckanext/odsh/public/base/fonts/Fonts/905300/b3d18117-6517-4d3f-afc1-774086ff5fc1.ttf b/ckanext/odsh/public/base/fonts/Fonts/905300/b3d18117-6517-4d3f-afc1-774086ff5fc1.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bc02f72fd493bee27fc61593b7c8791bb000438b Binary files /dev/null and b/ckanext/odsh/public/base/fonts/Fonts/905300/b3d18117-6517-4d3f-afc1-774086ff5fc1.ttf differ diff --git a/ckanext/odsh/public/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot b/ckanext/odsh/public/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot new file mode 100644 index 0000000000000000000000000000000000000000..9699c0675cca98fa4e919612ce5ac434b9256466 Binary files /dev/null and b/ckanext/odsh/public/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot differ diff --git a/ckanext/odsh/public/base/images/checked.png b/ckanext/odsh/public/base/images/checked.png new file mode 100644 index 0000000000000000000000000000000000000000..afa2b3a420e52fa1564b97aefb7707d1be29aad1 Binary files /dev/null and b/ckanext/odsh/public/base/images/checked.png differ diff --git a/ckanext/odsh/public/base/images/ckan-logo.png b/ckanext/odsh/public/base/images/ckan-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..b7ce131c3c01a1874d4c393d0429f4cb1c05ab2f Binary files /dev/null and b/ckanext/odsh/public/base/images/ckan-logo.png differ diff --git a/ckanext/odsh/public/base/images/search_submit.png b/ckanext/odsh/public/base/images/search_submit.png new file mode 100644 index 0000000000000000000000000000000000000000..68bdbaf9f482814183cd00c1c5e09c8b6f4ad401 Binary files /dev/null and b/ckanext/odsh/public/base/images/search_submit.png differ diff --git a/ckanext/odsh/public/base/images/sprite.png b/ckanext/odsh/public/base/images/sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..0794806c149c450b20e8dfcd4d93a388fc49c64b Binary files /dev/null and b/ckanext/odsh/public/base/images/sprite.png differ diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css index b795be1de50045fbc76ae1da79813fb8bf448fd8..1c7d8a84718c082ed14e3ed94afd482bba2c1745 100644 --- a/ckanext/odsh/public/odsh.css +++ b/ckanext/odsh/public/odsh.css @@ -1,4 +1,317 @@ +/* FONTS */ + +@font-face{ + font-family:"MuseoSans"; + src:url("/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot?#iefix"); + src:url("/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot?#iefix") format("eot"),url("/base/fonts/Fonts/905300/1d3191cd-ae8c-45e2-bb04-11e96d8fa974.woff2") format("woff2"),url("/base/fonts/Fonts/905300/b252d464-65cb-4950-88f7-ac0a1bf79b75.woff") format("woff"),url("/base/fonts/Fonts/905300/b3d18117-6517-4d3f-afc1-774086ff5fc1.ttf") format("truetype"); +} + + + +/* css allgemein (body, etc.) */ + +body { + font-family: "MuseoSans", Euphemia, Segoe UI, Arial, Helvetica, sans-serif, "Droid Sans"; + font-weight: 300; + font-style: normal; + line-height: 1.2; + font-size: 16px; +} + +/* FROM: https://stackoverflow.com/questions/2610497/change-an-html5-inputs-placeholder-color-with-css */ +/* do not group these rules */ +*::-webkit-input-placeholder { + color: black !important; +} +*:-moz-placeholder { + /* FF 4-18 */ + color: black !important; + opacity: 1 !important; +} +*::-moz-placeholder { + /* FF 19+ */ + color: black !important; + opacity: 1 !important; +} +*:-ms-input-placeholder { + /* IE 10+ */ + color: black !important; +} +*::-ms-input-placeholder { + /* Microsoft Edge */ + color: black !important; +} +*::placeholder { + /* modern browser */ + color: black !important; +} + +input, button, select, textarea { + font-family: 'MuseoSans','Helvetica Neue',Helvetica,Arial,sans-serif; +} + + + + +/* css for searchresults */ + +/* same width as schleswig-holstein.de */ +.container { + width: 1000px; +} + +.search-form { + border-bottom: 4px solid #dbdbdb; + padding-bottom: 5px; +} + .search-form .control-order-by select { width: 225px; margin: 0; -} \ No newline at end of file + border: 1px; + background-color: #f2f2f2; + color: black; +} + +.search-form h2 { + margin-top: 0px; + font-size: 25px; + color: #003064; + font-weight: 300; +} + +.module-content:first-child { + padding-top: 0px; +} + +.module-content { + padding: 0; +} + +input[type=radio], input[type=checkbox] { + top: 0px; +} + +.nav-simple>li { + border-bottom: 0px; + padding: 15px 0px 15px 8px; +} + +@media (min-width: 768px){ + [role=main], .main { + background: white; + } + + .wrapper { + background-image: none; + background-repeat: no-repeat; + } +} + +.secondary { + background-color: #f2f2f2; +} + +.secondary.span3 { + width: 210px; + padding: 20px 16px 0px; +} + +.primary { + padding-left: 10px; +} + +.primary.span9 { + width: 780px; +} + +.wrapper { + -webkit-box-shadow: none !important; + -moz-box-shadow: none !important; + box-shadow: none !important; + border: none; +} + +.karte_inner { + background-color: lightgrey; + height: 220px; + margin-bottom: 20px; +} + +.filter-reset { + padding: 0px 0px 10px 0px; +} + +.filter-reset-label { + float: left; +} + +.filter-reset-box { + float: right; + background-color: white; + padding: 0px 10px 0px 10px; +} + +.filter-reset-box a { + color: black; + font-size: 12px; +} + +.filters section nav { + border-top: 2px solid #DBDBDB; +} + +.filters section nav .nav-title { + padding: 15px 0px 0px 8px; + font-size: 12px; + color: black; +} + +.nav-item .facet_label { + display: block; + float: left; +} + +.nav-item .facet_label a{ + color: black; +} + +.nav-item .facet_count { + display: block; + float: right; + background-color: white; + padding: 0px 2px 0px 2px; +} + +.filter-checkbox { + +} + + +/* checkbox customize trick, see: https://stackoverflow.com/questions/24322599/css-why-cannot-change-checkbox-color-whatever-i-do */ +input[type=checkbox] { + display:none; +} + +input[type=checkbox] + label.mylabel { + background: #fff; + border: 1px solid white; + height: 8px; + width: 8px; + display: inline-block; + padding: 0 0 0 0px; +} + +input[type=checkbox]:checked + label.mylabel { + background: url(/base/images/checked.png); + background-color: #fff; + background-size: 8px 8px; + border: 1px solid black; + height: 8px; + width: 8px; + display:inline-block; + padding: 0 0px 0 0px; + +} + +label.mylabel { + margin-right: 3px; + margin-bottom: 0px; + -webkit-user-select: none; /* Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+/Edge */ + user-select: none; /* Standard */ +} + +label.mylabel::after { + content: ""; +} + +/* following makes the secondary span (left side, facets etc.) the same height as the primary span */ +/* see: https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height */ +.is-table-row { + display: table; +} + +.is-table-row [class*="span"] { + float: none; + display: table-cell; + vertical-align: top; +} + +.pill { + background-color: #F6F7F9; + border-radius: 0px; + color:black; + font-size: 12px; + margin-right: 2px; +} + +.pill a.remove { + color: black; + font-size: 10px; + position: relative; + top: -8px; + right: -8px; +} + +.container-fluid.odsh-dataset-item { + padding: 20px 0px 20px 0px; + border-bottom: 2px solid #DBDBDB; +} + +.dataset-content { + float:left; + width: 70%; +} + +.dataset-heading { + margin-right: 30px; +} + +.dataset-empty { + margin-right: 30px; + color: darkgrey; +} + +.dataset-meta { + float:right; + width: 30%; +} + +ul.dataset-resources { + margin: 0px 0px 10px 0px; +} + +.dataformat-label { + background-color: #1c355e !important; + padding: 3px 3px 1px 3px; + font-size: 14px; + margin-right: 4px; +} + +.dataset-stars { + margin-bottom: 10px; +} + +.odsh-star { + margin-right: 5px; + font-size: 20px; + color: #1c355e; +} + +.dataformat-label:hover { + background-color: #d7004d !important; +} + +.dataset-info p { + font-size: 12px; + margin-bottom: 1px; + color: black; +} + +.breadcrumb>li a { + font-weight: normal !important; + font-size: 15px; + color: #003064 !important; +} diff --git a/ckanext/odsh/public/odsh_header.css b/ckanext/odsh/public/odsh_header.css new file mode 100644 index 0000000000000000000000000000000000000000..5c7a96457a62394ca638e75506625c92c6d44945 --- /dev/null +++ b/ckanext/odsh/public/odsh_header.css @@ -0,0 +1,187 @@ +/* css for header */ + +/* same width as schleswig-holstein.de */ +.navbar-static-top .container { + width: 1000px; +} + +[class*="span"] { + margin-left: 0px; +} + +.row { + margin-left: 0px; +} + +.span3.span-navigation { + width: auto; +} + +.span9.span-navigation { + width: auto; + margin-right: 15px; +} + +.header-image { + padding-right: 0; + position: relative; + top: 0; + padding: 1em 0; +} + +.language-switch { + float: right; + background-color: #f2f2f2; + padding: 6px 10px; + margin-left: 20px; + height: 44px; /* dirty fix to make it the same height as schleswig-holstein.de */ +} + +.language-switch ul { + margin: 0; + padding-left: 0; + list-style-type: none; +} + +.language-switch li { + display: block; + padding: 7px; + float: left; + line-height: 1.5; +} + +.language-switch li a { + color: #003064; + padding: 5px; + display: block; +} + +.language-switch li a:hover { + color: white; + background: #011e5a; +} + +.language-switch .navLeichteSprache { + background: url(/base/images/sprite.png) no-repeat 6px -5557px; + font: 0/0 serif; + display: block; + height: 20px; + width: 20px; + overflow: hidden; +} + +.language-switch .navLeichteSprache:hover { + background: #011e5a url(/base/images/sprite.png) no-repeat 6px -5334px; + +} + +.masthead .top-search-form { + float:right; + background: #f2f2f2; + width: 15em; + height: 56px; /* dirty fix to make it the same height as schleswig-holstein.de */ +} + +.masthead .top-search-form .site-search { + margin: 0; + padding: 14px 15px 10px; +} + +.masthead .site-search input { + padding: 5px 8px 0; +} + +.masthead { + background: white; +} + +#field-sitewide-search { + font-size: 87%; + font-weight: 300; + padding-left: .5em; + width: 167px; + line-height: 1.1; + border-bottom: 2px solid #c2cbd6 !important; + background: #f2f2f2; + border: 1px solid #f2f2f2; + box-shadow: none !important; + height: 20px; +} + +#field-sitewide-search:focus { + outline: 1px solid rgba(82,168,236,0.8); + border-color: rgba(82,168,236,0.8); +} + +.simple-input .field .btn-search { + height: 32px; + width: 32px; + background: url(/base/images/search_submit.png); + right: -47px; + top: 36%; +} + +.navigation-container { + background: #f2f2f2; + width: 100% !important; + border-bottom: 15px solid #1c355e; +} + +.navigation-row { + width: 1000px; + padding-left: 33px; + margin-left: auto; + margin-right: auto; +} + +.masthead .nav-collapse { + float: left; + padding-top: 0px; +} + +.nav-pills li a:hover, .nav-pills li:hover { + border-radius: 0px; + -webkit-border-radius: 0px; + background-color: #011e4a !important; +} + +.masthead .navigation .nav-pills li:not(:first-child) { + margin-left: 22px; +} + +/* Default border to align font vertically to active navigation tab */ +.masthead .navigation .nav-pills li { + border-top: 2px solid #f2f2f2; +} + +/* Change default border color on hover to background color (align font vertically to active navigation tab) */ +.masthead .navigation .nav-pills li:hover { + border-top: 2px solid #011e4a; +} + +/* The active navigation tab gets a differently coloured top-border */ +.masthead .navigation .nav-pills li.active { + border-top: 2px solid #003064; +} + +/* Remove borders and get background color from parent (.navigation-container) */ +.masthead .navigation .nav-pills li.active a { + background-color: inherit; + -webkit-box-shadow: none !important; + -moz-box-shadow: none !important; + box-shadow: none !important; + text-decoration: none; +} + +/* Font color of navigation links (default) */ +.masthead .nav>li>a, .masthead .nav>.active>a { + padding: 16px 10px 19px; + color: #003064; + font-size: 1.125rem; +} + +/* Font color of navigation links (hover) */ +.masthead .nav>li:hover a { + color: #ffffff; + text-decoration: underline; +} diff --git a/ckanext/odsh/templates/base.html b/ckanext/odsh/templates/base.html index 4e59c50f332a05900a6328874986c5c03381904f..527549b2cbb0a3a2303c8369ec94f70dbcb1e484 100644 --- a/ckanext/odsh/templates/base.html +++ b/ckanext/odsh/templates/base.html @@ -2,6 +2,8 @@ {% block styles %} {{ super() }} <script type="text/javascript" src="bootstrap-multiselect.js"></script> -<link rel="stylesheet" href="/odsh.css" /> +{% resource 'odsh/odsh.js' %} +<link rel="stylesheet" href="/odsh.css?refresh={{ range(1,10000) | random }}" /> +<link rel="stylesheet" href="/odsh_header.css?refresh={{ range(1,10000) | random }}" /> <link rel="stylesheet" href="/bootstrap-multiselect.css" /> -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html index 85f77c9f011d55f55a534961c6d63fa98c5919ea..6970982b8c3074eb37c806b66eb577320978a485 100644 --- a/ckanext/odsh/templates/header.html +++ b/ckanext/odsh/templates/header.html @@ -1,70 +1,5 @@ {% block header_wrapper %} {% block header_account %} -<header class="account-masthead"> - <div class="container"> - {% block header_account_container_content %} - {% if c.userobj %} - <div class="account avatar authed" data-module="me" data-me="{{ c.userobj.id }}"> - <ul class="unstyled"> - {% block header_account_logged %} - {% if c.userobj.sysadmin %} - <li> - <a href="{{ h.url_for(controller='admin', action='index') }}" title="{{ _('Sysadmin settings') }}"> - <i class="fa fa-gavel" aria-hidden="true"></i> - <span class="text">{{ _('Admin') }}</span> - </a> - </li> - {% endif %} - <li> - <a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}" class="image" title="{{ _('View profile') }}"> - {{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }} - <span class="username">{{ c.userobj.display_name }}</span> - </a> - </li> - {% set new_activities = h.new_activities() %} - <li class="notifications {% if new_activities > 0 %}notifications-important{% endif %}"> - {% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new - items)', new_activities) %} - <a href="{{ h.url_for(controller='user', action='dashboard') }}" title="{{ notifications_tooltip }}"> - <i class="fa fa-tachometer" aria-hidden="true"></i> - <span class="text">{{ _('Dashboard') }}</span> - <span class="badge">{{ new_activities }}</span> - </a> - </li> - {% block header_account_settings_link %} - <li> - <a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}" title="{{ _('Edit settings') }}"> - <i class="fa fa-cog" aria-hidden="true"></i> - <span class="text">{{ _('Settings') }}</span> - </a> - </li> - {% endblock %} - {% block header_account_log_out_link %} - <li> - <a href="{{ h.url_for('/user/_logout') }}" title="{{ _('Log out') }}"> - <i class="fa fa-sign-out" aria-hidden="true"></i> - <span class="text">{{ _('Log out') }}</span> - </a> - </li> - {% endblock %} - {% endblock %} - </ul> - </div> - {% else %} - <nav class="account not-authed"> - <ul class="unstyled"> - {% block header_account_notlogged %} - <li>{% link_for _('Log in'), controller='user', action='login' %}</li> - {% if h.check_access('user_create') %} - <li>{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li> - {% endif %} - {% endblock %} - </ul> - </nav> - {% endif %} - {% endblock %} - </div> -</header> <header class="navbar navbar-static-top masthead"> {% block header_debug %} {% if g.debug and not g.debug_supress_header %} @@ -72,69 +7,67 @@ {% endif %} {% endblock %} <div class="container"> - <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button"> - <span class="fa fa-bars"></span> - </button> - {# The .header-image class hides the main text and uses image replacement for the title #} - <div class='row'> + <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button"> + <span class="fa fa-bars"></span> + </button> + {# The .header-image class hides the main text and uses image replacement for the title #} + <div class='row'> - <div class='span4'> - <hgroup class="{{ g.header_class }} pull-left"> + <div class='span3 span-navigation'> + <hgroup class="{{ g.header_class }} pull-left"> - {% block header_logo %} - {% if g.site_logo %} - <a class="logo" href="{{ h.url_for('home') }}"><img src="{{ h.url_for_static_or_external(g.site_logo) }}" - alt="{{ g.site_title }}" title="{{ g.site_title }}" /></a> - {% else %} - <h1> - <a href="{{ h.url_for('home') }}">{{ g.site_title }}</a> - </h1> - {% if g.site_description %}<h2>{{ g.site_description }}</h2>{% endif %} - {% endif %} - {% endblock %} - </hgroup> - </div> - - - {% block header_site_search %} - <div class="span4"> - <form class="section site-search simple-input" action="{% url_for controller='package', action='search' %}" - method="get"> - <div class="field"> - <label for="field-sitewide-search">{% block header_site_search_label %}{{ _('Search Datasets') - }}{% - endblock %}</label> - <input id="field-sitewide-search" type="text" name="q" placeholder="{{ _('Search') }}" /> - <button class="btn-search" type="submit"><i class="fa fa-search"></i></button> - </div> - </form> - </div> + {% block header_logo %} + {% if g.site_logo %} + <a class="logo" href="{{ h.url_for('home') }}"><img src="{{ h.url_for_static_or_external(g.site_logo) }}" + alt="{{ g.site_title }}" title="{{ g.site_title }}" /></a> + {% else %} + <h1> + <a href="{{ h.url_for('home') }}">{{ g.site_title }}</a> + </h1> + {% if g.site_description %}<h2>{{ g.site_description }}</h2>{% endif %} + {% endif %} {% endblock %} + </hgroup> + </div> - <div class='span4'> - {% snippet "snippets/language_selector.html" %} - </div> + <div class='span9 span-navigation pull-right'> + {% snippet "snippets/language_selector.html" %} + {% block header_site_search %} + <div class='top-search-form'> + <form class="section site-search simple-input" action="{% url_for controller='package', action='search' %}" + method="get"> + <div class="field"> + <input id="field-sitewide-search" type="text" name="q" placeholder="{{ _('Suchbegriff') }}" /> + <button class="btn-search" type="submit"> + </div> + </form> + </div> + {% endblock %} </div> + </div> + </div> + + <div class="container navigation-container"> + <div class='row navigation-row'> <div class="nav-collapse collapse"> - - <nav class="section navigation"> - <ul class="nav nav-pills"> - {% block header_site_navigation_tabs %} - {{ h.build_nav_main( - ('home', _('Start')), - ('search', _('Datasets')), - ('organizations_index', _('Organizations')), - ('info_page', _('Info')) - ) }} - {% endblock %} - </ul> - </nav> - {% endblock %} - - + <nav class="section navigation"> + <ul class="nav nav-pills"> + {% block header_site_navigation_tabs %} + {{ h.build_nav_main( + ('home', _('Startseite')), + ('search', _('Daten')), + ('organizations_index', _('Herausgeber')), + ('info_page', _('Infos')) + ) }} + {% endblock %} + </ul> + </nav> + {% endblock %} </div> + </div> </div> +</div> </header> -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ckanext/odsh/templates/package/search.html b/ckanext/odsh/templates/package/search.html index 5c0e5bb0f03424d11883ea9634eb65bba4cd13d9..f9de380113769006b225e5cf528b936ec636945e 100644 --- a/ckanext/odsh/templates/package/search.html +++ b/ckanext/odsh/templates/package/search.html @@ -11,7 +11,18 @@ ## ## tools on left side, ie filter {% block secondary_content %} +<div class="karte_outer"> + <p>Karte:</p> + <div class="karte_inner"> + + </div> +</div> <div class="filters"> + <div class="container-fluid filter-reset"> + <div class="filter-reset-label"><span>Filter:</span></div> + <div class="filter-reset-box"><a href="#">zurücksetzen</a></button></div> + </div> + <div> {% for facet in c.facet_titles %} {{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet) }} @@ -21,4 +32,4 @@ </div> {% endblock %} {% block package_search_results_api %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ckanext/odsh/templates/page.html b/ckanext/odsh/templates/page.html new file mode 100644 index 0000000000000000000000000000000000000000..3c264e335d93a4337e1b7244443bec4f8b1ef8a0 --- /dev/null +++ b/ckanext/odsh/templates/page.html @@ -0,0 +1,45 @@ +{% ckan_extends %} + +{%- block content %} + {% block maintag %}<div role="main">{% endblock %} + <div id="content" class="container"> + {% block main_content %} + + {% block flash %} + {{ super() }} + {% endblock %} + + {% block toolbar %} + {{ super() }} + {% endblock %} + + <div class="row wrapper{% block wrapper_class %}{% endblock %}{% if self.secondary()|trim == '' %} no-nav{% endif %} is-table-row"> + {# + The pre_primary block can be used to add content to before the + rendering of the main content columns of the page. + #} + {% block pre_primary %} + {% endblock %} + + {% block secondary %} + <aside class="secondary span3"> + {% block secondary_content %} + {{ super() }} + {% endblock %} + </aside> + {% endblock %} + + {% block primary %} + <div class="primary span9"> + {% block primary_content %} + {{ super() }} + {% endblock %} + </div> + {% endblock %} + + </div> + {% endblock %} + </div> + </div> +{% endblock -%} + diff --git a/ckanext/odsh/templates/snippets/facet_list.html b/ckanext/odsh/templates/snippets/facet_list.html index 4b561d9606844bd66b4c75feb1b977185850e48b..069de907cbce9a562c682927169d881bbd133dd7 100644 --- a/ckanext/odsh/templates/snippets/facet_list.html +++ b/ckanext/odsh/templates/snippets/facet_list.html @@ -1,25 +1,45 @@ {% ckan_extends %} + +{% block facet_list_heading %} + {# {% set title = title or h.get_facet_title(name) %} + {{ title }} #} +{% endblock %} + {% block facet_list_items %} -{% with items = items or h.get_facet_items_dict(name) %} +{# {% with items = items or h.get_facet_items_dict(name,20) %} #} +{% with items = items or h.odsh_get_facet_items_dict(name,20) %} {% if items %} <nav> + {% set title = title or h.get_facet_title(name) %} + <div class="nav-title">{{ title }}</div> <ul class="{{ nav_class or 'unstyled nav nav-simple nav-facet' }}"> {% for item in items %} {% set href = h.remove_url_param(name, item.name, extras=extras, alternative_url=alternative_url) if item.active else h.add_url_param(new_params={name: item.name}, extras=extras, alternative_url=alternative_url) %} {% set label = label_function(item) if label_function else item.display_name %} - {% set label_truncated = h.truncate(label, 22) if not label_function else label %} - <li class="{{ nav_item_class or 'nav-item' }}{% if item.active %} active{% endif %}"> - <a href="{{ href }}" title="{{ label if label != label_truncated else '' }}"> + {% set count = count_label(item['count']) if count_label else ('%d' % item['count']) %} + {% set label_truncated = h.truncate(label, 26) if not label_function else label %} + <li class="{{ nav_item_class or 'nav-item' }}"> + <div class="facet_label"> + {# TODO: checkbox-id vereinheitlichen (code-duplikation) und sicher gegen Titel mit Leerzeichen machen! #} + <input type="checkbox" {% if item.active %} checked {% endif %} class="filter-checkbox" id="check-{{ title.lower() }}-{{ loop.index }}"/> + <label class="mylabel" for="check-{{ title.lower() }}-{{ loop.index }}"></label> + <a href="{{ href }}" title="{{ label if label != label_truncated else '' }}"> <span>{{ label_truncated }}</span> </a> + </div> + <div class="facet_count"> + <span class="facet_count">{{ count }}</span> + </div> </li> {% endfor %} </ul> </nav> -<p class="module-footer"> +{# TODO: when there are more than N facets ('with items...' above), how many should be +displayed and how should these links look? Pascal R. 12.10.2018 #} +{#<p class="module-footer"> {% if h.get_param_int('_%s_limit' % name) %} {% if h.has_more_facets(name) %} <a href="{{ h.remove_url_param('_%s_limit' % name, replace=0, extras=extras, alternative_url=alternative_url) }}" @@ -29,9 +49,10 @@ <a href="{{ h.remove_url_param('_%s_limit' % name, extras=extras, alternative_url=alternative_url) }}" class="read-more">{{ _('Show Only Popular {facet_type}').format(facet_type=title) }}</a> {% endif %} -</p> +</p>#} + {% else %} <p class="module-content empty">{{ _('There are no {facet_type} that match this search').format(facet_type=title) }}</p> {% endif %} {% endwith %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ckanext/odsh/templates/snippets/language_selector.html b/ckanext/odsh/templates/snippets/language_selector.html index 8363118d802577548cf5535652a5d4f0994b74a7..55a7db22dd6a7ea325c4560b8feb627ca8070682 100644 --- a/ckanext/odsh/templates/snippets/language_selector.html +++ b/ckanext/odsh/templates/snippets/language_selector.html @@ -1,14 +1,17 @@ {% set current_lang = request.environ.CKAN_LANG %} -<form class="form-inline form-select lang-select" action="{% url_for controller='util', action='redirect' %}" - data-module="select-switch" method="POST"> - <select id="field-lang-select" name="url" data-module="autocomplete" data-module-dropdown-class="lang-dropdown" - data-module-container-class="lang-container"> - {% for locale in h.get_available_locales() %} - <option value="{% url_for h.current_url(), locale=locale.short_name %}" {% if locale.identifier==current_lang - %}selected="selected" {% endif %}> - {{ locale.short_name }} - </option> - {% endfor %} - </select> - <button class="btn js-hide" type="submit">{{ _('Go') }}</button> -</form> \ No newline at end of file + +<div class="language-switch"> + <ul> + <li> + <a href="#" title="Leichte Sprache" class="navLeichteSprache">Leichte Sprache</a> + </li> + <li> + {% for locale in h.get_available_locales() %} + {% if (locale.identifier!=current_lang) and ((locale.short_name=='de') or (locale.short_name=='en')) %} + <a title="Switch to ... website" href="{% url_for h.current_url(), locale=locale.short_name %}" + xml:lang="{{ locale.short_name }}" hreflang="{{ locale.short_name }}" lang="{{ locale.short_name }}">{{ locale.short_name.upper() }}</a> + {% endif %} + {% endfor %} + </li> + </ul> +</div> diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html index ad5edae23d497d15433cc1b2021d650b099dde61..7eb2551dfeef9a0dfc8b9be4a53b43479a31ced5 100644 --- a/ckanext/odsh/templates/snippets/package_item.html +++ b/ckanext/odsh/templates/snippets/package_item.html @@ -22,10 +22,10 @@ Example: {% set org = package.organization.title or package.organization.name or '-' %} {% set access_count=(package.tracking_summary.total if package.tracking_summary) or '-' %} {% set timerange_label ='Zeitraum' %} -{% set access_count_label ='Zugriffe' %} +{% set access_count_label ='Aufrufe' %} {% block package_item %} -<li class="{{ item_class or "dataset-item" }}"> +<div class="container-fluid odsh-dataset-item"> {% block content %} <div class="dataset-content"> {% block heading %} @@ -62,34 +62,42 @@ Example: {% if notes %} <div>{{ notes|urlize }}</div> {% else %} - <p class="empty">{{ _("This dataset has no description") }}</p> + <p class="dataset-empty">{{ _("This dataset has no description") }}</p> {% endif %} {% endblock %} </div> - {% block resources %} - {% if package.resources and not hide_resources %} - {% block resources_outer %} - <ul class="dataset-resources unstyled"> - {% block resources_inner %} - {% for resource in h.dict_list_reduce(package.resources, 'format') %} - <li> - <a href="{{ h.url_for(controller='package', action='read', id=package.name) }}" class="label" data-format="{{ resource.lower() }}">{{ - resource }}</a> - </li> - {% endfor %} + <div class="dataset-meta"> + {% block resources %} + {% if package.resources and not hide_resources %} + {% block resources_outer %} + <ul class="dataset-resources"> + {% block resources_inner %} + {% for resource in h.dict_list_reduce(package.resources, 'format') %} + <li> + <a href="{{ h.url_for(controller='package', action='read', id=package.name) }}" class="label dataformat-label" data-format="{{ resource.lower() }}">{{ + resource }}</a> + </li> + {% endfor %} + {% endblock %} + </ul> + <div class="dataset-stars"> + <i class="fa fa-star odsh-star"></i><i class="fa fa-star odsh-star"></i><i class="fa fa-star odsh-star"></i><i class="fa fa-star odsh-star"></i><i class="fa fa-star-o odsh-star"></i> + </div> + + <div class="dataset-info"> + <p> {{_('Lizenz')}}: {{license}}</p> + <p> {{_('Herausgeber')}}: {{org}} </p> + <p> {{timerange_label}}: {{timerange}}</p> + <p> {{access_count_label}}: {{access_count}}</p> + </div> {% endblock %} - </ul> - <span> {{_('Organizations')}}: {{org}}</span> - <span> {{_('License')}}: {{license}}</span> - <span> {{timerange_label}}: {{timerange}}</span> - <span> {{access_count_label}}: {{access_count}}</span> - {% endblock %} - {% endif %} - {% endblock %} + {% endif %} + {% endblock %} + </div> {% block package_openness %} <div class="module module-narrow module-shallow context-info"> </div> {% endblock %} {% endblock %} -</li> -{% endblock %} \ No newline at end of file +</div> +{% endblock %} diff --git a/ckanext/odsh/templates/snippets/package_list.html b/ckanext/odsh/templates/snippets/package_list.html index 3cb0d852a4bed29be608e29aec42fb5a45d733c5..01b2ef8f6fbf0dcfd6ae03e841c84322a8fce64c 100644 --- a/ckanext/odsh/templates/snippets/package_list.html +++ b/ckanext/odsh/templates/snippets/package_list.html @@ -16,12 +16,12 @@ Example: #} {% block package_list %} {% if packages %} - <ul class="{{ list_class or 'dataset-list unstyled' }}"> + <div class="{{ list_class or 'dataset-list unstyled' }}"> {% block package_list_inner %} {% for package in packages %} {% snippet 'snippets/package_item.html', package=package, item_class=item_class, hide_resources=hide_resources, banner=banner, truncate=truncate, truncate_title=truncate_title %} {% endfor %} {% endblock %} - </ul> + </div> {% endif %} {% endblock %}