mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
UI changes to add checkbox and support searching for only new matches via new API.
This commit is contained in:
parent
0d3ff966d6
commit
39871802b5
6 changed files with 56 additions and 23 deletions
3
Ombi.UI/Content/requests.js
vendored
3
Ombi.UI/Content/requests.js
vendored
|
@ -745,7 +745,8 @@ function actorLoad() {
|
||||||
}
|
}
|
||||||
$ml.html("");
|
$ml.html("");
|
||||||
|
|
||||||
var url = createBaseUrl(base, '/requests/actor');
|
var $newOnly = $('#searchNewOnly').val();
|
||||||
|
var url = createBaseUrl(base, '/requests/actor' + (!!$newOnly ? '/new' : ''));
|
||||||
$.ajax(url).success(function (results) {
|
$.ajax(url).success(function (results) {
|
||||||
if (results.length > 0) {
|
if (results.length > 0) {
|
||||||
results.forEach(function (result) {
|
results.forEach(function (result) {
|
||||||
|
|
16
Ombi.UI/Content/search.js
vendored
16
Ombi.UI/Content/search.js
vendored
|
@ -65,14 +65,23 @@ $(function () {
|
||||||
|
|
||||||
// Type in actor search
|
// Type in actor search
|
||||||
$("#actorSearchContent").on("input", function () {
|
$("#actorSearchContent").on("input", function () {
|
||||||
|
triggerActorSearch();
|
||||||
|
});
|
||||||
|
|
||||||
|
// if they toggle the checkbox, we want to refresh our search
|
||||||
|
$("#actorsSearchNew").click(function () {
|
||||||
|
triggerActorSearch();
|
||||||
|
});
|
||||||
|
|
||||||
|
function triggerActorSearch()
|
||||||
|
{
|
||||||
if (searchTimer) {
|
if (searchTimer) {
|
||||||
clearTimeout(searchTimer);
|
clearTimeout(searchTimer);
|
||||||
}
|
}
|
||||||
searchTimer = setTimeout(function () {
|
searchTimer = setTimeout(function () {
|
||||||
moviesFromActor();
|
moviesFromActor();
|
||||||
}.bind(this), 800);
|
}.bind(this), 800);
|
||||||
|
}
|
||||||
});
|
|
||||||
|
|
||||||
$('#moviesComingSoon').on('click', function (e) {
|
$('#moviesComingSoon').on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -326,7 +335,8 @@ $(function () {
|
||||||
|
|
||||||
function moviesFromActor() {
|
function moviesFromActor() {
|
||||||
var query = $("#actorSearchContent").val();
|
var query = $("#actorSearchContent").val();
|
||||||
var url = createBaseUrl(base, '/search/actor/');
|
var $newOnly = $('#actorsSearchNew')[0].checked;
|
||||||
|
var url = createBaseUrl(base, '/search/actor/' + (!!$newOnly ? 'new/' : ''));
|
||||||
query ? getMovies(url + query, "#actorMovieList", "#actorSearchButton") : resetMovies("#actorMovieList");
|
query ? getMovies(url + query, "#actorMovieList", "#actorSearchButton") : resetMovies("#actorMovieList");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,9 @@
|
||||||
<data name="Search_Albums" xml:space="preserve">
|
<data name="Search_Albums" xml:space="preserve">
|
||||||
<value>Albums</value>
|
<value>Albums</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Search_NewOnly" xml:space="preserve">
|
||||||
|
<value>Don't include titles that are already requested/available</value>
|
||||||
|
</data>
|
||||||
<data name="Search_Paragraph" xml:space="preserve">
|
<data name="Search_Paragraph" xml:space="preserve">
|
||||||
<value>Want to watch something that is not currently on Plex?! No problem! Just search for it below and request it!</value>
|
<value>Want to watch something that is not currently on Plex?! No problem! Just search for it below and request it!</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
9
Ombi.UI/Resources/UI1.Designer.cs
generated
9
Ombi.UI/Resources/UI1.Designer.cs
generated
|
@ -897,6 +897,15 @@ namespace Ombi.UI.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Don't include titles that are already requested/available.
|
||||||
|
/// </summary>
|
||||||
|
public static string Search_NewOnly {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Search_NewOnly", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Not Requested yet.
|
/// Looks up a localized string similar to Not Requested yet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
|
|
||||||
@Html.Checkbox(Model.SearchForMovies,"SearchForMovies","Search for Movies")
|
@Html.Checkbox(Model.SearchForMovies,"SearchForMovies","Search for Movies")
|
||||||
|
|
||||||
|
@Html.Checkbox(Model.SearchForActors,"SearchForActors","Search for Movies by Actor")
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|
|
@ -25,10 +25,13 @@
|
||||||
<a id="movieTabButton" href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-film"></i> @UI.Search_Movies</a>
|
<a id="movieTabButton" href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-film"></i> @UI.Search_Movies</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li role="presentation">
|
@if (Model.Settings.SearchForActors)
|
||||||
<a id="actorTabButton" href="#ActorsTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-users"></i> @UI.Search_Actors</a>
|
{
|
||||||
|
<li role="presentation">
|
||||||
|
<a id="actorTabButton" href="#ActorsTab" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-users"></i> @UI.Search_Actors</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@if (Model.Settings.SearchForTvShows)
|
@if (Model.Settings.SearchForTvShows)
|
||||||
{
|
{
|
||||||
|
@ -74,21 +77,27 @@
|
||||||
<div id="movieList">
|
<div id="movieList">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (Model.Settings.SearchForActors)
|
||||||
|
{
|
||||||
<!-- Actors tab -->
|
<!-- Actors tab -->
|
||||||
<div role="tabpanel" class="tab-pane" id="ActorsTab">
|
<div role="tabpanel" class="tab-pane" id="ActorsTab">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="actorSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
|
<input id="actorSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
|
||||||
<div class="input-group-addon">
|
<div class="input-group-addon">
|
||||||
<i id="actorSearchButton" class="fa fa-search"></i>
|
<i id="actorSearchButton" class="fa fa-search"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="checkbox">
|
||||||
|
<input type="checkbox" class="newMoviesOnly" id="actorsSearchNew" name="actorsSearchNew"><label for="actorsSearchNew">@UI.Search_NewOnly</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<!-- Movie content -->
|
||||||
|
<div id="actorMovieList">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
}
|
||||||
<br />
|
|
||||||
<!-- Movie content -->
|
|
||||||
<div id="actorMovieList">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (Model.Settings.SearchForTvShows)
|
@if (Model.Settings.SearchForTvShows)
|
||||||
|
@ -139,7 +148,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<script id="search-templateNew" type="text/x-handlebars-template">
|
<script id="search-templateNew" type="text/x-handlebars-template">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="{{id}}imgDiv" class="col-sm-2">
|
<div id="{{id}}imgDiv" class="col-sm-2">
|
||||||
|
|
||||||
|
@ -301,7 +310,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Movie and TV Results template -->
|
<!-- Movie and TV Results template -->
|
||||||
<script id="search-template" type="text/x-handlebars-template">
|
<script id="search-template" type="text/x-handlebars-template">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="{{id}}imgDiv" class="col-sm-2">
|
<div id="{{id}}imgDiv" class="col-sm-2">
|
||||||
|
|
||||||
|
@ -327,7 +336,7 @@
|
||||||
<h4>
|
<h4>
|
||||||
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
|
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
|
||||||
{{title}} ({{year}})
|
{{title}} ({{year}})
|
||||||
|
|
||||||
</a>{{#if status}}<span class="label label-primary" style="font-size:60%" target="_blank">{{status}}</span>{{/if}}
|
</a>{{#if status}}<span class="label label-primary" style="font-size:60%" target="_blank">{{status}}</span>{{/if}}
|
||||||
</h4>
|
</h4>
|
||||||
{{/if_eq}}
|
{{/if_eq}}
|
||||||
|
@ -356,7 +365,7 @@
|
||||||
|
|
||||||
|
|
||||||
<span id="{{id}}netflixTab"></span>
|
<span id="{{id}}netflixTab"></span>
|
||||||
|
|
||||||
{{#if homepage}}
|
{{#if homepage}}
|
||||||
<a href="{{homepage}}" target="_blank"><span class="label label-info">HomePage</span></a>
|
<a href="{{homepage}}" target="_blank"><span class="label label-info">HomePage</span></a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue