My page content
+Some content for the page
+ {% endblock %} + #} + {% block primary_content %} +diff --git a/ckanext/ubdc/assets/css/style.css b/ckanext/ubdc/assets/css/style.css index bbfdfd4..0db22d0 100644 --- a/ckanext/ubdc/assets/css/style.css +++ b/ckanext/ubdc/assets/css/style.css @@ -7194,6 +7194,205 @@ input[type=checkbox][name=consentName]:focus { height: 550px; } +.section_small-hero { + background-color: #f2f1fe; + border: 1px solid #dfe1e7; + border-bottom-style: none; + position: relative; + overflow: hidden; +} +.section_small-hero.padding-global { + padding-left: 2.5em; + padding-right: 2.5em; +} + +.container-small { + margin-right: auto !important; + margin-left: auto !important; + width: 100%; + max-width: 48em; +} + +.padding-section-medium.bigger { + padding-top: 6em; + padding-bottom: 6em; + position: relative; +} + +.text-align-center { + text-align: center; + margin-bottom: 0; +} + +.margin-right { + margin-top: 0 !important; + margin-bottom: 0 !important; + margin-left: 0 !important; +} + +.hero_head { + letter-spacing: -0.2vw; + margin-top: 0; + margin-bottom: 1vw; + font-size: 4em; + font-weight: 700; + line-height: 1.125; +} + +.margin-custom1 { + margin: 1.5rem; +} + +.hero_bg-img.left { + width: 20em; + height: 10em; + top: auto; + bottom: 0%; + left: 0%; + right: auto; + position: absolute; +} +.hero_bg-img.right { + width: 24.5781em; + height: 10.19em; + top: auto; + bottom: 0%; + left: auto; + right: 0%; + position: absolute; +} +.hero_bg-img.default { + width: 23.4404em; + height: 16.8373em; + position: absolute; +} + +.section_small-hero { + background-color: #f2f2f2; + border: 1px solid #dfe1e7; + border-bottom-style: none; + position: relative; + overflow: hidden; +} +.section_small-hero.padding-global { + padding-left: 2.5em; + padding-right: 2.5em; +} + +.container-small { + margin-right: auto !important; + margin-left: auto !important; + width: 100%; + max-width: 48em; +} + +.padding-section-medium { + padding-top: 5em; + padding-bottom: 5em; + position: relative; +} + +.rich-text-block-2 { + font-size: 1em; + line-height: 2.4em; + font-weight: 300; +} +.rich-text-block-2 h2 { + display: inline-block; + margin-top: 2vw; + margin-bottom: 1vw; + font-size: 2.3em; + line-height: 1.125em; +} + +.text-color-dark-green { + color: var(--dark-green); +} +.text-color-dark-green strong { + font-weight: 700; +} + +#cookies-table { + float: left; + width: 100%; +} +#cookies-table table { + width: 100%; + border-collapse: collapse; +} +#cookies-table table tr:nth-of-type(odd) { + background: #f2f2f2; +} +#cookies-table table th { + background: #184e44; + color: white; + font-weight: bold; + padding: 0.375em; + border: 0.125em solid #ccc; + text-align: left; +} +#cookies-table table td, +#cookies-table table th { + padding: 0.375em; + border: 0.125em solid #ccc; + text-align: left; +} +@media all and (max-width: 767px) { + #cookies-table table, + #cookies-table thead, + #cookies-table tbody, + #cookies-table th, + #cookies-table td, + #cookies-table tr { + display: block; + } + #cookies-table thead tr { + position: absolute; + top: -9999px; + left: -9999px; + } + #cookies-table tr { + border-left: 0.125em solid #ccc; + border-right: 0.125em solid #ccc; + border-bottom: 0.125em solid #ccc; + } + #cookies-table tr:nth-of-type(1) { + border-top: 0.125em solid #ccc; + } + #cookies-table td { + border: none; + border-bottom: 0.125em solid #eee; + position: relative; + padding-left: 50%; + } + #cookies-table td:before { + position: absolute; + top: 0.375em; + left: 0.375em; + width: 45%; + padding-right: 0.625em; + white-space: nowrap; + } + #cookies-table td:nth-of-type(1):before { + content: "Cookie"; + } + #cookies-table td:nth-of-type(2):before { + content: "Purpose"; + } + #cookies-table td:nth-of-type(3):before { + content: "More information"; + } +} + +.cursor-pointer { + cursor: pointer; +} + +.link-selected:hover { + color: #bd4e0a; + text-decoration: underline; +} + .tag { display: inline-block; margin-bottom: 4px; @@ -10209,7 +10408,7 @@ h4 small { background-repeat: no-repeat; display: flex; align-items: center; - border: 1px solid #DFE1E7; + border: 1px solid #dfe1e7; } .homepage .hero .wrap { display: flex; @@ -10705,6 +10904,18 @@ h4 small { background: #c2410c; } +input[type=search]::-webkit-search-cancel-button, +input[type=search]::-webkit-search-decoration { + -webkit-appearance: searchfield-cancel-button; + position: relative; + right: 20px; + height: 20px; + width: 20px; + border-radius: 10px; + background: url(/base/images/close.svg) no-repeat 50% 50%; + background-size: contain; +} + .account-masthead { min-height: 30px; color: #fff; @@ -10902,7 +11113,7 @@ h4 small { .masthead .site-search input { width: 40px; opacity: 0; - padding: 5px 10px; + padding: 10px; -webkit-transition: width 0.4s ease-in-out; transition: width 0.4s ease-in-out; } @@ -10911,6 +11122,7 @@ h4 small { cursor: default; font-size: 20px !important; color: #000000; + top: 40%; } .masthead .site-search input:focus { width: 200px; diff --git a/ckanext/ubdc/logic/action.py b/ckanext/ubdc/logic/action.py index 95fad52..91506e6 100644 --- a/ckanext/ubdc/logic/action.py +++ b/ckanext/ubdc/logic/action.py @@ -2,6 +2,7 @@ import datetime import logging import ckan.plugins.toolkit as tk +import ckan.plugins as p from ckan.lib.navl.dictization_functions import validate import ckan.lib.uploader as uploader from ckan.lib.mailer import mail_recipient @@ -143,3 +144,13 @@ def request_data_access_show(context, data_dict): data_dict = RequestDataAccess.get_by_id(data_dict["id"]) return data_dict.as_dict() + + +@p.toolkit.chained_action +@tk.side_effect_free +def package_search(up_func, context, data_dict): + if data_dict.get('q') and 'id' not in data_dict.get('q'): + data_dict['q'] = f"{data_dict.get('q')} OR title_ngram: {data_dict.get('q')}~1" + log.info(data_dict) + result = up_func(context, data_dict) + return result diff --git a/ckanext/ubdc/plugin.py b/ckanext/ubdc/plugin.py index 1796640..c95ebeb 100644 --- a/ckanext/ubdc/plugin.py +++ b/ckanext/ubdc/plugin.py @@ -50,6 +50,7 @@ def get_actions(self): "request_data_access_show": action.request_data_access_show, "request_data_access_update": action.request_data_access_update, "request_data_access_delete": action.request_data_access_delete, + "package_search": action.package_search } # IPackageController diff --git a/ckanext/ubdc/public/base/images/close.svg b/ckanext/ubdc/public/base/images/close.svg new file mode 100644 index 0000000..0119e30 --- /dev/null +++ b/ckanext/ubdc/public/base/images/close.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/ckanext/ubdc/public/base/scss/_custom.scss b/ckanext/ubdc/public/base/scss/_custom.scss index 6297307..5338069 100644 --- a/ckanext/ubdc/public/base/scss/_custom.scss +++ b/ckanext/ubdc/public/base/scss/_custom.scss @@ -82,4 +82,224 @@ input[type=checkbox][name="consentName"]:focus { .img-fluid-hero { height: 550px +} + + +.section_small-hero { + background-color: #f2f1fe; + border: 1px solid #dfe1e7; + border-bottom-style: none; + position: relative; + overflow: hidden; + + &.padding-global { + padding-left: 2.5em; + padding-right: 2.5em; + } +} + +.container-small { + margin-right: auto !important; + margin-left: auto !important; + width: 100%; + max-width: 48em; +} + +.padding-section-medium { + &.bigger { + padding-top: 6em; + padding-bottom: 6em; + position: relative; + } +} + +.text-align-center { + text-align: center; + margin-bottom: 0; +} + +.margin-right { + margin-top: 0 !important; + margin-bottom: 0 !important; + margin-left: 0 !important; +} + +.hero_head { + letter-spacing: -0.2vw; + margin-top: 0; + margin-bottom: 1vw; + font-size: 4em; + font-weight: 700; + line-height: 1.125; +} + +.margin-custom1 { + margin: 1.5rem; +} + +.hero_bg-img { + &.left { + width: 20em; + height: 10em; + top: auto; + bottom: 0%; + left: 0%; + right: auto; + position: absolute; + } + + &.right { + width: 24.5781em; + height: 10.19em; + top: auto; + bottom: 0%; + left: auto; + right: 0%; + position: absolute; + } + + &.default { + width: 23.4404em; + height: 16.8373em; + position: absolute; + } +} + +.section_small-hero { + background-color: $light-gray; + border: 1px solid #dfe1e7; + border-bottom-style: none; + position: relative; + overflow: hidden; + + &.padding-global { + padding-left: 2.5em; + padding-right: 2.5em; + } +} + +.container-small { + margin-right: auto !important; + margin-left: auto !important; + width: 100%; + max-width: 48em; +} + +.padding-section-medium { + padding-top: 5em; + padding-bottom: 5em; + position: relative; +} + +.rich-text-block-2 { + font-size: 1em; + line-height: 2.4em; + font-weight: 300; + h2 { + display: inline-block; + margin-top: 2vw; + margin-bottom: 1vw; + font-size: 2.3em; + line-height: 1.125em; + } +} + +.text-color-dark-green { + color: var(--dark-green); + strong { + font-weight: 700; + } +} + +#cookies-table { + float: left; + width: 100%; + + table { + width: 100%; + border-collapse: collapse; + + tr:nth-of-type(odd) { + background: $light-gray; + } + + th { + background: $dark-green; + color: white; + font-weight: bold; + padding: 0.375em; + border: 0.125em solid $medium-gray; + text-align: left; + } + + td, + th { + padding: 0.375em; + border: 0.125em solid $medium-gray; + text-align: left; + } + } + + @media all and (max-width: 767px) { + table, + thead, + tbody, + th, + td, + tr { + display: block; + } + + thead tr { + position: absolute; + top: -9999px; + left: -9999px; + } + + tr { + border-left: 0.125em solid $medium-gray; + border-right: 0.125em solid $medium-gray; + border-bottom: 0.125em solid $medium-gray; + + &:nth-of-type(1) { + border-top: 0.125em solid $medium-gray; + } + } + + td { + border: none; + border-bottom: 0.125em solid $lighter-gray; + position: relative; + padding-left: 50%; + + &:before { + position: absolute; + top: 0.375em; + left: 0.375em; + width: 45%; + padding-right: 0.625em; + white-space: nowrap; + } + + &:nth-of-type(1):before { + content: "Cookie"; + } + + &:nth-of-type(2):before { + content: "Purpose"; + } + + &:nth-of-type(3):before { + content: "More information"; + } + } + } +} + +.cursor-pointer { + cursor: pointer; +} +.link-selected:hover{ + color: #bd4e0a; + text-decoration: underline; } \ No newline at end of file diff --git a/ckanext/ubdc/public/base/scss/_homepage.scss b/ckanext/ubdc/public/base/scss/_homepage.scss index e96a37a..4d4a667 100644 --- a/ckanext/ubdc/public/base/scss/_homepage.scss +++ b/ckanext/ubdc/public/base/scss/_homepage.scss @@ -15,7 +15,7 @@ background-repeat: no-repeat; display: flex; align-items: center; - border: 1px solid #DFE1E7; + border: 1px solid #dfe1e7; .wrap { display: flex; justify-content: center; @@ -562,3 +562,15 @@ color: #fff; background: $orange-shade; } + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: searchfield-cancel-button; + position: relative; + right: 20px; + height: 20px; + width: 20px; + border-radius: 10px; + background: url(/base/images/close.svg) no-repeat 50% 50%; + background-size: contain; +} diff --git a/ckanext/ubdc/public/base/scss/_masthead.scss b/ckanext/ubdc/public/base/scss/_masthead.scss index 9da996e..52dea11 100644 --- a/ckanext/ubdc/public/base/scss/_masthead.scss +++ b/ckanext/ubdc/public/base/scss/_masthead.scss @@ -212,7 +212,7 @@ $notificationsBg: #c9403a; input { width: 40px; opacity: 0; - padding: calc($grid-gutter-width/6) calc($grid-gutter-width/3); + padding: 10px; -webkit-transition: width 0.4s ease-in-out; transition: width 0.4s ease-in-out; ~ .btn-search { @@ -220,6 +220,7 @@ $notificationsBg: #c9403a; cursor: default; font-size: 20px !important; color: $black; + top: 40%; } &:focus { width: 200px; diff --git a/ckanext/ubdc/public/base/scss/_variables.scss b/ckanext/ubdc/public/base/scss/_variables.scss index 584c8a3..c4f51e9 100644 --- a/ckanext/ubdc/public/base/scss/_variables.scss +++ b/ckanext/ubdc/public/base/scss/_variables.scss @@ -159,4 +159,8 @@ $heading-black-shade: #0d0d12; $text-black-shade: #36394a; $orange-shade: #c2410c; -$hero-height: 550px; \ No newline at end of file +$hero-height: 550px; +$dark-green: #184e44; +$light-gray: #f2f2f2; +$medium-gray: #ccc; +$lighter-gray: #eee; \ No newline at end of file diff --git a/ckanext/ubdc/templates/cookie/base.html b/ckanext/ubdc/templates/cookie/base.html new file mode 100644 index 0000000..ed706cc --- /dev/null +++ b/ckanext/ubdc/templates/cookie/base.html @@ -0,0 +1,134 @@ +{% extends "base.html" %} + +{%- block page -%} + + {% block skip %} +
+ {% endblock %} + + {# + Override the header on a page by page basis by extending this block. If + making sitewide header changes it is preferable to override the header.html + file. + #} + {%- block header %} + {% include "header.html" %} + {% endblock -%} + + {# The content block allows you to replace the content of the page if needed #} + {%- block content %} + {% block maintag %}Some content for the page
+ {% endblock %} + #} + {% block primary_content %} +The Urban Big Data Centre (UBDC) uses cookies to ensure the website functions correctly, to + provide enhancing features and to analyse website performance. We may share information + about your use of our website with our social media and analytics partners who may combine + it with other information that you’ve provided to them or that they’ve collected from your + use of their services.
+
+Cookies are small text files stored on your browser and they contain certain information + about you, or your website behaviour, such as your language preferences or whether you are a + new or returning user to our website. This allows us to give you a better website + experience.
+
+The UBDC data catalogue uses a combination of first- and third-party cookies. First party + cookies are placed on your browser by the same website you are on (www.data.ubdc.ac.uk), + while third party cookies are placed on your browser by a different website than the one you + are on (i.e. Twitter).
+At UBDC we respect your right to privacy, that is why we require your consent to use any + non-essential cookies. However, not allowing certain type of cookies may impact how the + website works. You can choose your cookies preference by using the consent preference + centre on the website (or clicking on the cookie button at the + bottom....).
+
+Learn more about who we are, how you can contact us and how we process personal data in our + Privacy + Policy. +
+
+Your consent applies to the following domains: www.data.ubdc.ac.uk. Please state your + consentID and date when you contact us regarding your consent. +
+