-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from datopian/setup/scss-styling-setup
Home page styling implemented as per Figma design
- Loading branch information
Showing
167 changed files
with
35,992 additions
and
46 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$('.site-search button').click(function(event) { | ||
$('#field-sitewide-search').addClass(''); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# ubdc-js: | ||
# filter: rjsmin | ||
# output: ckanext-ubdc/%(version)s-ubdc.js | ||
# contents: | ||
# - js/ubdc.js | ||
# extra: | ||
# preload: | ||
# - base/main | ||
ubdc-js: | ||
filter: rjsmin | ||
output: ckanext-ubdc/%(version)s-ubdc.js | ||
contents: | ||
- js/ubdc.js | ||
extra: | ||
preload: | ||
- base/main | ||
|
||
# ubdc-css: | ||
# filter: cssrewrite | ||
# output: ckanext-ubdc/%(version)s-ubdc.css | ||
# contents: | ||
# - css/ubdc.css | ||
ubdc-css: | ||
filter: cssrewrite | ||
output: ckanext-ubdc/%(version)s-ubdc.css | ||
contents: | ||
- css/style.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ dataset_fields: | |
preset: title | ||
form_placeholder: eg. A descriptive title | ||
|
||
- field_name: alternative_title | ||
label: Alternative title | ||
form_placeholder: eg. An alternative dataset title | ||
|
||
- field_name: name | ||
label: URL | ||
preset: dataset_slug | ||
|
@@ -21,60 +25,173 @@ dataset_fields: | |
form_snippet: markdown.html | ||
form_placeholder: eg. Some useful notes about the data | ||
|
||
- field_name: content | ||
label: Content | ||
form_snippet: markdown.html | ||
form_placeholder: eg. Some useful content about what does the dataset consists of (more tables, some specifics etc…) | ||
|
||
- field_name: subject | ||
label: Subject | ||
form_snippet: markdown.html | ||
form_placeholder: eg. Subject of the dataset ie housing/transport | ||
|
||
- field_name: tag_string | ||
label: Tags | ||
label: Topics | ||
preset: tag_string_autocomplete | ||
form_placeholder: eg. economy, mental health, government | ||
|
||
- field_name: dataset_citation | ||
label: Dataset Citation | ||
|
||
- field_name: time_period_coverage | ||
label: Time Period Coverage | ||
|
||
- field_name: geographical_coverage | ||
label: Geographical Coverage | ||
|
||
- field_name: spatial_units | ||
label: Subject | ||
|
||
- field_name: observation_units | ||
label: Observation Units | ||
|
||
- field_name: resource_type | ||
label: Resource Type | ||
|
||
- field_name: data_format | ||
label: Data Format | ||
|
||
- field_name: weighting | ||
label: Weighting | ||
|
||
- field_name: method_of_collection | ||
label: Method of Collection | ||
|
||
- field_name: collection_status | ||
label: Collection Status | ||
|
||
- field_name: dataset_fields | ||
label: Dataset Fields | ||
|
||
- field_name: dataset_aggregation | ||
label: Dataset Aggregation | ||
|
||
- field_name: data_owner | ||
label: Data Owner | ||
|
||
- field_name: data_owner_url | ||
label: Data Owner Url | ||
|
||
- field_name: license_id | ||
label: License | ||
form_snippet: license.html | ||
help_text: License definitions and additional information can be found at http://opendefinition.org/ | ||
label: Licence Name | ||
|
||
- field_name: license_specifics | ||
label: Licence Specifics | ||
form_snippet: markdown.html | ||
form_placeholder: eg. Some useful notes about the licence | ||
|
||
- field_name: owner_org | ||
label: Organization | ||
preset: dataset_organization | ||
|
||
- field_name: url | ||
label: Source | ||
form_placeholder: http://example.com/dataset.json | ||
display_property: foaf:homepage | ||
display_snippet: link.html | ||
|
||
- field_name: version | ||
label: Version | ||
validators: ignore_missing unicode_safe package_version_validator | ||
form_placeholder: '1.0' | ||
|
||
- field_name: author | ||
label: Author | ||
form_placeholder: Joe Bloggs | ||
display_property: dc:creator | ||
- field_name: dataset_available | ||
label: Dataset Available | ||
reset: date | ||
form_placeholder: eg. 2011-01-01 | ||
|
||
- field_name: dataset_closed | ||
label: Dataset Closed | ||
preset: date | ||
form_placeholder: eg. 2011-01-01 | ||
|
||
- field_name: dataset_valid | ||
label: Dataset Valid | ||
preset: date | ||
form_placeholder: eg. 2011-01-01 | ||
|
||
- field_name: dataset_updating_frequency | ||
label: Dataset Updating Frequency | ||
form_placeholder: eg. Every monthy | ||
|
||
- field_name: dataset_next_version_due | ||
label: Dataset Next Version Due | ||
preset: date | ||
form_placeholder: eg. 2011-01-01 | ||
|
||
- field_name: date_published | ||
label: Date Published | ||
preset: date | ||
form_placeholder: eg. 2022-01-01 | ||
|
||
- field_name: date_of_fieldwork | ||
label: Date of Fieldwork | ||
form_placeholder: eg. 2022-01-01 to 2022-02-29 | ||
|
||
- field_name: dataset_file_type | ||
label: Dataset File Type | ||
form_placeholder: eg. CSV | ||
|
||
- field_name: dataset_file_size | ||
label: Dataset File Size | ||
form_placeholder: eg. 1.5MB | ||
|
||
- field_name: dataset_creation_date | ||
label: Dataset Creation Date | ||
preset: date | ||
form_placeholder: eg. 2011-01-01 | ||
|
||
- field_name: dataset_access_restrictions | ||
label: Dataset Access Restrictions | ||
form_placeholder: eg. Open, Safeguarded or Controlled Dataset | ||
|
||
- field_name: metadata_created_date | ||
label: Metadata Created Date | ||
preset: date | ||
form_placeholder: eg. 2022-01-01 | ||
|
||
- field_name: metadata_created_institution | ||
label: Metadata Created Institution | ||
form_placeholder: eg. Urban Big Data Centre | ||
|
||
# - field_name: dataset_fields | ||
# label: Dataset Fields | ||
# repeating_label: Dataset Field | ||
# repeating_subfields: | ||
|
||
# - field_name: name | ||
# label: Field Name | ||
|
||
# - field_name: description | ||
# label: Description | ||
|
||
# - field_name: type | ||
# label: Type | ||
# preset: select | ||
# choices: | ||
# - value: text | ||
# label: Text | ||
# - value: number | ||
# label: Number | ||
# - value: date | ||
# label: Date | ||
# - value: boolean | ||
# label: Boolean | ||
# - value: other | ||
# label: Other | ||
|
||
- field_name: author_email | ||
label: Author Email | ||
form_placeholder: [email protected] | ||
display_property: dc:creator | ||
display_snippet: email.html | ||
display_email_name_field: author | ||
|
||
- field_name: publishing_status | ||
label: Publishing Status | ||
form_snippet: null | ||
display_snippet: null | ||
validators: ignore_missing publishing_status_validator | ||
|
||
- field_name: maintainer | ||
label: Maintainer | ||
form_placeholder: Joe Bloggs | ||
display_property: dc:contributor | ||
|
||
- field_name: maintainer_email | ||
label: Maintainer Email | ||
form_placeholder: [email protected] | ||
display_property: dc:contributor | ||
display_snippet: email.html | ||
display_email_name_field: maintainer | ||
|
||
|
||
resource_fields: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
from ckan import model | ||
from ckan.logic import get_action | ||
|
||
|
||
def popular_datasets(limit=3): | ||
"""Return a list of the most popular datasets.""" | ||
context = {'model': model, 'session': model.Session} | ||
data_dict = {'sort': 'views_recent desc', 'rows': limit} | ||
return get_action('package_search')(context, data_dict)['results'] | ||
|
||
|
||
def resources_count(): | ||
"""Return the total number of resources.""" | ||
context = {'model': model, 'session': model.Session} | ||
data_dict = {'query': 'name:'} | ||
return get_action('resource_search')(context, data_dict)['count'] | ||
|
||
def tags_count(): | ||
"""Return the total number of tags.""" | ||
context = {'model': model, 'session': model.Session} | ||
return {'count': len(get_action('tag_list')(context, {})) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import ckan.plugins as plugins | ||
import ckan.plugins.toolkit as toolkit | ||
|
||
import ckanext.ubdc.helpers as helpers | ||
|
||
class UbdcPlugin(plugins.SingletonPlugin): | ||
plugins.implements(plugins.IConfigurer) | ||
plugins.implements(plugins.ITemplateHelpers) | ||
|
||
# IConfigurer | ||
def update_config(self, config_): | ||
toolkit.add_template_directory(config_, 'templates') | ||
toolkit.add_public_directory(config_, 'public') | ||
toolkit.add_resource('fanstatic', | ||
'ubdc') | ||
toolkit.add_resource('assets', 'ubdc') | ||
|
||
# ITemplateHelpers | ||
def get_helpers(self): | ||
return { | ||
'popular_datasets': helpers.popular_datasets, | ||
'resources_count': helpers.resources_count, | ||
'tags_count': helpers.tags_count, | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.