<!-- ko if: !bIsHidden -->
<div class="item file attachment" data-bind="
	css: cssClasses,
	event: allowDrag() ? { 'dragstart': eventDragStart } : null,
	draggablePlace: allowDrag() ? function (file, ctrlOrCmdUsed) { return $parent.dragAndDropHelper(file, ctrlOrCmdUsed); } : null,
	draggableDragStartCallback: function() { if (allowDrag()) { $root.dragover(true); } },
	draggableDragStopCallback: function() { if (allowDrag()) { $root.dragover(false); } }
">

	<!-- ko if: (sHeaderText.length > 0) -->
	<span class="header" data-bind="text: sHeaderText"></span>
	<!-- /ko -->

	<span class="item_content ui-droppable dragHandle">
		<span class="cancel" data-bind="visible: visibleCancelButton, click: function () { $parent.onFileRemove( uploadUid(), $data); }, customTooltip: 'COREWEBCLIENT/ACTION_CANCEL'"></span>

		<span class="image" data-bind="customTooltip: getTooltip(iconAction()), click: function () { executeAction(iconAction()); }, 
				css: {'has_action': iconAction() !== ''}, clickBubble: iconAction() === ''">
			<!-- ko if: thumbnailSrc() !== '' -->
			<img data-bind="attr: {'src': thumbnailSrc()}" />
			<span class="icon play" data-bind="click: viewFile, visible: bHasHtmlEmbed"></span>
			<!-- /ko -->
			<!-- ko if: thumbnailSrc() === '' -->
			<span class="icon" data-bind="css: extension().toLowerCase() + (bHasHtmlEmbed ? ' ' + sLinkType.toLowerCase() : '')"></span>
			<!-- /ko -->
			<!-- ko if: sharedWithMe() && !$root.bPublic -->
			<span class="file_shared_with_me_icon"></span>
			<!-- /ko -->
		</span>

		<div class="file_states" data-bind="if: !$root.bPublic">
			<!-- ko if: bIsSecure -->
			<span class="file_encrypted_icon" data-bind="click: function (oItem) { $root.onSecureIconClick(oItem); }"></span>
			<!-- /ko -->
			<!-- ko if: sharedWithOthers() -->
			<span class="file_shared_icon" data-bind="click: function (oItem) { $root.onFileShareIconClick(oItem); }"></span>
			<!-- /ko -->
			<!-- ko if: allowPublicLink() && published() -->
			<span class="file_published_icon" data-bind="click: function (oItem) { $root.onShareIconClick(oItem); }"></span>
			<!-- /ko -->
			<!-- ko if: $root.bAllowFavorites && !$root.bPublic -->
			<span class="file_favorite_icon" data-bind="css: {'favorite_set': favorite }, click: function (oItem) { $root.onFavoriteClick(oItem); }"></span>
			<!-- /ko -->
		</div>
		<div class="footer">
			<span class="progress" data-bind="visible: visibleProgress()">
				<span data-bind="style: {'width': progressPercent() + '%'}"></span>
				<span class="progress-percent" data-bind="text: progressPercent() + '%'"></span>
			</span>
			<span class="status_text" data-bind="text: statusText(), css: {'error': uploadError()}, customTooltip: statusTooltip, visible: statusText().length > 0"></span>

			<span class="title" data-bind="customTooltip: displayName, css: {entire_line: friendlySize() === ''}">
				<span class="name" data-bind="text: displayName"></span>
			</span>
		</div>
	</span>
	<span class="main_action dragHandle" data-bind="visible: firstAction().length > 0">
		<a class="button view" href="javascript: void(0)" data-bind="click: function () { executeAction(firstAction()); }, text: getActionText(firstAction()), clickBubble: false"></a>
	</span>
	
	<div class="buttons" data-bind="visible: allowActions() && uploaded() && !uploadError() && statusText().length === 0 && !downloading() && !visibleProgress()">
		<a class="button download" href="javascript: void(0)" data-bind="visible: secondAction().length > 0, 
			click: function () { executeAction(secondAction()); }, text: getActionText(secondAction()), clickBubble: false"></a>
		<span class="size" data-bind="text: friendlySize()"></span>
	</div>


</div>
<!-- /ko -->
