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}'
|
||||
|
||||
@property
|
||||
def single_file(self):
|
||||
def has_single_file(self):
|
||||
return len(self.files.all()) == 1
|
||||
|
||||
def add_file(self, file: File):
|
||||
|
@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<div class="dl-col">
|
||||
<dt>{% trans 'Size' %}</dt>
|
||||
{% if version.single_file %}
|
||||
{% if version.has_single_file %}
|
||||
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
||||
{% else %}
|
||||
{% for file in version.files.all %}
|
||||
|
@ -187,7 +187,7 @@
|
||||
</div>
|
||||
<div class="dl-col">
|
||||
<dt>{% trans 'Size' %}</dt>
|
||||
{% if latest.single_file %}
|
||||
{% if latest.has_single_file %}
|
||||
<dd>{{ latest.files.first.size_bytes|filesizeformat }}</dd>
|
||||
{% else %}
|
||||
<dd>
|
||||
|
@ -30,7 +30,7 @@
|
||||
{% include "extensions/components/blender_version.html" with version=version %}
|
||||
</span>
|
||||
<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>
|
||||
{% else %}
|
||||
{% for file in version.files.all %}
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="dl-col">
|
||||
<dt>Size</dt>
|
||||
{% if version.single_file %}
|
||||
{% if version.has_single_file %}
|
||||
<dd>{{ version.files.first.size_bytes|filesizeformat }}</dd>
|
||||
{% else %}
|
||||
{% for file in version.files.all %}
|
||||
|
Loading…
Reference in New Issue
Block a user