1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 17:47:20 +00:00
bazarr/views/episodes.tpl

366 lines
13 KiB
Python
Raw Normal View History

2017-09-16 00:49:46 +00:00
<html>
<head>
<!DOCTYPE html>
2017-11-09 21:13:14 +00:00
<script src="{{base_url}}static/jquery/jquery-latest.min.js"></script>
<script src="{{base_url}}static/semantic/semantic.min.js"></script>
<script src="{{base_url}}static/jquery/tablesort.js"></script>
<link rel="stylesheet" href="{{base_url}}static/semantic/semantic.min.css">
2017-09-16 00:49:46 +00:00
2017-11-09 21:13:14 +00:00
<link rel="apple-touch-icon" sizes="120x120" href="{{base_url}}static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{base_url}}static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{base_url}}static/favicon-16x16.png">
<link rel="manifest" href="{{base_url}}static/manifest.json">
<link rel="mask-icon" href="{{base_url}}static/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="{{base_url}}static/favicon.ico">
<meta name="msapplication-config" content="{{base_url}}static/browserconfig.xml">
2017-09-16 00:49:46 +00:00
<meta name="theme-color" content="#ffffff">
<title>{{details[0]}} - Bazarr</title>
<style>
body {
background-color: #1b1c1d;
2017-11-09 21:13:14 +00:00
background-image: url("{{base_url}}image_proxy{{details[3]}}");
2017-09-16 00:49:46 +00:00
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-position:center center;
}
#divdetails {
background-color: #000000;
opacity: 0.9;
color: #ffffff;
margin-top: 6em;
margin-bottom: 3em;
padding: 2em;
border-radius: 1px;
box-shadow: 0px 0px 5px 5px #000000;
min-height: calc(250px + 4em);
}
#fondblanc {
background-color: #ffffff;
opacity: 0.9;
border-radius: 1px;
box-shadow: 0px 0px 3px 3px #ffffff;
margin-top: 32px;
margin-bottom: 3em;
padding-top: 2em;
padding-left: 2em;
padding-right: 2em;
padding-bottom: 1em;
}
2018-01-05 04:24:11 +00:00
.ui.basic.button:hover, .ui.basic.buttons .button:hover {
background: transparent !important;
}
.ui.basic.button:active, .ui.basic.buttons .button:active {
background: transparent !important;
}
.ui.basic.button:focus, .ui.basic.buttons .button:focus {
background: transparent !important;
}
.ui.basic.button:visited, .ui.basic.buttons .button:visited {
background: transparent !important;
}
2017-09-16 00:49:46 +00:00
</style>
<script>
$(document).ready(function(){
$('.ui.accordion').accordion();
var first_season_acc_title = document.getElementsByClassName("title")[0];
first_season_acc_title.className += " active";
var first_season_acc_content = document.getElementsByClassName("content")[0];
first_season_acc_content.className += " active";
});
</script>
</head>
<body>
%import ast
2017-09-17 00:11:47 +00:00
%import pycountry
%from get_general_settings import *
2018-01-10 16:44:47 +00:00
%single_language = get_general_settings()[7]
2017-11-09 21:13:14 +00:00
<div style="display: none;"><img src="{{base_url}}image_proxy{{details[3]}}"></div>
2017-09-16 00:49:46 +00:00
<div id='loader' class="ui page dimmer">
<div class="ui indeterminate text loader">Loading...</div>
</div>
2017-12-22 00:49:39 +00:00
% include('menu.tpl')
2017-09-16 00:49:46 +00:00
<div style='padding-left: 2em; padding-right: 2em;' class='ui container'>
<div id="divdetails" class="ui container">
2018-05-20 12:33:12 +00:00
<img class="left floated ui image" style="max-height:250px;" src="{{base_url}}image_proxy{{details[2]}}">
2018-01-05 04:24:11 +00:00
<div class="ui right floated basic icon buttons">
<button id="scan_disk" class="ui button" data-tooltip="Scan disk for subtitles" data-inverted=""><i class="ui inverted large compact refresh icon"></i></button>
<button id="search_missing_subtitles" class="ui button" data-tooltip="Download missing subtitles" data-inverted=""><i class="ui inverted huge compact search icon"></i></button>
<%
subs_languages = ast.literal_eval(str(details[7]))
subs_languages_list = []
if subs_languages is not None:
for subs_language in subs_languages:
subs_languages_list.append(subs_language)
end
end
%>
<button id="config" class="ui button" data-tooltip="Edit series" data-inverted="" data-tvdbid="{{details[5]}}" data-title="{{details[0]}}" data-poster="{{details[2]}}" data-audio="{{details[6]}}" data-languages="{{!subs_languages_list}}" data-hearing-impaired="{{details[4]}}"><i class="ui inverted large compact configure icon"></i></button>
2017-10-03 02:59:45 +00:00
</div>
2017-09-16 00:49:46 +00:00
<h2>{{details[0]}}</h2>
<p>{{details[1]}}</p>
2018-01-05 04:24:11 +00:00
<p style='margin-top: 3em;'>
<div class="ui tiny inverted label" style='background-color: #777777;'>{{details[6]}}</div>
<div class="ui tiny inverted label" style='background-color: #35c5f4;'>{{details[8]}}</div>
<div class="ui tiny inverted label" style='background-color: #35c5f4;'>{{number}} files</div>
</p>
<p style='margin-top: 2em;'>
%for language in subs_languages_list:
<div class="ui tiny inverted label" style='background-color: #35c5f4;'>{{language}}</div>
%end
</p>
2018-04-08 00:31:02 +00:00
<div style='clear:both;'></div>
2017-09-16 00:49:46 +00:00
</div>
%if len(seasons) == 0:
<div id="fondblanc" class="ui container">
2018-01-05 04:24:11 +00:00
<h3 class="ui header">No episode files available for this series or Bazarr is still synchronizing with Sonarr. Please come back later.</h3>
2017-09-16 00:49:46 +00:00
</div>
%else:
%for season in seasons:
<div id="fondblanc" class="ui container">
%missing_subs = len([i for i in season if i[6] != "[]"])
%total_subs = len(season)
2018-04-25 00:48:23 +00:00
%subs_label = ''
%if subs_languages is not None:
% subs_label = '<div class="ui tiny '
% if missing_subs == 0:
% subs_label = subs_label + 'green'
% else:
% subs_label = subs_label + 'yellow'
% end
% subs_label = subs_label + ' circular label">' + str(total_subs - missing_subs) + ' / ' + str(total_subs) + '</div>'
%end
<h1 class="ui header">Season {{season[0][2]}}{{!subs_label}}</h1>
2017-09-16 00:49:46 +00:00
<div class="ui accordion">
<div class="title">
<div class="ui one column stackable center aligned page grid">
<div class="column twelve wide">
<h3 class="ui header"><i class="dropdown icon"></i>
Show/Hide Episodes</h3>
</div>
</div>
</div>
<div class="content">
<table class="ui very basic single line selectable table">
<thead>
<tr>
<th class="collapsing">Episode</th>
<th>Title</th>
<th class="collapsing">Existing subtitles</th>
<th class="collapsing">Missing subtitles</th>
</tr>
</thead>
<tbody>
%for episode in season:
<tr>
<td>{{episode[3]}}</td>
<td>{{episode[0]}}</td>
<td>
2017-10-19 11:10:52 +00:00
%if episode[4] is not None:
% actual_languages = ast.literal_eval(episode[4])
%else:
2017-11-14 04:23:07 +00:00
% actual_languages = '[]'
2017-10-19 11:10:52 +00:00
%end
2017-11-14 04:23:07 +00:00
%try:
2017-09-16 00:49:46 +00:00
%for language in actual_languages:
2017-11-14 04:23:07 +00:00
%if language[1] is not None:
<a data-episodePath="{{episode[1]}}" data-subtitlesPath="{{path_replace(language[1])}}" data-language="{{pycountry.languages.lookup(str(language[0])).alpha_3}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="remove_subtitles ui tiny label">
{{language[0]}}
<i class="delete icon"></i>
</a>
%else:
<div class="ui tiny label">
{{language[0]}}
</div>
%end
2017-09-16 00:49:46 +00:00
%end
2017-11-14 04:23:07 +00:00
%except:
%pass
2017-09-16 00:49:46 +00:00
%end
</td>
<td>
2017-11-14 04:23:07 +00:00
%try:
%if episode[6] is not None:
% missing_languages = ast.literal_eval(episode[6])
%else:
% missing_languages = None
%end
%if missing_languages is not None:
%for language in missing_languages:
<a data-episodePath="{{episode[1]}}" data-scenename="{{episode[8]}}" data-language="{{pycountry.languages.lookup(str(language)).alpha_3}}" data-hi="{{details[4]}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="get_subtitle ui tiny label">
2017-11-14 04:23:07 +00:00
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search icon"></i>
</a>
%end
2017-09-16 00:49:46 +00:00
%end
2017-11-14 04:23:07 +00:00
%except:
%pass
2017-09-16 00:49:46 +00:00
%end
</td>
</tr>
%end
</tbody>
</table>
</div>
</div>
</div>
2017-12-22 00:49:39 +00:00
%end
2017-09-16 00:49:46 +00:00
%end
</div>
2018-01-05 04:24:11 +00:00
<div class="ui small modal">
<i class="close icon"></i>
<div class="header">
<div id="series_title"></div>
</div>
<div class="content">
<form name="series_form" id="series_form" action="" method="post" class="ui form">
<div class="ui grid">
<div class="four wide column">
<img id="series_poster" class="ui image" src="">
</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned five wide column">
<label>Audio language</label>
</div>
<div class="nine wide column">
<div id="series_audio_language"></div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned five wide column">
<label>Subtitles languages</label>
</div>
<div class="nine wide column">
2018-01-10 16:44:47 +00:00
<select name="languages" id="series_languages" {{!'multiple="" ' if single_language == 'False' else ''}} class="ui fluid selection dropdown">
2018-01-05 04:24:11 +00:00
<option value="">Languages</option>
2018-06-14 16:46:52 +00:00
%if single_language == 'True':
<option value="None">None</option>
%end
2018-01-05 04:24:11 +00:00
%for language in languages:
<option value="{{language[0]}}">{{language[1]}}</option>
%end
</select>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned five wide column">
<label>Hearing-impaired</label>
</div>
<div class="nine wide column">
<div id="series_hearing-impaired_div" class="ui toggle checkbox">
<input name="hearing_impaired" id="series_hearing-impaired" type="checkbox">
<label></label>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="actions">
<button class="ui cancel button" >Cancel</button>
<button type="submit" name="save" value="save" form="series_form" class="ui blue approve button">Save</button>
</div>
</div>
2017-12-22 00:49:39 +00:00
% include('footer.tpl')
2017-09-16 00:49:46 +00:00
</body>
2017-10-16 23:27:19 +00:00
</html>
<script>
2017-10-27 15:56:45 +00:00
$('#scan_disk').click(function(){
2017-11-09 21:13:14 +00:00
window.location = '{{base_url}}scan_disk/{{no}}';
2017-10-16 23:27:19 +00:00
})
2017-10-27 15:56:45 +00:00
$('#search_missing_subtitles').click(function(){
2017-11-09 21:13:14 +00:00
window.location = '{{base_url}}search_missing_subtitles/{{no}}';
2017-10-16 23:27:19 +00:00
})
2017-10-27 15:56:45 +00:00
$('.remove_subtitles').click(function(){
2017-10-16 23:27:19 +00:00
var values = {
episodePath: $(this).attr("data-episodePath"),
language: $(this).attr("data-language"),
subtitlesPath: $(this).attr("data-subtitlesPath"),
sonarrSeriesId: $(this).attr("data-sonarrSeriesId"),
2017-11-16 14:53:12 +00:00
sonarrEpisodeId: $(this).attr("data-sonarrEpisodeId"),
tvdbid: {{tvdbid}}
2017-10-16 23:27:19 +00:00
};
$.ajax({
2017-11-09 21:13:14 +00:00
url: "{{base_url}}remove_subtitles",
2017-10-16 23:27:19 +00:00
type: "POST",
dataType: "json",
data: values
});
$(document).ajaxStart(function(){
$('#loader').addClass('active');
});
$(document).ajaxStop(function(){
window.location.reload();
});
2017-10-16 23:27:19 +00:00
})
2017-10-27 15:56:45 +00:00
$('.get_subtitle').click(function(){
2017-10-16 23:27:19 +00:00
var values = {
episodePath: $(this).attr("data-episodePath"),
2018-02-24 01:08:31 +00:00
sceneName: $(this).attr("data-sceneName"),
2017-10-16 23:27:19 +00:00
language: $(this).attr("data-language"),
hi: $(this).attr("data-hi"),
sonarrSeriesId: $(this).attr("data-sonarrSeriesId"),
2017-11-16 14:53:12 +00:00
sonarrEpisodeId: $(this).attr("data-sonarrEpisodeId"),
tvdbid: {{tvdbid}}
2017-10-16 23:27:19 +00:00
};
$.ajax({
2017-11-09 21:13:14 +00:00
url: "{{base_url}}get_subtitle",
2017-10-16 23:27:19 +00:00
type: "POST",
dataType: "json",
data: values
});
$(document).ajaxStart(function(){
$('#loader').addClass('active');
});
$(document).ajaxStop(function(){
window.location.reload();
});
2017-10-16 23:27:19 +00:00
})
$('a, .menu .item, button:not(#config, .cancel)').click(function(){
$('#loader').addClass('active');
})
2018-01-05 04:24:11 +00:00
$('.modal')
.modal({
autofocus: false
})
;
$('#config').click(function(){
$('#series_form').attr('action', '{{base_url}}edit_series/{{no}}');
$("#series_title").html($(this).data("title"));
$("#series_poster").attr("src", "{{base_url}}image_proxy" + $(this).data("poster"));
$("#series_audio_language").html($(this).data("audio"));
$('#series_languages').dropdown('clear');
var languages_array = eval($(this).data("languages"));
$('#series_languages').dropdown('set selected',languages_array);
if ($(this).data("hearing-impaired") == "True") {
$("#series_hearing-impaired_div").checkbox('check');
} else {
$("#series_hearing-impaired_div").checkbox('uncheck');
}
$('.small.modal').modal('show');
})
</script>