Combine layouts
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(Model)
|
||||
@@ -1,5 +1,10 @@
|
||||
@model DateTime
|
||||
@using System.Globalization
|
||||
@model DateTime
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
var val =
|
||||
ViewData.ModelMetadata.DisplayFormatString != null
|
||||
?string.Format(ViewData.ModelMetadata.DisplayFormatString, Model)
|
||||
: Model.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
@Html.Encode(string.Format(ViewData.ModelMetadata.DisplayFormatString, Model))
|
||||
@Html.Encode(val)
|
||||
@@ -1,5 +1,10 @@
|
||||
@model DateTime
|
||||
@using System.Globalization
|
||||
@model DateTime
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
var val =
|
||||
ViewData.ModelMetadata.DisplayFormatString != null
|
||||
?string.Format(ViewData.ModelMetadata.DisplayFormatString, Model)
|
||||
: Model.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
@Html.Encode(string.Format(ViewData.ModelMetadata.DisplayFormatString, Model))
|
||||
@Html.Encode(val)
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
<a href="mailto:@Model">@Html.Encode(Model)</a>
|
||||
@@ -0,0 +1,12 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
var inputSize = (string)ViewData.ModelMetadata.AdditionalValues["InputSize"];
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(inputSize))
|
||||
{
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = inputSize})
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.TextArea("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
@@ -2,7 +2,18 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.ModelType.IsCollection()))
|
||||
|
||||
@foreach (var prop in ViewData.ModelMetadata.Properties)
|
||||
{
|
||||
@Html.Editor(prop.PropertyName)
|
||||
if (prop.ShowForEdit)
|
||||
{
|
||||
if (!prop.ModelType.IsCollection())
|
||||
{
|
||||
@Html.Editor(prop.PropertyName)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Error";
|
||||
if (Model.ControllerName == "CreateLog")
|
||||
{
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
}
|
||||
|
||||
<h2>
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mileage Traker - ETHRA - @ViewBag.Title</title>
|
||||
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.9.2.custom.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/Site.admin.css")" rel="stylesheet" type="text/css" />
|
||||
@RenderSection("Styles", false)
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="navbar navbar-fixed-top navbar-inverse">
|
||||
<div class="navbar-inner">
|
||||
<span class="brand" ></span>
|
||||
<ul class="nav">
|
||||
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
|
||||
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
|
||||
<li>@Html.ActionLink("Enter Mileage Log", "Index", "CreateLog")</li>
|
||||
</ul>
|
||||
<section id="account-management">
|
||||
@Html.Partial("_Layout.authentication")
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container-fluid">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<footer>
|
||||
Mileage Traker © 2012 James Kolpack
|
||||
</footer>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
@RenderSection("Scripts", false)
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,15 +0,0 @@
|
||||
@if (Request.IsAuthenticated) {
|
||||
<ul class="nav pull-right">
|
||||
<li>
|
||||
@Html.ActionLink(User.Identity.Name, "Manage", "Account", null, new { @class = "username", title = "Manage" })
|
||||
</li>
|
||||
<li>
|
||||
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "form-logout" })) {
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn-link logoff">
|
||||
Log Off
|
||||
</button>
|
||||
}
|
||||
</li>
|
||||
</ul>
|
||||
}
|
||||
@@ -6,28 +6,54 @@
|
||||
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.9.2.custom.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
|
||||
@RenderSection("Styles", false)
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div class="navbar navbar-static-top navbar-inverse">
|
||||
<div class="navbar navbar-fixed-top navbar-inverse">
|
||||
<div class="navbar-inner">
|
||||
<span class="brand" ></span>
|
||||
<div class="container-fluid">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="brand"></span>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
@if (Roles.IsUserInRole(User.Identity.Name, "Administrator")
|
||||
|| Roles.IsUserInRole(User.Identity.Name, "Developer"))
|
||||
{
|
||||
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
|
||||
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
|
||||
<li id="user-nav">@Html.ActionLink("Users", "Index", "User")</li>
|
||||
}
|
||||
<li>@Html.ActionLink("Enter Log", "Index", "CreateLog")</li>
|
||||
</ul>
|
||||
<section id="account-management">
|
||||
@Html.Partial("_NavAccountInfo")
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<footer>
|
||||
Mileage Traker © 2012 James Kolpack
|
||||
</footer>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
|
||||
@RenderSection("Scripts", false)
|
||||
</body>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
|
||||
@RenderSection("Scripts", false)
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<ul class="nav pull-right">
|
||||
@if (Request.IsAuthenticated)
|
||||
{
|
||||
<li>
|
||||
@Html.ActionLink(User.Identity.Name, "Manage", "Account", null, new {@class = "username", title = "Manage"})
|
||||
</li>
|
||||
<li>
|
||||
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new {id = "form-logout"}))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn-link">
|
||||
Log Off
|
||||
</button>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li>
|
||||
@Html.ActionLink("Login", "Login", "Account", null, new {title = "Login"})
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
Reference in New Issue
Block a user