mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 14:10: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("");
|
||||
|
||||
var url = createBaseUrl(base, '/requests/actor');
|
||||
var $newOnly = $('#searchNewOnly').val();
|
||||
var url = createBaseUrl(base, '/requests/actor' + (!!$newOnly ? '/new' : ''));
|
||||
$.ajax(url).success(function (results) {
|
||||
if (results.length > 0) {
|
||||
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
|
||||
$("#actorSearchContent").on("input", function () {
|
||||
triggerActorSearch();
|
||||
});
|
||||
|
||||
// if they toggle the checkbox, we want to refresh our search
|
||||
$("#actorsSearchNew").click(function () {
|
||||
triggerActorSearch();
|
||||
});
|
||||
|
||||
function triggerActorSearch()
|
||||
{
|
||||
if (searchTimer) {
|
||||
clearTimeout(searchTimer);
|
||||
}
|
||||
searchTimer = setTimeout(function () {
|
||||
moviesFromActor();
|
||||
}.bind(this), 800);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$('#moviesComingSoon').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
@ -326,7 +335,8 @@ $(function () {
|
|||
|
||||
function moviesFromActor() {
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
|
@ -211,6 +211,9 @@
|
|||
<data name="Search_Albums" xml:space="preserve">
|
||||
<value>Albums</value>
|
||||
</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">
|
||||
<value>Want to watch something that is not currently on Plex?! No problem! Just search for it below and request it!</value>
|
||||
</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>
|
||||
/// Looks up a localized string similar to Not Requested yet.
|
||||
/// </summary>
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
|
||||
@Html.Checkbox(Model.SearchForMovies,"SearchForMovies","Search for Movies")
|
||||
|
||||
@Html.Checkbox(Model.SearchForActors,"SearchForActors","Search for Movies by Actor")
|
||||
|
||||
<div class="form-group">
|
||||
<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>
|
||||
|
||||
</li>
|
||||
<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>
|
||||
@if (Model.Settings.SearchForActors)
|
||||
{
|
||||
<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)
|
||||
{
|
||||
|
@ -74,21 +77,27 @@
|
|||
<div id="movieList">
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.Settings.SearchForActors)
|
||||
{
|
||||
<!-- Actors tab -->
|
||||
<div role="tabpanel" class="tab-pane" id="ActorsTab">
|
||||
<div class="input-group">
|
||||
<input id="actorSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
|
||||
<div class="input-group-addon">
|
||||
<i id="actorSearchButton" class="fa fa-search"></i>
|
||||
<div role="tabpanel" class="tab-pane" id="ActorsTab">
|
||||
<div class="input-group">
|
||||
<input id="actorSearchContent" type="text" class="form-control form-control-custom form-control-search form-control-withbuttons">
|
||||
<div class="input-group-addon">
|
||||
<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>
|
||||
<br />
|
||||
<br />
|
||||
<!-- Movie content -->
|
||||
<div id="actorMovieList">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@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 id="{{id}}imgDiv" class="col-sm-2">
|
||||
|
||||
|
@ -301,7 +310,7 @@
|
|||
</script>
|
||||
|
||||
<!-- 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 id="{{id}}imgDiv" class="col-sm-2">
|
||||
|
||||
|
@ -327,7 +336,7 @@
|
|||
<h4>
|
||||
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
|
||||
{{title}} ({{year}})
|
||||
|
||||
|
||||
</a>{{#if status}}<span class="label label-primary" style="font-size:60%" target="_blank">{{status}}</span>{{/if}}
|
||||
</h4>
|
||||
{{/if_eq}}
|
||||
|
@ -356,7 +365,7 @@
|
|||
|
||||
|
||||
<span id="{{id}}netflixTab"></span>
|
||||
|
||||
|
||||
{{#if homepage}}
|
||||
<a href="{{homepage}}" target="_blank"><span class="label label-info">HomePage</span></a>
|
||||
{{/if}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue