Add Xbox to front page; Bulk add

This commit is contained in:
Thomas Hounsell 2017-01-22 22:50:19 +00:00
parent c3cdb064de
commit 813aa09205
15 changed files with 442 additions and 306 deletions

View File

@ -123,6 +123,15 @@ public static string Common_AddBuild {
}
}
/// <summary>
/// Looks up a localized string similar to Add bulk.
/// </summary>
public static string Common_AddBulk {
get {
return ResourceManager.GetString("Common_AddBulk", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Admin.
/// </summary>
@ -339,6 +348,15 @@ public static string Front_CurrentRelease {
}
}
/// <summary>
/// Looks up a localized string similar to Current Xbox.
/// </summary>
public static string Front_CurrentXbox {
get {
return ResourceManager.GetString("Front_CurrentXbox", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete.
/// </summary>

View File

@ -138,6 +138,9 @@
<data name="Common_AddBuild" xml:space="preserve">
<value>Add build</value>
</data>
<data name="Common_AddBulk" xml:space="preserve">
<value>Add bulk</value>
</data>
<data name="Common_Admin" xml:space="preserve">
<value>Admin</value>
</data>
@ -210,6 +213,9 @@
<data name="Front_CurrentRelease" xml:space="preserve">
<value>Current Release</value>
</data>
<data name="Front_CurrentXbox" xml:space="preserve">
<value>Current Xbox</value>
</data>
<data name="Front_Delete" xml:space="preserve">
<value>Delete</value>
</data>
@ -447,5 +453,4 @@
<data name="Support_Week" xml:space="preserve">
<value>Week</value>
</data>
</root>

View File

@ -105,6 +105,7 @@
<Compile Include="ProjectFamily.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TypeOfSource.cs" />
<Compile Include="View\AddBulk.cs" />
<Compile Include="View\ChangePassword.cs" />
<Compile Include="View\FrontBuildGroup.cs" />
<Compile Include="View\FrontPage.cs" />

View File

@ -197,6 +197,18 @@ public async Task<FrontPage> SelectFrontPage()
}).Sort(sortByCompileDate).Limit(1);
fp.CurrentRelease = await query.FirstOrDefaultAsync();
query = _buildCollection.Find(new BsonDocument
{
{
nameof(Build.LabUrl), new BsonDocument
{
{"$in", new BsonArray(ConfigurationManager.AppSettings["site:XboxLab"].Split(';'))}
}
}
}).Sort(sortByCompileDate).Limit(1);
fp.CurrentXbox = await query.FirstOrDefaultAsync();
return fp;
}

View File

@ -0,0 +1,9 @@
namespace BuildFeed.Model.View
{
public class AddBulk
{
public string Builds { get; set; }
public bool SendNotifications { get; set; }
}
}

View File

@ -5,5 +5,6 @@ public class FrontPage
public Build CurrentCanary { get; set; }
public Build CurrentInsider { get; set; }
public Build CurrentRelease { get; set; }
public Build CurrentXbox { get; set; }
}
}

View File

@ -412,6 +412,7 @@
</Content>
<Content Include="Scripts\trumbowyg\plugins\colors\ui\sass\trumbowyg.colors.scss" />
<Content Include="Scripts\trumbowyg\ui\sass\trumbowyg.scss" />
<Content Include="Views\front\AddBulk.cshtml" />
</ItemGroup>
<ItemGroup />
<ItemGroup>

View File

@ -448,6 +448,21 @@ public async Task<ActionResult> AddBuild(Build build)
return View("EditBuild", build);
}
[Route("bulk/")]
[Authorize]
public ActionResult AddBulk()
{
return View();
}
[Route("bulk/")]
[Authorize]
[HttpPost]
public async Task<ActionResult> AddBulk(AddBulk builds)
{
return View(builds);
}
[Route("edit/{id}/")]
[Authorize]
public async Task<ActionResult> EditBuild(Guid id)

View File

@ -0,0 +1,40 @@
@model BuildFeed.Model.View.AddBulk
@{
ViewBag.Title = $"{VariantTerms.Common_AddBulk} | {InvariantTerms.SiteName}";
}
<h1>Add builds in bulk</h1>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<div class="form-group">
<label for="@Html.IdFor(m => m.Builds)">Builds</label>
<div>
@Html.TextAreaFor(m => m.Builds, new
{
rows = 10
})
</div>
</div>
<div class="form-group">
<label></label>
<div>
<label>
@Html.CheckBoxFor(m => m.SendNotifications)
Send notifications
</label>
</div>
</div>
<div class="form-group">
<label></label>
<div>
<input type="submit" value="Add builds" class="button" />
</div>
</div>
}

View File

@ -44,7 +44,7 @@
<a href="@Url.Action("ViewBuild", new
{
Model.CurrentRelease.Id
})" class="latest-flex-item latest-flex-green">
})" class="latest-flex-item latest-flex-blue">
<h3 class="latest-flex-title">@VariantTerms.Front_CurrentRelease</h3>
<div class="latest-flex-detail">
<p class="latest-flex-build">@(Model.CurrentRelease.MajorVersion).@(Model.CurrentRelease.MinorVersion).@(Model.CurrentRelease.Number).@(Model.CurrentRelease.Revision)</p>
@ -53,6 +53,20 @@
</div>
</a>
}
@if (Model.CurrentXbox != null)
{
<a href="@Url.Action("ViewBuild", new
{
Model.CurrentXbox.Id
})" class="latest-flex-item latest-flex-green">
<h3 class="latest-flex-title">@VariantTerms.Front_CurrentXbox</h3>
<div class="latest-flex-detail">
<p class="latest-flex-build">@(Model.CurrentXbox.MajorVersion).@(Model.CurrentXbox.MinorVersion).@(Model.CurrentXbox.Number).@(Model.CurrentXbox.Revision)</p>
<p class="latest-flex-lab">@Model.CurrentXbox.Lab</p>
<p class="latest-flex-time">@(Model.CurrentXbox.BuildTime?.ToString("HH:mm, dddd dd MMMM yyyy"))</p>
</div>
</a>
}
</div>
<a href="@Url.Action("IndexPage", new
{

View File

@ -135,6 +135,15 @@
<i class="fa fa-fw fa-plus-square"></i> @VariantTerms.Common_AddBuild
</a>
</li>
<li>
<a href="@Url.Action(nameof(FrontController.AddBulk), new
{
controller = "Front",
area = ""
})" title="@VariantTerms.Common_AddBulk">
<i class="fa fa-fw fa-database"></i> @VariantTerms.Common_AddBulk
</a>
</li>
<li>
<a href="@Url.Action(nameof(SupportController.Logout), new
{

View File

@ -11,6 +11,7 @@
<add key="site:OSGLab" value="rs_prerelease" />
<add key="site:InsiderLab" value="rs_prerelease" />
<add key="site:ReleaseLab" value="rs1_release;rs1_release_inmarket;rs1_release_sec;rs1_release_inmarket_rim" />
<add key="site:XboxLab" value="rs1_xbox_rel_1610" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.2">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -341,7 +341,7 @@ article
.build-group-empty
{
width: 255px;
width: 270px;
flex-grow: 1;
margin: 0 0.75em;
box-sizing: border-box;
@ -404,6 +404,16 @@ article
}
}
&.latest-flex-blue
{
border: #{(1em / 4)} solid #0A81CC;
h3.latest-flex-title
{
background: #0A81CC;
}
}
&.latest-flex-green
{
border: #{(1em / 4)} solid #12B23F;