Skip to content

Commit

Permalink
Update review page
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Oct 17, 2024
1 parent c6dd290 commit ee29ee7
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 95 deletions.
13 changes: 7 additions & 6 deletions qgis-app/base/forms/processing_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ def __init__(self, *args, **kwargs):
super(ResourceBaseReviewForm, self).__init__(*args, **kwargs)
self.fields["comment"].widget = forms.Textarea(
attrs={
"placeholder": _(
"Please provide clear feedback if you decided to not "
"approve this %s."
)
% self.resource_name,
"rows": "5",
"placeholder": _(
"Please provide clear feedback if you decided to not "
"approve this %s."
)
% self.resource_name,
"rows": "5",
"class": "textarea",
}
)

Expand Down
3 changes: 0 additions & 3 deletions qgis-app/styles/templates/styles/style_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ <h2>{% trans "QGIS Style"%}</h2>
text-align: center;
margin-top: 23px;
}
div.style-polaroid, div.span12.license {
margin-left: 1em;
}
.style-title {
margin-bottom: 0;
padding-bottom: 0;
Expand Down
3 changes: 0 additions & 3 deletions qgis-app/templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ <h2 xmlns="http://www.w3.org/1999/html">QGIS {{ resource_name }}</h2>
width: 100%;
text-align: center;
}
div.style-polaroid, div.span12.license {
margin-left: 1em;
}
</style>
{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
<dt>Datasource</dt>
<dd><a href="{{ object_detail.url_datasource }}" target="_blank">{{ object_detail.url_datasource }}</a></dd>
<dt>License</dt>
<dd>{% if object_detail.license %}{{ object_detail.license }}{% else %}-{% endif%}</dd>
<div class="columns">
<div class="column is-6">
<div class="field">
<div class="label">Datasource:</div>
<div class="control">
{% if object_detail.url_datasource %}
<a href="{{ object_detail.url_datasource }}" target="_blank">{{ object_detail.url_datasource }}</a>
{% else %}
-
{% endif %}
</div>
</div>
</div>
<div class="column is-6">
<div class="field">
<div class="label">License:</div>
<div class="control">
{% if object_detail.license %}
{{ object_detail.license }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a class="tagcloudModalButton" href="#tagcloudModal" role="button" data-target="tagcloudModal">
<a class="tagcloudModalButton" href="#tagcloudModal" role="button" data-target="tagcloudModal" onclick="toggleMenu();">
<span class="icon">
<i class="fas fa-tag"></i>
</span>
Expand Down
181 changes: 103 additions & 78 deletions qgis-app/templates/base/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,120 @@

{% block extrajs %}
{{ block.super }}
<style type="text/css">
dl.dl-horizontal::before {
content: none;
}
.radio.inline{
padding-top: 0;
}

</style>
{% for css_src in css %}
<link rel="stylesheet" href="{% static css_src %}" type="text/css" />
{% endfor %}
{% endblock %}

{% block content %}
<h3>{{ object_detail.name }} <small>in review</small></h3>
{% if user == object_detail.creator or user.is_staff %}
<div class="row pull-right">
<a class="btn btn-primary btn-mini" href="{% url url_update object_detail.id %}" title="{% trans "Edit" %}"><i class="icon-pencil icon-white"></i></a>&nbsp
<a class="btn btn-danger btn-mini" href="{% url url_delete object_detail.id %}" title="{% trans "Delete" %}"><i class="icon-remove icon-white"></i></a>&nbsp
<div class="box-content">

<div class="columns">
<div class="column is-6">
<h3 class="title is-4">{{ object_detail.name }}
<span class="tag is-size-6 is-info">
in review
</span>
</h3>
</div>

<div class="column is-6 has-text-right">
{% if user == object_detail.creator or user.is_staff %}
<div>
<a class="button is-success is-small is-outlined" href="{% url url_update object_detail.id %}" title="{% trans "Edit" %}">
<span class="icon is-small">
<i class="fas fa-pencil-alt"></i>
</span>
</a>
<a class="button is-danger is-small is-outlined" href="{% url url_delete object_detail.id %}" title="{% trans "Delete" %}">
<span class="icon is-small">
<i class="fas fa-trash-alt"></i>
</span>
</a>
{% if object_detail.file and object_detail.file.file %}
<button class="button is-small"
onclick="location.href='{% url url_download object_detail.id %}'"
title="{% trans "Download" %}">
<span class="icon is-small">
<i class="fas fa-download"></i>
</span>
<span>{% trans "Download" %}</span>
</button>
{% else %}
<button class="button is-small"
title="{% trans "File missing: The resource file couldn't be located." %}"
disabled>
<span class="icon is-small">
<i class="fas fa-exclamation-triangle"></i>
</span>
<span>{% trans "File missing" %}</span>
</button>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div>
<hr />
<div class="row">
<div class="span4 mb-5 view-resource">
<div class="style-polaroid">
{% 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 %}
{% if is_3d_model %}
<div class="middle">
{% thumbnail object_detail.thumbnail_image "150x150" format="PNG" as im %}
<img alt="{% trans "image" %}" src="{% static 'wavefront/img/cube-3d.png' %}" width="{{ im.x }}" height="{{ im.y }}" />
{% endthumbnail %}
</div>
</div>
<div id="urlView" data-url="{{ obj_url }}" data-mtl-url="{{ mtl_url }}"></div>
<div class="view-resource mb-3">
<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>
{% include "base/includes/detail_object.html" %}
{% include "base/includes/layerdefinition/review_datasource.html" %}

{% else %}
<hr />
{% if reviewer %}
{% with review=object_detail.review_set.last %}
<div class="field">
<label class="label">Last Review:</label>
<div class="control">
<div class="notification">
<p class="content">{{ review.comment }}</p>
<p class="has-text-darker is-size-7">
<i><small>Reviewed by {{ reviewer|title }} {{ review.review_date|naturaltime }}</small></i>
</p>
</div>
{% endif %}
</div>
<div class="span6 info-resource">
<dl class="dl-horizontal">
{% include "base/includes/detail_object.html" %}
{% include "base/includes/layerdefinition/review_datasource.html" %}
<dt>{{ resource_name }} File</dt>
<dd>
<div>
<a class="btn btn-primary btn-mini" href="{% url url_download object_detail.id %}" title="{% trans "Download" %}"><i class="icon-download-alt"></i> Download</a>
</div>
</dd>

<hr />
{% if reviewer %}
{% with review=object_detail.review_set.last %}
<dt>Last Review</dt>
<dd>{{ review.comment }}<br/>
<i><small>Reviewed by {{ reviewer|title }} {{ review.review_date|naturaltime }}</small></i>
</dd>
{% endwith %}
{% endif %}

{% if user.is_staff or is_style_manager %}
<form method="post" action="{% url url_review pk=object_detail.id %}">{% csrf_token %}
<dt>Approval</dt>
<dd>
<label class="radio inline">
{{ form.approval.0 }}
</label>
<label class="radio inline">
{{ form.approval.1 }}
</label>
</dd>
<dt>Comment</dt>
<dd>
{{ form.comment }}
<br />
<input type="submit" class="btn btn-primary" value="Submit Review"/>
</dd>
</form>
{% endif %}

</dl>
</div>
<div class="span12"></div>
{% endwith %}
{% endif %}

</div>
{% for js_src in js %}
<script type="{% if not js_src.type %}text/javascript{% else %}{{ js_src.type }}{% endif %}" src="{% static js_src.src %}"></script>
{% endfor %}
{% if user.is_staff or is_style_manager %}
<form method="post" action="{% url url_review pk=object_detail.id %}">{% csrf_token %}
<div class="field">
<label class="label">Approval:</label>
<div class="control">
<label class="radio">
{{ form.approval.0 }}
</label>
<label class="radio">
{{ form.approval.1 }}
</label>
</div>
</div>
<div class="field">
<label class="label">Comment:</label>
<div class="control">
{{ form.comment }}
</div>
</div>
<div class="form-actions has-text-right">
<button type="submit" class="button is-success">
<span class="icon is-small">
<i class="fas fa-check"></i>
</span>
<span>Submit Review</span>
</button>
</div>
</form>
{% endif %}
</div>
{% endblock %}

0 comments on commit ee29ee7

Please sign in to comment.