Skip to content

Commit

Permalink
continuing to update mvc sample
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed May 5, 2011
1 parent fa39fe5 commit 106bf42
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Web;
using System.Web.Mvc;
using System.Text;
using System.Web.WebPages;

namespace GithubSharp.Samples.MvcSample.MvcApplication.Models.HtmlHelpers
{
Expand Down
6 changes: 4 additions & 2 deletions Samples/MvcSample/MvcApplication/MvcApplication.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -90,7 +90,9 @@
<Compile Include="Models\ViewModels\LoginViewModel.cs" />
<Compile Include="ServerApp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Default.cs" />
<Compile Include="Default.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Core\Core.csproj">
Expand Down
16 changes: 8 additions & 8 deletions Samples/MvcSample/MvcUI/MvcUI.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -106,11 +106,8 @@
<Content Include="Views\Repository\PublicKeys.aspx" />
<Content Include="Views\Repository\Search.aspx" />
<Content Include="Views\Repository\Tags.aspx" />
<Content Include="Views\Shared\Error.aspx" />
<Content Include="Views\Shared\Footer.ascx" />
<Content Include="Views\Shared\Login.aspx" />
<Content Include="Views\Shared\LoginControl.ascx" />
<Content Include="Views\Shared\Menu.ascx" />
<None Include="Views\Shared\Error.cshtml" />
<None Include="Views\Shared\Footer.cshtml" />
<Content Include="Views\User\Index.aspx" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
Expand All @@ -136,7 +133,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<FlavorProperties GUID="{349C5851-65DF-11DA-9384-00065B846F21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
Expand Down Expand Up @@ -165,6 +162,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\Login.cshtml" />
<Content Include="Views\Shared\LoginControl.cshtml" />
<Content Include="Views\Shared\Menu.cshtml" />
<None Include="Views\_ViewStart.cshtml" />
</ItemGroup>
</Project>
</Project>
11 changes: 0 additions & 11 deletions Samples/MvcSample/MvcUI/Views/Shared/Error.aspx

This file was deleted.

7 changes: 7 additions & 0 deletions Samples/MvcSample/MvcUI/Views/Shared/Error.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@model GithubSharp.Samples.MvcSample.MvcApplication.Models.ViewModels.ErrorViewModel
@section Title {
Error
}
<h2>
Sorry, an error occurred while processing your request.
</h2>
2 changes: 0 additions & 2 deletions Samples/MvcSample/MvcUI/Views/Shared/Footer.ascx

This file was deleted.

1 change: 1 addition & 0 deletions Samples/MvcSample/MvcUI/Views/Shared/Footer.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2011 <a href"http://erikzaadi.com">Erik Zaadi</a>
2 changes: 1 addition & 1 deletion Samples/MvcSample/MvcUI/Views/Shared/LoginControl.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@if (!string.IsNullOrEmpty(Model.Message))
{
<div class="error span-8">
@Model.Message%></div>
@Model.Message</div>
}
</div>
</fieldset>
Expand Down
19 changes: 12 additions & 7 deletions Samples/MvcSample/MvcUI/Views/Shared/Menu.cshtml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
@{
var currentController = ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
Func<string,string> currentOrNot = (string x) => { return currentController == x ? "CurrentAPI" : ""; };

}
<ul id="menu">
<li>
@Html.ActionLink("User", "Index", "User",null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "User" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("User", "Index", "User",null, new { @class = currentOrNot("User") })</li>
<li>
@Html.ActionLink("Issues", "Index", "Issues", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Issues" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Issues", "Index", "Issues", null, new { @class = currentOrNot("Issues") })</li>
<li>
@Html.ActionLink("Network", "Index", "Network", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Network" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Network", "Index", "Network", null, new { @class = currentOrNot("Network")})</li>
<li>
@Html.ActionLink("Repository", "Index", "Repository", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Repository" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Repository", "Index", "Repository", null, new { @class = currentOrNot("Repository") })</li>
<li>
@Html.ActionLink("Commit", "Index", "Commit", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Commit" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Commit", "Index", "Commit", null, new { @class = currentOrNot("Commit")})</li>
<li>
@Html.ActionLink("Object", "Index", "Object", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Object" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Object", "Index", "Object", null, new { @class = currentOrNot("Object") })</li>
<li>
@Html.ActionLink("Gists", "Index", "Gists", null, new { @class = ViewContext.RouteData.GetRequiredString("controller") == "Gists" ? "CurrentAPI" : "" })</li>
@Html.ActionLink("Gists", "Index", "Gists", null, new { @class = currentOrNot("Gists") })</li>
</ul>

0 comments on commit 106bf42

Please sign in to comment.