diff --git a/changes/1582.feature b/changes/1582.feature new file mode 100644 index 000000000..119cda11d --- /dev/null +++ b/changes/1582.feature @@ -0,0 +1 @@ +split dataset type into separate pages using scheming form pages and dataset completeness feature diff --git a/ckanext/canada/assets/internal/canada_internal.css b/ckanext/canada/assets/internal/canada_internal.css index ceea48c4b..669530722 100644 --- a/ckanext/canada/assets/internal/canada_internal.css +++ b/ckanext/canada/assets/internal/canada_internal.css @@ -24,6 +24,10 @@ ol.breadcrumb { text-decoration: none; } +.border-0 { + border: 0 !important; +} + #wb-info a { text-decoration: none; } @@ -504,39 +508,7 @@ label:lang(fr):after { .control-required { color: #e00; } -.stages li.active:after { - border-top-color: #EDEDED; - border-bottom-color: #EDEDED; - border-right-color: #284162; - z-index: -1; -} -.border-0 { - border: 0 !important; -} - -.stages li.complete .highlight { - color: #aeaeae; - background: #EDEDED; -} -.stages li.complete:before { - color: #aeaeae; - background: white; -} - -.stages li.active:after { - border-top-color: #284162; - border-bottom-color: #284162; - border-right-color: #284162; -} -.stages li.active:after { - border-top-color: #EDEDED; - border-bottom-color: #EDEDED; -} -.stages li.complete:after { - border-top-color: #EDEDED; - border-bottom-color: #EDEDED; -} li.nav-item.justify-content-between.position-relative:hover { background-color: #eee; } @@ -700,6 +672,127 @@ body ul.xloader-log li.item.failure > i::after{ ## END ## #############################*/ +/*#################### +## Package Stages ## +######################*/ +#dropdown-manage-dataset{ + font-weight: bold !important; + font-size: 16px !important; + line-height: 1.4375 !important; + border-radius: 0 !important; + border: none !important; + background-color: #f6f6f6 !important; + transition-duration: 0.325s !important; +} + +#dropdown-manage-dataset:hover, +#dropdown-manage-dataset:active, +#dropdown-manage-dataset:focus{ + background-color: #335075 !important; + color: white !important; +} + +ul.dropdown-menu#dropdown-manage-dataset-menu a{ + display: block !important; + padding: 3px 20px !important; + clear: both !important; + font-weight: 400 !important; + line-height: 1.4375 !important; + color: #333 !important; + white-space: nowrap !important; + text-decoration: none !important; + margin: 0 !important; + transition-duration: 0.325s !important; + background-color: white !important; +} + +ul.dropdown-menu#dropdown-manage-dataset-menu a:hover, +ul.dropdown-menu#dropdown-manage-dataset-menu a:active, +ul.dropdown-menu#dropdown-manage-dataset-menu a:focus{ + color: #333 !important; + text-decoration: none !important; + background-color: #f5f5f5 !important; +} + +form#dataset-edit{ + position: relative; + width: 100%; +} + +.canada-package-edit-toolbar{ + margin: 0 !important; + padding: 0 !important; +} + +#canada-package-form-stages{ + background-color: #EDEDED; + margin-bottom: 30px; + margin-top: 0; +} + +#canada-package-form-stages[data-form-style="new"]{ + margin-top: -30px; +} + +#canada-package-form-stages .module-heading{ + padding-left: 15px !important; +} + +#canada-package-form-stages ul.nav li.nav-item{ + display: flex !important; + flex-direction: row; + flex-wrap: nowrap; + position: relative; + padding: 0 !important; +} + +#canada-package-form-stages .canada-package-form-stages--label{ + padding: 17px 35px 17px 25px; + display: block; + width: 100%; + text-decoration: none !important; + color: #333 !important; +} + +#canada-package-form-stages a.canada-package-form-stages--label:hover, +#canada-package-form-stages a.canada-package-form-stages--label:active, +#canada-package-form-stages a.canada-package-form-stages--label:focus{ + background: #d9d9d9; + color: #333 !important; + transition-duration: 0.325s; +} + +#canada-package-form-stages ul.nav li.nav-item.active .canada-package-form-stages--label{ + background: #38414d; + color: #fefefe !important; + font-weight: 600; +} + +#canada-package-form-stages ul.nav li.nav-item abbr{ + height: auto; + display: block; + position: absolute; + right: 12px; + top: 50%; + transform: translate(0, -50%); + pointer-events: hover; + cursor: help; +} + +#canada-package-form-stages ul.nav li.nav-item.active abbr i{ + background: white; + border: 1px solid white; + border-radius: 50%; +} + +#canada-package-form-stages ul.nav button{ + padding: 0 !important; +} +/*#################### +## END ## +## Package Stages ## +## END ## +######################*/ /*#################################### ## Recombinant Base CSS Overrides ## @@ -868,4 +961,4 @@ input#field-resource-url{ ## TODO: DEPRECATED: ## ## REMOVE AFTER FULL PD DATATABLES QA ## ## END ## -########################################*/ \ No newline at end of file +########################################*/ diff --git a/ckanext/canada/assets/public/canada_public.css b/ckanext/canada/assets/public/canada_public.css index fe75abe30..b7dee5de2 100644 --- a/ckanext/canada/assets/public/canada_public.css +++ b/ckanext/canada/assets/public/canada_public.css @@ -146,6 +146,20 @@ body .canada-w10-spacer{ line-height: 0 !important; } +body .canada-v10-spacer{ + display: block !important; + margin: 0 !important; + padding: 0 !important; + min-height: 10px !important; + max-height: 10px !important; + height: 10px !important; + min-width: 0 !important; + max-width: 0 !important; + width: 0 !important; + line-height: 0 !important; +} + + img.openness-rating-stars { margin-bottom: 0px !important; } @@ -2074,4 +2088,4 @@ body select[data-field-select2="True"]{ font-weight: 600 !important; font-size: 32px !important; color: #38414d !important; -} \ No newline at end of file +} diff --git a/ckanext/canada/plugin/dataset_plugin.py b/ckanext/canada/plugin/dataset_plugin.py index 9289d3b9e..ec3bba23e 100644 --- a/ckanext/canada/plugin/dataset_plugin.py +++ b/ckanext/canada/plugin/dataset_plugin.py @@ -16,7 +16,9 @@ from ckanext.canada.helpers import RELEASE_DATE_FACET_STEP from ckanext.canada.view import ( CanadaDatasetEditView, + CanadaDatasetEditPageView, CanadaDatasetCreateView, + CanadaDatasetCreatePageView, CanadaResourceEditView, CanadaResourceCreateView, canada_search, @@ -116,6 +118,16 @@ def prepare_dataset_blueprint(self, package_type: str, methods=['GET'], strict_slashes=False ) + blueprint.add_url_rule( + '/new//', + 'scheming_new_page', + CanadaDatasetCreatePageView.as_view('new_page'), + ) + blueprint.add_url_rule( + '/edit//', + 'scheming_edit_page', + CanadaDatasetEditPageView.as_view('edit_page'), + ) # redirect PD endpoints accessed from /dataset/ blueprint.before_request(cast(BeforeRequestCallable, self._redirect_pd_dataset_endpoints)) diff --git a/ckanext/canada/schemas/dataset.yaml b/ckanext/canada/schemas/dataset.yaml index 33b915c06..a3cbb7949 100644 --- a/ckanext/canada/schemas/dataset.yaml +++ b/ckanext/canada/schemas/dataset.yaml @@ -1,7 +1,7 @@ - -scheming_version: 1 dataset_type: dataset +draft_fields_required: false + before_validators: limit_resources_per_dataset about: 'open.canada.ca: raw open data metadata definition' @@ -59,7 +59,9 @@ sidebar_show_fields: dataset_fields: # our id + name fields are uuids and always equal -- preset: canada_dataset_id +- start_form_page: + title: Descriptive Metadata + preset: canada_dataset_id - preset: canada_dataset_name - preset: canada_collection @@ -69,6 +71,67 @@ dataset_fields: - api - app +- preset: canada_title +- preset: canada_owner_org +- preset: canada_notes +- preset: canada_keywords +- preset: canada_digital_object_identifier + +- start_form_page: + title: Publishing Information + preset: canada_org_title_at_publication +- preset: canada_org_section_name +- preset: canada_creator +- preset: canada_contributor +- preset: canada_maintainer_email +- preset: canada_maintainer_contact_form +- preset: canada_credit + +- start_form_page: + title: Taxonomic Metadata + preset: canada_subject +- preset: canada_audience + +- field_name: place_of_publication + label: + en: Place of Publication + fr: Endroit de publication + help_text: + en: "The region where the dataset was originally published. You may select or deselect multiple options (Ctrl+Click) " + fr: "La région où le jeu de données a été publié initialement. Vous pouvez sélectionner ou désélectionner de multiples options (Ctrl+Clic)" + preset: canada_geographic_region # use same multi-select controlled list + select_size: 10 + +- preset: canada_spatial +- preset: canada_geographic_region + +- start_form_page: + title: Series Metadata + preset: canada_data_series_name +- preset: canada_data_series_issue_identification +- preset: canada_program_page_url +- preset: canada_dataset_relationship + +- start_form_page: + title: Coverage + preset: canada_time_period_coverage_start +- preset: canada_time_period_coverage_end +- preset: canada_frequency +- preset: canada_date_published +- preset: canada_date_modified +- preset: canada_federated_date_modified +- preset: canada_jurisdiction +- preset: canada_license_id +- preset: canada_restrictions + +- start_form_page: + title: Approval + preset: canada_imso_approval +- preset: canada_ready_to_publish +- preset: canada_portal_release_date + + + # FGP fields (hidden from form) - field_name: metadata_contact label: @@ -100,14 +163,6 @@ dataset_fields: fr: Identifiant court form_snippet: null validators: scheming_required string_safe - -- preset: canada_title -- preset: canada_owner_org -- preset: canada_org_title_at_publication -- preset: canada_org_section_name -- preset: canada_creator - -# FGP fields (hidden from form) - field_name: position_name label: en: Position Name @@ -212,37 +267,6 @@ dataset_fields: fr: Services communication value: utilities_communication -- preset: canada_contributor -- preset: canada_maintainer_email -- preset: canada_maintainer_contact_form -- preset: canada_credit -- preset: canada_notes -- preset: canada_keywords -- preset: canada_subject -- preset: canada_audience - -- field_name: place_of_publication - label: - en: Place of Publication - fr: Endroit de publication - help_text: - en: "The region where the dataset was originally published. You may select or deselect multiple options (Ctrl+Click) " - fr: "La région où le jeu de données a été publié initialement. Vous pouvez sélectionner ou désélectionner de multiples options (Ctrl+Clic)" - preset: canada_geographic_region # use same multi-select controlled list - select_size: 10 - -- preset: canada_spatial -- preset: canada_geographic_region -- preset: canada_time_period_coverage_start -- preset: canada_time_period_coverage_end -- preset: canada_frequency -- preset: canada_date_published -- preset: canada_date_modified -- preset: canada_program_page_url -- preset: canada_federated_date_modified -- preset: canada_data_series_name -- preset: canada_data_series_issue_identification -- preset: canada_digital_object_identifier # FGP fields (hidden from form) - field_name: reference_system_information @@ -340,13 +364,6 @@ dataset_fields: - preset: canada_spatial_representation_type -- preset: canada_jurisdiction -- preset: canada_license_id -- preset: canada_restrictions -- preset: canada_imso_approval -- preset: canada_ready_to_publish -- preset: canada_portal_release_date - # fields hidden from the form to support loading fgp and geogratis data - field_name: presentation_form @@ -453,7 +470,6 @@ dataset_fields: en: FGP viewer is supported value: fgp_viewer -- preset: canada_dataset_relationship # diff --git a/ckanext/canada/schemas/info.yaml b/ckanext/canada/schemas/info.yaml index ab6cac435..d7d6753ff 100644 --- a/ckanext/canada/schemas/info.yaml +++ b/ckanext/canada/schemas/info.yaml @@ -1,7 +1,7 @@ - -scheming_version: 1 dataset_type: info +draft_fields_required: false + before_validators: limit_resources_per_dataset about: 'open.canada.ca: open information metadata definition' @@ -53,7 +53,9 @@ sidebar_show_fields: dataset_fields: # our id + name fields are uuids and always equal -- preset: canada_dataset_id +- start_form_page: + title: Descriptive Metadata + preset: canada_dataset_id - preset: canada_dataset_name - preset: canada_collection @@ -67,62 +69,9 @@ dataset_fields: - aia - accessibiliy_plans -# Field = Title English. -# {The English name by which the asset is known} -# Field = Title French. -# {The French name by which the asset is known} - preset: canada_title - -# Field = Publisher - Current Organization Name. -# List box Source: Publisher - Current Organization Name code table (refer to Data Migration). -# Populate the list box with the Titles of all the organizations the currently logged-in user is linked to. -# {The Title of the current Organization (GC Department or Agency) primarily responsible for publishing the asset} - preset: canada_owner_org - -# Field = Publisher - Organization Name at Publication (English). -# {The organization Title at publication Time} -# Field = Publisher - Organization Name at Publication (French). -# {The organization Title at publication Time} -- preset: canada_org_title_at_publication - -# Field = Publisher - Organization Section Name English. -# {The English names of the work groups, units of work, business units, etc. of the organization that publishes the asset (separate multiple names by commas).} -# Field = Publisher - Organization Section Name French. -# {The French names of the work groups, units of work, business units, etc. of the organization that publishes the asset (separate multiple names by commas).} -- preset: canada_org_section_name - -# Field = Creator. -# { Individual entities (persons) primarily responsible for making the asset (separate multiple entities by commas).} -- preset: canada_creator - -# Field = Contributor English. -# {The English names of entities (persons, groups, GC Departments or Agencies) that contributed to the asset (separate multiple entities by commas).} -# Field = Contributor French. -# {The French names of entities (persons, groups, GC Departments or Agencies) that contributed to the asset (separate multiple entities by commas).} -- preset: canada_contributor - -# Field = Contact Email. -# {The contact person's email for the information asset} -- preset: canada_maintainer_email - -# Field = Credit English. -# {The English names of entities (persons, groups, GC Departments or Agencies) that are credited for the dataset.} -# Field = Reconnaissance French. -# {The French names of entities (persons, groups, GC Departments or Agencies) that are credited for the dataset.} -- preset: canada_credit - -# Field = Description English -# Markdown formatting Property = http://daringfireball.net/projects/markdown/syntax -# {An account of the information asset, in English. A description may include abstract, table of contents or a free-text.} -# Field = Description French. -# Markdown formatting Property = http://daringfireball.net/projects/markdown/syntax -# {An account of the information asset, in French. A description may include abstract, table of contents or a free-text.} - preset: canada_notes - -# Field = Note English. -# { General information relating to an asset, in English } -# Field = Note English. -# { General information relating to an asset, in French } - field_name: additional_notes label: en: Note @@ -150,25 +99,71 @@ dataset_fields: size: 100 class: form-control -# Field = Keywords English. -# {Commonly used words or phrases which describe the asset, in English} -# Field = Keywords French. -# {Commonly used words or phrases which describe the asset, in French} - preset: canada_keywords -# Field = Subject. -# List box Source: Subject code table (refer to Data Migration). -# {The topic of the content of the information asset. You may select or deselect multiple subjects (Ctrl+Click).} -- preset: canada_subject +- start_form_page: + title: Publishing Information + preset: canada_org_title_at_publication +- preset: canada_org_section_name +- preset: canada_creator +- preset: canada_contributor +- preset: canada_maintainer_email +- preset: canada_credit -# Field = Audience. -# List box Source: Audience code table (refer to Data Migration). -# {A description of the audience or group of people for whom the described asset is intended or useful. You may select or deselect multiple options (Ctrl+Click).} +# Field = ISBN. +# {The identification of the asset’s - International Standard Book Number, a unique identifier assigned to many types of publications except serials by a registration agency.} +- field_name: isbn + label: + en: ISBN + help_text: + en: The identification of the asset’s - International Standard Book Number, a unique identifier assigned to many types of publications except serials by a registration agency + +# Field = ISSN. +# {The identification of the asset’s International Standard Serial Number, a unique identifier assigned to serial publications by a registration agency.} +- field_name: issn + label: + en: ISSN + help_text: + en: The identification of the asset’s International Standard Serial Number, a unique identifier assigned to serial publications by a registration agency + fr: Identification du Numéro international normalisé des publications en série du produit, un identificateur unique assigné aux publications en série par un organisme d’enregistrement + +# Field = Government of Canada Catalogue Number. +# {The identification of the asset’s GC Catalogue Number} +- field_name: gc_catalogue_number + label: + en: Government of Canada Catalogue Number + fr: Numéro de catalogue du gouvernement du Canada + help_text: + en: The identification of the asset’s GC Catalogue Number + fr: Identification du numéro du produit dans le catalogue du GC + +# Field = Departmental Identification Number. +# {The identification number of the organization which published the asset} +- field_name: departmental_identification_number + label: + en: Departmental Identification Number + fr: Numéro d’identification du ministère + help_text: + en: The identification number of the organization which published the asset + fr: Numéro d’identification de l’organisation qui a publié le produit + +# Field = PSPC System Identifier. +# {The identification number given to the asset by Public Service and Procurement Canada} +- field_name: pspc_identification_number + label: + en: PSPC System Identifier + fr: Identificateur de système de SPAC + help_text: + en: The identification number given to the asset by Public Service and Procurement Canada + fr: Le numéro d’identification attribué au produit par Services publics et Approvisionnement Canada + +- preset: canada_digital_object_identifier + +- start_form_page: + title: Taxonomic Metadata + preset: canada_subject - preset: canada_audience -# Field = Place pf Publication. -# List box Source: Geographic Region Name code table (refer to Data Migration). -# {The region where the asset was originally published} - field_name: place_of_publication label: en: Place of Publication @@ -178,68 +173,20 @@ dataset_fields: fr: La région où le produit a été publié initialement. Vous pouvez sélectionner ou désélectionner de multiples options (Ctrl+Clic) preset: canada_geographic_region # use same multi-select controlled list -# Field = Spatial. -# {The range of spatial applicability of an information asset. This element could include either a bounding box, or GeoJson string.} - preset: canada_spatial - -# Field = Geographic Region Name. -# List box Source: Geographic Region name code table (refer to Data Migration). -# Format: {Province – Region}, e.g. Ontario – Sudbury. -# {The geographic region of an asset. You may or deselect multiple regions (Ctrl+Click).} - preset: canada_geographic_region -# Field = Time Period Coverage Start Date. -# Add a Calendar control to select a Date. -# {The start date of the period covered by the asset (YYYY-MM-DD)} -- preset: canada_time_period_coverage_start +- start_form_page: + title: Series Metadata + preset: canada_data_series_name +- preset: canada_data_series_issue_identification +- preset: canada_program_page_url +- preset: canada_dataset_relationship -# Field = Time Period Coverage End Date. -# Add a Calendar control to select a Date. -# {The end date of the period covered by the asset (YYYY-MM-DD)} +- start_form_page: + title: Coverage + preset: canada_time_period_coverage_start - preset: canada_time_period_coverage_end - -# Field = Issuance. -# List box Source: Issuance code table (refer to Data Migration). -# { A term that designates how the resource is issued } -- field_name: issuance - label: - en: Issuance - fr: Publication - help_text: - en: A term that designates how the asset is issued - fr: Un terme qui décrit comment la ressource est publié - form_snippet: select.html - display_snippet: select.html - validators: scheming_required scheming_choices - choices: - - label: - en: Monographic - fr: Monographique - value: monographic - - label: - en: Single Unit - fr: Unité simple - value: single_unit - - label: - en: Multipart monograph - fr: Monographie en plusieurs volumes - value: multipart_monograph - - label: - en: Continuing - fr: Suite - value: continuing - - label: - en: Serial - fr: Série - value: serial - - label: - en: Integrating Resource - fr: Ressource intégratrice - value: integrating_resource - -# Field = Frequency of Issuance. -# List box Source: Frequency of Issuance code table (refer to Data Migration). -# { A statement of publication frequency in textual form } - field_name: issuance_frequency label: en: Frequency of Issuance @@ -320,19 +267,8 @@ dataset_fields: fr: Entièrement irrégulier value: irregular -# Field = Maintenance and Update Frequency. -# List box Source: Maintenance and Update Frequency code table (refer to Data Migration). -# {The frequency with which changes and additions are made to the initial asset} - preset: canada_frequency - -# Field = Date Published. -# Add a Calendar control to select a Date. -# {The date of issuance (e.g., publication) of the information asset (YYYY-MM-DD)} - preset: canada_date_published - -# Field = Date Modified. -# Add a Calendar control to select a Date. -# {The date on which the information asset was updated (YYYY-MM-DD)} - preset: canada_date_modified # Field = Date Created. @@ -393,108 +329,55 @@ dataset_fields: form_attrs: class: form-control -# Field = Homepage English. -# {A program or homepage that can be navigated to gain additional or contextual information about the asset.} -# Field = Homepage French. -# {A program or homepage that can benavigated to gain additional or contextual information about the asset.} -- preset: canada_program_page_url - -# Field = Series Title English. -# {The English name of the series, or aggregate asset, of which the asset is a part} -# Field = Series Title French. -# {The French name of the series, or aggregate asset, of which the asset is a part} -- preset: canada_data_series_name - -# Field = Series Issue ID English. -# {English identification of the series’ issue information} -# Field = Series Issue ID French. -# {French identification of the series’ issue information} -- preset: canada_data_series_issue_identification - -# Field = ISBN. -# {The identification of the asset’s - International Standard Book Number, a unique identifier assigned to many types of publications except serials by a registration agency.} -- field_name: isbn - label: - en: ISBN - help_text: - en: The identification of the asset’s - International Standard Book Number, a unique identifier assigned to many types of publications except serials by a registration agency - -# Field = ISSN. -# {The identification of the asset’s International Standard Serial Number, a unique identifier assigned to serial publications by a registration agency.} -- field_name: issn - label: - en: ISSN - help_text: - en: The identification of the asset’s International Standard Serial Number, a unique identifier assigned to serial publications by a registration agency - fr: Identification du Numéro international normalisé des publications en série du produit, un identificateur unique assigné aux publications en série par un organisme d’enregistrement - -# Field = Government of Canada Catalogue Number. -# {The identification of the asset’s GC Catalogue Number} -- field_name: gc_catalogue_number - label: - en: Government of Canada Catalogue Number - fr: Numéro de catalogue du gouvernement du Canada - help_text: - en: The identification of the asset’s GC Catalogue Number - fr: Identification du numéro du produit dans le catalogue du GC - -# Field = Departmental Identification Number. -# {The identification number of the organization which published the asset} -- field_name: departmental_identification_number - label: - en: Departmental Identification Number - fr: Numéro d’identification du ministère - help_text: - en: The identification number of the organization which published the asset - fr: Numéro d’identification de l’organisation qui a publié le produit - -# Field = PSPC System Identifier. -# {The identification number given to the asset by Public Service and Procurement Canada} -- field_name: pspc_identification_number +# Field = Issuance. +# List box Source: Issuance code table (refer to Data Migration). +# { A term that designates how the resource is issued } +- field_name: issuance label: - en: PSPC System Identifier - fr: Identificateur de système de SPAC + en: Issuance + fr: Publication help_text: - en: The identification number given to the asset by Public Service and Procurement Canada - fr: Le numéro d’identification attribué au produit par Services publics et Approvisionnement Canada - -# Field = Digital Object Identifier DOI. -# {The Digital Object Identifier assigned to the asset. For more information visit: http://cisti-icist.nrc-cnrc.gc.ca/eng/services/cisti/datacite-canada/index.html} -- preset: canada_digital_object_identifier + en: A term that designates how the asset is issued + fr: Un terme qui décrit comment la ressource est publié + form_snippet: select.html + display_snippet: select.html + validators: scheming_required scheming_choices + choices: + - label: + en: Monographic + fr: Monographique + value: monographic + - label: + en: Single Unit + fr: Unité simple + value: single_unit + - label: + en: Multipart monograph + fr: Monographie en plusieurs volumes + value: multipart_monograph + - label: + en: Continuing + fr: Suite + value: continuing + - label: + en: Serial + fr: Série + value: serial + - label: + en: Integrating Resource + fr: Ressource intégratrice + value: integrating_resource -# Field = Jurisdiction. -# {The extent or range of judicial, law enforcement or other authority. Example: Level of government that contributed the asset.} - preset: canada_jurisdiction - -# Field = Licence. -# Populate the list box with the licence options from the Registry. -# {The licence applied to the information asset} - preset: canada_license_id - -# Field = Access Restrictions. -# Default Value = Unrestricted. -# {These are the access restrictions of the asset} - preset: canada_restrictions -# Field = IMSO Approval. -# List box options are Yes and No. -# {Has IMSO approval been obtained for this asset? By selecting yes, you agree to release this asset under the Open Government Licence - Canada} -# http://open.canada.ca/en/open-government-licence-canada -- preset: canada_imso_approval - -# Field = Ready to Publish. -# List box options are Yes and No. -# {Selecting ‘Yes’ will set this asset as ready to publish on the Open Government Portal. Selecting ‘No’ will saved it as a ‘draft’} +- start_form_page: + title: Approval + preset: canada_imso_approval - preset: canada_ready_to_publish - -# Field = Date Released. -# Available only for an Admin user. -# Add a Calendar control to select a Date. -# {The date the asset may be published on the Portal (YYYY-MM-DD)} - preset: canada_portal_release_date -- preset: canada_dataset_relationship - # # RESOURCE FIELDS diff --git a/ckanext/canada/templates/package/base_form_page.html b/ckanext/canada/templates/package/base_form_page.html index 5d12e34a5..73d87f6c7 100644 --- a/ckanext/canada/templates/package/base_form_page.html +++ b/ckanext/canada/templates/package/base_form_page.html @@ -7,11 +7,28 @@ {% endblock %} {% block secondary_content %} - {% if not h.is_registry_domain() %} + {% if form_vars and form_vars.dataset_type not in h.recombinant_get_types() %} + {% snippet "package/snippets/stages_sidebar.html", + data=form_vars.data, + dataset_type=form_vars.dataset_type, + form_style=form_vars.form_style, + s1 = form_vars.stage[0] or 'active', + s2 = form_vars.stage[1] or 'uncomplete' + %} {{ super() }} + {% if form_vars.data and form_vars.data.resources %} +
+ {% snippet "package/snippets/resources.html", pkg=form_vars.data %} +
+ {% endif %} {% endif %} {% endblock %} +{% block pre_primary %} + {{ super() }} +
+{% endblock %} + {% block page_header %} {% if not h.is_registry_domain() %} {{ super() }} diff --git a/ckanext/canada/templates/package/edit.html b/ckanext/canada/templates/package/edit.html index 28ff174d5..ae453ecc3 100644 --- a/ckanext/canada/templates/package/edit.html +++ b/ckanext/canada/templates/package/edit.html @@ -16,9 +16,26 @@ {% endblock %} +{% block page_header %} +
+ {{ super() }} +
+{% endblock %} + {% block secondary_content %} + {% if form_vars and form_vars.dataset_type not in h.recombinant_get_types() %} + {% snippet "package/snippets/stages_sidebar.html", + data=form_vars.data, + dataset_type=form_vars.dataset_type, + form_style=form_vars.form_style, + s1 = form_vars.stage[0] or 'active', + s2 = form_vars.stage[1] or 'uncomplete' + %} + {% endif %} {% if pkg_dict and pkg_dict.resources %} - {% snippet "package/snippets/resources.html", pkg=pkg %} +
+ {% snippet "package/snippets/resources.html", pkg=pkg %} +
{% endif %} {% endblock %} diff --git a/ckanext/canada/templates/package/new.html b/ckanext/canada/templates/package/new.html index 91cd683c6..d7715c5d7 100644 --- a/ckanext/canada/templates/package/new.html +++ b/ckanext/canada/templates/package/new.html @@ -1,12 +1,26 @@ {% ckan_extends %} {% block subtitle %} + {%- set editingDraft = form_vars.data.state == 'draft' -%} + {%- set title = h.get_translated(form_vars.data, 'title') or form_vars.data.id -%} {% if dataset_type == 'info' %} - {{- _('Create an Open Information Asset') -}} + {% if editingDraft %} + {{- _('Edit Draft Open Information Asset:') -}} {{- title -}} + {% else %} + {{- _('Create an Open Information Asset') -}} + {% endif %} {% elif dataset_type == 'dataset' %} - {{- _('Create an Open Data Record') -}} + {% if editingDraft %} + {{- _('Edit Draft Open Data Record:') -}} {{- title -}} + {% else %} + {{- _('Create an Open Data Record') -}} + {% endif %} {% else %} - {{- h.humanize_entity_type('package', dataset_type, 'create title') or _('Create Dataset') -}} + {% if editingDraft %} + {{- h.humanize_entity_type('package', dataset_type, 'edit label') or _('Edit Dataset') -}}{{- _(':') -}} {{- title -}} + {% else %} + {{- h.humanize_entity_type('package', dataset_type, 'create title') or _('Create Dataset') -}} + {% endif %} {% endif %} {% endblock %} diff --git a/ckanext/canada/templates/package/new_resource.html b/ckanext/canada/templates/package/new_resource.html index b1da44bf4..955441bc4 100644 --- a/ckanext/canada/templates/package/new_resource.html +++ b/ckanext/canada/templates/package/new_resource.html @@ -8,6 +8,17 @@ {% endblock %} +{% block secondary_content %} + {%- set pages = h.scheming_get_dataset_form_pages(dataset_type) -%} + {% snippet "package/snippets/stages_sidebar.html", + data={"_form_page": pages | length + 1, "id": pkg_dict.id, "state": pkg_dict.state}, + dataset_type=dataset_type, + s1 = 'complete', + s2 = 'active' + %} + {{ super() }} +{% endblock %} + {% block form %} {% set max_resource_count = h.max_resources_per_dataset() %} {% if h.is_registry_domain() and max_resource_count and pkg_dict.resources|length >= max_resource_count %} diff --git a/ckanext/canada/templates/package/read_base.html b/ckanext/canada/templates/package/read_base.html index 25aba744b..49ce0d2a5 100644 --- a/ckanext/canada/templates/package/read_base.html +++ b/ckanext/canada/templates/package/read_base.html @@ -31,8 +31,30 @@ {% endblock %} {% block content_action %} - {% if pkg.type not in h.recombinant_get_types() %} - {{ super() }} + {% if pkg.type not in h.recombinant_get_types() and h.check_access('package_update', {'id':pkg.id }) %} + {%- set pages = h.scheming_get_dataset_form_pages(pkg.type) -%} + {% if pages %} + + + {% else %} + {{- super() -}} + {% endif %} {% endif %} {% endblock %} diff --git a/ckanext/canada/templates/package/resource_edit_base.html b/ckanext/canada/templates/package/resource_edit_base.html index 1749e6444..483b5849a 100644 --- a/ckanext/canada/templates/package/resource_edit_base.html +++ b/ckanext/canada/templates/package/resource_edit_base.html @@ -8,6 +8,17 @@ {% endif %} {% endblock %} +{% block secondary_content %} + {%- set pages = h.scheming_get_dataset_form_pages(dataset_type) -%} + {% snippet "package/snippets/stages_sidebar.html", + data={"_form_page": pages | length + 1}, + dataset_type=dataset_type, + s1 = 'complete', + s2 = 'active' + %} + {{ super() }} +{% endblock %} + {% block content_action %} {%- link_for _('All resources'), named_route=pkg.type ~ '.resources', id=pkg.name, class_='btn btn-default', icon='arrow-left' -%} {% if res %} diff --git a/ckanext/canada/templates/package/snippets/resources.html b/ckanext/canada/templates/package/snippets/resources.html index 25c40dcce..6160b1ac5 100644 --- a/ckanext/canada/templates/package/snippets/resources.html +++ b/ckanext/canada/templates/package/snippets/resources.html @@ -31,7 +31,7 @@