<%@ Control Language="C#" AutoEventWireup="true" CodeFile="template.ascx.cs" Inherits="bitrix_components_bitrix_photogallery_photo_templates__default_template" EnableViewState="false" %>
<%@ Reference VirtualPath="~/bitrix/components/bitrix/photogallery.photo/component.ascx" %>

<a href="<%=  Component.BackUrl %>" EnableAjax="true"><%= GetMessage("Kernel.Back") %></a> 
<% if(Component.Photo!=null){ %>
<% if (Component.ModifyElements)
   { %>
        <% if (Component.Photo != null)
        { %>
            | <a enableajax="true" href="<%= Component.EditUrl %>"><%= GetMessage("Kernel.Edit") %></a>
            | <asp:LinkButton runat="server" ID="lButtonDelete" Text="<%$ Loc:Delete %>" OnClick="lbDelete_Click" Visible="false"><%= GetMessage("Delete") %></asp:LinkButton>
      <%}%>
<%}%>
<script src="<%= Bitrix.BXUri.ToRelativeUri(AppRelativeTemplateSourceDirectory) %>prototype.js" type="text/javascript"></script>
<script src="<%= Bitrix.BXUri.ToRelativeUri(AppRelativeTemplateSourceDirectory) %>scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="<%= Bitrix.BXUri.ToRelativeUri(AppRelativeTemplateSourceDirectory) %>lightbox.js" type="text/javascript"></script>
<script>
    var fileBottomNavCloseImage = "<%= Bitrix.BXUri.ToRelativeUri(AppRelativeTemplateSourceDirectory) %>images/close.gif";
    var fileLoadingImage = "<%= Bitrix.BXUri.ToRelativeUri(AppRelativeTemplateSourceDirectory) %>images/loading.gif";
</script>
<table>
    <tr valign="top">
        <td class="photo-column" align="center" style="width:300px;">
                
                <div style="width:<%=Component.PhotoWidth%>px;height:<%=Component.PhotoHeight%>px">
                <div style="width:<%=Component.ActualPhotoWidth%>px;height:<%=Component.ActualPhotoHeight%>px;padding-top:<%=(int)((Component.PhotoHeight - Component.ActualPhotoHeight)/2)%>px;">
                <a href="<%= Component.PhotoOriginalUrl %>" title="<%= Component.Description %>" rel="lightbox"><img id="previewImg" src="<%= Component.PhotoUrl %>" style="position:relative;width:<%=Component.ActualPhotoWidth%>px;height:<%=Component.ActualPhotoHeight%>px;" border="0" /></a>
                </div>
                </div>
            
            <div style="height:50px;width:250px;overflow-x:hidden;overflow-y:auto;"><%=Component.Description%></div>
        </td>
        <td class="detail-column" style="width:250px;">
            <ul>
                <li>
                <%= GetMessage("PhotoHasBeenLoaded.User") %> <b><%= Encode(Component.PhotoAuthor)%></b>
                </li>
                <li>
                <%= GetMessage("PhotoHasBeenLoaded.Date") %> <b><%= Component.Photo.CreateDate %></b>
                </li>
                <li><a href="<%= Component.PhotoOriginalUrl %>" title="<%= Component.Description %>" rel="lightbox"><%= Component.PhotoOriginalSizeText %></a></li>
                <li><%= GetMessage("PhotoHasBeenShown.Times") %> <%= Component.Photo.ViewsCount+1 %></li>
            </ul>
        </td>
    </tr>
    <tr>
        <td align="center">
            <bx:IncludeComponent runat="server" ID="sliderr" 
                ComponentName="bitrix:photogallery.slider" Template=".default" 
                CacheMode="<%$ Parameters:CacheMode %>" CacheDuration="<%$ Parameters:CacheDuration %>"
                EnableAjax="<%$ Parameters:EnableAjax %>" EnableSEF="<%$ Parameters:EnableSEF %>" SEFFolder="<%$ Parameters:SEFFolder %>"
                FlickrMode="false" Size="3" />        
        </td>
        <td></td>
    </tr>
</table>
<% } else {%>
  <h1><%= GetMessage("PhotoNotFound") %></h1>  
<%} %>