Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
172 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%@ Application Codebehind="Global.asax.cs" Inherits="OpenSurvey.Web.Global" Language="C#" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace OpenSurvey.Web | ||
{ | ||
using System; | ||
using Castle.Windsor; | ||
using OpenRasta.DI; | ||
using Castle.Facilities.Logging; | ||
using Castle.Services.Logging.Log4netIntegration; | ||
using OpenSurvey.Persistence.NHibernate.Configuration; | ||
using Castle.MicroKernel.Registration; | ||
using OpenRasta.DI.Windsor; | ||
|
||
public class Global : System.Web.HttpApplication, IContainerAccessor, IDependencyResolverAccessor | ||
{ | ||
|
||
IWindsorContainer container; | ||
public IWindsorContainer Container | ||
{ | ||
get | ||
{ | ||
if (container == null) | ||
container = ConfigureContainer(); | ||
return container; | ||
} | ||
} | ||
|
||
private IWindsorContainer ConfigureContainer() | ||
{ | ||
container = new WindsorContainer() | ||
.AddFacility<LoggingFacility>("loggingFacility", f => f.LogUsing<Log4netFactory>().WithAppConfig()) | ||
.Install(new NHibernateInstaller()) | ||
.Register(AllTypes.FromThisAssembly() | ||
.Where(t => t.Namespace.EndsWith(".Resources")) | ||
) | ||
; | ||
return container; | ||
} | ||
|
||
public IDependencyResolver Resolver | ||
{ | ||
get { return new WindsorDependencyResolver(Container); } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<%@ Page Language="C#" Inherits="ResourceView<SurveyResource>" MasterPageFile="~/Views/Survey.Master" | ||
Title="Home Page" %> | ||
|
||
<script runat="server"> | ||
protected void Page_Load() | ||
{ | ||
Page.Title = Resource.Title; | ||
} | ||
</script> | ||
<asp:Content ContentPlaceHolderID="Content" ID="content" runat="server"> | ||
<div> | ||
<% using ( | ||
scope(Xhtml.Form(Resource).Method("put"))) | ||
{ | ||
using (scope(p)) | ||
{ | ||
%> | ||
<input type="text" name="Name" value="<%= Resource.Name %>" /> | ||
<input type="text" name="Title" value="<%= Resource.Title %>" /> | ||
<textarea name="Description" rows="4" cols="20"><%= Resource.Description %></textarea> | ||
<input type="submit" value="Save" /> <a href="<%= Resource.CreateUri() %>">Cancel</a> | ||
<% } | ||
} %> | ||
</div> | ||
</asp:Content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
<%@ Page Language="C#" Inherits="ResourceView<SurveyResource>" MasterPageFile="~/Views/Survey.Master" Title="Home Page" %> | ||
|
||
<script runat="server"> | ||
protected void Page_Load() | ||
{ | ||
Page.Title = Resource.Title; | ||
} | ||
</script> | ||
<asp:Content ContentPlaceHolderID="Content" ID="content" runat="server"> | ||
<div> | ||
<h1><%= Resource.Title %></h1> | ||
<p><%= Resource.Description %></p> | ||
|
||
<a href="<%= Resource.CreateUri() %>">Permalink</a> | ||
<a href="<%= Resource.CreateUri("edit") %>">Edit</a> | ||
</div> | ||
</asp:Content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters