Fix "already acquired" pictogram. Close #8
This commit is contained in:
parent
71e0537400
commit
50c4cebc96
2 changed files with 7 additions and 4 deletions
|
@ -145,11 +145,11 @@ class Book(BaseModel):
|
|||
)
|
||||
|
||||
@property
|
||||
def previously_acquired_emoji(self):
|
||||
def previously_acquired_text(self):
|
||||
if self.previously_acquired:
|
||||
return '✅'
|
||||
return 'Oui'
|
||||
else:
|
||||
return '🚫'
|
||||
return 'Non'
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.title} ({self.authors}) - {self.isbn}'
|
||||
|
|
|
@ -59,7 +59,10 @@
|
|||
<td>{{ book.publication_year }}</td>
|
||||
<td>{{ book.isbn }}</td>
|
||||
<td>{{ book.price }}</td>
|
||||
<td>{{ book.previously_acquired_emoji }}</td>
|
||||
<td>
|
||||
<i class="fas fa-{% if book.previously_acquired %}check-circle{% else %}ban{% endif %}"></i>
|
||||
{{ book.previously_acquired_text }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue