{% extends "base.html" %}
{% load compress staticfiles i18n %}
{% load embed_video_tags %}
{% load thumbnail %}
{% load get_favorited_artwork %}
{% load collaborated_users_in_an_artwork %}
{% load check_artwork_has_making_of %}
{% load number_of_collabs_and_artworks %}
{% get_current_language as LANGUAGE_CODE %}
{% block page_title %}
{{ artwork.artwork_name }}
{% endblock %}
{% block meta_og_title %}{{ artwork.artwork_name }}{% endblock %}
{% block meta_og_url %}{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'artwork:artwork-details' artwork.slug %}{% endblock %}
{% block meta_og_description %}
{% if artwork.collaborators %}
Credits:
{% for collaborator in artwork.collaborators.all %}
{% if collaborator.user %}
{% if collaborator.collaborator_name %}
{{ collaborator.collaborator_name }},
{% else %}
{{ collaborator.user.get_full_name }},
{% endif %}
{% else %}
{{ collaborator.collaborator_name }},
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}
{% block meta_og_image %}
{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% if artwork.artwork_type.artwork_type == 'image' %}{% if not artwork.artwork_cover_thumbnail and artwork.gallery_images.all%}{% thumbnail artwork.gallery_images.all.0.gallery_image 1300x728 crop=',0' upscale %}{% else %}{% thumbnail artwork.artwork_cover_thumbnail 1300x728 crop=',0' upscale %}{% endif %}{% else %}{% thumbnail artwork.artwork_cover_thumbnail 1300x728 crop=',0' upscale %}{% endif %}
{% endblock %}
{% block content %}
<div id="artwork_items" class="video_wrapper">
<div class="container">
{% include "partials/artwork/big/_big_artwork_item.html" %}
<div class="modal hide" id="portfolioModal" data-backdrop="static" data-keyboard="false">
<!-- Ajax Upload add and edit artwork form -->
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
{% compress js %}
<script src="{% static 'js/imagesloaded.js' %}"></script>
<script src="{% static 'js/masonry.min.js' %}"></script>
<script src="{% static 'js/simple-gallery.js' %}"></script>
<script src="{% static 'js/artwork.js' %}"></script>
{% endcompress %}
<script type="text/javascript">
(function($){
$(document).ready(function() {
// For Iframe height
var currentIframeWidth = $('.global_iframe').width();
var iframeHeigth = parseInt(parseInt(currentIframeWidth)*0.56);
$('.global_iframe').css('height', iframeHeigth)
$("#artwork_items").find(".large_artwork_slide_down_top").trigger('click');
$('.artwork_url_modal').on('shown.bs.modal', function() {
$(this).find('input').select ();
});
$(".big_artwork_item").on('click', '.artwork_url_modal_close', function(ev){
$(".artwork_url_modal").hide();
$(".artwork_url_modal").toggleClass('in');
$('.modal-backdrop').remove();
if (!$('#artwork_popup_modal').hasClass('in')){
$('body').removeClass('modal-open');
$('body').css('padding-right', "");
}
});
$(".jbox-container").on('click', '.svg_jbox_close', function(ev){
$(".jbox-container").find(".svg_jbox_close_hide").trigger('click');
});
$(".gallery_content").lightGallery({
'closable':false,
'download':false,
'share':false,
});
$('#artwork_items .artwork_common_item').each(function(index, obj){
if($(obj).find('.gallery_content').length){
var current_artwork_id = $(obj).find('.gallery_content').data('current-artwork-id')
$('#gallery_wrapper_'+current_artwork_id).simplegallery({
galltime : 400,
gallcontent: '#gallery_wrapper_'+current_artwork_id + ' .gallery_content',
gallthumbnail: '#gallery_wrapper_'+current_artwork_id + ' .thumbnail',
gallthumb: '#gallery_wrapper_'+current_artwork_id + ' .thumb'
});
}
});
});
// Initialize Masonry for ajax call
function initializeMasonry(){
var $container = $('#artwork_items .masonry-container');
$container.imagesLoaded(function() {
$container.masonry({
isInitLayout : true,
columnWidth: '.item',
itemSelector: '.item',
});
});
}
initializeMasonry();
})(jQuery);
</script>
{% endblock %}