Multi-platform: support multiple files per version #201
@ -674,7 +674,7 @@ class Version(CreatedModifiedMixin, TrackChangesMixin, models.Model):
|
|||||||
return f'{self.extension} v{self.version}'
|
return f'{self.extension} v{self.version}'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def single_file(self):
|
def has_single_file(self):
|
||||||
return len(self.files.all()) == 1
|
return len(self.files.all()) == 1
|
||||||
|
|
||||||
def add_file(self, file: File):
|
def add_file(self, file: File):
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="dl-col">
|
<div class="dl-col">
|
||||||
<dt>{% trans 'Size' %}</dt>
|
<dt>{% trans 'Size' %}</dt>
|
||||||
{% if version.single_file %}
|
{% if version.has_single_file %}
|
||||||
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for file in version.files.all %}
|
{% for file in version.files.all %}
|
||||||
|
@ -187,7 +187,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="dl-col">
|
<div class="dl-col">
|
||||||
<dt>{% trans 'Size' %}</dt>
|
<dt>{% trans 'Size' %}</dt>
|
||||||
{% if latest.single_file %}
|
{% if latest.has_single_file %}
|
||||||
<dd>{{ latest.files.first.size_bytes|filesizeformat }}</dd>
|
<dd>{{ latest.files.first.size_bytes|filesizeformat }}</dd>
|
||||||
{% else %}
|
{% else %}
|
||||||
<dd>
|
<dd>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
{% include "extensions/components/blender_version.html" with version=version %}
|
{% include "extensions/components/blender_version.html" with version=version %}
|
||||||
</span>
|
</span>
|
||||||
<ul class="ms-auto">
|
<ul class="ms-auto">
|
||||||
{% if version.single_file %}
|
{% if version.has_single_file %}
|
||||||
<li class="show-on-collapse">{{ version.files.first.size_bytes|filesizeformat }}</li>
|
<li class="show-on-collapse">{{ version.files.first.size_bytes|filesizeformat }}</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for file in version.files.all %}
|
{% for file in version.files.all %}
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="dl-col">
|
<div class="dl-col">
|
||||||
<dt>Size</dt>
|
<dt>Size</dt>
|
||||||
{% if version.single_file %}
|
{% if version.has_single_file %}
|
||||||
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for file in version.files.all %}
|
{% for file in version.files.all %}
|
||||||
|
Loading…
Reference in New Issue
Block a user