episode_statuses.mako 7.56 KB
Newer Older
echel0n's avatar
echel0n committed
1
2
3
4
5
6
7
8
<%inherit file="../layouts/main.mako"/>
<%!
    import sickrage
    from sickrage.core.common import DOWNLOADED, SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, FAILED
    from sickrage.core.common import statusStrings, Quality, Overview
%>
<%block name="content">
    <div class="row">
9
        <div class="col-md-10 mx-auto">
echel0n's avatar
echel0n committed
10
            <div class="card mt-3 mb-3">
echel0n's avatar
echel0n committed
11
                <div class="card-header">
echel0n's avatar
echel0n committed
12
                    <h3>${title}</h3>
echel0n's avatar
echel0n committed
13
                </div>
echel0n's avatar
echel0n committed
14
15
16
17
18
19
20
21
22
23
24
                <div class="card-body">
                    % if not whichStatus or (whichStatus and not ep_counts):
                    % if whichStatus:
                        <div class="row">
                            <div class="col-md-12">
                                <h2>
                                    ${_('None of your episodes have status')} ${statusStrings[int(whichStatus)]}
                                </h2>
                            </div>
                        </div>
                    % endif
echel0n's avatar
echel0n committed
25

echel0n's avatar
echel0n committed
26
27
28
29
30
31
32
33
34
35
36
                        <form action="${srWebRoot}/manage/episodeStatuses">
                            <label for="whichStatus">${_('Manage episodes with status')}</label>
                            <div class="input-group">
                                <select name="whichStatus" id="whichStatus" class="form-control shadow">
                                    % for curStatus in [SKIPPED, SNATCHED, WANTED, IGNORED] + Quality.DOWNLOADED + Quality.ARCHIVED:
                                        %if curStatus not in [ARCHIVED, DOWNLOADED]:
                                            <option value="${curStatus}">${statusStrings[curStatus]}</option>
                                        %endif
                                    % endfor
                                </select>
                                <div class="input-group-append">
echel0n's avatar
echel0n committed
37
                                    <input class="btn" type="submit" value="${_('Manage')}"/>
echel0n's avatar
echel0n committed
38
39
40
41
42
43
                                </div>
                            </div>
                        </form>
                    % else:
                        <form action="${srWebRoot}/manage/changeEpisodeStatuses" method="post">
                            <input type="hidden" id="oldStatus" name="oldStatus" value="${whichStatus}"/>
echel0n's avatar
echel0n committed
44

echel0n's avatar
echel0n committed
45
46
47
48
49
50
51
                            <div class="row">
                                <div class="col-md-12">
                                    <h2>
                                        ${_('Shows containing')} ${statusStrings[int(whichStatus)]} ${_('episodes')}
                                    </h2>
                                </div>
                            </div>
echel0n's avatar
echel0n committed
52

echel0n's avatar
echel0n committed
53
                            <br>
echel0n's avatar
echel0n committed
54

echel0n's avatar
echel0n committed
55
56
57
58
59
60
61
62
                            <div class="row">
                                <div class="col-md-12">
                                    <%
                                        if int(whichStatus) in [IGNORED, SNATCHED] + Quality.DOWNLOADED + Quality.ARCHIVED:
                                            row_class = "good"
                                        else:
                                            row_class = Overview.overviewStrings[int(whichStatus)]
                                    %>
echel0n's avatar
echel0n committed
63

echel0n's avatar
echel0n committed
64
                                    <input type="hidden" id="row_class" value="${row_class}"/>
echel0n's avatar
echel0n committed
65

echel0n's avatar
echel0n committed
66
67
68
69
70
71
72
73
74
75
                                    <label for="newStatus">${_('Set checked shows/episodes to')}</label>
                                    <div class="input-group">
                                        <select name="newStatus" id="newStatus" class="form-control">
                                            <%
                                                statusList = [SKIPPED, WANTED, IGNORED] + Quality.DOWNLOADED + Quality.ARCHIVED
                                                # Do not allow setting to bare downloaded or archived!
                                                statusList.remove(DOWNLOADED)
                                                statusList.remove(ARCHIVED)
                                                if int(whichStatus) in statusList:
                                                    statusList.remove(int(whichStatus))
echel0n's avatar
echel0n committed
76

echel0n's avatar
echel0n committed
77
78
79
                                                if int(whichStatus) in [SNATCHED, SNATCHED_PROPER, SNATCHED_BEST] + Quality.ARCHIVED + Quality.DOWNLOADED:
                                                    statusList.append(FAILED)
                                            %>
echel0n's avatar
echel0n committed
80

echel0n's avatar
echel0n committed
81
82
83
84
85
                                            % for curStatus in statusList:
                                                <option value="${curStatus}">${statusStrings[curStatus]}</option>
                                            % endfor
                                        </select>
                                        <div class="input-group-append">
echel0n's avatar
echel0n committed
86
                                            <input class="btn" type="submit" value="${_('Go')}"/>
echel0n's avatar
echel0n committed
87
88
89
90
91
92
93
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <br/>
                            <div class="row">
                                <div class="col-md-12">
echel0n's avatar
echel0n committed
94
95
                                    <button class="btn selectAllShows">${_('Select All')}</button>
                                    <button class="btn unselectAllShows">${_('Clear All')}</button>
echel0n's avatar
echel0n committed
96
97
                                </div>
                            </div>
echel0n's avatar
echel0n committed
98
                            <br/>
echel0n's avatar
echel0n committed
99
100
                            <div class="row">
                                <div class="col-md-12">
echel0n's avatar
echel0n committed
101
                                    <table class="table">
echel0n's avatar
echel0n committed
102
103
104
105
106
107
108
109
110
                                        % for cur_indexer_id in sorted_show_ids:
                                            <tr id="${cur_indexer_id}">
                                                <th>
                                                    <input type="checkbox" class="allCheck"
                                                           id="allCheck-${cur_indexer_id}"
                                                           title="${show_names[cur_indexer_id]}"
                                                           name="${cur_indexer_id}-all" checked/>
                                                </th>
                                                <th colspan="2" style="width: 100%; text-align: left;">
echel0n's avatar
echel0n committed
111
                                                    <a class="text-white" href="${srWebRoot}/home/displayShow?show=${cur_indexer_id}">
echel0n's avatar
echel0n committed
112
113
                                                        ${show_names[cur_indexer_id]}
                                                    </a>
echel0n's avatar
echel0n committed
114
                                                    (<span class="text-info">${ep_counts[cur_indexer_id]}</span>)
echel0n's avatar
echel0n committed
115
                                                    <input type="button" class="btn btn-sm get_more_eps"
echel0n's avatar
echel0n committed
116
                                                           id="${cur_indexer_id}" value="${_('Expand')}"/>
echel0n's avatar
echel0n committed
117
118
119
120
                                                </th>
                                            </tr>
                                        % endfor
                                        <tr>
echel0n's avatar
echel0n committed
121
122
123
                                            <td></td>
                                            <td></td>
                                            <td></td>
echel0n's avatar
echel0n committed
124
125
126
127
128
129
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </form>
                    % endif
echel0n's avatar
echel0n committed
130
131
                </div>
            </div>
echel0n's avatar
echel0n committed
132
133
        </div>
    </div>
echel0n's avatar
echel0n committed
134
</%block>