Add dependency support

This commit is contained in:
rubenwardy
2018-05-21 22:20:28 +01:00
parent 47432ea7e4
commit acad90c312
6 changed files with 86 additions and 25 deletions

View File

@@ -21,6 +21,8 @@
{{ render_field(form.type, class_="pkg_meta") }}
{{ render_field(form.license, class_="pkg_meta") }}
{{ render_field(form.tags, class_="pkg_meta") }}
{{ render_field(form.harddeps, class_="pkg_meta") }}
{{ render_field(form.softdeps, class_="pkg_meta") }}
<div class="pkg_wiz_1">
<p>Enter the repo URL for the package.

View File

@@ -118,6 +118,41 @@
{% endfor %}
</ul>
<table class="table-topalign">
<tr>
<td>
<h3>Dependencies</h3>
<ul>
{% for p in package.harddeps %}
<li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }}</li>
{% else %}
{% if not package.softdeps %}
<li>No dependencies.</li>
{% endif %}
{% endfor %}
{% for p in package.softdeps %}
<li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }} [optional]</li>
{% endfor %}
</ul>
</td>
<td>
<h3>Required by</h3>
<ul>
{% for p in package.dependents %}
<li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }}</li>
{% else %}
{% if not package.softdependents %}
<li>No dependents.</li>
{% endif %}
{% endfor %}
{% for p in package.softdependents %}
<li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }} [optional]</li>
{% endfor %}
</ul>
</td>
</tr>
</table>
{% if current_user.is_authenticated or requests %}
<h3>Edit Requests</h3>