Multi-platform: support multiple files per version #201

Merged
Oleg-Komarov merged 43 commits from multi-os into main 2024-07-09 16:27:46 +02:00
4 changed files with 5 additions and 5 deletions
Showing only changes of commit 0a90c3dcdb - Show all commits

View File

@ -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):

View 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 %}

View File

@ -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>

View File

@ -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 %}