Permalink
Browse files

admin backend stuff

  • Loading branch information...
1 parent d90caab commit 07bb6d1e0eae1fb9b460e1bcff51af8fdbc677e4 @1kevgriff committed Feb 6, 2012
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using System.Web.Security;
+using LeadGen.Web.Models;
+
+namespace LeadGen.Web.Controllers
+{
+ public class AccountController : Controller
+ {
+ //
+ // GET: /Account/
+
+ public ActionResult LoggyMeOn()
+ {
+ return View();
+ }
+
+ [HttpPost]
+ public ActionResult LoggyMeOn(LoginModel model)
+ {
+ if (model.Password == "griff in da house")
+ {
+ FormsAuthentication.SetAuthCookie("griff", true);
+ }
+
+ return RedirectToAction("Index", "Admin");
+ }
+
+ public ActionResult LoggyMeOut()
+ {
+ FormsAuthentication.SignOut();
+ return RedirectToAction("Index", "Home");
+ }
+
+ }
+}
@@ -12,6 +12,7 @@
namespace LeadGen.Web.Controllers
{
+ [Authorize]
public class AdminController : Controller
{
public ActionResult Index()
@@ -41,8 +41,6 @@ public static void RegisterRoutes(RouteCollection routes)
protected void Application_Start()
{
- HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize();
-
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<LeadGenContext>());
AreaRegistration.RegisterAllAreas();
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<publishData>
- <publishProfile publishUrl="ec2-204-236-249-223.compute-1.amazonaws.com" deleteExistingFiles="False" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="Default Web Site" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="True" msdeploySkipExtraFilesOnServer="False" msdeployMarkAsApp="False" profileName="Profile1" publishMethod="MSDeploy" replaceMatchingFiles="True" userName="Administrator" savePWD="True" userPWD="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAyjmwLakYk0uyoZnrHtj2YgAAAAACAAAAAAAQZgAAAAEAACAAAACJPOf6+Y6qDiNrslYmDagBUlEu1EdlXLqm1SMWXL3DZgAAAAAOgAAAAAIAACAAAABNrTQPfGwgPVyLLb62n6aEaAUjIUacxe+nehs2Qk3ULCAAAAA0kBxHdStrS/WnUBf+O7XZ0zEQOfTFZrXuVm3jvi1RAEAAAACvwgPXW54yQzy5Z5tFfJC2+YtAKJZs37d64lsEU7OgCufzK+7fgLphKgcEqtDUzfBraDPc+8KJhKnStxYslTwL" SelectedForPublish="True" />
+ <publishProfile publishUrl="ec2-107-22-62-77.compute-1.amazonaws.com" deleteExistingFiles="False" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="Default Web Site" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="True" msdeploySkipExtraFilesOnServer="False" msdeployMarkAsApp="False" profileName="Profile1" publishMethod="MSDeploy" replaceMatchingFiles="True" userName="Administrator" savePWD="True" userPWD="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA+fGe/qc06UKWDQyYUSpXOQAAAAACAAAAAAAQZgAAAAEAACAAAABk9Wr0ZIlf0B8MX1jI2Ik9f9wJco85CA39jW6W0JDIvQAAAAAOgAAAAAIAACAAAAD0fmQSnCc7TSHyleswULyYVbkEdof+76ztZsff0bIWNiAAAABXugJRTz4JFCwSNLBZHHNGwYRg5xwlUnFjf/h1e5K3ZkAAAAAibxd1Is5j677sZoClr36zX7zfxyo+F4G4WfCUpp9evqTm24DFL6V3INiesIBniabEsnIV92iTflGfJUSKZTpd" SelectedForPublish="True" />
</publishData>
@@ -38,15 +38,9 @@
<HintPath>C:\Program Files (x86)\ComponentOne\Studio for ASP.NET\bin\v4\C1.C1Excel.4.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
- <Reference Include="Elmah">
- <HintPath>..\packages\elmah.corelibrary.1.2.1\lib\Elmah.dll</HintPath>
- </Reference>
<Reference Include="EntityFramework">
<HintPath>..\packages\EntityFramework.4.2.0.0\lib\net40\EntityFramework.dll</HintPath>
</Reference>
- <Reference Include="HibernatingRhinos.Profiler.Appender.v4.0">
- <HintPath>D:\Tools\EFProf\HibernatingRhinos.Profiler.Appender.v4.0.dll</HintPath>
- </Reference>
<Reference Include="System.Data.Entity" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
@@ -74,6 +68,7 @@
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Controllers\EventController.cs" />
<Compile Include="Controllers\HomeController.cs" />
@@ -84,6 +79,7 @@
<Compile Include="Models\EventResponse.cs" />
<Compile Include="Models\EventViewModel.cs" />
<Compile Include="Models\LeadGenContext.cs" />
+ <Compile Include="Models\LoginModel.cs" />
<Compile Include="Models\Question.cs" />
<Compile Include="Models\QuestionChoice.cs" />
<Compile Include="Models\QuestionResponse.cs" />
@@ -137,6 +133,7 @@
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
+ <Content Include="Views\Account\LoggyMeOn.cshtml" />
<None Include="_bin_deployableAssemblies\WebMatrix.WebData.xml" />
<None Include="_bin_deployableAssemblies\WebMatrix.WebData.dll" />
<None Include="_bin_deployableAssemblies\WebMatrix.Data.xml" />
@@ -0,0 +1,7 @@
+namespace LeadGen.Web.Models
+{
+ public class LoginModel
+ {
+ public string Password { get; set; }
+ }
+}
@@ -0,0 +1,16 @@
+@model LeadGen.Web.Models.LoginModel
+@{
+ ViewBag.Title = "Loggy Me In";
+ Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
+}
+<h2>
+ Loggy Me In</h2>
+<p>
+ WHAT IS THE PASSWORD MORTAL?</p>
+@using (Html.BeginForm())
+{
+ @Html.TextBoxFor(p => p.Password)
+ @Html.AntiForgeryToken()
+
+ <input type="submit" name="buttonSubmit" value="GO!!!" />
+}
@@ -59,7 +59,7 @@
{
<fieldset data-role="controlgroup">
<legend>@e.QuestionText</legend>
- @foreach (var q in e.QuestionChoices)
+ @foreach (var q in e.QuestionChoices.OrderBy(p=>p.Text))
{
<input type="radio" name="question_@(e.QuestionId)" id="radio-choice-@(q.QuestionChoiceId)" value="@(q.Text)" />
<label for="radio-choice-@(q.QuestionChoiceId)">
@@ -72,7 +72,7 @@
{
<fieldset data-role="controlgroup">
<legend>@e.QuestionText</legend>
- @foreach (var q in e.QuestionChoices)
+ @foreach (var q in e.QuestionChoices.OrderBy(p => p.Text))
{
<input type="checkbox" name="question_@(e.QuestionId)" id="checkbox-choice-@(q.QuestionChoiceId)" value="@(q.Text)" />
<label for="checkbox-choice-@(q.QuestionChoiceId)">
@@ -4,9 +4,22 @@
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
- <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
+ <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
+ <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script src="@Url.Content("~/Scripts/jsrender.js")" type="text/javascript"></script>
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-28271987-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function () {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
</head>
<body data-role="page">
<div data-role="header" data-position="inline" >
@@ -1,90 +1,106 @@
<!DOCTYPE html>
-
<html>
<head>
<title>ComponentOne LeadGen - @ViewBag.Title</title>
<!--jQuery References-->
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jsrender.js")" type="text/javascript"></script>
-
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
-
<!--Theme-->
<link href="@Url.Content("~/Content/redmond/jquery-ui-1.8.16.custom.css")" rel="stylesheet" type="text/css" title="rocket-jqueryui" />
-
@*<!--Wijmo Widgets CSS-->
<link href="http://cdn.wijmo.com/jquery.wijmo-complete.all.2.0.0b1.min.css" rel="stylesheet" type="text/css" />
<!--Wijmo Widgets JavaScript-->
<script src="http://cdn.wijmo.com/jquery.wijmo-open.all.2.0.0b1.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/jquery.wijmo-complete.all.2.0.0b1.min.js" type="text/javascript"></script>*@
-
<style type="text/css">
- /* Override some defaults */
- html, body {
- background-color: #eee;
- }
- body {
- padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
- }
- .container > footer p {
- text-align: center; /* center align it with the container */
- }
- .container {
- width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
- }
-
- /* The white background content wrapper */
- .content {
- background-color: #fff;
- padding: 20px;
- margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
- box-shadow: 0 1px 2px rgba(0,0,0,.15);
- }
-
- /* Page header tweaks */
- .page-header {
- background-color: #f5f5f5;
- padding: 20px 20px 10px;
- margin: -20px -20px 20px;
- }
+ /* Override some defaults */
+ html, body
+ {
+ background-color: #eee;
+ }
+ body
+ {
+ padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
+ }
+ .container > footer p
+ {
+ text-align: center; /* center align it with the container */
+ }
+ .container
+ {
+ width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
+ }
+
+ /* The white background content wrapper */
+ .content
+ {
+ background-color: #fff;
+ padding: 20px;
+ margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
+ -webkit-border-radius: 0 0 6px 6px;
+ -moz-border-radius: 0 0 6px 6px;
+ border-radius: 0 0 6px 6px;
+ -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ }
+
+ /* Page header tweaks */
+ .page-header
+ {
+ background-color: #f5f5f5;
+ padding: 20px 20px 10px;
+ margin: -20px -20px 20px;
+ }
+
+ /* Styles you shouldn't keep as they are for displaying this base example only */
+ .content .span10, .content .span4
+ {
+ min-height: 500px;
+ }
+ /* Give a quick and non-cross-browser friendly divider */
+ .content .span4
+ {
+ margin-left: 0;
+ padding-left: 19px;
+ border-left: 1px solid #eee;
+ }
+
+ .topbar .btn
+ {
+ border: 0;
+ }
+ </style>
+ <script type="text/javascript">
- /* Styles you shouldn't keep as they are for displaying this base example only */
- .content .span10,
- .content .span4 {
- min-height: 500px;
- }
- /* Give a quick and non-cross-browser friendly divider */
- .content .span4 {
- margin-left: 0;
- padding-left: 19px;
- border-left: 1px solid #eee;
- }
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-28271987-1']);
+ _gaq.push(['_trackPageview']);
- .topbar .btn {
- border: 0;
- }
+ (function () {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
- </style>
+ </script>
</head>
<body>
<div class="topbar">
- <div class="fill">
- <div class="container">
- <a class="brand" href="#">ComponentOne Lead Generator</a>
- <ul class="nav">
- <li>@Html.ActionLink("Home", "Index")</li>
- <li><a href="#users">Users</a></li>
- </ul>
- <p class="pull-right">Logged in as <a href="#">username</a></p>
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="#">ComponentOne Lead Generator</a>
+ <ul class="nav">
+ <li>@Html.ActionLink("Home", "Index")</li>
+ <li><a href="#users">Users</a></li>
+ </ul>
+ <p class="pull-right">
+ Logged in as <a href="#">username</a></p>
+ </div>
</div>
- </div>
</div>
<div class="container">
@RenderBody()
Oops, something went wrong.

0 comments on commit 07bb6d1

Please sign in to comment.