Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to display grouped metadata by relying on start_form_page #383

Open
frafra opened this issue Aug 12, 2023 · 0 comments
Open

Option to display grouped metadata by relying on start_form_page #383

frafra opened this issue Aug 12, 2023 · 0 comments

Comments

@frafra
Copy link

frafra commented Aug 12, 2023

Hi,
it would be nice to display metadata using the same groups defined while editing. A simple solution can be extending package_additional_info section in additional_info.html snippet to add an extra row to show the group title and description, if any:

{% block package_additional_info %}
{%- for field in schema.dataset_fields -%}
{%- if field.field_name not in exclude_fields
and field.display_snippet is not none -%}
<tr>

This is an example on how to do it:

      {%- if field.start_form_page is defined -%}  
      </tbody>
    </table>
    <h3>Additional info - {{ field.start_form_page.title }}</h3>
    {%- if field.start_form_page.description is defined -%}
    <p>{{ field.start_form_page.description }}</p>
    {%- endif -%}
    <table class="table table-striped table-bordered table-condensed">
      <thead>
        <tr>
          <th scope="col">{{ _('Field') }}</th>
          <th scope="col">{{ _('Value') }}</th>
        </tr>
      </thead>
      <tbody>
      {%- endif -%}

This would not work with the main section though, as owner belongs to the excluded field, so a more complex logic should be implemented for that.

What are your thoughts on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant