mirror of https://github.com/Ombi-app/Ombi
parent
83848865e8
commit
a4f892b702
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.2.3" targetFramework="net452" />
|
||||
</packages>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.2.3" targetFramework="net452" />
|
||||
<package id="TMDbLib" version="0.8.3" targetFramework="net452" />
|
||||
</packages>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,12 @@
|
||||
using Nancy;
|
||||
|
||||
namespace RequestPlex.UI.Modules
|
||||
{
|
||||
public class AdminModule : NancyModule
|
||||
{
|
||||
public AdminModule()
|
||||
{
|
||||
Get["admin/"] = _ => "Hello!";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using Nancy;
|
||||
|
||||
namespace RequestPlex.UI.Modules
|
||||
{
|
||||
public class LoginModule : NancyModule
|
||||
{
|
||||
public LoginModule()
|
||||
{
|
||||
Get["/"] = _ => View["Login/Index"];
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using Nancy;
|
||||
|
||||
namespace RequestPlex.UI.Modules
|
||||
{
|
||||
public class ManageModule : NancyModule
|
||||
{
|
||||
public ManageModule()
|
||||
{
|
||||
Get["manage/"] = _ => "Hello!";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
using Nancy;
|
||||
using Nancy.ModelBinding;
|
||||
using Nancy.Responses.Negotiation;
|
||||
|
||||
using RequestPlex.Api;
|
||||
|
||||
namespace RequestPlex.UI.Modules
|
||||
{
|
||||
public class RequestModule : NancyModule
|
||||
{
|
||||
public RequestModule()
|
||||
{
|
||||
Get["request/"] = parameters => RequestLoad();
|
||||
|
||||
Get["request/movie/{searchTerm}"] = parameters =>
|
||||
{
|
||||
var search = (string)parameters.searchTerm;
|
||||
return SearchMovie(search);
|
||||
};
|
||||
|
||||
Get["request/tv/{searchTerm}"] = parameters =>
|
||||
{
|
||||
var search = (string)parameters.searchTerm;
|
||||
return SearchTvShow(search);
|
||||
};
|
||||
}
|
||||
|
||||
private Negotiator RequestLoad()
|
||||
{
|
||||
return View["Request/Index"];
|
||||
}
|
||||
|
||||
private Response SearchMovie(string searchTerm)
|
||||
{
|
||||
var api = new TheMovieDbApi();
|
||||
var movies = api.SearchMovie(searchTerm);
|
||||
|
||||
return Response.AsJson(movies);
|
||||
}
|
||||
|
||||
private Response SearchTvShow(string searchTerm)
|
||||
{
|
||||
var api = new TheMovieDbApi();
|
||||
var movies = api.SearchTv(searchTerm);
|
||||
|
||||
return Response.AsJson(movies);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
BODY
|
@ -0,0 +1,74 @@
|
||||
<div>
|
||||
<h2 >Search</h2>
|
||||
<!-- Nav tabs -->
|
||||
<ul id="nav-tabs" class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab">Movies</a></li>
|
||||
<li role="presentation"><a href="#TvShowTab" aria-controls="profile" role="tab" data-toggle="tab">TV Shows</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="MoviesTab">
|
||||
<div class="input-group">
|
||||
<input id="movieSearchContent" type="text" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="movieSearchButton">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="movieList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="TvShowTab">
|
||||
|
||||
<div class="input-group">
|
||||
<input id="tvSearchContent" type="text" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="tvSearchButton">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="tvList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
|
||||
$('#movieSearchButton').click(function (e) {
|
||||
$('#list').html("");
|
||||
e.preventDefault();
|
||||
|
||||
var query = $('#movieSearchContent').val();
|
||||
|
||||
$.ajax("/request/movie/" + query).success(function (results) {
|
||||
results.forEach(function (result) {
|
||||
$('#movieList').append("<div id='" + result.id + "'>" + result.title + "</div>");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#tvSearchButton').click(function (e) {
|
||||
$('#list').html("");
|
||||
e.preventDefault();
|
||||
|
||||
var query = $('#tvSearchContent').val();
|
||||
|
||||
$.ajax("/request/tv/" + query).success(function (results) {
|
||||
results.forEach(function (result) {
|
||||
$('#tvList').append("<div id='" + result.id + "'>" + result.name + "</div>");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,32 @@
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
|
||||
<link rel="stylesheet" href="/Content/bootstrap.css" type="text/css"/>
|
||||
<script src="/Content/jquery-2.2.1.min.js"></script>
|
||||
<script src="/Content/bootstrap.min.js"></script>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Request Plex</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="/request">Search</a></li>
|
||||
<li><a href="/admin">Admin</a></li>
|
||||
<li><a href="/admin">Requested</a></li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="#">Login</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
@RenderBody()
|
||||
</div>
|
@ -0,0 +1,25 @@
|
||||
@Model string;
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>RequestPlex.UI</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<img src="~/Content/nancy-logo.png" alt="Nancy logo" /><br />
|
||||
This view was rendered using the Nancy Razor view engine
|
||||
@if (1 == 1)
|
||||
{
|
||||
<div>@Model</div>
|
||||
}
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "Views/Shared/_Layout.cshtml";
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<appSettings>
|
||||
<add key="webPages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web.webPages.razor>
|
||||
<pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
|
||||
<namespaces>
|
||||
<add namespace="Nancy.ViewEngines.Razor" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
</configuration>
|
After Width: | Height: | Size: 547 B |
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Nancy" version="1.4.1" requireReinstallation="true" />
|
||||
<package id="Nancy.Hosting.Self" version="1.4.1" requireReinstallation="true" />
|
||||
<package id="Nancy.Owin" version="1.4.1" targetFramework="net452" />
|
||||
<package id="Nancy.Viewengines.Razor" version="1.4.1" requireReinstallation="true" />
|
||||
<package id="Owin" version="1.0" targetFramework="net452" />
|
||||
<package id="RestSharp" version="105.2.3" targetFramework="net452" />
|
||||
<package id="TMDbLib" version="0.8.3" targetFramework="net452" />
|
||||
</packages>
|
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.2">
|
||||
|
||||
<buildProviders>
|
||||
<add extension=".cshtml"
|
||||
type="Nancy.ViewEngines.Razor.BuildProviders.NancyCSharpRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" />
|
||||
<add extension=".vbhtml"
|
||||
type="Nancy.ViewEngines.Razor.BuildProviders.NancyVisualBasicRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" />
|
||||
</buildProviders>
|
||||
</compilation>
|
||||
|
||||
<httpHandlers>
|
||||
<add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
|
||||
<appSettings>
|
||||
<add key="webPages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web.webPages.razor>
|
||||
<pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
|
||||
<namespaces>
|
||||
<add namespace="Nancy.ViewEngines.Razor" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<httpErrors existingResponse="PassThrough"/>
|
||||
<handlers>
|
||||
<add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
Loading…
Reference in new issue