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}' 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):

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

View File

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

View File

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