Removed unused wishlist code
Added renaming of shelf name Added sorting abilty to shelfs jquery is loaded locally nowpull/90/head
parent
580389d279
commit
e0459eb62b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,30 @@
|
||||
Sortable.create(sortTrue, {
|
||||
group: "sorting",
|
||||
sort: true
|
||||
});
|
||||
|
||||
function sendData(path){
|
||||
var elements;
|
||||
var counter;
|
||||
var maxElements;
|
||||
var tmp=[];
|
||||
|
||||
elements=Sortable.utils.find(sortTrue,"div");
|
||||
maxElements=elements.length;
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.setAttribute("method", "post");
|
||||
form.setAttribute("action", path);
|
||||
|
||||
|
||||
for(counter=0;counter<maxElements;counter++){
|
||||
tmp[counter]=elements[counter].getAttribute("id");
|
||||
var hiddenField = document.createElement("input");
|
||||
hiddenField.setAttribute("type", "hidden");
|
||||
hiddenField.setAttribute("name", elements[counter].getAttribute("id"));
|
||||
hiddenField.setAttribute("value", counter+1);
|
||||
form.appendChild(hiddenField);
|
||||
}
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<div class="col-sm-6 col-lg-6 col-xs-6">
|
||||
<h2>{{title}}</h2>
|
||||
<div id="sortTrue" class="list-group">
|
||||
{% for entry in entries %}
|
||||
<div id="{{entry.id}}" class="list-group-item">{{entry.title}}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button onclick="sendData('{{ url_for('order_shelf', shelf_id=shelf.id) }}')" class="btn btn-default" id="ChangeOrder">{{_('Change order')}}</button>
|
||||
<a href="{{ url_for('show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="{{ url_for('static', filename='js/shelforder.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue