1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
<html>
<head>
<!DOCTYPE html>
<style>
#divmenu {
background-color: #000000;
opacity: 0.8;
padding-top: 2em;
padding-bottom: 1em;
padding-left: 1em;
padding-right: 128px;
}
.prompt {
background-color: #333333 !important;
color: white !important;
border-radius: 3px !important;
}
.searchicon {
color: white !important;
}
</style>
</head>
<body>
% from get_argv import config_dir
% import os
% import sqlite3
% from get_settings import get_general_settings
%if get_general_settings()[24] is True:
% monitored_only_query_string = ' AND monitored = "True"'
%else:
% monitored_only_query_string = ""
%end
% conn = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30)
% c = conn.cursor()
% wanted_series = c.execute("SELECT COUNT(*) FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
% wanted_movies = c.execute("SELECT COUNT(*) FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
<div id="divmenu" class="ui container">
<div class="ui grid">
<div class="middle aligned row">
<div class="three wide column">
<a href="{{base_url}}"><img class="logo" src="{{base_url}}static/logo128.png"></a>
</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="row">
<div class="sixteen wide column">
<div class="ui inverted borderless labeled icon massive menu six item">
<div class="ui container">
% if get_general_settings()[12] is True:
<a class="item" href="{{base_url}}series">
<i class="play icon"></i>
Series
</a>
% end
% if get_general_settings()[13] is True:
<a class="item" href="{{base_url}}movies">
<i class="film icon"></i>
Movies
</a>
% end
<a class="item" href="{{base_url}}history">
<i class="wait icon"></i>
History
</a>
<a class="item" href="{{base_url}}wanted">
<i class="warning sign icon">
% if get_general_settings()[12] is True:
<div class="floating ui tiny yellow label" style="left:90% !important;top:0.5em !important;">
{{wanted_series[0]}}
</div>
% end
% if get_general_settings()[13] is True:
<div class="floating ui tiny green label" style="left:90% !important;top:3em !important;">
{{wanted_movies[0]}}
</div>
% end
</i>
Wanted
</a>
<a class="item" href="{{base_url}}settings">
<i class="settings icon"></i>
Settings
</a>
<a class="item" href="{{base_url}}system">
<i class="laptop icon"></i>
System
</a>
</div>
</div>
</div>
</div>
<div style='padding-top:0rem;' class="row">
<div class="three wide column"></div>
<div class="ten wide column">
<div class="ui search">
<div class="ui left icon fluid input">
<input class="prompt" type="text" placeholder="Search the series in your library">
<i class="searchicon search icon"></i>
</div>
</div>
</div>
<div class="three wide column"></div>
</div>
</div>
</div>
</div>
</div>
</div>
% restart_required = c.execute("SELECT configured, updated FROM system").fetchone()
% c.close()
% if restart_required[1] == '1' and restart_required[0] == '1':
<div class='ui center aligned grid'><div class='fifteen wide column'><div class="ui red message">Bazarr need to be restarted to apply last update and changes to general settings.</div></div></div>
% elif restart_required[1] == '1':
<div class='ui center aligned grid'><div class='fifteen wide column'><div class="ui red message">Bazarr need to be restarted to apply last update.</div></div></div>
% elif restart_required[0] == '1':
<div class='ui center aligned grid'><div class='fifteen wide column'><div class="ui red message">Bazarr need to be restarted to apply changes to general settings.</div></div></div>
% end
</body>
</html>
<script>
$('.ui.search')
.search({
apiSettings: {
url: '{{base_url}}search_json/{query}',
onResponse: function(results) {
var response = {
results : []
};
$.each(results.items, function(index, item) {
response.results.push({
title : item.name,
url : item.url
});
});
return response;
}
},
minCharacters : 2
})
;
if (window.location.href.indexOf("episodes") > -1) {
$('.menu').css('background', '#000000');
$('#divmenu').css('background', '#000000');
}
else {
$('.menu').css('background', '#272727');
$('#divmenu').css('background', '#272727');
}
</script>
|