Skip to content

Commit

Permalink
Updates for resource details
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Oct 11, 2024
1 parent 7b0e567 commit 748a0ec
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 46 deletions.
28 changes: 10 additions & 18 deletions qgis-app/templates/base/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,17 @@ <h3 class="title is-4">{{ object_detail.name }}</h3>
</div>
</div>
<hr />
<div class="columns">
<div class="column is-6 is-flex is-justify-content-center is-align-items-start">
<div class="style-polaroid">
{% if object_detail.thumbnail_image and object_detail.thumbnail_image.file %}
{% thumbnail object_detail.thumbnail_image "420x420" format="PNG" as im %}
<img class="image-resource" alt="{% trans "image" %}" src="{{ im.url }}" width="{{ im.x }}" height="{{ im.y }}" />
{% endthumbnail %}
{% endif %}
{% if is_3d_model %}
{% include "base/includes/wavefront/detail_3dviewer.html" %}
{% endif %}
</div>

</div>
<div class="column is-6">
{% include "base/includes/detail_object.html" %}

</div>
<div class="style-polaroid">
{% if object_detail.thumbnail_image and object_detail.thumbnail_image.file %}
{% thumbnail object_detail.thumbnail_image "420x420" format="PNG" as im %}
<img class="image-resource" alt="{% trans "image" %}" src="{{ im.url }}" width="{{ im.x }}" height="{{ im.y }}" />
{% endthumbnail %}
{% endif %}
{% if is_3d_model %}
{% include "base/includes/wavefront/detail_3dviewer.html" %}
{% endif %}
</div>
{% include "base/includes/detail_object.html" %}
<hr />
{% if license_template %}
{% include license_template %}
Expand Down
40 changes: 28 additions & 12 deletions qgis-app/templates/base/includes/detail_object.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{% load i18n resources_custom_tags%}
<div class="columns is-multiline">
<div class="column is-12">
<label class="label">{% trans "Description" %}:</label>
<div>
{{ object_detail.description|md_to_html }}
</div>
<label class="label">
<span class="icon"><i class="fas fa-info-circle"></i></span>
{% trans "Description" %}:
</label>
<div>
{{ object_detail.description|md_to_html }}
</div>
</div>
<div class="column is-6">
<div class="field">
<label class="label">{% trans "Uploaded Date" %}:</label>
<label class="label">
<span class="icon"><i class="fas fa-calendar-alt"></i></span>
{% trans "Uploaded Date" %}:
</label>
<div class="control truncate">
{{ object_detail.upload_date|date:"d F Y" }}
</div>
Expand All @@ -17,7 +23,10 @@
{% if object_detail.review_set.last.review_date and object_detail.approved %}
<div class="column is-6">
<div class="field">
<label class="label">{% trans "Approved Date" %}:</label>
<label class="label">
<span class="icon"><i class="fas fa-check-circle"></i></span>
{% trans "Approved Date" %}:
</label>
<div class="control truncate">
{{ object_detail.review_set.last.review_date|date:"d F Y" }}
</div>
Expand All @@ -26,29 +35,36 @@
{% endif %}
<div class="column is-6">
<div class="field">
<label class="label">{% trans "Modified Date" %}:</label>
<label class="label">
<span class="icon"><i class="fas fa-edit"></i></span>
{% trans "Modified Date" %}:
</label>
<div class="control truncate">
{{ object_detail.modified_date|date:"d F Y" }}
</div>
</div>
</div>
<div class="column is-6">
<div class="field">
<label class="label">{% trans "Creator" %}:</label>
<label class="label">
<span class="icon"><i class="fas fa-user"></i></span>
{% trans "Creator" %}:
</label>
<div class="control truncate">
{{ object_detail.get_creator_name|title }}
</div>
</div>
</div>
{% if is_qlr %}
<div class="column is-6">
{% include "base/includes/layerdefinition/detail_datasource.html" %}
</div>
{% include "base/includes/layerdefinition/detail_datasource.html" %}
{% endif %}
{% if object_detail.style_type %}
<div class="column is-6">
<div class="field">
<label class="label">{% trans "Type" %}:</label>
<label class="label">
<span class="icon"><i class="fas fa-palette"></i></span>
{% trans "Type" %}:
</label>
<div class="control truncate">
{{ object_detail.style_type.name }}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
<dt>Provider</dt>
<dd>{{ object_detail.provider }}</dd>
<dt>Metadata</dt>
<dd>{% if object_detail.url_metadata%}{{object_detail.url_metadata}}{% else %}-{% endif %}</dd>
{% load static i18n %}
<div class="column is-6">
<div class="field">
<label class="label">
<span class="icon">
<i class="fas fa-database"></i>
</span>
{% trans "Provider" %}:
</label>
<div class="control truncate">
{{ object_detail.provider }}
</div>
</div>
</div>
<div class="column is-6">
<div class="field">
<label class="label">
<span class="icon">
<i class="fas fa-info-circle"></i>
</span>
{% trans "Metadata" %}:
</label>
<div class="control truncate">
{% if object_detail.url_metadata %}
<a href="{{ object_detail.url_metadata }}" target="_blank">{{ object_detail.url_metadata }}</a>
{% else %}
-
{% endif %}
</div>
</div>
</div>
39 changes: 27 additions & 12 deletions qgis-app/templates/base/includes/layerdefinition/license.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
{% load static %}
<div class="span12 license" >
<div class="span8" style="margin-top: 2rem">
<p><strong>Data source</strong>: <a href="{{ object_detail.url_datasource }}" target="_blank">{{ object_detail.url_datasource }}</a></p>
<p><strong>License</strong>:
{% if object_detail.license %}
<br /><span class="custom-license">{{ object_detail.license }}</span></p>
{% else %}
-
{% endif %}
</div>
</div>
{% load static i18n %}
<div class="columns is-multiline">
<div class="column is-12">
<div class="field">
<label class="label">
<i class="fas fa-database"></i> {% trans "Data source" %}:
</label>
<div class="control truncate">
<a href="{{ object_detail.url_datasource }}" target="_blank">{{ object_detail.url_datasource }}</a>
</div>
</div>
</div>
<div class="column is-12">
<div class="field">
<label class="label">
<i class="fas fa-file-alt"></i> {% trans "License" %}:
</label>
<div class="control">
{% if object_detail.license %}
<span class="custom-license" style="word-break: break-all;">{{ object_detail.license }}</span>
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>

0 comments on commit 748a0ec

Please sign in to comment.