extends layout

block content
	.row
		.col-sm-3
			img#poster(style='width: 100%;margin-top: 2em')
	
		.col-sm-6
			h1
				+fa('th-large', item.name)

			form(action='/torrent', method='GET')
				+inputHidden('id', item._id) 
				+input('text', 'what', 'Search Term', searchTerm)
				+faButtonSubmit('search', 'Search Now')
				button#reset.btn(type='submit', name='reset', value='1', style='margin-left:1em')
					+fa('undo', 'Reset')
		
			hr
			
			each result in results
				div
					strong
						a(href=result.torrentInfoUrl, target='_blank')= result.title
					
					span.state(style='float:right')
						+faButtonDefault('download', '/torrent/add?id=' + item._id + '&magnet=' + encodeURIComponent(result.magnetLink) + '&page=' + encodeURIComponent(result.torrentInfoUrl), '', 'Download')

				div
					small
						em
							= result.serviceName
						
				div
					span.state
						+fa('cube', result.size + ' MB', 'Size')
					span.state
						| &nbsp;
						+fa('arrow-up', result.seeds + '', 'Seeders')
					span.state
						| &nbsp;
						+fa('arrow-down', result.leechs + '', 'Leechers')
					if result.verified
						span.state
							| &nbsp;
							+fa('check', 'Verified', 'Verified')
					if result.hasSubtitles
						span.state
							| &nbsp;
							+fa('check', 'Subtitles', 'Subtitles')
					if result.hasHdVideo
						span.state
							| &nbsp;
							+fa('check', 'HD Video', 'HD Video')
					if result.hasDigitalAudio
						span.state
							| &nbsp;
							+fa('check', 'Digital Audio', 'Digital Audio')
					if result.isLossless
						span.state
							| &nbsp;
							+fa('check', 'Lossless', 'Lossless')
				
				div
					= result.info
				
				hr
			hr
			+buttonHome()
