Skip to content

Commit

Permalink
fixed two resource views of resource_read
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavin2897 committed Jan 8, 2024
1 parent 12056a6 commit e5a703a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions ckanext/rdkit_visuals/templates/package/resource_read.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% ckan_extends %}
{% block resource_view_content %}
{% if pkg_dict.get('inchi_key') %}
{% snippet "snippets/data_page_visuals.html", pkg = pkg_dict%}
{% block resource_view_content %}
{{ super() }}
{% endif %}
{% endblock %}
{% endblock %}





Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h3>{{ _('Chemical Info') }}</h3>
{% if data_dict.exact_mass %}
<tr>
<th scope="row" class="dataset-label">{{ _("Exact Mass") }}</th>
<td class="dataset-details">{{ data_dict.exact_mass }} {{ _('g/mol') }}</td>
<td class="dataset-details">{{ '%.3f' | format(data_dict.exact_mass | float) }} {{ _('g/mol') }}</td>
</tr>
{% endif %}
</tbody>
Expand Down
3 changes: 2 additions & 1 deletion ckanext/rdkit_visuals/templates/snippets/rdkit_visuals.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ <h3>{{ _('Chemical Info') }}</h3>

{% endif %}
{% if data_dict.exact_mass %}
{% set format_exact_mass = data_dict.exact_mass %}
<tr>
<th scope="row" class="dataset-label">{{ _("Exact Mass") }}</th>
<td class="dataset-details">{{ data_dict.exact_mass }} {{ _('g/mol') }}</td>
<td class="dataset-details">{{ '%.3f' | format(data_dict.exact_mass | float) }} {{ _('g/mol') }}</td>
</tr>
{% endif %}
</tbody>
Expand Down

0 comments on commit e5a703a

Please sign in to comment.