zmiany ux

This commit is contained in:
Mateusz Gruszczyński
2025-07-03 23:07:04 +02:00
parent 9ba5921985
commit 670ff4768f
2 changed files with 17 additions and 2 deletions

3
app.py
View File

@ -303,7 +303,7 @@ def upload_receipt(list_id):
file_path = os.path.join(app.config['UPLOAD_FOLDER'], f"list_{list_id}_{filename}")
img = Image.open(file)
img.thumbnail((800, 800))
img.thumbnail((2000, 2000))
img.save(file_path)
flash('Wgrano paragon', 'success')
@ -319,6 +319,7 @@ def uploaded_file(filename):
response.headers.pop('Pragma', None)
return response
# chyba do usuniecia przeniesione na eventy socket.io
@app.route('/update-note/<int:item_id>', methods=['POST'])
def update_note(item_id):
item = Item.query.get_or_404(item_id)

View File

@ -50,7 +50,7 @@
<h5>📤 Dodaj zdjęcie paragonu</h5>
<form action="{{ url_for('upload_receipt', list_id=list.id) }}" method="post" enctype="multipart/form-data">
<div class="input-group mb-2">
<input type="file" name="receipt" accept="image/*" capture="environment" class="form-control" id="receiptInput">
<input type="file" name="receipt" accept="image/*" capture="environment" class="form-control custom-file-input" id="receiptInput">
<button type="submit" class="btn btn-success"> Wgraj</button>
</div>
</form>
@ -97,5 +97,19 @@
.bg-light {
background-color: #2c2f33 !important;
}
input[type="file"]::file-selector-button {
background-color: #28a745; /* Zielony */
color: #fff;
border: none;
padding: 0.5em 1em;
border-radius: 4px;
font-weight: bold;
cursor: pointer;
transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover {
background-color: #218838;
}
</style>
{% endblock %}