Cleanup the homepage

This commit is contained in:
Frank A. Krueger 2017-11-15 22:32:17 -06:00
parent 83fceb7ed1
commit 7cf286846c
10 changed files with 13 additions and 38 deletions

View File

@ -18,33 +18,16 @@ namespace AspNetCoreMvc.Controllers
return View (); return View ();
} }
public IActionResult Clicker ()
{
var count = 0;
var head = new Heading { Text = "Click away!" };
var label = new Label { Text = "0" };
var btn = new Button { Text = "Increase" };
btn.Clicked += (sender, e) => {
count++;
label.Text = count.ToString ();
};
var div = new Div ();
div.AppendChild (head);
div.AppendChild (label);
div.AppendChild (btn);
return new ElementResult (div);
}
public IActionResult About () public IActionResult About ()
{ {
ViewData["Message"] = "Your application description page."; ViewData["Message"] = "Ooui is a mini web framework to make programming interactive UIs easy.";
return View (); return View ();
} }
public IActionResult Contact () public IActionResult Contact ()
{ {
ViewData["Message"] = "Your contact page."; ViewData["Message"] = "Find us on github.";
return View (); return View ();
} }

View File

@ -35,7 +35,11 @@ namespace AspNetCoreMvc.Controllers
var sampleType = typeof (Samples.ISample); var sampleType = typeof (Samples.ISample);
var asm = sampleType.Assembly; var asm = sampleType.Assembly;
var sampleTypes = asm.GetTypes ().Where (x => x.Name.EndsWith ("Sample", StringComparison.Ordinal) && x != sampleType); var sampleTypes = asm.GetTypes ().Where (x => x.Name.EndsWith ("Sample", StringComparison.Ordinal) && x != sampleType);
var samples = from t in sampleTypes let s = Activator.CreateInstance (t) as Samples.ISample where s != null select s; var samples = from t in sampleTypes
let s = Activator.CreateInstance (t) as Samples.ISample
where s != null
orderby s.Title
select s;
return samples.ToList (); return samples.ToList ();
}), true); }), true);

View File

@ -4,4 +4,4 @@
<h2>@ViewData["Title"].</h2> <h2>@ViewData["Title"].</h2>
<h3>@ViewData["Message"]</h3> <h3>@ViewData["Message"]</h3>
<p>Use this area to provide additional information.</p> <p>Find out more <a href="https://github.com/praeclarum/Ooui">on github</a></p>

View File

@ -4,14 +4,3 @@
<h2>@ViewData["Title"].</h2> <h2>@ViewData["Title"].</h2>
<h3>@ViewData["Message"]</h3> <h3>@ViewData["Message"]</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>

View File

@ -13,7 +13,7 @@
</div> </div>
<div class="row" style="margin-top:4em;"> <div class="row" style="margin-top:4em;">
<div class="col-md-3"> <div class="col-md-4">
<h3>Samples</h3> <h3>Samples</h3>
<ul> <ul>
@foreach (var s in SamplesController.Samples) { @foreach (var s in SamplesController.Samples) {

View File

@ -32,7 +32,6 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li> <li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li> <li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -5,7 +5,7 @@ namespace Samples
{ {
public class ButtonSample : ISample public class ButtonSample : ISample
{ {
public string Title => "Button that count clicks"; public string Title => "Button Counter";
Button MakeButton () Button MakeButton ()
{ {

View File

@ -7,7 +7,7 @@ namespace Samples
{ {
public class DrawSample : ISample public class DrawSample : ISample
{ {
public string Title => "Collaborative Drawing"; public string Title => "Drawing";
public void Publish () public void Publish ()
{ {

View File

@ -6,7 +6,7 @@ using Ooui;
namespace Samples namespace Samples
{ {
public class FilesSample : ISample public class FilesSample //: ISample
{ {
public string Title => "Upload files"; public string Title => "Upload files";

View File

@ -7,7 +7,7 @@ namespace Samples
{ {
public class TodoSample : ISample public class TodoSample : ISample
{ {
public string Title => "Global TODO list"; public string Title => "Todo List";
List items = new List () { List items = new List () {
ClassName = "list-group", ClassName = "list-group",