update web console
This commit is contained in:
@@ -19,6 +19,7 @@ namespace OnePeek.WebConsole.Modules
|
||||
return View["Index"];
|
||||
};
|
||||
|
||||
|
||||
Get["/meta", true] = async (ctx, token) =>
|
||||
{
|
||||
AppMetadata meta = await api.GetMetadata(Request.Query["id"], StoreType.WindowsPhone8, StoreCultureType.EN_US);
|
||||
@@ -32,6 +33,14 @@ namespace OnePeek.WebConsole.Modules
|
||||
return View["Reviews", reviews];
|
||||
};
|
||||
|
||||
|
||||
Get["/search", true] = async (ctx, token) =>
|
||||
{
|
||||
StoreSearchResults result = await api.Search(Request.Query["term"], StoreType.WindowsPhone8, StoreCultureType.EN_US);
|
||||
return View["Search", result];
|
||||
};
|
||||
|
||||
|
||||
Get["/ratings", true] = async (ctx, token) =>
|
||||
{
|
||||
var order = Request.Query["order"];
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
<Content Include="Views\Meta.cshtml" />
|
||||
<Content Include="Views\Reviews.cshtml" />
|
||||
<Content Include="Views\Ratings.cshtml" />
|
||||
<Content Include="Views\Search.cshtml" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
|
||||
@@ -3,24 +3,41 @@
|
||||
Layout = "_Layout.cshtml";
|
||||
}
|
||||
|
||||
<form action="/meta" method="get">
|
||||
<h3>META</h3>
|
||||
<form id="apiquery" action="/meta" method="get">
|
||||
<div class="large-12 columns">
|
||||
<h3>API QUERY</h3>
|
||||
</div>
|
||||
<div class="large-4 columns">
|
||||
<select id="apiquery-type">
|
||||
<option value="meta">meta</option>
|
||||
<option value="reviews">reviews</option>
|
||||
<option value="ratings">ratings</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-8 columns">
|
||||
<input type="text" name="id" value="2532ff45-aa3f-4aba-a266-ed7ec71d47bd" />
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<input type="submit" value="submit" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
<br /><br />
|
||||
|
||||
<form action="/reviews" method="get">
|
||||
<h3>REVIEWS</h3>
|
||||
<input type="text" name="id" value="2532ff45-aa3f-4aba-a266-ed7ec71d47bd" />
|
||||
<form id="apisearch" action="/search" method="get">
|
||||
<div class="large-12 columns">
|
||||
<h3>SEARCH</h3>
|
||||
<input type="text" name="term" value="" placeholder="search term ..." />
|
||||
<input type="submit" value="submit" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<form action="/ratings" method="get">
|
||||
<h3>RATINGS</h3>
|
||||
<input type="text" name="id" value="2532ff45-aa3f-4aba-a266-ed7ec71d47bd" />
|
||||
<input type="submit" value="submit" class="button" />
|
||||
</form>
|
||||
<script>
|
||||
$('#apiquery').on('submit', function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
$(this).off('submit').attr('action', '/' + $('#apiquery-type').val()).submit();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
|
||||
@{
|
||||
Layout = "_Layout.cshtml";
|
||||
}
|
||||
|
||||
@foreach (var result in Model.Results)
|
||||
{
|
||||
<div class="result">
|
||||
@result.Name
|
||||
</div>
|
||||
<hr />
|
||||
}
|
||||
|
||||
<style>
|
||||
.result
|
||||
{
|
||||
padding: 1rem;
|
||||
}
|
||||
.result:nth-child(4n+1)
|
||||
{
|
||||
background: #f7f7f7;
|
||||
}
|
||||
</style>
|
||||
@@ -5,16 +5,16 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="~/Assets/normalize.css" />
|
||||
<link rel="stylesheet" href="~/Assets/foundation.min.css" />
|
||||
<script src="~/Assets/jquery.js"></script>
|
||||
<script src="~/Assets/foundation.min.js"></script>
|
||||
<script>
|
||||
$(document).foundation();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<br /><br />
|
||||
<div class="row">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<script src="~/Assets/jquery.js"></script>
|
||||
<script src="~/Assets/foundation.min.js"></script>
|
||||
<script>
|
||||
$(document).foundation();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user