130 lines
3.3 KiB
Plaintext
130 lines
3.3 KiB
Plaintext
|
|
-if admin
|
|
|
|
%h2=input.name
|
|
.description
|
|
=raw input.description
|
|
|
|
.gallery_images
|
|
=render :collection => input.gallery_images, :partial => "portlet/gallery_images/gallery_image"
|
|
%p{:style => "clear:both;"}
|
|
|
|
:coffeescript
|
|
|
|
adjustment = ""
|
|
|
|
$('.gallery_images').sortable({
|
|
itemSelector:".gallery_image",
|
|
containerSelector :".gallery_images",
|
|
nested:true,
|
|
placeholder:"<div class='placeholder' style='display:inline-block;width:50px;height:170px;'></div>",
|
|
onDragStart: ($item, container, _super) ->
|
|
$("body").addClass("dragging")
|
|
|
|
offset = $item.offset()
|
|
pointer = container.rootGroup.pointer
|
|
adjustment = {
|
|
left: pointer.left - offset.left,
|
|
top: pointer.top - offset.top
|
|
}
|
|
onDrag: ($item, position, _super) ->
|
|
|
|
$item.css({
|
|
|
|
left: position.left - adjustment.left,
|
|
top: position.top - adjustment.top - $(window).scrollTop()
|
|
|
|
})
|
|
|
|
onDrop: ($item, container, _super) ->
|
|
|
|
$item.removeClass("dragged").removeAttr("style")
|
|
$("body").removeClass("dragging")
|
|
|
|
result = []
|
|
container.el.find(".gallery_image").each ->
|
|
result.push $(this).data("id")
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
url:"/portlet/gallery_images/reorder.js",
|
|
type: "GET",
|
|
data: {
|
|
order : result
|
|
}
|
|
|
|
})
|
|
});
|
|
|
|
|
|
|
|
|
|
-else
|
|
-if input.style == 4
|
|
%ul#portfolio-filter
|
|
|
|
%li
|
|
%a.current{:href => "#all"} Tous
|
|
|
|
-input.tags.each do |tag|
|
|
%li
|
|
%a{:href => "##{tag.to_slug}"}= tag
|
|
|
|
|
|
|
|
%ul#portfolio-list
|
|
-input.gallery_images.each do |gallery_images|
|
|
%li{:class => gallery_images.tags_class}=link_to image_tag(gallery_images.image_file.file.square.url),gallery_images.image_file.file.large.url, :title => "#{gallery_images.title}", :rel => "prettyPhoto"
|
|
|
|
|
|
:coffeescript
|
|
$('#portfolio-list').filterable({
|
|
animationSpeed: 300,
|
|
show: { height: 'show',width: 'show' },
|
|
hide: { height: 'hide' ,width: 'hide'}
|
|
})
|
|
|
|
|
|
|
|
-if input.style == 3
|
|
.portlet.input
|
|
|
|
|
|
|
|
.rea-gal
|
|
-input.gallery_images.each do |gallery_images|
|
|
=link_to image_tag(gallery_images.image_file.file.square.url, :alt => "#{gallery_images.title}"), gallery_images.image_file.file.large.url, :title => gallery_images.title
|
|
.clear
|
|
|
|
-elsif input.style==2
|
|
|
|
%ul.bxslider{:data => {:ratio => 1.8}}
|
|
-input.gallery_images.each do |gallery_images|
|
|
%li
|
|
=image_tag(gallery_images.image_file.file.large.url, :title => "#{gallery_images.title}")
|
|
|
|
|
|
|
|
|
|
|
|
-elsif input.style==1
|
|
.portlet.input
|
|
%table.gallery_images
|
|
=raw "<tr>"
|
|
|
|
- i = 0
|
|
-input.gallery_images.each do |gallery_images|
|
|
-if gallery_images.image_file
|
|
- i = i+1
|
|
|
|
%td=link_to image_tag(gallery_images.image_file.file.large.medium.small.thumb.url, :alt => "#{gallery_images.title}"), gallery_images.image_file.file.large.url, :rel => "prettyPhoto"
|
|
|
|
-if i % 4 == 0
|
|
=raw "</tr><tr>"
|
|
|
|
|
|
=raw "</tr>"
|
|
|
|
|