<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
	
	<asp:content ContentPlaceHolderId="Head" runat="server">
		<link rel="stylesheet" type="text/css" href="/css/releases.css?v=4" />
		<!-- release scripts -->
		<script src="/Scripts/jquery.cookie.js" type="text/javascript"></script>
		<script src="/Scripts/knockout-2.0.0.js" type="text/javascript"></script>
		<script src="/Scripts/knockout.mapping-latest.js" type="text/javascript"></script>
		<script src="/Scripts/humane.js" type="text/javascript"></script>
		<script src="/Scripts/app.js?v=4" type="text/javascript"></script>	
	</asp:content>
	
	
	<asp:content ContentPlaceHolderId="Main" runat="server">
		<div id="body" class="subpage wrapper">
			<div style="margin-top: 25px;">
				<umbraco:Macro ID="Macro1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
			</div>
			
			<h1>
				Umbraco v<umbraco:Item ID="Item1" field="pageName" runat="server" />
				<small>Status: Archived</small>
			</h1>	
			
			<div class="version">
				<h3>
					<span>100% Complete</span>
					<span>0% In Progress</span>  
				</h3>
				<!-- Progress Bar -->    
				<div class="progressbar">
					<div class="bar bar1 rl rr" style="width: 100%;">&nbsp;</div>
				</div>
			</div>
			
			<umbraco:Macro Language="cshtml" runat="server">
				@if(Model.HasValue("bodyText")) 
				{
					<div style="background-color: #FFEEC2; clear: both;padding: 25px; margin-top: 30px;">
						<h2>Archived release</h2>
						@Model.BodyText
					</div>
				}
  			</umbraco:Macro>
						
			<umbraco:Macro ID="Macro2" Language="cshtml" runat="server">
				@{ 
					var downloads = Model.ReleaseDownload.Where("Visible"); 	
					var countIsOdd = ((downloads.Count() & 1) != 0) ? true : false;				
					if(downloads.Any())
					{
						<br /><br />
						<h2>Available downloads</h2>
						<ul class="projectGroups" style="">
							@foreach (var item in downloads)
							{							
								var background = item.IsFirst() ? "/images/releases/download.png" : "/media/2483095/download.png"; 
								var width = (item.IsLast() && countIsOdd) ? 895 : 380;
								var numberOfDownloads = 0;
								int.TryParse(item.NumberOfDownloads, out numberOfDownloads);
			
								<li>
									<div style="background-image: url('@background');width: @(width)px;height: 40px;">
										<h3><a href="/ReleaseDownload?id=@item.Id">@item.Name</a></h3>
										<p>Downloaded @numberOfDownloads times - uploaded @item.UploadDate.ToString("D")</p>
									</div>
								</li>
							}
						</ul>
					}
				} 
			</umbraco:Macro>
		</div>
	</asp:content>