From 1c88bf257d3c2b13602c2fb93b4ee3911424ab09 Mon Sep 17 00:00:00 2001 From: Thomas Hounsell Date: Sun, 31 May 2015 00:50:29 +0100 Subject: [PATCH] Responsive tweaks plus a little cleanup. --- BuildFeed.csproj | 2 - Models/ViewModel/QuestionForm.cs | 21 ---- Views/build/index.cshtml | 210 ------------------------------- Views/front/index.cshtml | 2 +- Views/front/viewGroup.cshtml | 4 +- Views/front/viewLab.cshtml | 2 +- Views/front/viewSource.cshtml | 2 +- Views/front/viewVersion.cshtml | 4 +- Views/front/viewYear.cshtml | 2 +- Views/shared/_default.cshtml | 20 +-- 10 files changed, 18 insertions(+), 251 deletions(-) delete mode 100644 Models/ViewModel/QuestionForm.cs delete mode 100644 Views/build/index.cshtml diff --git a/BuildFeed.csproj b/BuildFeed.csproj index 0c73e7f..774040e 100644 --- a/BuildFeed.csproj +++ b/BuildFeed.csproj @@ -212,7 +212,6 @@ - @@ -322,7 +321,6 @@ - diff --git a/Models/ViewModel/QuestionForm.cs b/Models/ViewModel/QuestionForm.cs deleted file mode 100644 index 0021c63..0000000 --- a/Models/ViewModel/QuestionForm.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; - -namespace BuildFeed.Models.ViewModel -{ - public class QuestionForm - { - [Required] - [DisplayName("Your name")] - public string Name { get; set; } - - [Required] - [DisplayName("Your email address")] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DisplayName("Question")] - public string Comment { get; set; } - } -} \ No newline at end of file diff --git a/Views/build/index.cshtml b/Views/build/index.cshtml deleted file mode 100644 index 44b6684..0000000 --- a/Views/build/index.cshtml +++ /dev/null @@ -1,210 +0,0 @@ -@model IEnumerable - -@{ - ViewBag.Action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString().ToLower(); - ViewBag.Title = "BuildFeed"; - - - if (ViewBag.PageNumber > 1) - { - ViewBag.Title = string.Format("Page {1} | {0}", ViewBag.Title, ViewBag.PageNumber); - } - - switch (ViewBag.Action as string) - { - case "index": - ViewBag.Title = "BuildFeed | The collaborative build list"; - break; - case "lab": - ViewBag.ItemId = ViewContext.Controller.ValueProvider.GetValue("lab").RawValue; - ViewBag.Title = string.Format("Builds from {1} | {0}", ViewBag.Title, ViewBag.ItemId); - break; - case "year": - ViewBag.ItemId = ViewContext.Controller.ValueProvider.GetValue("year").RawValue; - ViewBag.Title = string.Format("Builds from {1} | {0}", ViewBag.Title, ViewBag.ItemId); - break; - case "version": - ViewBag.ItemId = string.Format("{0}.{1}", ViewContext.Controller.ValueProvider.GetValue("major").RawValue, ViewContext.Controller.ValueProvider.GetValue("minor").RawValue); - ViewBag.Title = string.Format("Windows NT {1} | {0}", ViewBag.Title, ViewBag.ItemId); - break; - case "source": - ViewBag.ItemId = DisplayHelpers.GetDisplayTextForEnum(Enum.Parse(typeof(BuildFeed.Models.TypeOfSource), ViewContext.Controller.ValueProvider.GetValue("source").RawValue.ToString())); - ViewBag.Title = string.Format("{1} | {0}", ViewBag.Title, ViewBag.ItemId); - break; - } -} - -@section head -{ - @switch (ViewBag.Action as string) - { - case "index": - - - break; - case "lab": - if (ViewBag.MetaItem != null) - { - - - } - else - { - - - } - break; - case "year": - - - break; - } -} - -
-
- @switch (ViewBag.Action as string) - { - case "lab": -

@string.Format("Builds from {0}", ViewBag.ItemId)

- break; - case "year": -

@string.Format("Builds from {0}", ViewBag.ItemId)

- break; - case "version": -

@string.Format("Windows NT {0}", ViewBag.ItemId)

- break; - case "source": -

@ViewBag.ItemId

- break; - } - @if (ViewBag.PageNumber == 1 && ViewBag.MetaItem != null && !string.IsNullOrWhiteSpace(ViewBag.MetaItem.PageContent)) - { -

About

- @Html.Raw(ViewBag.MetaItem.PageContent) -

Share

-
-

Listing

- } -
    - @foreach (var item in Model) - { -
  • -
    - @Html.ActionLink("Info", "info", new { id = item.Id }, new { @class = "btn btn-info btn-xs" }) - @if (User.Identity.IsAuthenticated) - { - @Html.ActionLink("Edit", "edit", new { id = item.Id }, new { @class = "btn btn-default btn-xs" }) - } - @if (Roles.IsUserInRole("Administrators")) - { - @Html.ActionLink("Delete", "delete", new { id = item.Id }, new { @class = "btn btn-danger btn-xs" }) - } -

    @Html.DisplayFor(modelItem => item.FullBuildString)

    -
    -
    - @Html.DisplayFor(TypeOfSource => item.SourceType, "Enumeration") - @if ((item.MajorVersion == 6 && item.MinorVersion == 4) || (item.MajorVersion == 10 && item.MinorVersion == 0) && item.FlightLevel != BuildFeed.Models.LevelOfFlight.None) - { - Flight Level: @Html.DisplayFor(TypeOfSource => item.FlightLevel, "Enumeration") - } - @if (item.BetaWikiUri != null) - { - BetaWiki (Client) - } - @if (item.BetaWikiServerUri != null) - { - BetaWiki (Server) - } - @if (item.WinWorldPCUri != null) - { - WinWorldPC - } - @if (item.BetaArchiveUri != null) - { - BetaArchive Wiki - } - @if (item.LonghornMsUri != null) - { - Longhorn.ms - } -
    -
  • - } -
-
-
- - @if (ViewBag.Action != "index") - { -
- @Html.ActionLink("Return to full listing", "index", new { controller = "build", area = "", page = 1 }, new { @class = "list-group-item" }) -
- } -
- @if (User.Identity.IsAuthenticated) - { - if (Roles.IsUserInRole("Administrators")) - { - @Html.ActionLink("Administration", "index", new { controller = "base", area = "admin" }, new { @class = "list-group-item" }) - } - @Html.ActionLink("Add a build", "create", new { controller = "build" }, new { @class = "list-group-item" }) - @Html.ActionLink("Change your password", "password", new { controller = "support" }, new { @class = "list-group-item" }) - @Html.ActionLink("Log out", "logout", new { controller = "support" }, new { @class = "list-group-item" }) - } - else - { - @Html.ActionLink("Log in", "login", new { controller = "support" }, new { @class = "list-group-item" }) - @Html.ActionLink("Register", "register", new { controller = "support" }, new { @class = "list-group-item" }) - } - @Html.ActionLink("Ask a question", "question", new { controller = "support" }, new { @class = "list-group-item" }) -
-
-
- -@if (ViewBag.PageCount > 1) -{ -
    - @if (ViewBag.PageNumber > 1) - { -
  • @Html.ActionLink(HttpUtility.HtmlDecode("«"), ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(), new { page = ViewBag.PageNumber - 1 })
  • - } - else - { -
  • «
  • - } - - - @for (int i = 1; i <= ViewBag.PageCount; i++) - { -
  • @Html.ActionLink(i.ToString(), ViewBag.Action as string, new { page = i })
  • - } - - - @if (ViewBag.PageNumber < ViewBag.PageCount) - { -
  • @Html.ActionLink(HttpUtility.HtmlDecode("»"), ViewBag.Action as string, new { page = ViewBag.PageNumber + 1 })
  • - } - else - { -
  • »
  • - } -
-} - -@section scripts -{ - @Scripts.Render("~/bundles/jsrender") - - - -} \ No newline at end of file diff --git a/Views/front/index.cshtml b/Views/front/index.cshtml index 8027862..e788b8b 100644 --- a/Views/front/index.cshtml +++ b/Views/front/index.cshtml @@ -7,7 +7,7 @@
@foreach (BuildFeed.Models.ViewModel.Front.FrontBuildGroup group in Model) { -
+

@group.Key.ToString()

@if (group.LastBuild.HasValue) diff --git a/Views/front/viewGroup.cshtml b/Views/front/viewGroup.cshtml index 78ad54a..d9a8504 100644 --- a/Views/front/viewGroup.cshtml +++ b/Views/front/viewGroup.cshtml @@ -9,8 +9,8 @@

@foreach (var build in Model.OrderBy(b => b.BuildTime)) { -
-

@build.Lab

+
+

@build.Lab

Info @if (User.Identity.IsAuthenticated) diff --git a/Views/front/viewLab.cshtml b/Views/front/viewLab.cshtml index 75b14ac..8c7476b 100644 --- a/Views/front/viewLab.cshtml +++ b/Views/front/viewLab.cshtml @@ -35,7 +35,7 @@

@foreach (var build in Model) { -
+

@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)

Info diff --git a/Views/front/viewSource.cshtml b/Views/front/viewSource.cshtml index 7b552cc..773b17f 100644 --- a/Views/front/viewSource.cshtml +++ b/Views/front/viewSource.cshtml @@ -30,7 +30,7 @@

@foreach (var build in Model) { -
+

@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)

Info diff --git a/Views/front/viewVersion.cshtml b/Views/front/viewVersion.cshtml index 26d6bff..ee29983 100644 --- a/Views/front/viewVersion.cshtml +++ b/Views/front/viewVersion.cshtml @@ -30,7 +30,7 @@

@foreach (var build in Model) { -
+

@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)

Info @@ -46,7 +46,7 @@

@if (!string.IsNullOrEmpty(build.Lab)) { - @build.Lab
+

@build.Lab
} @if (build.BuildTime.HasValue) { diff --git a/Views/front/viewYear.cshtml b/Views/front/viewYear.cshtml index 575618c..f2df618 100644 --- a/Views/front/viewYear.cshtml +++ b/Views/front/viewYear.cshtml @@ -35,7 +35,7 @@
@foreach (var build in Model) { -
+

@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)

Info diff --git a/Views/shared/_default.cshtml b/Views/shared/_default.cshtml index ad5ecbf..1db554e 100644 --- a/Views/shared/_default.cshtml +++ b/Views/shared/_default.cshtml @@ -58,23 +58,23 @@