mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Rebuilt all the things I burnt, (p2)
etc
This commit is contained in:
parent
0403a9a1f5
commit
5a243b9b96
|
@ -196,10 +196,10 @@
|
|||
<Compile Include="Code\LocalController.cs" />
|
||||
<Compile Include="Code\SiteLocale.cs" />
|
||||
<Compile Include="Code\MvcIntrinsics.cs" />
|
||||
<Compile Include="Controllers\apiController.cs" />
|
||||
<Compile Include="Controllers\frontController.cs" />
|
||||
<Compile Include="Controllers\rssController.cs" />
|
||||
<Compile Include="Controllers\supportController.cs" />
|
||||
<Compile Include="Controllers\ApiController.cs" />
|
||||
<Compile Include="Controllers\FrontController.cs" />
|
||||
<Compile Include="Controllers\RssController.cs" />
|
||||
<Compile Include="Controllers\SupportController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -751,6 +751,7 @@
|
|||
<Compile Include="Models\ApiModel\NewBuild.cs" />
|
||||
<Compile Include="Models\ApiModel\SearchResult.cs" />
|
||||
<Compile Include="Models\Build\Build-Group.cs" />
|
||||
<Compile Include="Models\Build\Build-Flights.cs" />
|
||||
<Compile Include="Models\Build\Build-Source.cs" />
|
||||
<Compile Include="Models\Build\Build-Version.cs" />
|
||||
<Compile Include="Models\Build\Build-Year.cs" />
|
||||
|
|
|
@ -11,31 +11,30 @@
|
|||
|
||||
namespace BuildFeed.Controllers
|
||||
{
|
||||
public class apiController : ApiController
|
||||
public class ApiController : System.Web.Http.ApiController
|
||||
{
|
||||
private Build bModel;
|
||||
private readonly Build _bModel;
|
||||
|
||||
public apiController() : base()
|
||||
public ApiController() : base()
|
||||
{
|
||||
bModel = new Build();
|
||||
_bModel = new Build();
|
||||
}
|
||||
|
||||
public async Task<BuildModel[]> GetBuilds(int limit = 20, int skip = 0)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
// var builds = await bModel.SelectInBuildOrder(limit, skip);
|
||||
// return builds.ToArray();
|
||||
var builds = await _bModel.SelectBuildsByOrder(limit, skip);
|
||||
return builds.ToArray();
|
||||
}
|
||||
|
||||
public async Task<FrontBuildGroup[]> GetBuildGroups(int limit = 20, int skip = 20)
|
||||
{
|
||||
var bgroups = await bModel.SelectAllGroups(limit, skip);
|
||||
var bgroups = await _bModel.SelectAllGroups(limit, skip);
|
||||
return bgroups.ToArray();
|
||||
}
|
||||
|
||||
public async Task<BuildModel[]> GetBuildsForBuildGroup(uint major, uint minor, uint number, uint? revision = null)
|
||||
{
|
||||
var builds = await bModel.SelectGroup(new BuildGroup()
|
||||
var builds = await _bModel.SelectGroup(new BuildGroup()
|
||||
{
|
||||
Major = major,
|
||||
Minor = minor,
|
||||
|
@ -48,16 +47,15 @@ public async Task<BuildModel[]> GetBuildsForBuildGroup(uint major, uint minor, u
|
|||
|
||||
public async Task<IEnumerable<string>> GetWin10Labs()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//List<string> labs = new List<string>();
|
||||
//labs.AddRange(await bModel.SelectLabs(6, 4));
|
||||
//labs.AddRange(await bModel.SelectLabs(10, 0));
|
||||
List<string> labs = new List<string>();
|
||||
labs.AddRange(await _bModel.SelectLabsForVersion(6, 4));
|
||||
labs.AddRange(await _bModel.SelectLabsForVersion(10, 0));
|
||||
|
||||
//return labs
|
||||
// .GroupBy(l => l)
|
||||
// .Select(l => l.Key)
|
||||
// .Where(l => l.All(c => c != '('))
|
||||
// .ToArray();
|
||||
return labs
|
||||
.GroupBy(l => l)
|
||||
.Select(l => l.Key)
|
||||
.Where(l => l.All(c => c != '('))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
@ -69,7 +67,7 @@ public async Task<bool> AddWin10Builds(NewBuild apiModel)
|
|||
}
|
||||
if (Membership.ValidateUser(apiModel.Username, apiModel.Password))
|
||||
{
|
||||
await bModel.InsertAll(apiModel.NewBuilds.Select(nb => new BuildModel()
|
||||
await _bModel.InsertAll(apiModel.NewBuilds.Select(nb => new BuildModel()
|
||||
{
|
||||
MajorVersion = nb.MajorVersion,
|
||||
MinorVersion = nb.MinorVersion,
|
||||
|
@ -81,11 +79,8 @@ public async Task<bool> AddWin10Builds(NewBuild apiModel)
|
|||
}));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchResult>> GetSearchResult(string id)
|
||||
{
|
||||
|
@ -110,7 +105,7 @@ orderby s.Text.ToLower().IndexOf(id.ToLower(), StringComparison.Ordinal) ascendi
|
|||
results.AddRange(sourceResults);
|
||||
|
||||
|
||||
var versionResults = from v in await bModel.SelectAllVersions()
|
||||
var versionResults = from v in await _bModel.SelectAllVersions()
|
||||
where $"{v.Major}.{v.Minor}".StartsWith(id)
|
||||
orderby v.Major descending, v.Minor descending
|
||||
select new SearchResult()
|
||||
|
@ -124,7 +119,7 @@ orderby s.Text.ToLower().IndexOf(id.ToLower(), StringComparison.Ordinal) ascendi
|
|||
results.AddRange(versionResults);
|
||||
|
||||
|
||||
var yearResults = from y in await bModel.SelectAllYears()
|
||||
var yearResults = from y in await _bModel.SelectAllYears()
|
||||
where y.ToString().Contains(id)
|
||||
orderby y descending
|
||||
select new SearchResult()
|
||||
|
@ -138,21 +133,19 @@ orderby y descending
|
|||
results.AddRange(yearResults);
|
||||
|
||||
|
||||
//var labResults = from l in await bModel.SearchBuildLabs(id)
|
||||
// orderby l.IndexOf(id.ToLower()) ascending,
|
||||
// l.Length ascending
|
||||
// select new SearchResult()
|
||||
// {
|
||||
// Url = Url.Route("Lab Root", new { controller = "Front", action = "ViewLab", lab = l.Replace('/', '-') }),
|
||||
// Label = l.Replace(id, $"<strong>{id}</strong>"),
|
||||
// Title = l,
|
||||
// Group = Common.SearchLab
|
||||
// };
|
||||
var labResults = from l in await _bModel.SearchLabs(id)
|
||||
select new SearchResult()
|
||||
{
|
||||
Url = Url.Route("Lab Root", new { controller = "Front", action = "ViewLab", lab = l.Replace('/', '-') }),
|
||||
Label = l.Replace(id, $"<strong>{id}</strong>"),
|
||||
Title = l,
|
||||
Group = Common.SearchLab
|
||||
};
|
||||
|
||||
//results.AddRange(labResults);
|
||||
results.AddRange(labResults);
|
||||
|
||||
|
||||
var buildResults = from b in await bModel.Select()
|
||||
var buildResults = from b in await _bModel.Select()
|
||||
where b.FullBuildString.ToLower().Contains(id.ToLower())
|
||||
orderby b.FullBuildString.ToLower().IndexOf(id.ToLower(), StringComparison.Ordinal) ascending,
|
||||
b.BuildTime descending
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BuildFeed.Controllers
|
|||
{
|
||||
public class FrontController : LocalController
|
||||
{
|
||||
private const int PAGE_SIZE = 72;
|
||||
public const int PageSize = 72;
|
||||
|
||||
private readonly Build _bModel;
|
||||
private readonly MetaItem _mModel;
|
||||
|
@ -38,12 +38,12 @@ public FrontController()
|
|||
#endif
|
||||
public async Task<ActionResult> IndexPage(int page)
|
||||
{
|
||||
var buildGroups = await _bModel.SelectAllGroups(PAGE_SIZE, (page - 1) * PAGE_SIZE);
|
||||
var buildGroups = await _bModel.SelectAllGroups(PageSize, (page - 1) * PageSize);
|
||||
|
||||
ViewBag.PageNumber = page;
|
||||
ViewBag.PageCount = Math.Ceiling(
|
||||
Convert.ToDouble(await _bModel.SelectAllGroupsCount()) /
|
||||
Convert.ToDouble(PAGE_SIZE));
|
||||
Convert.ToDouble(PageSize));
|
||||
|
||||
if (ViewBag.PageNumber > ViewBag.PageCount)
|
||||
{
|
||||
|
@ -189,12 +189,12 @@ public async Task<ActionResult> ViewLabPage(string lab, int page)
|
|||
Value = lab
|
||||
});
|
||||
|
||||
var builds = await _bModel.SelectLab(lab, PAGE_SIZE, (page - 1) * PAGE_SIZE);
|
||||
var builds = await _bModel.SelectLab(lab, PageSize, (page - 1) * PageSize);
|
||||
|
||||
ViewBag.ItemId = builds.FirstOrDefault()
|
||||
?.Lab;
|
||||
ViewBag.PageNumber = page;
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectLabCount(lab)) / Convert.ToDouble(PAGE_SIZE));
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectLabCount(lab)) / Convert.ToDouble(PageSize));
|
||||
|
||||
if (ViewBag.PageNumber > ViewBag.PageCount)
|
||||
{
|
||||
|
@ -223,10 +223,10 @@ public async Task<ActionResult> ViewSourcePage(TypeOfSource source, int page)
|
|||
});
|
||||
ViewBag.ItemId = DisplayHelpers.GetDisplayTextForEnum(source);
|
||||
|
||||
var builds = await _bModel.SelectSource(source, PAGE_SIZE, (page - 1) * PAGE_SIZE);
|
||||
var builds = await _bModel.SelectSource(source, PageSize, (page - 1) * PageSize);
|
||||
|
||||
ViewBag.PageNumber = page;
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectSourceCount(source)) / Convert.ToDouble(PAGE_SIZE));
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectSourceCount(source)) / Convert.ToDouble(PageSize));
|
||||
|
||||
if (ViewBag.PageNumber > ViewBag.PageCount)
|
||||
{
|
||||
|
@ -255,10 +255,10 @@ public async Task<ActionResult> ViewYearPage(int year, int page)
|
|||
});
|
||||
ViewBag.ItemId = year.ToString();
|
||||
|
||||
var builds = await _bModel.SelectYear(year, PAGE_SIZE, (page - 1) * PAGE_SIZE);
|
||||
var builds = await _bModel.SelectYear(year, PageSize, (page - 1) * PageSize);
|
||||
|
||||
ViewBag.PageNumber = page;
|
||||
ViewBag.PageCount = Math.Ceiling(await _bModel.SelectYearCount(year) / Convert.ToDouble(PAGE_SIZE));
|
||||
ViewBag.PageCount = Math.Ceiling(await _bModel.SelectYearCount(year) / Convert.ToDouble(PageSize));
|
||||
|
||||
if (ViewBag.PageNumber > ViewBag.PageCount)
|
||||
{
|
||||
|
@ -288,10 +288,10 @@ public async Task<ActionResult> ViewVersionPage(uint major, uint minor, int page
|
|||
});
|
||||
ViewBag.ItemId = valueString;
|
||||
|
||||
var builds = await _bModel.SelectVersion(major, minor, PAGE_SIZE, (page - 1) * PAGE_SIZE);
|
||||
var builds = await _bModel.SelectVersion(major, minor, PageSize, (page - 1) * PageSize);
|
||||
|
||||
ViewBag.PageNumber = page;
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectVersionCount(major, minor)) / Convert.ToDouble(PAGE_SIZE));
|
||||
ViewBag.PageCount = Math.Ceiling(Convert.ToDouble(await _bModel.SelectVersionCount(major, minor)) / Convert.ToDouble(PageSize));
|
||||
|
||||
if (ViewBag.PageNumber > ViewBag.PageCount)
|
||||
{
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using BuildFeed.Code;
|
||||
using BuildFeed.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Mvc;
|
||||
using BuildFeed.Code;
|
||||
using BuildFeed.Models;
|
||||
using X.Web.RSS;
|
||||
using X.Web.RSS.Enumerators;
|
||||
using X.Web.RSS.Structure;
|
||||
|
@ -12,244 +13,242 @@
|
|||
|
||||
namespace BuildFeed.Controllers
|
||||
{
|
||||
public class rssController : LocalController
|
||||
public class RssController : LocalController
|
||||
{
|
||||
private Build bModel;
|
||||
private const int RSS_SIZE = 25;
|
||||
private readonly Build _bModel;
|
||||
|
||||
public rssController() : base()
|
||||
{
|
||||
bModel = new Build();
|
||||
}
|
||||
public RssController() { _bModel = new Build(); }
|
||||
|
||||
[Route("rss/compiled")]
|
||||
public async Task<ActionResult> index()
|
||||
public async Task<ActionResult> Index()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectInBuildOrder(RSS_SIZE, 0);
|
||||
var builds = await _bModel.SelectBuildsByCompileDate(RSS_SIZE, 0);
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = "BuildFeed RSS - Recently Compiled",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
RssDocument rdoc = new RssDocument
|
||||
{
|
||||
Channel = new RssChannel
|
||||
{
|
||||
Title = "BuildFeed RSS - Recently Compiled",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
Items = (from build in builds
|
||||
select new RssItem
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
}
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid() { IsPermaLink = true, Value = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Action("viewBuild", new { controller = "Front", id = build.Id })) },
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
|
||||
[Route("rss/added")]
|
||||
public async Task<ActionResult> added()
|
||||
public async Task<ActionResult> Added()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectLatest(RSS_SIZE, 0);
|
||||
var builds = await _bModel.SelectBuildsByAddedDate(RSS_SIZE, 0);
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = "BuildFeed RSS - Recently Added",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
RssDocument rdoc = new RssDocument()
|
||||
{
|
||||
Channel = new RssChannel()
|
||||
{
|
||||
Title = "BuildFeed RSS - Recently Added",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid()
|
||||
// {
|
||||
// IsPermaLink = true,
|
||||
// Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"
|
||||
// },
|
||||
// Category = new RssCategory() { Text = build.Family.ToString() },
|
||||
// InternalPubDate = new RssDate(build.Added).DateStringISO8601 // bit of a dirty hack to work around problem in X.Web.RSS with the date format.
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
Items = (from build in builds
|
||||
select new RssItem()
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid()
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
},
|
||||
Category = new RssCategory() { Text = build.Family.ToString() },
|
||||
InternalPubDate = new RssDate(build.Added).DateStringISO8601 // bit of a dirty hack to work around problem in X.Web.RSS with the date format.
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
|
||||
[Route("rss/leaked")]
|
||||
public async Task<ActionResult> leaked()
|
||||
public async Task<ActionResult> Leaked()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectLatestLeaked(RSS_SIZE, 0);
|
||||
var builds = await _bModel.SelectBuildsByLeakedDate(RSS_SIZE, 0);
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = "BuildFeed RSS - Recently Leaked",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
RssDocument rdoc = new RssDocument()
|
||||
{
|
||||
Channel = new RssChannel()
|
||||
{
|
||||
Title = "BuildFeed RSS - Recently Leaked",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid()
|
||||
// {
|
||||
// IsPermaLink = true,
|
||||
// Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"
|
||||
// },
|
||||
// InternalPubDate = new RssDate(build.LeakDate.Value).DateStringISO8601 // bit of a dirty hack to work around problem in X.Web.RSS with the date format.
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
Items = (from build in builds
|
||||
select new RssItem()
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid()
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
},
|
||||
InternalPubDate = new RssDate(build.LeakDate.Value).DateStringISO8601 // bit of a dirty hack to work around problem in X.Web.RSS with the date format.
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
|
||||
[Route("rss/version")]
|
||||
public async Task<ActionResult> version()
|
||||
public async Task<ActionResult> Version()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectInVersionOrder(RSS_SIZE, 0);
|
||||
var builds = await _bModel.SelectBuildsByOrder(RSS_SIZE, 0);
|
||||
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = "BuildFeed RSS - Highest Version",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
RssDocument rdoc = new RssDocument()
|
||||
{
|
||||
Channel = new RssChannel()
|
||||
{
|
||||
Title = "BuildFeed RSS - Highest Version",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid()
|
||||
// {
|
||||
// IsPermaLink = true,
|
||||
// Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"
|
||||
// },
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
Items = (from build in builds
|
||||
select new RssItem()
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid()
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
},
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
|
||||
[Route("rss/flight/{id}")]
|
||||
public async Task<ActionResult> flight(LevelOfFlight id)
|
||||
public async Task<ActionResult> Flight(LevelOfFlight id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectFlight(id, RSS_SIZE, 0);
|
||||
var builds = await _bModel.SelectFlight(id, RSS_SIZE, 0);
|
||||
|
||||
RssDocument rdoc = new RssDocument()
|
||||
{
|
||||
Channel = new RssChannel()
|
||||
{
|
||||
Title = $"BuildFeed RSS - {id} Flight Level",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = $"BuildFeed RSS - {id} Flight Level",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
Items = (from build in builds
|
||||
select new RssItem()
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid()
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
},
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid()
|
||||
// {
|
||||
// IsPermaLink = true,
|
||||
// Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"
|
||||
// },
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
|
||||
[Route("rss/lab/{lab}")]
|
||||
public async Task<ActionResult> lab(string lab)
|
||||
public async Task<ActionResult> Lab(string lab)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectLab(lab, 0, RSS_SIZE);
|
||||
var builds = await _bModel.SelectLab(lab, RSS_SIZE, 0);
|
||||
|
||||
RssDocument rdoc = new RssDocument()
|
||||
{
|
||||
Channel = new RssChannel()
|
||||
{
|
||||
Title = $"BuildFeed RSS - {lab} Lab",
|
||||
Description = "",
|
||||
Generator = "BuildFeed.net RSS Controller",
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
SkipHours = new List<Hour>(),
|
||||
SkipDays = new List<Day>(),
|
||||
|
||||
//RssDocument rdoc = new RssDocument()
|
||||
//{
|
||||
// Channel = new RssChannel()
|
||||
// {
|
||||
// Title = $"BuildFeed RSS - {lab} Lab",
|
||||
// Description = "",
|
||||
// Generator = "BuildFeed.net RSS Controller",
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}"),
|
||||
// SkipHours = new List<Hour>(),
|
||||
// SkipDays = new List<Day>(),
|
||||
Items = (from build in builds
|
||||
select new RssItem()
|
||||
{
|
||||
Title = build.FullBuildString,
|
||||
Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
Guid = new RssGuid()
|
||||
{
|
||||
IsPermaLink = true,
|
||||
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("ViewBuild", new { controller = "Front", id = build.Id })}"
|
||||
},
|
||||
}).ToList()
|
||||
}
|
||||
};
|
||||
|
||||
// Items = (from build in builds
|
||||
// select new RssItem()
|
||||
// {
|
||||
// Title = build.FullBuildString,
|
||||
// Link = new RssUrl($"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"),
|
||||
// Guid = new RssGuid()
|
||||
// {
|
||||
// IsPermaLink = true,
|
||||
// Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "Front", id = build.Id })}"
|
||||
// },
|
||||
// }).ToList()
|
||||
// }
|
||||
//};
|
||||
|
||||
//Response.ContentType = "application/rss+xml";
|
||||
|
||||
//await Response.Output.WriteAsync(rdoc.ToXml());
|
||||
|
||||
//return new EmptyResult();
|
||||
return new ContentResult
|
||||
{
|
||||
Content = rdoc.ToXml(),
|
||||
ContentType = "application/rss+xml",
|
||||
ContentEncoding = Encoding.UTF8
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,23 +14,23 @@
|
|||
|
||||
namespace BuildFeed.Controllers
|
||||
{
|
||||
public class supportController : LocalController
|
||||
public class SupportController : LocalController
|
||||
{
|
||||
private Build bModel;
|
||||
private readonly Build _bModel;
|
||||
|
||||
public supportController() : base()
|
||||
public SupportController() : base()
|
||||
{
|
||||
bModel = new Build();
|
||||
_bModel = new Build();
|
||||
}
|
||||
|
||||
[Route("login/")]
|
||||
public ActionResult login()
|
||||
public ActionResult Login()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost, Route("login/")]
|
||||
public ActionResult login(LoginUser ru)
|
||||
public ActionResult Login(LoginUser ru)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
|
@ -59,10 +59,10 @@ public ActionResult login(LoginUser ru)
|
|||
}
|
||||
|
||||
[Authorize, Route("password/")]
|
||||
public ActionResult password() => View();
|
||||
public ActionResult Password() => View();
|
||||
|
||||
[HttpPost, Authorize, Route("password/")]
|
||||
public ActionResult password(ChangePassword cp)
|
||||
public ActionResult Password(ChangePassword cp)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
|
@ -84,17 +84,17 @@ public ActionResult password(ChangePassword cp)
|
|||
}
|
||||
|
||||
[Route("logout/")]
|
||||
public ActionResult logout()
|
||||
public ActionResult Logout()
|
||||
{
|
||||
FormsAuthentication.SignOut();
|
||||
return Redirect("/");
|
||||
}
|
||||
|
||||
[Route("register/")]
|
||||
public ActionResult register() => View();
|
||||
public ActionResult Register() => View();
|
||||
|
||||
[HttpPost, Route("register/")]
|
||||
public ActionResult register(RegistrationUser ru)
|
||||
public ActionResult Register(RegistrationUser ru)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
|
@ -127,9 +127,9 @@ public ActionResult register(RegistrationUser ru)
|
|||
public ActionResult thanks_register() => View();
|
||||
|
||||
[Route("rss")]
|
||||
public async Task<ActionResult> rss()
|
||||
public async Task<ActionResult> Rss()
|
||||
{
|
||||
ViewBag.Labs = await bModel.SelectAllLabs();
|
||||
ViewBag.Labs = await _bModel.SelectAllLabs();
|
||||
return View();
|
||||
}
|
||||
|
||||
|
@ -137,145 +137,157 @@ public async Task<ActionResult> rss()
|
|||
#if !DEBUG
|
||||
// [OutputCache(Duration = 3600, VaryByParam = "none", VaryByCustom = "userName")]
|
||||
#endif
|
||||
public async Task<ActionResult> sitemap()
|
||||
public async Task<ActionResult> Sitemap()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var builds = await bModel.SelectInVersionOrder();
|
||||
//Dictionary<string, SitemapPagedAction[]> actions = new Dictionary<string, SitemapPagedAction[]>();
|
||||
//actions.Add("Pages", new[]
|
||||
// {
|
||||
// new SitemapPagedAction()
|
||||
// {
|
||||
// UrlParams = new RouteValueDictionary(new
|
||||
// {
|
||||
// controller = "front",
|
||||
// action = "index",
|
||||
// page = 1
|
||||
// }),
|
||||
// Pages = (builds.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
// }
|
||||
// });
|
||||
var builds = await _bModel.SelectBuildsByOrder();
|
||||
Dictionary<string, SitemapPagedAction[]> actions = new Dictionary<string, SitemapPagedAction[]>
|
||||
{
|
||||
{
|
||||
"Pages", new[]
|
||||
{
|
||||
new SitemapPagedAction()
|
||||
{
|
||||
UrlParams = new RouteValueDictionary(new
|
||||
{
|
||||
controller = "Front",
|
||||
action = "Index",
|
||||
page = 1
|
||||
}),
|
||||
Pages = (builds.Count + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Versions", (from b in builds
|
||||
group b by new BuildVersion()
|
||||
{
|
||||
Major = b.MajorVersion,
|
||||
Minor = b.MinorVersion
|
||||
}
|
||||
into bv
|
||||
orderby bv.Key.Major descending,
|
||||
bv.Key.Minor descending
|
||||
select new SitemapPagedAction()
|
||||
{
|
||||
Name = $"{Common.ProductName} {bv.Key.Major}.{bv.Key.Minor}",
|
||||
UrlParams = new RouteValueDictionary(new
|
||||
{
|
||||
controller = "Front",
|
||||
action = "ViewVersion",
|
||||
major = bv.Key.Major,
|
||||
minor = bv.Key.Minor,
|
||||
page = 1
|
||||
}),
|
||||
Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
}).ToArray()
|
||||
},
|
||||
{
|
||||
"Labs", (from b in builds
|
||||
where !string.IsNullOrEmpty(b.Lab)
|
||||
group b by b.Lab
|
||||
into bv
|
||||
orderby bv.Key
|
||||
select new SitemapPagedAction()
|
||||
{
|
||||
Name = bv.Key,
|
||||
UrlParams = new RouteValueDictionary(new
|
||||
{
|
||||
controller = "Front",
|
||||
action = "ViewLab",
|
||||
lab = bv.Key,
|
||||
page = 1
|
||||
}),
|
||||
Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
}).ToArray()
|
||||
},
|
||||
{
|
||||
"Years", (from b in builds
|
||||
where b.BuildTime.HasValue
|
||||
group b by b.BuildTime.Value.Year
|
||||
into bv
|
||||
orderby bv.Key descending
|
||||
select new SitemapPagedAction()
|
||||
{
|
||||
Name = bv.Key.ToString(),
|
||||
UrlParams = new RouteValueDictionary(new
|
||||
{
|
||||
controller = "Front",
|
||||
action = "ViewYear",
|
||||
year = bv.Key,
|
||||
page = 1
|
||||
}),
|
||||
Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
}).ToArray()
|
||||
},
|
||||
{
|
||||
"Sources", (from b in builds
|
||||
group b by b.SourceType
|
||||
into bv
|
||||
orderby bv.Key
|
||||
select new SitemapPagedAction()
|
||||
{
|
||||
Name = DisplayHelpers.GetDisplayTextForEnum(bv.Key),
|
||||
UrlParams = new RouteValueDictionary(new
|
||||
{
|
||||
controller = "Front",
|
||||
action = "ViewSource",
|
||||
source = bv.Key,
|
||||
page = 1
|
||||
}),
|
||||
Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
}).ToArray()
|
||||
}
|
||||
};
|
||||
|
||||
//actions.Add("Versions", (from b in builds
|
||||
// group b by new BuildVersion()
|
||||
// {
|
||||
// Major = b.MajorVersion,
|
||||
// Minor = b.MinorVersion
|
||||
// }
|
||||
// into bv
|
||||
// orderby bv.Key.Major descending,
|
||||
// bv.Key.Minor descending
|
||||
// select new SitemapPagedAction()
|
||||
// {
|
||||
// Name = $"{Common.ProductName} {bv.Key.Major}.{bv.Key.Minor}",
|
||||
// UrlParams = new RouteValueDictionary(new
|
||||
// {
|
||||
// controller = "front",
|
||||
// action = "viewVersion",
|
||||
// major = bv.Key.Major,
|
||||
// minor = bv.Key.Minor,
|
||||
// page = 1
|
||||
// }),
|
||||
// Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
// }).ToArray());
|
||||
|
||||
//actions.Add("Labs", (from b in builds
|
||||
// where !string.IsNullOrEmpty(b.Lab)
|
||||
// group b by b.Lab
|
||||
// into bv
|
||||
// orderby bv.Key
|
||||
// select new SitemapPagedAction()
|
||||
// {
|
||||
// Name = bv.Key,
|
||||
// UrlParams = new RouteValueDictionary(new
|
||||
// {
|
||||
// controller = "front",
|
||||
// action = "viewLab",
|
||||
// lab = bv.Key,
|
||||
// page = 1
|
||||
// }),
|
||||
// Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
// }).ToArray());
|
||||
|
||||
//actions.Add("Years", (from b in builds
|
||||
// where b.BuildTime.HasValue
|
||||
// group b by b.BuildTime.Value.Year
|
||||
// into bv
|
||||
// orderby bv.Key descending
|
||||
// select new SitemapPagedAction()
|
||||
// {
|
||||
// Name = bv.Key.ToString(),
|
||||
// UrlParams = new RouteValueDictionary(new
|
||||
// {
|
||||
// controller = "front",
|
||||
// action = "viewYear",
|
||||
// year = bv.Key,
|
||||
// page = 1
|
||||
// }),
|
||||
// Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
// }).ToArray());
|
||||
|
||||
//actions.Add("Sources", (from b in builds
|
||||
// group b by b.SourceType
|
||||
// into bv
|
||||
// orderby bv.Key
|
||||
// select new SitemapPagedAction()
|
||||
// {
|
||||
// Name = DisplayHelpers.GetDisplayTextForEnum(bv.Key),
|
||||
// UrlParams = new RouteValueDictionary(new
|
||||
// {
|
||||
// controller = "front",
|
||||
// action = "viewSource",
|
||||
// source = bv.Key,
|
||||
// page = 1
|
||||
// }),
|
||||
// Pages = (bv.Count() + (FrontController.PageSize - 1)) / FrontController.PageSize
|
||||
// }).ToArray());
|
||||
|
||||
//SitemapData model = new SitemapData()
|
||||
//{
|
||||
// Builds = (from b in builds
|
||||
// group b by new
|
||||
// {
|
||||
// Major = b.MajorVersion,
|
||||
// Minor = b.MinorVersion,
|
||||
// Build = b.Number,
|
||||
// Revision = b.Revision
|
||||
// } into bg
|
||||
// orderby bg.Key.Major descending,
|
||||
// bg.Key.Minor descending,
|
||||
// bg.Key.Build descending,
|
||||
// bg.Key.Revision descending
|
||||
// select new SitemapDataBuildGroup()
|
||||
// {
|
||||
// Id = new BuildGroup() {
|
||||
// Major = bg.Key.Major,
|
||||
// Minor = bg.Key.Minor,
|
||||
// Build = bg.Key.Build,
|
||||
// Revision = bg.Key.Revision
|
||||
// },
|
||||
// Builds = (from bgb in bg
|
||||
// select new SitemapDataBuild()
|
||||
// {
|
||||
// Id = bgb.Id,
|
||||
// Name = bgb.FullBuildString
|
||||
// }).ToArray()
|
||||
// }).ToArray(),
|
||||
SitemapData model = new SitemapData()
|
||||
{
|
||||
Builds = (from b in builds
|
||||
group b by new
|
||||
{
|
||||
Major = b.MajorVersion,
|
||||
Minor = b.MinorVersion,
|
||||
Build = b.Number,
|
||||
Revision = b.Revision
|
||||
} into bg
|
||||
orderby bg.Key.Major descending,
|
||||
bg.Key.Minor descending,
|
||||
bg.Key.Build descending,
|
||||
bg.Key.Revision descending
|
||||
select new SitemapDataBuildGroup()
|
||||
{
|
||||
Id = new BuildGroup()
|
||||
{
|
||||
Major = bg.Key.Major,
|
||||
Minor = bg.Key.Minor,
|
||||
Build = bg.Key.Build,
|
||||
Revision = bg.Key.Revision
|
||||
},
|
||||
Builds = (from bgb in bg
|
||||
select new SitemapDataBuild()
|
||||
{
|
||||
Id = bgb.Id,
|
||||
Name = bgb.FullBuildString
|
||||
}).ToArray()
|
||||
}).ToArray(),
|
||||
|
||||
// Actions = actions,
|
||||
// Labs = (from b in builds
|
||||
// group b by b.Lab into lab
|
||||
// select lab.Key).ToArray()
|
||||
//};
|
||||
Actions = actions,
|
||||
Labs = (from b in builds
|
||||
group b by b.Lab into lab
|
||||
select lab.Key).ToArray()
|
||||
};
|
||||
|
||||
//return View(model);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[Route("xml-sitemap/")]
|
||||
#if !DEBUG
|
||||
// [OutputCache(Duration = 3600, VaryByParam = "none", VaryByCustom = "userName")]
|
||||
#endif
|
||||
public async Task<ActionResult> xmlsitemap()
|
||||
public async Task<ActionResult> XmlSitemap()
|
||||
{
|
||||
XNamespace xn = XNamespace.Get("http://www.sitemaps.org/schemas/sitemap/0.9");
|
||||
List<XElement> xlist = new List<XElement>();
|
||||
|
@ -286,10 +298,10 @@ public async Task<ActionResult> xmlsitemap()
|
|||
home.Add(new XElement(xn + "changefreq", "daily"));
|
||||
xlist.Add(home);
|
||||
|
||||
foreach (var b in await bModel.Select())
|
||||
foreach (var b in await _bModel.Select())
|
||||
{
|
||||
XElement url = new XElement(xn + "url");
|
||||
url.Add(new XElement(xn + "loc", Request.Url?.GetLeftPart(UriPartial.Authority) + Url.Action("viewBuild", "Front", new { id = b.Id })));
|
||||
url.Add(new XElement(xn + "loc", Request.Url?.GetLeftPart(UriPartial.Authority) + Url.Action("ViewBuild", "Front", new { id = b.Id })));
|
||||
if (b.Modified != DateTime.MinValue)
|
||||
{
|
||||
url.Add(new XElement(xn + "lastmod", b.Modified.ToString("yyyy-MM-dd")));
|
||||
|
@ -312,9 +324,9 @@ public async Task<ActionResult> xmlsitemap()
|
|||
#if !DEBUG
|
||||
// [OutputCache(Duration = 3600, VaryByParam = "none", VaryByCustom = "userName")]
|
||||
#endif
|
||||
public async Task<ActionResult> stats()
|
||||
public async Task<ActionResult> Stats()
|
||||
{
|
||||
var builds = await bModel.Select();
|
||||
var builds = await _bModel.Select();
|
||||
|
||||
List<MonthCount> additions = new List<MonthCount>();
|
||||
var rawAdditions = (from b in builds
|
||||
|
@ -378,6 +390,6 @@ orderby bl.Count() descending
|
|||
}
|
||||
|
||||
[Route("credits/")]
|
||||
public ActionResult credits() => View();
|
||||
public ActionResult Credits() => View();
|
||||
}
|
||||
}
|
40
BuildFeed/Models/Build/Build-Flights.cs
Normal file
40
BuildFeed/Models/Build/Build-Flights.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace BuildFeed.Models
|
||||
{
|
||||
public partial class Build
|
||||
{
|
||||
public Task<LevelOfFlight[]> SelectAllFlights(int limit = -1, int skip = 0)
|
||||
{
|
||||
return Task.Run(() => Enum.GetValues(typeof(LevelOfFlight)) as LevelOfFlight[]);
|
||||
}
|
||||
|
||||
public Task<long> SelectAllFlightsCount()
|
||||
{
|
||||
return Task.Run(() => Enum.GetValues(typeof(LevelOfFlight))
|
||||
.LongLength);
|
||||
}
|
||||
|
||||
public async Task<List<BuildModel>> SelectFlight(LevelOfFlight flight, int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection.Find(new BsonDocument(nameof(BuildModel.FlightLevel), flight))
|
||||
.Sort(sortByOrder)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
{
|
||||
query = query.Limit(limit);
|
||||
}
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<long> SelectFlightCount(LevelOfFlight flight) { return await _buildCollection.CountAsync(new BsonDocument(nameof(BuildModel.FlightLevel), flight)); }
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MongoDB.Bson;
|
||||
|
@ -23,9 +24,43 @@ public async Task<string[]> SelectAllLabs(int limit = -1, int skip = 0)
|
|||
var grouping = await query.ToListAsync();
|
||||
|
||||
return (from g in grouping
|
||||
where !g["_id"].IsBsonNull
|
||||
select g["_id"].AsString).ToArray();
|
||||
}
|
||||
|
||||
public async Task<string[]> SelectLabsForVersion(int major, int minor)
|
||||
{
|
||||
var query = _buildCollection.Aggregate()
|
||||
.Match(new BsonDocument
|
||||
{
|
||||
new BsonElement(nameof(BuildModel.MajorVersion), major),
|
||||
new BsonElement(nameof(BuildModel.MinorVersion), minor)
|
||||
})
|
||||
.Group(new BsonDocument("_id", $"${nameof(BuildModel.Lab)}"))
|
||||
.Sort(new BsonDocument("_id", 1));
|
||||
|
||||
var grouping = await query.ToListAsync();
|
||||
|
||||
return (from g in grouping
|
||||
where !g["_id"].IsBsonNull
|
||||
select g["_id"].AsString).ToArray();
|
||||
}
|
||||
|
||||
public async Task<List<string>> SearchLabs(string search)
|
||||
{
|
||||
var result = await _buildCollection.Aggregate()
|
||||
.Match(b => b.Lab != null)
|
||||
.Match(b => b.Lab != "")
|
||||
.Match(b => b.Lab.ToLower().Contains(search.ToLower()))
|
||||
.Group(b => b.Lab.ToLower(),
|
||||
// incoming bullshit hack
|
||||
bg => new Tuple<string>(bg.Key))
|
||||
.ToListAsync();
|
||||
|
||||
// work ourselves out of aforementioned bullshit hack
|
||||
return result.Select(b => b.Item1).ToList();
|
||||
}
|
||||
|
||||
public async Task<long> SelectAllLabsCount()
|
||||
{
|
||||
var query = _buildCollection.Aggregate()
|
||||
|
@ -40,7 +75,7 @@ public async Task<long> SelectAllLabsCount()
|
|||
public async Task<List<BuildModel>> SelectLab(string lab, int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection.Find(new BsonDocument(nameof(BuildModel.LabUrl), lab))
|
||||
.Sort(sortByDate)
|
||||
.Sort(sortByCompileDate)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
|
@ -51,9 +86,6 @@ public async Task<List<BuildModel>> SelectLab(string lab, int limit = -1, int sk
|
|||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<long> SelectLabCount(string lab)
|
||||
{
|
||||
return await _buildCollection.CountAsync(new BsonDocument(nameof(BuildModel.LabUrl), lab));
|
||||
}
|
||||
public async Task<long> SelectLabCount(string lab) { return await _buildCollection.CountAsync(new BsonDocument(nameof(BuildModel.LabUrl), lab)); }
|
||||
}
|
||||
}
|
|
@ -10,9 +10,16 @@ namespace BuildFeed.Models
|
|||
{
|
||||
public partial class Build
|
||||
{
|
||||
public async Task<TypeOfSource[]> SelectAllSources(int limit = -1, int skip = 0) { throw new NotImplementedException(); }
|
||||
public Task<TypeOfSource[]> SelectAllSources(int limit = -1, int skip = 0)
|
||||
{
|
||||
return Task.Run(() => Enum.GetValues(typeof(TypeOfSource)) as TypeOfSource[]);
|
||||
}
|
||||
|
||||
public async Task<long> SelectAllSourcesCount() { throw new NotImplementedException(); }
|
||||
public Task<long> SelectAllSourcesCount()
|
||||
{
|
||||
return Task.Run(() => Enum.GetValues(typeof(TypeOfSource))
|
||||
.LongLength);
|
||||
}
|
||||
|
||||
public async Task<List<BuildModel>> SelectSource(TypeOfSource source, int limit = -1, int skip = 0)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,8 @@ public partial class Build
|
|||
public async Task<int[]> SelectAllYears(int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection.Aggregate()
|
||||
.Group(new BsonDocument("_id", $"${nameof(BuildModel.BuildTime)}.{nameof(DateTime.Year)}"))
|
||||
.Match(Builders<BuildModel>.Filter.Ne(b => b.BuildTime, null))
|
||||
.Group(new BsonDocument("_id", new BsonDocument("$year", $"${nameof(BuildModel.BuildTime)}")))
|
||||
.Sort(new BsonDocument("_id", -1))
|
||||
.Skip(skip);
|
||||
|
||||
|
@ -24,13 +25,15 @@ public async Task<int[]> SelectAllYears(int limit = -1, int skip = 0)
|
|||
var grouping = await query.ToListAsync();
|
||||
|
||||
return (from g in grouping
|
||||
where !g["_id"].IsBsonNull
|
||||
select g["_id"].AsInt32).ToArray();
|
||||
}
|
||||
|
||||
public async Task<long> SelectAllYearsCount()
|
||||
{
|
||||
var query = await _buildCollection.Aggregate()
|
||||
.Group(new BsonDocument("_id", $"${nameof(BuildModel.BuildTime)}.{nameof(DateTime.Year)}"))
|
||||
.Match(Builders<BuildModel>.Filter.Ne(b => b.BuildTime, null))
|
||||
.Group(new BsonDocument("_id", new BsonDocument("$year", $"${nameof(BuildModel.BuildTime)}")))
|
||||
.ToListAsync();
|
||||
|
||||
return query.Count;
|
||||
|
@ -42,7 +45,7 @@ public async Task<List<BuildModel>> SelectYear(int year, int limit = -1, int ski
|
|||
new DateTime(year, 1, 1, 0, 0, 0, DateTimeKind.Utc)),
|
||||
Builders<BuildModel>.Filter.Lte(b => b.BuildTime,
|
||||
new DateTime(year, 12, 31, 23, 59, 59, DateTimeKind.Utc))))
|
||||
.Sort(sortByDate)
|
||||
.Sort(sortByCompileDate)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
|
|
|
@ -11,7 +11,9 @@ namespace BuildFeed.Models
|
|||
public partial class Build
|
||||
{
|
||||
private const string BUILD_COLLECTION_NAME = "builds";
|
||||
private static readonly BsonDocument sortByDate = new BsonDocument(nameof(BuildModel.BuildTime), -1);
|
||||
private static readonly BsonDocument sortByCompileDate = new BsonDocument(nameof(BuildModel.BuildTime), -1);
|
||||
private static readonly BsonDocument sortByAddedDate = new BsonDocument(nameof(BuildModel.Added), -1);
|
||||
private static readonly BsonDocument sortByLeakedDate = new BsonDocument(nameof(BuildModel.LeakDate), -1);
|
||||
|
||||
private static readonly BsonDocument sortByOrder = new BsonDocument
|
||||
{
|
||||
|
@ -59,6 +61,14 @@ await _buildCollection.Indexes.CreateOneAsync(Builders<BuildModel>.IndexKeys.Com
|
|||
Name = "_idx_legacy"
|
||||
});
|
||||
}
|
||||
|
||||
if (indexes.All(i => i["name"] != "_idx_lab"))
|
||||
{
|
||||
await _buildCollection.Indexes.CreateOneAsync(Builders<BuildModel>.IndexKeys.Ascending(b => b.Lab), new CreateIndexOptions
|
||||
{
|
||||
Name = "_idx_lab"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, true)]
|
||||
|
@ -84,6 +94,70 @@ public async Task<BuildModel> SelectByLegacyId(long id)
|
|||
.SingleOrDefaultAsync();
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||
public async Task<List<BuildModel>> SelectBuildsByOrder(int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection
|
||||
.Find(new BsonDocument())
|
||||
.Sort(sortByOrder)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
{
|
||||
query = query.Limit(limit);
|
||||
}
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||
public async Task<List<BuildModel>> SelectBuildsByCompileDate(int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection
|
||||
.Find(new BsonDocument())
|
||||
.Sort(sortByCompileDate)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
{
|
||||
query = query.Limit(limit);
|
||||
}
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||
public async Task<List<BuildModel>> SelectBuildsByAddedDate(int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection
|
||||
.Find(new BsonDocument())
|
||||
.Sort(sortByAddedDate)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
{
|
||||
query = query.Limit(limit);
|
||||
}
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||
public async Task<List<BuildModel>> SelectBuildsByLeakedDate(int limit = -1, int skip = 0)
|
||||
{
|
||||
var query = _buildCollection
|
||||
.Find(new BsonDocument())
|
||||
.Sort(sortByLeakedDate)
|
||||
.Skip(skip);
|
||||
|
||||
if (limit > 0)
|
||||
{
|
||||
query = query.Limit(limit);
|
||||
}
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Insert, true)]
|
||||
public async Task Insert(BuildModel item)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@model Tuple<BuildFeed.Models.BuildGroup, List<BuildFeed.Models.BuildModel>>
|
||||
@using Humanizer;
|
||||
@{
|
||||
ViewBag.Title = string.Format("{0} | {1}", Model.Item1.ToString(), BuildFeed.Local.Common.SiteName);
|
||||
ViewBag.Title = $"{Model.Item1} | {BuildFeed.Local.Common.SiteName}";
|
||||
}
|
||||
|
||||
<h1>@Model.Item1.ToString()</h1>
|
||||
|
@ -10,11 +10,11 @@
|
|||
@foreach (var build in Model.Item2)
|
||||
{
|
||||
<div class="col-sm-3 col-xs-6 build-group">
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("viewBuild", new {id = build.Id})">@build.Lab</a></h3>
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("ViewBuild", new {id = build.Id})">@(string.IsNullOrEmpty(build.Lab) ? "{Unknown}" : build.Lab)</a></h3>
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<p>
|
||||
<a href="@Url.Action("editBuild", new { id = build.Id })" class="btn btn-primary btn-xs">@BuildFeed.Local.Front.Edit</a>
|
||||
<a href="@Url.Action("EditBuild", new { id = build.Id })" class="btn btn-primary btn-xs">@BuildFeed.Local.Front.Edit</a>
|
||||
@if (Roles.IsUserInRole("Administrators"))
|
||||
{
|
||||
<a href="@Url.Action("DeleteBuild", new { id = build.Id })" class="btn btn-danger btn-xs">@BuildFeed.Local.Front.Delete</a>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
@foreach (var build in Model)
|
||||
{
|
||||
<div class="col-md-2 col-sm-3 col-xs-6 build-group">
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("viewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("ViewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<p>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
@foreach (var build in Model)
|
||||
{
|
||||
<div class="col-md-2 col-sm-3 col-xs-6 build-group">
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("viewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("ViewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<p>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
@foreach (var build in Model)
|
||||
{
|
||||
<div class="col-md-2 col-sm-3 col-xs-6 build-group">
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("viewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
<h3 class="build-group-title no-wrapping" title="@build.Lab"><a href="@Url.Action("ViewBuild", new {id = build.Id})">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</a></h3>
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<p>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
@using System.Globalization;
|
||||
@{
|
||||
bool IsRTL = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
||||
bool isRtl = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html dir="@(IsRTL ? "rtl" : "ltr")" lang="@CultureInfo.CurrentUICulture.TwoLetterISOLanguageName">
|
||||
<html dir="@(isRtl ? "rtl" : "ltr")" lang="@CultureInfo.CurrentUICulture.TwoLetterISOLanguageName">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
|
@ -17,7 +17,7 @@
|
|||
<meta name="application-name" content="@BuildFeed.Local.Common.SiteName" />
|
||||
|
||||
@Styles.Render("~/content/css")
|
||||
@if (IsRTL)
|
||||
@if (isRtl)
|
||||
{
|
||||
@Styles.Render("~/content/rtl")
|
||||
}
|
||||
|
@ -66,22 +66,22 @@
|
|||
<ul class="nav navbar-nav navbar-right">
|
||||
@if (!User.Identity.IsAuthenticated)
|
||||
{
|
||||
<li><a href="@Url.Action("login", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.LogIn"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogIn</a></li>
|
||||
<li><a href="@Url.Action("Login", new { controller = "Support", area = "" })" title="@BuildFeed.Local.Common.LogIn"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogIn</a></li>
|
||||
}
|
||||
else if (Roles.IsUserInRole("Administrators"))
|
||||
{
|
||||
<li><a href="@Url.Action("index", new { controller = "base", area = "admin" })" title="@BuildFeed.Local.Common.Admin"><i class="fa fa-fw fa-cogs"></i> @BuildFeed.Local.Common.Admin</a></li>
|
||||
<li><a href="@Url.Action("addBuild", new { controller = "Front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
||||
<li><a href="@Url.Action("logout", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
||||
<li><a href="@Url.Action("AddBuild", new { controller = "Front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
||||
<li><a href="@Url.Action("Logout", new { controller = "Support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li><a href="@Url.Action("addBuild", new { controller = "Front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
||||
<li><a href="@Url.Action("logout", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
||||
<li><a href="@Url.Action("AddBuild", new { controller = "Front", area = "" })" title="@BuildFeed.Local.Common.AddBuild"><i class="fa fa-fw fa-plus-square"></i> @BuildFeed.Local.Common.AddBuild</a></li>
|
||||
<li><a href="@Url.Action("Logout", new { controller = "Support", area = "" })" title="@BuildFeed.Local.Common.LogOut"><i class="fa fa-fw fa-user"></i> @BuildFeed.Local.Common.LogOut</a></li>
|
||||
}
|
||||
<li><a href="#" id="page-navigation-search" title="@BuildFeed.Local.Common.Search"><i class="fa fa-fw fa-search"></i> @BuildFeed.Local.Common.Search</a></li>
|
||||
<li><a href="@Url.Action("stats", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.Statistics"><i class="fa fa-fw fa-line-chart"></i> @BuildFeed.Local.Common.Statistics</a></li>
|
||||
<li><a href="@Url.Action("rss", new { controller = "support", area = "" })" title="@BuildFeed.Local.Common.RssFeeds"><i class="fa fa-fw fa-rss"></i> @BuildFeed.Local.Common.RssFeeds</a></li>
|
||||
<li><a href="@Url.Action("Stats", new { controller = "Support", area = "" })" title="@BuildFeed.Local.Common.Statistics"><i class="fa fa-fw fa-line-chart"></i> @BuildFeed.Local.Common.Statistics</a></li>
|
||||
<li><a href="@Url.Action("Rss", new { controller = "Support", area = "" })" title="@BuildFeed.Local.Common.RssFeeds"><i class="fa fa-fw fa-rss"></i> @BuildFeed.Local.Common.RssFeeds</a></li>
|
||||
<li><a href="https://twitter.com/buildfeed" title="@BuildFeed.Local.Common.Twitter" target="_blank"><i class="fa fa-fw fa-twitter"></i> @BuildFeed.Local.Common.Twitter</a></li>
|
||||
<li>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> <span class="caret"></span></a>
|
||||
|
@ -108,8 +108,8 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-8 text-left">
|
||||
<p>
|
||||
<a href="@Url.Action("sitemap", new { controller = "support" })">@BuildFeed.Local.Common.Sitemap</a><br />
|
||||
<i class="fa fa-language"></i> @System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("credits", new { controller = "support" })">@BuildFeed.Local.Common.Credits</a>)
|
||||
<a href="@Url.Action("Sitemap", new { controller = "Support" })">@BuildFeed.Local.Common.Sitemap</a><br />
|
||||
<i class="fa fa-language"></i> @System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("Credits", new { controller = "Support" })">@BuildFeed.Local.Common.Credits</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
@model System.Web.Mvc.HandleErrorInfo
|
||||
@{
|
||||
Layout = null;
|
||||
bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
||||
bool isRtl = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html dir="@(IsRTL ? "rtl" : "ltr")">
|
||||
<html dir="@(isRtl ? "rtl" : "ltr")">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
|
@ -17,9 +17,9 @@
|
|||
<meta name="application-name" content="@BuildFeed.Local.Common.SiteName" />
|
||||
|
||||
@Styles.Render("~/content/css")
|
||||
@if (IsRTL)
|
||||
@if (isRtl)
|
||||
{
|
||||
Styles.Render("~/content/rtl");
|
||||
@Styles.Render("~/content/rtl");
|
||||
}
|
||||
<title>@BuildFeed.Local.Common.Error | @BuildFeed.Local.Common.SiteName</title>
|
||||
<script type="text/javascript">
|
||||
|
@ -76,7 +76,7 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-8 text-left">
|
||||
<p>
|
||||
<i class="fa fa-language"></i> @System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("credits", new { controller = "support" })">@BuildFeed.Local.Common.Credits</a>)
|
||||
<i class="fa fa-language"></i> @System.Globalization.CultureInfo.CurrentUICulture.NativeName (<a href="@Url.Action("Credits", new { controller = "Support" })">@BuildFeed.Local.Common.Credits</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@model BuildFeed.Models.ViewModel.LoginUser
|
||||
|
||||
@{
|
||||
ViewBag.Title = string.Format("{0} | {1}", BuildFeed.Local.Support.Login, BuildFeed.Local.Common.SiteName);
|
||||
ViewBag.Title = $"{BuildFeed.Local.Support.Login} | {BuildFeed.Local.Common.SiteName}";
|
||||
Html.EnableClientValidation();
|
||||
Html.EnableUnobtrusiveJavaScript();
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
|||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="@BuildFeed.Local.Support.Login" class="btn btn-primary" />
|
||||
@Html.ActionLink(BuildFeed.Local.Support.Register, "register", new { controller = "support" }, new { @class = "btn btn-default" })
|
||||
@Html.ActionLink(BuildFeed.Local.Support.Register, "register", new { controller = "Support" }, new { @class = "btn btn-default" })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
@{
|
||||
ViewBag.Title = string.Format("{0} | {1}", BuildFeed.Local.Common.RssFeeds, BuildFeed.Local.Common.SiteName);
|
||||
ViewBag.Title = $"{BuildFeed.Local.Common.RssFeeds} | {BuildFeed.Local.Common.SiteName}";
|
||||
}
|
||||
|
||||
<h1>@BuildFeed.Local.Common.RssFeeds</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="@Url.Action("index", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyCompiled"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyCompiled</a></li>
|
||||
<li><a href="@Url.Action("leaked", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyLeaked"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyLeaked</a></li>
|
||||
<li><a href="@Url.Action("added", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyAdded"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyAdded</a></li>
|
||||
<li><a href="@Url.Action("version", new { controller = "rss" })" title="@BuildFeed.Local.Support.HighestVersion"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.HighestVersion</a></li>
|
||||
<li><a href="@Url.Action("Index", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyCompiled"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyCompiled</a></li>
|
||||
<li><a href="@Url.Action("Leaked", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyLeaked"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyLeaked</a></li>
|
||||
<li><a href="@Url.Action("Added", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyAdded"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyAdded</a></li>
|
||||
<li><a href="@Url.Action("Version", new { controller = "Rss" })" title="@BuildFeed.Local.Support.HighestVersion"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.HighestVersion</a></li>
|
||||
<li>
|
||||
@BuildFeed.Local.Model.FlightLevel
|
||||
<ul>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "wis" })" title="@BuildFeed.Local.Model.FlightWIS"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIS</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "wif" })" title="@BuildFeed.Local.Model.FlightWIF"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIF</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "osg" })" title="@BuildFeed.Local.Model.FlightOSG"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightOSG</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "msit" })" title="@BuildFeed.Local.Model.FlightMSIT"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightMSIT</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "canary" })" title="@BuildFeed.Local.Model.FlightCanary"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightCanary</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "wis" })" title="@BuildFeed.Local.Model.FlightWIS"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIS</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "wif" })" title="@BuildFeed.Local.Model.FlightWIF"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIF</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "osg" })" title="@BuildFeed.Local.Model.FlightOSG"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightOSG</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "msit" })" title="@BuildFeed.Local.Model.FlightMSIT"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightMSIT</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "canary" })" title="@BuildFeed.Local.Model.FlightCanary"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightCanary</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<ul id="rss-labs" class="collapse">
|
||||
@foreach (string lab in ViewBag.Labs)
|
||||
{
|
||||
<li><a href="@Url.Action("lab", new { controller = "rss", lab = lab })" title="@lab"><i class="fa fa-sm fa-rss"></i> @lab</a></li>
|
||||
<li><a href="@Url.Action("Lab", new { controller = "Rss", lab = lab })" title="@lab"><i class="fa fa-sm fa-rss"></i> @lab</a></li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@model BuildFeed.Models.ViewModel.SitemapData
|
||||
@{
|
||||
ViewBag.Title = string.Format("{0} | {1}", BuildFeed.Local.Common.Sitemap, BuildFeed.Local.Common.SiteName);
|
||||
ViewBag.Title = $"{BuildFeed.Local.Common.Sitemap} | {BuildFeed.Local.Common.SiteName}";
|
||||
}
|
||||
|
||||
<h1>@BuildFeed.Local.Common.Sitemap</h1>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<ul>
|
||||
@foreach (var build in buildGroup.Builds)
|
||||
{
|
||||
<li>@Html.ActionLink(build.Name, "viewBuild", new { controller = "Front", id = build.Id })</li>
|
||||
<li>@Html.ActionLink(build.Name, "ViewBuild", new { controller = "Front", id = build.Id })</li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -65,18 +65,18 @@
|
|||
<li>
|
||||
<a href="#sitemap-rss" data-toggle="collapse">@BuildFeed.Local.Common.RssFeeds</a>
|
||||
<ul id="sitemap-rss" class="collapse">
|
||||
<li><a href="@Url.Action("index", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyCompiled"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyCompiled</a></li>
|
||||
<li><a href="@Url.Action("leaked", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyLeaked"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyLeaked</a></li>
|
||||
<li><a href="@Url.Action("added", new { controller = "rss" })" title="@BuildFeed.Local.Support.RecentlyAdded"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyAdded</a></li>
|
||||
<li><a href="@Url.Action("version", new { controller = "rss" })" title="@BuildFeed.Local.Support.HighestVersion"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.HighestVersion</a></li>
|
||||
<li><a href="@Url.Action("Index", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyCompiled"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyCompiled</a></li>
|
||||
<li><a href="@Url.Action("Leaked", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyLeaked"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyLeaked</a></li>
|
||||
<li><a href="@Url.Action("Added", new { controller = "Rss" })" title="@BuildFeed.Local.Support.RecentlyAdded"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.RecentlyAdded</a></li>
|
||||
<li><a href="@Url.Action("Version", new { controller = "Rss" })" title="@BuildFeed.Local.Support.HighestVersion"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Support.HighestVersion</a></li>
|
||||
<li>
|
||||
@BuildFeed.Local.Model.FlightLevel
|
||||
<ul>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "wis" })" title="@BuildFeed.Local.Model.FlightWIS"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIS</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "wif" })" title="@BuildFeed.Local.Model.FlightWIF"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIF</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "osg" })" title="@BuildFeed.Local.Model.FlightOSG"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightOSG</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "msit" })" title="@BuildFeed.Local.Model.FlightMSIT"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightMSIT</a></li>
|
||||
<li><a href="@Url.Action("flight", new { controller = "rss", id = "canary" })" title="@BuildFeed.Local.Model.FlightCanary"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightCanary</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "wis" })" title="@BuildFeed.Local.Model.FlightWIS"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIS</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "wif" })" title="@BuildFeed.Local.Model.FlightWIF"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightWIF</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "osg" })" title="@BuildFeed.Local.Model.FlightOSG"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightOSG</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "msit" })" title="@BuildFeed.Local.Model.FlightMSIT"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightMSIT</a></li>
|
||||
<li><a href="@Url.Action("Flight", new { controller = "Rss", id = "canary" })" title="@BuildFeed.Local.Model.FlightCanary"><i class="fa fa-sm fa-rss"></i> @BuildFeed.Local.Model.FlightCanary</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -84,7 +84,7 @@
|
|||
<ul id="rss-labs" class="collapse">
|
||||
@foreach (string lab in Model.Labs)
|
||||
{
|
||||
<li><a href="@Url.Action("lab", new { controller = "rss", lab = lab })" title="@lab"><i class="fa fa-sm fa-rss"></i> @lab</a></li>
|
||||
<li><a href="@Url.Action("Lab", new { controller = "Rss", lab = lab })" title="@lab"><i class="fa fa-sm fa-rss"></i> @lab</a></li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue
Block a user