<# if(this.model.isDefault()) { #>
<div class="template-top-label"><#= this.model.label() #></div>
<# } #>

<div class="template-upper" style="<#= this.model.hasThumbnail() ? this.model.getThumbnailCss() : ''  #>">

	<# if ( ! this.model.hasThumbnail() ) { #>
	<div class="template-icon">
		<#= this.model.icon() #>
	</div>
	<# } #>

	<# if(this.model.inheritsTemplate() && !this.model.isLandingPage()) { #>

	<div class="template-actions">

		<div><?php echo __( 'Your homepage is currently using the', THEME_DOMAIN ); ?> "<#= this.model.title() #>" <?php echo __( 'template', THEME_DOMAIN ); ?></div>

		<a target="_blank" href="<#= this.model.get('edit_url') #>">
			<?php Thrive_Views::svg_icon( 'pen-light' ); ?>
			<?php echo __( 'Edit existing template', THEME_DOMAIN ); ?>
		</a>

		<div><?php echo __( 'or', THEME_DOMAIN ); ?></div>

		<button class="click" data-fn="newHomepage">
			<?php Thrive_Views::svg_icon( 'new-homepage' ); ?>
			<?php echo __( 'Create new homepage template', THEME_DOMAIN ); ?>
		</button>
	</div>

	<# } else { #>
	<button class="template-edit-button">
		<a target="_blank" href="<#= this.model.get('edit_url') #>">
			<?php Thrive_Views::svg_icon( 'pen-light' ); ?>
			<span><?php echo __( 'Edit', THEME_DOMAIN ); ?> <#= this.model.isLandingPage() ? ' Landing Page':'' #></span>
		</a>
	</button>
	<# } #>
</div>

<div class="template-lower">
	<div class="template-name-container">
		<#= this.model.icon() #>
		<span class="template-name"><#= this.model.name() #></span>
	</div>

	<# if(!this.model.isLandingPage()) { #>
	<span class="ttd-dropdown-dots click" data-fn="showOptionsTooltip">
			<?php Thrive_Views::svg_icon( 'icon-three-dots' ); ?>
		</span>
	<# } #>

	<div class="template-meta">
		<ul>
			<# if(!this.model.isLandingPage()) { #>
			<li>
				<span class="template-label"><?php echo __( 'Layout', THEME_DOMAIN ); ?></span>
				<span class="template-meta-val"><#= this.model.getLayoutName() #></span>
			</li>
			<# } #>

			<li>
				<span class="template-label"><?php echo __( 'Content Type', THEME_DOMAIN ); ?></span>
				<span class="template-meta-val"><#= this.model.getContentType() #></span>
			</li>
			<li>
				<# if(this.model.isLandingPage()) { #>
				<span class="template-label"><?php echo __( 'Page Set', THEME_DOMAIN ); ?></span>
				<span class="template-meta-val"><#= TTD.CONST.options.landing_page_set #></span>
				<# } else { #>
				<span class="template-label"><?php echo __( 'Single or List', THEME_DOMAIN ); ?></span>
				<span class="template-meta-val"><#= this.model.getType() #></span>
				<# } #>
			</li>
		</ul>
	</div>
</div>
