mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Tweaks; Code style fixes
This commit is contained in:
parent
af52088f8a
commit
9222e1f86d
|
@ -140,7 +140,7 @@ private void GenerateFamily()
|
|||
{
|
||||
Family = ProjectFamily.Redstone2;
|
||||
}
|
||||
else if(Lab?.StartsWith("rs1", StringComparison.InvariantCultureIgnoreCase) ?? false)
|
||||
else if (Lab?.StartsWith("rs1", StringComparison.InvariantCultureIgnoreCase) ?? false)
|
||||
{
|
||||
Family = ProjectFamily.Redstone;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ public class BuildDetails
|
|||
public string Lab { get; set; }
|
||||
|
||||
[Display(ResourceType = typeof(VariantTerms), Name = nameof(VariantTerms.Model_BuildTime))]
|
||||
[DisplayFormat(ConvertEmptyStringToNull = true, ApplyFormatInEditMode = true,
|
||||
[DisplayFormat(ConvertEmptyStringToNull = true,
|
||||
ApplyFormatInEditMode = true,
|
||||
DataFormatString = "{0:yyMMdd-HHmm}")]
|
||||
public DateTime? BuildTime { get; set; }
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BuildFeed.Model.View;
|
||||
|
@ -142,7 +141,7 @@ public async Task<FrontPage> SelectFrontPage(ProjectFamily family)
|
|||
|
||||
IFindFluent<Build, Build> query = _buildCollection.Find(new BsonDocument
|
||||
{
|
||||
{ "$where", "!this.LabUrl.contains(\"xbox\")"},
|
||||
{"$where", "!this.LabUrl.contains(\"xbox\")"},
|
||||
{
|
||||
nameof(Build.Family), family
|
||||
}
|
||||
|
@ -151,7 +150,7 @@ public async Task<FrontPage> SelectFrontPage(ProjectFamily family)
|
|||
|
||||
query = _buildCollection.Find(new BsonDocument
|
||||
{
|
||||
{ "$where", "!this.LabUrl.contains(\"xbox\")"},
|
||||
{"$where", "!this.LabUrl.contains(\"xbox\")"},
|
||||
{
|
||||
nameof(Build.Family), family
|
||||
},
|
||||
|
@ -175,7 +174,7 @@ public async Task<FrontPage> SelectFrontPage(ProjectFamily family)
|
|||
|
||||
query = _buildCollection.Find(new BsonDocument
|
||||
{
|
||||
{ "$where", "((this.MajorVersion === 10 && this.LabUrl.contains(\"_release\")) || this.MajorVersion < 10) && !this.LabUrl.contains(\"xbox\")"},
|
||||
{"$where", "((this.MajorVersion === 10 && this.LabUrl.contains(\"_release\")) || this.MajorVersion < 10) && !this.LabUrl.contains(\"xbox\")"},
|
||||
{
|
||||
nameof(Build.Family), family
|
||||
},
|
||||
|
@ -196,7 +195,7 @@ public async Task<FrontPage> SelectFrontPage(ProjectFamily family)
|
|||
|
||||
query = _buildCollection.Find(new BsonDocument
|
||||
{
|
||||
{ "$where", "this.LabUrl.contains(\"xbox\")"},
|
||||
{"$where", "this.LabUrl.contains(\"xbox\")"},
|
||||
{
|
||||
nameof(Build.Family), family
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public enum ProjectFamily
|
|||
[Display(Name = "Redstone 2 (Feature Update)")]
|
||||
Feature2 = 41,
|
||||
|
||||
[Display(Name = "Redstone 3")]
|
||||
[Display(Name = "Redstone 3", Description = "Windows 10 (Fall Creators Update)")]
|
||||
Redstone3 = 50
|
||||
}
|
||||
}
|
|
@ -86,7 +86,9 @@ public static string ToString(byte[] input)
|
|||
{
|
||||
returnArray[arrayIndex++] = ValueToChar(nextChar);
|
||||
while (arrayIndex != charCount)
|
||||
{
|
||||
returnArray[arrayIndex++] = '='; //padding
|
||||
}
|
||||
}
|
||||
|
||||
return new string(returnArray);
|
||||
|
|
|
@ -10,7 +10,8 @@ namespace BuildFeed.Code
|
|||
{
|
||||
public static class MvcExtensions
|
||||
{
|
||||
public static IHtmlString CheckboxListForEnum<T>(this HtmlHelper html, string id, T currentItem) where T : struct
|
||||
public static IHtmlString CheckboxListForEnum<T>(this HtmlHelper html, string id, T currentItem)
|
||||
where T : struct
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
@ -53,7 +54,12 @@ public static IHtmlString CheckboxListForEnum<T>(this HtmlHelper html, string id
|
|||
public static string GetDisplayTextForEnum(object o)
|
||||
{
|
||||
string result = null;
|
||||
DisplayAttribute display = o.GetType().GetMember(o.ToString()).First().GetCustomAttributes(false).OfType<DisplayAttribute>().LastOrDefault();
|
||||
DisplayAttribute display = o.GetType()
|
||||
.GetMember(o.ToString())
|
||||
.First()
|
||||
.GetCustomAttributes(false)
|
||||
.OfType<DisplayAttribute>()
|
||||
.LastOrDefault();
|
||||
|
||||
if (display != null)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ public static void PushNewBuild(this OneSignalClient osc, Build build, string ur
|
|||
#if DEBUG
|
||||
"Testers"
|
||||
#else
|
||||
"All"
|
||||
"All"
|
||||
#endif
|
||||
},
|
||||
Headings =
|
||||
|
|
|
@ -87,9 +87,10 @@
|
|||
<dd>Fuhrer_Adolf <a target="_blank" rel="nofollow" href="https://twitter.com/Fuhrer_Adolf"><i class="fa fa-twitter"></i></a></dd>
|
||||
<dt>Vietnamese (@System.Globalization.CultureInfo.GetCultureInfo("vi").NativeName) Translation</dt>
|
||||
<dd>Trần Kim Long Hải <a target="_blank" rel="nofollow" href="https://twitter.com/trankimlonghai"><i class="fa fa-twitter"></i></a></dd>
|
||||
<dt>Chinese - Simplified (@System.Globalization.CultureInfo.GetCultureInfo("zh-cn").NativeName) Translation</dt>
|
||||
<dt>Chinese - Simplified (@System.Globalization.CultureInfo.GetCultureInfo("zh-hans").NativeName) Translation</dt>
|
||||
<dd>Zheng He <a target="_blank" rel="nofollow" href="http://www.betaworld.cn/"><i class="fa fa-globe"></i></a></dd>
|
||||
<dt>Chinese - Traditional (@System.Globalization.CultureInfo.GetCultureInfo("zh-tw").NativeName) Translation</dt>
|
||||
<dt>Chinese - Traditional (@System.Globalization.CultureInfo.GetCultureInfo("zh-hant").NativeName) Translation</dt>
|
||||
<dd>Andrew Huang <a target="_blank" rel="nofollow" href="https://twitter.com/AndrewDev8383"><i class="fa fa-twitter"></i></a> <a target="_blank" rel="nofollow" href="http://isite.tw/"><i class="fa fa-globe"></i></a></dd>
|
||||
<dd>Link Chu <a target="_blank" rel="nofollow" href="https://twitter.com/iliGPU"><i class="fa fa-twitter"></i></a> <a target="_blank" rel="nofollow" href="https://github.com/kulaLin"><i class="fa fa-github"></i></a></dd>
|
||||
</dl>
|
||||
</div>
|
|
@ -1,4 +1,5 @@
|
|||
@using BuildFeed.Model.View
|
||||
@using BuildFeed.Controllers
|
||||
@using BuildFeed.Model.View
|
||||
@model BuildFeed.Model.View.SitemapData
|
||||
@{
|
||||
ViewBag.Title = $"{VariantTerms.Common_Sitemap} | {InvariantTerms.SiteName}";
|
||||
|
@ -8,11 +9,11 @@
|
|||
|
||||
<ul>
|
||||
<li>
|
||||
@Html.ActionLink("BuildFeed", "index", "build")
|
||||
@Html.ActionLink("BuildFeed", nameof(FrontController.Index), "Front")
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#sitemap-builds" data-toggle="collapse">Builds</a>
|
||||
<ul id="sitemap-builds" class="collapse">
|
||||
<a href="#sitemap-builds">Builds</a>
|
||||
<ul id="sitemap-builds">
|
||||
@foreach (SitemapDataBuildGroup buildGroup in Model.Builds)
|
||||
{
|
||||
<li>
|
||||
|
@ -42,8 +43,8 @@
|
|||
@foreach (KeyValuePair<string, SitemapPagedAction[]> item in Model.Actions)
|
||||
{
|
||||
<li>
|
||||
<a href="#sitemap-@item.Key.ToLower()" data-toggle="collapse">@item.Key</a>
|
||||
<ul id="sitemap-@item.Key.ToLower()" class="collapse">
|
||||
<a href="#sitemap-@item.Key.ToLower()">@item.Key</a>
|
||||
<ul id="sitemap-@item.Key.ToLower()">
|
||||
@foreach (SitemapPagedAction action in item.Value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(action.Name))
|
||||
|
@ -59,8 +60,8 @@
|
|||
else
|
||||
{
|
||||
<li>
|
||||
<a href="#sitemap-@action.UniqueId" data-toggle="collapse">@action.Name</a>
|
||||
<ul id="sitemap-@action.UniqueId" class="collapse">
|
||||
<a href="#sitemap-@action.UniqueId">@action.Name</a>
|
||||
<ul id="sitemap-@action.UniqueId">
|
||||
<li>@Html.ActionLink("Page 1", action.Action, action.UrlParams)</li>
|
||||
@for (int i = 2; i <= action.Pages; i++)
|
||||
{
|
||||
|
@ -76,8 +77,8 @@
|
|||
</li>
|
||||
}
|
||||
<li>
|
||||
<a href="#sitemap-rss" data-toggle="collapse">@VariantTerms.Common_RssFeeds</a>
|
||||
<ul id="sitemap-rss" class="collapse">
|
||||
<a href="#sitemap-rss">@VariantTerms.Common_RssFeeds</a>
|
||||
<ul id="sitemap-rss">
|
||||
<li>
|
||||
<a href="@Url.Action("Index", new
|
||||
{
|
||||
|
@ -107,8 +108,8 @@
|
|||
<i class="fa fa-sm fa-rss"></i> @VariantTerms.Support_HighestVersion</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#rss-labs" data-toggle="collapse">@VariantTerms.Model_LabString</a>
|
||||
<ul id="rss-labs" class="collapse">
|
||||
<a href="#rss-labs">@VariantTerms.Model_LabString</a>
|
||||
<ul id="rss-labs">
|
||||
@foreach (string lab in Model.Labs)
|
||||
{
|
||||
<li>
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
<add key="data:MongoDB" value="BuildFeed" />
|
||||
<add key="site:OSGLab" value="rs_prerelease" />
|
||||
<add key="site:InsiderLab" value="rs_prerelease" />
|
||||
<add key="site:ReleaseLab" value="rs2_release;rs2_release_svc_sec;rs2_release_svc_escrow" />
|
||||
<add key="site:XboxLab" value="rs2_release_xbox_1705" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.7">
|
||||
|
@ -91,9 +87,9 @@
|
|||
<add name="X-Content-Type-Options" value="nosniff" />
|
||||
<add name="X-Frame-Options" value="DENY" />
|
||||
<add name="X-XSS-Protection" value="1; mode=block" />
|
||||
<add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
|
|
Loading…
Reference in New Issue
Block a user