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("");
|
||||
|
||||
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,11 +25,14 @@
|
|||
<a id="movieTabButton" href="#MoviesTab" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-film"></i> @UI.Search_Movies</a>
|
||||
|
||||
</li>
|
||||
@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>
|
||||
}
|
||||
}
|
||||
@if (Model.Settings.SearchForTvShows)
|
||||
{
|
||||
<li role="presentation">
|
||||
|
@ -74,6 +77,8 @@
|
|||
<div id="movieList">
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.Settings.SearchForActors)
|
||||
{
|
||||
<!-- Actors tab -->
|
||||
<div role="tabpanel" class="tab-pane" id="ActorsTab">
|
||||
<div class="input-group">
|
||||
|
@ -82,13 +87,17 @@
|
|||
<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>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.Settings.SearchForTvShows)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue