Skip to content

Commit

Permalink
More /home routes
Browse files Browse the repository at this point in the history
* /home/snatchSelection
* /home/testRename
* /home/postprocess
* /home/status
  • Loading branch information
sharkykh committed Aug 21, 2018
1 parent 1d5eff9 commit 06b52e7
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 161 deletions.
8 changes: 0 additions & 8 deletions themes-default/slim/src/components/manual-post-process.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
export default {
name: 'manual-post-process',
template: '#manual-post-process-template',
metaInfo: {
title: 'Post Processing'
},
data() {
return {
header: 'Post Processing'
};
},
mounted() {
$('#episodeDir').fileBrowser({
title: 'Select Unprocessed Episode Folder',
Expand Down
17 changes: 17 additions & 0 deletions themes-default/slim/src/components/snatch-selection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ export default {
components: {
AppLink
},
metaInfo() {
if (!this.show || !this.show.title) {
return {
title: 'Medusa'
};
}
const { title } = this.show;
return {
title,
titleTemplate: '%s | Medusa'
};
},
computed: {
...mapState({
shows: state => state.shows.shows
Expand Down Expand Up @@ -43,6 +55,11 @@ export default {
return show;
}
},
created() {
const { indexer, id, $store } = this;
// Needed for the title
$store.dispatch('getShow', { indexer, id });
},
mounted() {
window.addEventListener('load', () => {
// Adjust the summary background position and size
Expand Down
23 changes: 23 additions & 0 deletions themes-default/slim/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ const homeRoutes = {
}, {
path: 'displayShow',
name: 'displayShow'
}, {
path: 'snatchSelection',
name: 'snatchSelection'
}, {
path: 'testRename',
name: 'testRename',
meta: {
title: 'Preview Rename',
header: 'Preview Rename'
}
}, {
path: 'postprocess',
name: 'postprocess',
meta: {
title: 'Manual Post-Processing',
header: 'Manual Post-Processing'
}
}, {
path: 'status',
name: 'status',
meta: {
title: 'Status'
}
}]
};

Expand Down
3 changes: 2 additions & 1 deletion themes-default/slim/views/home_postprocess.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div>
<div class="row">
<div class="col-md-12">
<h1 class="header">{{header}}</h1>
<h1 class="header">{{ $route.meta.header }}</h1>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -112,6 +112,7 @@ window.app = {};
window.app = new Vue({
el: '#vue-wrap',
store,
router,
data() {
return {
// This loads manual-post-process.vue
Expand Down
87 changes: 39 additions & 48 deletions themes-default/slim/views/testRename.mako
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,54 @@
<%block name="scripts">
<script>
window.app = {};
const startVue = () => {
window.app = new Vue({
store,
el: '#vue-wrap',
metaInfo: {
title: 'Preview Rename'
},
data() {
return {
header: 'Preview Rename'
};
},
mounted() {
$('.seriesCheck').on('click', function() {
const serCheck = this;
window.app = new Vue({
store,
router,
el: '#vue-wrap',
mounted() {
$('.seriesCheck').on('click', function() {
const serCheck = this;
$('.seasonCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.seasonCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.epCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.epCheck:visible').each(function() {
this.checked = serCheck.checked;
});
});
$('.seasonCheck').on('click', function() {
const seasCheck = this;
const seasNo = $(seasCheck).attr('id');
$('.seasonCheck').on('click', function() {
const seasCheck = this;
const seasNo = $(seasCheck).attr('id');
const seasonIdentifier = 's' + seasNo;
$('.epCheck:visible').each(function() {
const epParts = $(this).attr('id').split('e');
if (epParts[0] === seasonIdentifier) {
this.checked = seasCheck.checked;
}
});
const seasonIdentifier = 's' + seasNo;
$('.epCheck:visible').each(function() {
const epParts = $(this).attr('id').split('e');
if (epParts[0] === seasonIdentifier) {
this.checked = seasCheck.checked;
}
});
});
$('input[type=submit]').on('click', () => {
const epArr = [];
$('.epCheck').each(function() {
if (this.checked === true) {
epArr.push($(this).attr('id'));
}
});
$('input[type=submit]').on('click', () => {
const epArr = [];
if (epArr.length === 0) {
return false;
$('.epCheck').each(function() {
if (this.checked === true) {
epArr.push($(this).attr('id'));
}
window.location.href = $('base').attr('href') + 'home/doRename?indexername=' + $('#indexer-name').attr('value') +
'&seriesid=' + $('#series-id').attr('value') + '&eps=' + epArr.join('|');
});
}
});
};
if (epArr.length === 0) {
return false;
}
window.location.href = $('base').attr('href') + 'home/doRename?indexername=' + $('#indexer-name').attr('value') +
'&seriesid=' + $('#series-id').attr('value') + '&eps=' + epArr.join('|');
});
}
});
</script>
</%block>
<%block name="content">
Expand All @@ -82,7 +73,7 @@ const startVue = () => {
<input type="hidden" id="series-id" value="${show.indexerid}" />
<input type="hidden" id="indexer-name" value="${show.indexer_name}" />
<input type="hidden" id="series-slug" value="${show.slug}" />
<h1 class="header">{{header}}</h1>
<h1 class="header">{{ $route.meta.header }}</h1>
<h3>Preview of the proposed name changes</h3>
<blockquote>
% if int(show.air_by_date) == 1 and app.NAMING_CUSTOM_ABD:
Expand Down
6 changes: 3 additions & 3 deletions themes/dark/assets/js/vendors.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion themes/dark/templates/home_postprocess.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div>
<div class="row">
<div class="col-md-12">
<h1 class="header">{{header}}</h1>
<h1 class="header">{{ $route.meta.header }}</h1>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -112,6 +112,7 @@ window.app = {};
window.app = new Vue({
el: '#vue-wrap',
store,
router,
data() {
return {
// This loads manual-post-process.vue
Expand Down
87 changes: 39 additions & 48 deletions themes/dark/templates/testRename.mako
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,54 @@
<%block name="scripts">
<script>
window.app = {};
const startVue = () => {
window.app = new Vue({
store,
el: '#vue-wrap',
metaInfo: {
title: 'Preview Rename'
},
data() {
return {
header: 'Preview Rename'
};
},
mounted() {
$('.seriesCheck').on('click', function() {
const serCheck = this;
window.app = new Vue({
store,
router,
el: '#vue-wrap',
mounted() {
$('.seriesCheck').on('click', function() {
const serCheck = this;
$('.seasonCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.seasonCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.epCheck:visible').each(function() {
this.checked = serCheck.checked;
});
$('.epCheck:visible').each(function() {
this.checked = serCheck.checked;
});
});
$('.seasonCheck').on('click', function() {
const seasCheck = this;
const seasNo = $(seasCheck).attr('id');
$('.seasonCheck').on('click', function() {
const seasCheck = this;
const seasNo = $(seasCheck).attr('id');
const seasonIdentifier = 's' + seasNo;
$('.epCheck:visible').each(function() {
const epParts = $(this).attr('id').split('e');
if (epParts[0] === seasonIdentifier) {
this.checked = seasCheck.checked;
}
});
const seasonIdentifier = 's' + seasNo;
$('.epCheck:visible').each(function() {
const epParts = $(this).attr('id').split('e');
if (epParts[0] === seasonIdentifier) {
this.checked = seasCheck.checked;
}
});
});
$('input[type=submit]').on('click', () => {
const epArr = [];
$('.epCheck').each(function() {
if (this.checked === true) {
epArr.push($(this).attr('id'));
}
});
$('input[type=submit]').on('click', () => {
const epArr = [];
if (epArr.length === 0) {
return false;
$('.epCheck').each(function() {
if (this.checked === true) {
epArr.push($(this).attr('id'));
}
window.location.href = $('base').attr('href') + 'home/doRename?indexername=' + $('#indexer-name').attr('value') +
'&seriesid=' + $('#series-id').attr('value') + '&eps=' + epArr.join('|');
});
}
});
};
if (epArr.length === 0) {
return false;
}
window.location.href = $('base').attr('href') + 'home/doRename?indexername=' + $('#indexer-name').attr('value') +
'&seriesid=' + $('#series-id').attr('value') + '&eps=' + epArr.join('|');
});
}
});
</script>
</%block>
<%block name="content">
Expand All @@ -82,7 +73,7 @@ const startVue = () => {
<input type="hidden" id="series-id" value="${show.indexerid}" />
<input type="hidden" id="indexer-name" value="${show.indexer_name}" />
<input type="hidden" id="series-slug" value="${show.slug}" />
<h1 class="header">{{header}}</h1>
<h1 class="header">{{ $route.meta.header }}</h1>
<h3>Preview of the proposed name changes</h3>
<blockquote>
% if int(show.air_by_date) == 1 and app.NAMING_CUSTOM_ABD:
Expand Down
6 changes: 3 additions & 3 deletions themes/light/assets/js/vendors.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion themes/light/templates/home_postprocess.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div>
<div class="row">
<div class="col-md-12">
<h1 class="header">{{header}}</h1>
<h1 class="header">{{ $route.meta.header }}</h1>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -112,6 +112,7 @@ window.app = {};
window.app = new Vue({
el: '#vue-wrap',
store,
router,
data() {
return {
// This loads manual-post-process.vue
Expand Down
Loading

0 comments on commit 06b52e7

Please sign in to comment.