<commit_before>﻿@model  MoviePicker.WebApp.Models.IndexViewModel

@{
	ViewBag.Title = "Home Page";
}

<h2>Box Office Forecasts</h2>
<h5>weekend ending @Model.Miners.First().Movies.First().WeekendEnding.ToShortDateString()</h5>

@* Showing the data from ALL of the sources/miners *@

@using (Html.BeginForm("Picks", "Home", null, FormMethod.Post, htmlAttributes: new { @class = "form-horizontal" }))
{
	<table class="table">
		<thead>
			<tr>
				<th style="text-align: center">BUX</th>
				<th style="text-align: center">Movie</th>
				@foreach (var miner in Model.Miners)
				{
					<th style="text-align: center"><a href="@miner.UrlSource">@miner.Abbreviation</a></th>
				}
			</tr>
			<tr>
				<td></td>
				<td>@Html.ActionLink("Extract", "ExtractToCSV", null, htmlAttributes: new { @class = "btn btn-info btn-sm" })</td>
				@foreach (var miner in Model.Miners)
				{
					<td style="text-align: center">
						@if (miner.Movies?.Count > 0 && miner != Model.Miners.Last())
						{
							<a href="@Model.GetFMLNerdLink(miner)" class="btn btn-info btn-sm">Analyze</a>
						}
					</td>
				}
			</tr>
		</thead>

		<tbody>
			@foreach (var movie in Model.Miners.First().Movies)
			{
				<tr>
					<td>@movie.Cost</td>
					<td>@movie.Name</td>

					@foreach (var miner in Model.Miners)
					{
						var minerMovie = miner.Movies?.FirstOrDefault(item => item.Name == movie.Name);

						if (miner != Model.Miners.Last())
						{
							var lastWeek = Model.Miners.Last().Movies?.FirstOrDefault(item => item.Name == movie.Name);

							<td style="text-align: right">
								@string.Format("{0}{1:N0}{2}", minerMovie?.Earnings > 0 ? "$ " : string.Empty
													, minerMovie?.Earnings
													, lastWeek != null && minerMovie != null && minerMovie.EarningsBase > 0
														? " " + ((minerMovie.EarningsBase - lastWeek.EarningsBase) / lastWeek.EarningsBase * 100).ToString("N0") + "% "
														: string.Empty)
							</td>
						}
						else
						{
							<td style="text-align: right">
								@string.Format("{0}{1:N0}", minerMovie?.Earnings > 0 ? "$ " : string.Empty, minerMovie?.Earnings)
							</td>
						}
					}
				</tr>
			}

			<tr>
				<td></td>
				<th>Weights</th>

				@*
					This is pretty brute force to get the values through to the Post.
					TODO: Use reflection to loop through these "flat" properties.
				*@

				<td>
					@Html.TextBoxFor(model => model.Weight1, new { @class = "form-control" })
				</td>
				<td>
					@Html.TextBoxFor(model => model.Weight2, new { @class = "form-control" })
				</td>
				<td>
					@Html.TextBoxFor(model => model.Weight3, new { @class = "form-control" })
				</td><commit_msg>Put the percent change in its own column.<commit_after>﻿@model  MoviePicker.WebApp.Models.IndexViewModel

@{
	ViewBag.Title = "Home Page";
}

<h2>Box Office Forecasts</h2>
<h5>weekend ending @Model.Miners.First().Movies.First().WeekendEnding.ToShortDateString()</h5>

@* Showing the data from ALL of the sources/miners *@

@using (Html.BeginForm("Picks", "Home", null, FormMethod.Post, htmlAttributes: new { @class = "form-horizontal" }))
{
	<table class="table">
		<thead>
			<tr>
				<th style="text-align: center">BUX</th>
				<th style="text-align: center">Movie</th>
				@foreach (var miner in Model.Miners)
				{
					<th style="text-align: center"><a href="@miner.UrlSource">@miner.Abbreviation</a></th>
					<th></th>
				}
			</tr>
			<tr>
				<td></td>
				<td>@Html.ActionLink("Extract", "ExtractToCSV", null, htmlAttributes: new { @class = "btn btn-info btn-sm" })</td>
				@foreach (var miner in Model.Miners)
				{
					<td style="text-align: center">
						@if (miner.Movies?.Count > 0 && miner != Model.Miners.Last())
						{
							<a href="@Model.GetFMLNerdLink(miner)" class="btn btn-info btn-sm">Analyze</a>
						}
					</td>
					<td></td>
				}
			</tr>
		</thead>

		<tbody>
			@foreach (var movie in Model.Miners.First().Movies)
			{
				<tr>
					<td>@movie.Cost</td>
					<td>@movie.Name</td>

					@foreach (var miner in Model.Miners)
					{
						var minerMovie = miner.Movies?.FirstOrDefault(item => item.Name == movie.Name);

						<td style="text-align: right">
							@string.Format("{0:N0}", minerMovie?.Earnings)
						</td>

						if (miner != Model.Miners.Last())
						{
							var lastWeek = Model.Miners.Last().Movies?.FirstOrDefault(item => item.Name == movie.Name);

							<td style="text-align: right">
								@string.Format("{0}", lastWeek != null && minerMovie != null && minerMovie.EarningsBase > 0
														? " " + ((minerMovie.EarningsBase - lastWeek.EarningsBase) / lastWeek.EarningsBase * 100).ToString("N0") + "% "
														: string.Empty)
							</td>
						}
						else
						{
							<td></td>
						}
					}
				</tr>
			}

			<tr>
				<td></td>
				<th>Weights</th>

				@*
					This is pretty brute force to get the values through to the Post.
					TODO: Use reflection to loop through these "flat" properties.
				*@

				<td>
					@Html.TextBoxFor(model => model.Weight1, new { @class = "form-control" })
				</td>
				<td>
					@Html.TextBoxFor(model => model.Weight2, new { @class = "form-control" })
				</td>
				<td>
					@Html.TextBoxFor(model => model.Weight3, new { @class = "form-control" })
				</td>
{'fraction_non_alphanumeric': 0.18105584143319992, 'fraction_numerical': 0.0072422336573279966, 'mean_word_length': 2.634349030470914, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '240248', 'n_tokens_mistral': 2479, 'n_tokens_neox': 1870, 'n_words': 372}