summaryrefslogtreecommitdiffhomepage
path: root/views/movieseditor.tpl
blob: bc3e96f98423bc9622021a5cea71bc0fc2251211 (plain)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<html>
	<head>
		<!DOCTYPE html>
		<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">

		<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">
		<meta name="theme-color" content="#ffffff">

		<title>Movies Editor - Bazarr</title>

		<style>
			body {
				background-color: #272727;
			}
			#fondblanc {
				background-color: #ffffff;
				border-radius: 0px;
				box-shadow: 0px 0px 5px 5px #ffffff;
				margin-top: 32px;
				margin-bottom: 3em;
				padding: 2em 3em 2em 3em;
			}
			#tablemovies {
				padding-top: 1em;
			}
			#divdetails {
				min-height: 250px;
			}
			#bottommenu {
				background-color: #333333;
				box-shadow: 0 0 10px 1px #333;
				padding: 10px;
			}
			#bottomform {
				width: 100%;
				padding-left: 8em;
				margin-bottom: -1em !important;
			}
		</style>
	</head>
	<body>
		<div id='loader' class="ui page dimmer">
			<div class="ui indeterminate text loader">Loading...</div>
		</div>
		% include('menu.tpl')

		<div id="fondblanc" class="ui container">
			<table id="tablemovies" class="ui very basic selectable sortable table">
				<thead>
					<tr>
						<th class="no-sort collapsing">
							<div class="ui checkbox">
								<input id='selectall' type="checkbox">
								<label></label>
							</div>
						</th>
						<th class="sorted ascending">Name</th>
						<th>Audio language</th>
						<th>Subtitles languages</th>
						<th>Hearing-impaired</th>
					</tr>
				</thead>
				<tbody>
				%import ast
				%import os
				%for row in rows:
					<tr class="selectable">
						<td class="collapsing">
							<div class="ui checkbox">
								<input id='{{row[5]}}' type="checkbox" class="selected">
								<label></label>
							</div>
						</td>
						<td><a href="{{base_url}}movie/{{row[5]}}">{{row[1]}}</a></td>
						<td>{{row[7]}}</td>
						<td>
							%subs_languages = ast.literal_eval(str(row[3]))
							%if subs_languages is not None:
								%for subs_language in subs_languages:
									<div class="ui tiny label">{{subs_language}}</div>
								%end
							%end
						</td>
						<td>{{!"" if row[4] == None else row[4]}}</td>
					</tr>
				%end
				</tbody>
			</table>
		</div>
		<div id='bottommenu' class="ui inverted bottom fixed menu">
			<form id='bottomform' action="{{base_url}}edit_movieseditor" method="POST" class="ui form">
				<input type="hidden" name="movies" id="checked" />
				<div class="fields">
			    	<div class="eight wide field">
			      		<label style='color: white;'>Subtitles languages</label>
			      		<select name="languages" {{!'multiple="" ' if single_language is False else ''}}class="select ui disabled selection dropdown">
			                <option value="">No change</option>
			                <option value="None">None</option>
			                %for language in languages:
							<option value="{{language[0]}}">{{language[1]}}</option>
							%end
			            </select>
			    	</div>
			    	<div class="field">
			    		<label style='color: white;'>Hearing-impaired</label>
			    		<select name="hearing_impaired" class="select ui disabled selection dropdown">
			                <option value="">No change</option>
			                <option value="True">True</option>
			                <option value="False">False</option>
			            </select>
			    	</div>
			    	<div class='field'>
						<label style='color: white;'><span id='count'>0</span> movies selected</label>
						<button type="submit" id="save" name="save" value="save" class="ui disabled blue approve button">Save</button>
					</div>
				</div>
			</form>
		</div>

		% include('footer.tpl')
		<br><br><br><br>
	</body>
</html>


<script>
	if (sessionStorage.scrolly) {
		$(window).scrollTop(sessionStorage.scrolly);
		sessionStorage.clear();
	}

	$('table').tablesort();

	$('a, button').click(function(){
		$('#loader').addClass('active');
	})

	$('.modal')
		.modal({
			autofocus: false
		})
	;

	$('.selected').change(function() {
		$("#count").text($('.selected:checked').length);
		if ( $('.selected:checked').length > 0 ) {
			$('.select').removeClass('disabled');
			$('#save').removeClass('disabled');
		}
		else {
			$('.select').addClass('disabled');
			$('#save').addClass('disabled');
		}

		var result = [];
		$('.selected:checked').each(function(i){
			result.push($(this).attr('id'));
		});
		$("#checked").val(result);
	});

	$('#selectall').change(function() {
		if ( $('#selectall').is(":checked") ) {
			$('.selected').prop('checked', true).change();
		}
		else {
			$('.selected').prop('checked', false).change();
		}
	});

	$('.select').dropdown();
</script>