Finished progress bar
This commit is contained in:
parent
e835b8f3a2
commit
db032cd37f
5
app.py
5
app.py
@ -61,7 +61,7 @@ def new_set(set_num):
|
|||||||
# 1 for set
|
# 1 for set
|
||||||
# 1 for set image
|
# 1 for set image
|
||||||
|
|
||||||
total_parts = 2
|
total_parts = 4
|
||||||
|
|
||||||
set_num = set_num
|
set_num = set_num
|
||||||
# add_duplicate = request.form.get('addDuplicate', False) == 'true'
|
# add_duplicate = request.form.get('addDuplicate', False) == 'true'
|
||||||
@ -203,7 +203,6 @@ def new_set(set_num):
|
|||||||
count+=1
|
count+=1
|
||||||
socketio.emit('update_progress', {'progress': int(count/total_parts*100)}, namespace='/progress')
|
socketio.emit('update_progress', {'progress': int(count/total_parts*100)}, namespace='/progress')
|
||||||
#print(response)
|
#print(response)
|
||||||
|
|
||||||
for i in response['results']:
|
for i in response['results']:
|
||||||
|
|
||||||
# Get set image. Saved under ./static/minifigs/xxx-x.jpg
|
# Get set image. Saved under ./static/minifigs/xxx-x.jpg
|
||||||
@ -292,6 +291,8 @@ def new_set(set_num):
|
|||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
print('End Count: ' + str(count))
|
||||||
|
print('End Total: ' + str(total_parts))
|
||||||
count = total_parts
|
count = total_parts
|
||||||
socketio.emit('update_progress', {'progress': int(count/total_parts*100)}, namespace='/progress')
|
socketio.emit('update_progress', {'progress': int(count/total_parts*100)}, namespace='/progress')
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@
|
|||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column is-half" style="margin:0;padding:0;">
|
<div class="column is-half">
|
||||||
<div class="is-size-7">
|
<div class="is-size-7">
|
||||||
<label class="checkbox" >
|
<label class="checkbox" >
|
||||||
<input type="hidden" id="set_num" value="{{ i[0] }}">
|
<input type="hidden" id="set_num" value="{{ i[0] }}">
|
||||||
@ -268,13 +268,13 @@
|
|||||||
|
|
||||||
<p class="card-footer-item">
|
<p class="card-footer-item">
|
||||||
<span>
|
<span>
|
||||||
<a class="is-size-6" style="color: #363636;" href="/{{ i[0] }}/{{ i[8] }}">Inventory</a>
|
<a class="is-size-6" style="color: #363636;" href="/{{ i[0] }}/{{ i[8] }}">Inv.</a>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="card-footer-item">
|
<p class="card-footer-item">
|
||||||
<span>
|
<span>
|
||||||
<a class="is-size-6" style="color: #363636;" href="/{{ i['set_num'] }}">Instructions</a>
|
<a class="is-size-6" style="color: #363636;" href="/{{ i['set_num'] }}">Inst.</a>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
@ -531,6 +531,20 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function customSort(a, b) {
|
||||||
|
// Function to remove leading articles
|
||||||
|
function removeArticle(theme) {
|
||||||
|
return theme.replace(/^(a |the )/i, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the themes without leading articles
|
||||||
|
const themeA = removeArticle(a);
|
||||||
|
const themeB = removeArticle(b);
|
||||||
|
|
||||||
|
// Compare the themes without leading articles
|
||||||
|
return themeA.localeCompare(themeB);
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
const themeDropdown = document.getElementById('themeDropdown');
|
const themeDropdown = document.getElementById('themeDropdown');
|
||||||
|
|
||||||
@ -543,7 +557,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
themes.push(themeId);
|
themes.push(themeId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
themes.sort(customSort);
|
||||||
// Create options for the dropdown list
|
// Create options for the dropdown list
|
||||||
themes.forEach(function(theme) {
|
themes.forEach(function(theme) {
|
||||||
const option = document.createElement('a');
|
const option = document.createElement('a');
|
||||||
|
Loading…
Reference in New Issue
Block a user