Compare commits
4 Commits
feature/bo
...
bcba59b5e4
| Author | SHA1 | Date | |
|---|---|---|---|
| bcba59b5e4 | |||
| ed44deb5a6 | |||
| 00861f8945 | |||
| da1ef00072 |
@@ -43,20 +43,21 @@
|
|||||||
background-color: #f8f9fa;
|
background-color: #f8f9fa;
|
||||||
}
|
}
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
width: 200px;
|
width: 50px;
|
||||||
height: 200px;
|
height: 50px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.no-image {
|
.no-image {
|
||||||
width: 200px;
|
width: 50px;
|
||||||
height: 200px;
|
height: 50px;
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #999;
|
color: #999;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.back-link {
|
.back-link {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@@ -98,14 +99,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% if thing.picture %}
|
{% if thing.picture %}
|
||||||
{% thumbnail thing.picture "200x200" crop="center" as thumb %}
|
{% thumbnail thing.picture "50x50" crop="center" as thumb %}
|
||||||
<img src="{{ thumb.url }}" alt="{{ thing.name }}" class="thumbnail">
|
<img src="{{ thumb.url }}" alt="{{ thing.name }}" class="thumbnail">
|
||||||
{% endthumbnail %}
|
{% endthumbnail %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="no-image">No image</div>
|
<div class="no-image">No image</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ thing.name }}</td>
|
<td><a href="{% url 'thing_detail' thing.id %}">{{ thing.name }}</a></td>
|
||||||
<td>{{ thing.thing_type.name }}</td>
|
<td>{{ thing.thing_type.name }}</td>
|
||||||
<td>{{ thing.description|default:"-" }}</td>
|
<td>{{ thing.description|default:"-" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ def add_things(request, box_id):
|
|||||||
if created_count > 0:
|
if created_count > 0:
|
||||||
success_message = f'Added {created_count} thing{"s" if created_count > 1 else ""} successfully.'
|
success_message = f'Added {created_count} thing{"s" if created_count > 1 else ""} successfully.'
|
||||||
formset = ThingFormSet()
|
formset = ThingFormSet()
|
||||||
|
else:
|
||||||
|
formset = ThingFormSet()
|
||||||
|
|
||||||
return render(request, 'boxes/add_things.html', {
|
return render(request, 'boxes/add_things.html', {
|
||||||
'box': box,
|
'box': box,
|
||||||
|
|||||||
Reference in New Issue
Block a user