Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

created unsecure index page

old index page is now "home"
added logout link
  • Loading branch information...
commit 808cd1cba4e58cdead1e4ab16a2ffbac12b6dad7 1 parent 3c09f40
@snissim snissim authored
View
BIN  CodeProse.Shifter.Tests/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown
View
9 CodeProse.Shifter/CodeProse.Shifter.csproj
@@ -84,6 +84,7 @@
<Content Include="content\themeroller-icon-set-vector-32px.png" />
<Content Include="content\topnav.js" />
<Content Include="wireframes\assign-shifts.htm" />
+ <Content Include="wireframes\default.htm" />
<Content Include="wireframes\manage-shifts.htm" />
<Content Include="wireframes\view-calendar.htm" />
<Content Include="wireframes\view-shift.htm" />
@@ -95,11 +96,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
- <Content Include="views\index.cshtml" />
<Content Include="views\login.htm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="wireframes\default.htm" />
+ <Content Include="wireframes\home.htm" />
<Content Include="views\members.cshtml" />
<Content Include="content\fullcalendar.css" />
<Content Include="content\fullcalendar.js" />
@@ -124,9 +124,10 @@
<Compile Include="data\ConnectionExtensions.cs" />
<Compile Include="data\UserQueries.cs" />
<Compile Include="domain\User.cs" />
- <Compile Include="models\IndexModel.cs" />
+ <Compile Include="models\HomeModel.cs" />
<Compile Include="models\LoginModel.cs" />
<Compile Include="models\MasterModel.cs" />
+ <Compile Include="modules\HomeModule.cs" />
<Compile Include="modules\MembersDataModule.cs" />
<Compile Include="modules\LoginModule.cs" />
<Compile Include="modules\IndexModule.cs" />
@@ -141,6 +142,8 @@
</ItemGroup>
<ItemGroup>
<None Include="views\calendar.cshtml" />
+ <Content Include="views\home.cshtml" />
+ <Content Include="views\index.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
View
31 CodeProse.Shifter/content/base.css
@@ -43,6 +43,37 @@ ul
width: 250px;
margin-right: 2em;
}
+#logo
+{
+ text-align: center;
+ width: 400px;
+ margin: 40px 30px 0px 10px;
+ float: left;
+}
+#logo h1
+{
+ font-size: 5.0em;
+ background-color: #909090;
+ padding: 0;
+}
+#logo h2
+{
+ font-size: 1.8em;
+ color: #909090;
+ background-color: #000;
+}
+#signup
+{
+ border: 1px solid black;
+ width: 400px;
+ padding: 20px;
+}
+#signup input:not(.ui-button)
+{
+ width: 300px;
+ height: 30px;
+ margin-bottom: 10px;
+}
.cart
{
margin: 0px 10px;
View
2  CodeProse.Shifter/models/IndexModel.cs → CodeProse.Shifter/models/HomeModel.cs
@@ -2,7 +2,7 @@
namespace CodeProse.Shifter.models
{
- public class IndexModel
+ public class HomeModel
{
public IList<string> WireframePages
{
View
25 CodeProse.Shifter/modules/HomeModule.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using Nancy;
+using CodeProse.Shifter.models;
+
+namespace CodeProse.Shifter.modules
+{
+ public class HomeModule : SecureModule
+ {
+ public HomeModule()
+ {
+ Get["/"] = x => Index();
+ Get["/home"] = x => Index();
+ }
+
+ private Response Index()
+ {
+ var model = new HomeModel();
+ model.UserName = Context.CurrentUser.UserName;
+ return View["home", model];
+ }
+ }
+}
View
6 CodeProse.Shifter/modules/IndexModule.cs
@@ -3,7 +3,7 @@
namespace CodeProse.Shifter.modules
{
- public class IndexModule : SecureModule
+ public class IndexModule : NancyModule
{
public IndexModule()
{
@@ -13,9 +13,7 @@ public IndexModule()
private Response Index()
{
- var model = new IndexModel();
- model.UserName = Context.CurrentUser.UserName;
- return View["index", model];
+ return View["index"];
}
}
}
View
7 CodeProse.Shifter/modules/LoginModule.cs
@@ -17,7 +17,12 @@ public LoginModule(IUserRepository users)
var model = this.Bind<LoginModel>();
var userId = users.Authenticate(model.Username, model.Password);
- return this.LoginAndRedirect(userId, DateTime.Now.AddDays(7), "~/");
+ return this.LoginAndRedirect(userId, DateTime.Now.AddDays(7), "~/home");
+ };
+
+ Get["/logout"] = x =>
+ {
+ return this.LogoutAndRedirect("~/index");
};
}
}
View
2  CodeProse.Shifter/modules/WireframeModule.cs
@@ -10,7 +10,7 @@ public class WireframeModule : SecureModule
{
public WireframeModule() : base("/wireframes")
{
- Get["/{page}"] = x => View["wireframes/" + x.page.ToString(), new IndexModel { UserName = Context.CurrentUser.UserName}];
+ Get["/{page}"] = x => View["wireframes/" + x.page.ToString(), new HomeModel { UserName = Context.CurrentUser.UserName}];
}
}
}
View
4 CodeProse.Shifter/partials/topnav.cshtml
@@ -1,8 +1,8 @@
<div id="topnav" class="ui-widget-header">
- <a href="@Url.Content("~/index")">Home</a>
+ <a href="@Url.Content("~/home")">Home</a>
<a href="@Url.Content("~/views/calendar")">Calendar</a>
<a href="@Url.Content("~/wireframes/manage-shifts")">Shifts</a>
<a href="@Url.Content("~/views/members")">Members</a>
<a href="@Url.Content("~/wireframes/assign-shifts")">Schedule</a>
- <div id="user">@Model.UserName</div>
+ <div id="user">@Model.UserName | <a href="@Url.Content("~/logout")">logout</a></div>
</div>
View
0  CodeProse.Shifter/views/index.cshtml → CodeProse.Shifter/views/home.cshtml
File renamed without changes
View
40 CodeProse.Shifter/wireframes/default.htm
@@ -4,21 +4,43 @@
<title>Shifter</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
- <script type="text/javascript" src="../content/topnav.js"></script>
<!--<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" />-->
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/sunny/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="../content/base.css" />
+ <script type="text/javascript">
+ $(function () {
+ $("input[type=submit]").button();
+ });
+ </script>
</head>
<body>
+ <div id="topnav" class="ui-widget-header">
+ <div id="user">
+ <a href="">Login</a>
+ </div>
+ <div style="clear: both;">
+ </div>
+ </div>
<div id="content">
- <h2 class="ui-widget-header">
- News Feed</h2>
- <div class="ui-widget-content">
- <ul id="news-feed">
- <li>Raul wants to give up his Feb 15 9am-12pm shift</li>
- <li>Ryan wants to trade for his Feb 12 2pm-5pm shift</li>
- <li>Sam picked up the Feb 14 9am-12pm shift from Raul (is this necessary?)</li>
- </ul>
+ <div style="width: 900px; margin: 0 auto">
+ <div id="logo">
+ <h2>
+ make your people</h2>
+ <h1>
+ shiftable</h1>
+ </div>
+ <div id="signup" class="stacked" style="float: left;">
+ <label for="CompanyName">
+ Company Name</label>
+ <input type="text" name="CompanyName" />
+ <label for="Email">
+ Email</label>
+ <input type="text" name="Email" />
+ <label for="Password">
+ Password</label>
+ <input type="password" name="Password" />
+ <input type="submit" value="Sign Up" />
+ </div>
</div>
</div>
</body>
View
25 CodeProse.Shifter/wireframes/home.htm
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Shifter</title>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="../content/topnav.js"></script>
+ <!--<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" />-->
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/sunny/jquery-ui.css" />
+ <link rel="stylesheet" type="text/css" href="../content/base.css" />
+</head>
+<body>
+ <div id="content">
+ <h2 class="ui-widget-header">
+ News Feed</h2>
+ <div class="ui-widget-content">
+ <ul id="news-feed">
+ <li>Raul wants to give up his Feb 15 9am-12pm shift</li>
+ <li>Ryan wants to trade for his Feb 12 2pm-5pm shift</li>
+ <li>Sam picked up the Feb 14 9am-12pm shift from Raul (is this necessary?)</li>
+ </ul>
+ </div>
+ </div>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.