0001-gallery-adjust-cell-manager-style.patch
combo/apps/gallery/static/js/combo.gallery.js | ||
---|---|---|
1 | 1 |
function gallery(element) { |
2 | 2 |
var element_id = '#' + $(element).attr('id'); |
3 | 3 |
$(element).sortable({ |
4 |
items: '> li', |
|
4 |
items: '> li[data-object-id]',
|
|
5 | 5 |
containment: 'parent', |
6 | 6 |
placeholder: 'empty-image', |
7 | 7 |
update: function(event, ui) { |
combo/apps/gallery/templates/combo/gallery_manager.html | ||
---|---|---|
2 | 2 |
{% load static thumbnail i18n %} |
3 | 3 | |
4 | 4 |
{% block cell-form %} |
5 |
<form action="{{ url }}" method="post" data-label-url="{% url 'combo-manager-page-get-additional-label' page_pk=cell.page.id cell_reference=cell.get_reference %}"> |
|
6 |
{% csrf_token %} |
|
7 |
{{ form.as_p }} |
|
8 | ||
9 | 5 |
<ul class="gallery" id="gallery-{{cell.id}}" data-order-url="{% url 'combo-gallery-image-order' gallery_pk=cell.id %}"> |
10 | 6 |
{% for image in cell.image_set.all %} |
11 | 7 |
<li data-object-id="{{image.id}}"> |
... | ... | |
18 | 14 |
</span> |
19 | 15 |
</li> |
20 | 16 |
{% endfor %} |
17 |
<li><a class="button" rel="popup" href="{% url 'combo-gallery-image-add' gallery_pk=cell.id %}">{% trans 'Add an Image' %}</a></li> |
|
21 | 18 |
</ul> |
22 | 19 | |
23 |
<a class="image-add" rel="popup" href="{% url 'combo-gallery-image-add' gallery_pk=cell.id %}">{% trans 'New Image' %}</a> |
|
24 |
</form> |
|
25 | ||
26 | 20 |
<script src="{% static "js/combo.gallery.js" %}"></script> |
27 | 21 |
<script>gallery($('#gallery-{{cell.id}}'));</script> |
28 | 22 |
combo/manager/static/css/combo.manager.css | ||
---|---|---|
112 | 112 | |
113 | 113 | |
114 | 114 |
div.cell div.buttons { |
115 |
clear: both; |
|
115 | 116 |
margin-top: 2em; |
116 | 117 |
margin-bottom: 1ex; |
117 | 118 |
} |
... | ... | |
384 | 385 |
max-width: 35rem; |
385 | 386 |
} |
386 | 387 | |
388 |
div.gallerycell div.buttons button { |
|
389 |
display: none; |
|
390 |
} |
|
391 | ||
387 | 392 |
ul.gallery { |
388 | 393 |
list-style: none; |
389 | 394 |
margin: 0; |
... | ... | |
391 | 396 |
} |
392 | 397 | |
393 | 398 |
ul.gallery li { |
394 |
display: inline-block;
|
|
395 |
margin: 0.5ex;
|
|
399 |
float: left;
|
|
400 |
margin: 0 0.5rem 0.5rem 0;
|
|
396 | 401 |
position: relative; |
397 | 402 |
} |
398 | 403 | |
... | ... | |
412 | 417 |
right: 5px; |
413 | 418 |
font-size: 150%; |
414 | 419 |
} |
420 | ||
421 |
ul.gallery li:last-child { |
|
422 |
height: 124px; |
|
423 |
width: 124px; |
|
424 |
margin-bottom: 1rem; |
|
425 |
} |
|
426 | ||
427 |
ul.gallery li:last-child a { |
|
428 |
display: block; |
|
429 |
line-height: 120px; |
|
430 |
padding: 0; |
|
431 |
height: 100%; |
|
432 |
width: 100%; |
|
433 |
text-align: center; |
|
434 |
} |
|
415 |
- |