Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vue to all pages and convert all links to app-link #3884

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run_tests(self):
'pep8-naming',
'pytest',
'pytest-cov',
'pytest-flake8',
'pytest-flake8==0.9.1',
'pytest-tornado',
'PyYAML',
'mock',
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/views/500.mako
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If this happened during an update a simple page refresh may be the solution.<br>
Mako errors that happen during updates may be a one time error if there were significant ui changes.<br>
</p>
<hr>
<a href="#mako-error" class="btn btn-default" data-toggle="collapse">Show/Hide Error</a>
<app-link href="#mako-error" class="btn btn-default" data-toggle="collapse">Show/Hide Error</app-link>
<div id="mako-error" class="collapse">
<br>
<div class="align-center">
Expand Down
12 changes: 6 additions & 6 deletions themes-default/slim/views/addRecommended.mako
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@

<div id="addShowPortal">
<br><br>
<a href="addShows/trendingShows/?traktList=anticipated" id="btnNewShow" class="btn btn-large">
<app-link href="addShows/trendingShows/?traktList=anticipated" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="add-list-icon-addtrakt"></div></div>
<div class="buttontext">
<h3>Add From Trakt Lists</h3>
<p>For shows that you haven't downloaded yet, this option lets you choose from a show from one of the Trakt lists to add to Medusa .</p>
</div>
</a>
</app-link>

<a href="addShows/popularShows/" id="btnNewShow" class="btn btn-large">
<app-link href="addShows/popularShows/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="add-list-icon-addimdb"></div></div>
<div class="buttontext">
<h3>Add From IMDB's Popular Shows</h3>
<p>View IMDB's list of the most popular shows. This feature uses IMDB's MOVIEMeter algorithm to identify popular TV Series.</p>
</div>
</a>
</app-link>

<a href="addShows/popularAnime/" id="btnNewShow" class="btn btn-large">
<app-link href="addShows/popularAnime/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="add-list-icon-addanime"></div></div>
<div class="buttontext">
<h3>Add From Anidb's Hot Anime list</h3>
<p>View Anidb's list of the most popular anime shows. Anidb provides lists for Popular Anime, using the "Hot Anime" list.</p>
</div>
</a>
</app-link>

</div>
</%block>
21 changes: 17 additions & 4 deletions themes-default/slim/views/addShows.mako
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,40 @@
import urllib
from medusa import app
%>
<%block name="scripts">
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
% if not header is UNDEFINED:
<h1 class="header">${header}</h1>
% else:
<h1 class="title">${title}</h1>
% endif
<div id="addShowPortal">
<a href="addShows/newShow/" id="btnNewShow" class="btn btn-large">
<app-link href="addShows/newShow/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="add-list-icon-addnewshow"></div></div>
<div class="buttontext">
<h3>Add New Show</h3>
<p>For shows that you haven't downloaded yet, this option finds a show on your preferred indexer, creates a directory for it's episodes, and adds it to Medusa.</p>
</div>
</a>
</app-link>

<a href="addShows/existingShows/" id="btnExistingShow" class="btn btn-large">
<app-link href="addShows/existingShows/" id="btnExistingShow" class="btn btn-large">
<div class="button"><div class="add-list-icon-addexistingshow"></div></div>
<div class="buttontext">
<h3>Add Existing Shows</h3>
<p>Use this option to add shows that already have a folder created on your hard drive. Medusa will scan your existing metadata/episodes and add the show accordingly.</p>
</div>
</a>
</app-link>
</div>
</%block>
17 changes: 14 additions & 3 deletions themes-default/slim/views/addShows_addExistingShow.mako
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<%block name="scripts">
<script type="text/javascript" src="js/quality-chooser.js?${sbPID}"></script>
<script type="text/javascript" src="js/add-show-options.js?${sbPID}"></script>
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
% if not header is UNDEFINED:
Expand All @@ -14,13 +25,13 @@
% endif
<div id="newShowPortal">
<div id="config-components">
<ul><li><a href="${full_url}#core-component-group1">Add Existing Show</a></li></ul>
<ul><li><app-link href="#core-component-group1">Add Existing Show</app-link></li></ul>
<div id="core-component-group1" class="tab-pane active component-group">
<form id="addShowForm" method="post" action="addShows/addExistingShows" accept-charset="utf-8">
<div id="tabs">
<ul>
<li><a href="${base_url}addShows/existingShows/#tabs-1">Manage Directories</a></li>
<li><a href="${base_url}addShows/existingShows/#tabs-2">Customize Options</a></li>
<li><app-link href="addShows/existingShows/#tabs-1">Manage Directories</app-link></li>
<li><app-link href="addShows/existingShows/#tabs-2">Customize Options</app-link></li>
</ul>
<div id="tabs-1" class="existingtabs">
<%include file="/inc_rootDirs.mako"/>
Expand Down
15 changes: 13 additions & 2 deletions themes-default/slim/views/addShows_newShow.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
<script type="text/javascript" src="js/quality-chooser.js?${sbPID}"></script>
<script type="text/javascript" src="js/add-show-options.js?${sbPID}"></script>
<script type="text/javascript" src="js/blackwhite.js?${sbPID}"></script>
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
% if not header is UNDEFINED:
Expand All @@ -17,7 +28,7 @@
% endif
<div id="newShowPortal">
<div id="config-components">
<ul><li><a href="${full_url}#core-component-group1">Add New Show</a></li></ul>
<ul><li><app-link href="#core-component-group1">Add New Show</app-link></li></ul>
<div id="core-component-group1" class="tab-pane active component-group">
<div id="displayText"></div>
<br>
Expand All @@ -27,7 +38,7 @@
<div class="stepDiv">
<input type="hidden" id="indexer_timeout" value="${app.INDEXER_TIMEOUT}" />
% if use_provided_info:
Show retrieved from existing metadata: <a href="${anon_url(indexerApi(provided_indexer).config['show_url'], provided_indexer_id)}">${provided_indexer_name}</a>
Show retrieved from existing metadata: <app-link href="${anon_url(indexerApi(provided_indexer).config['show_url'], provided_indexer_id)}">${provided_indexer_name}</app-link>
<input type="hidden" id="indexer_lang" name="indexer_lang" value="en" />
<input type="hidden" id="whichSeries" name="whichSeries" value="${provided_indexer_id}" />
<input type="hidden" id="providedIndexer" name="providedIndexer" value="${provided_indexer}" />
Expand Down
27 changes: 19 additions & 8 deletions themes-default/slim/views/addShows_recommended.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
% if enable_anime_options:
<script type="text/javascript" src="js/blackwhite.js?${sbPID}"></script>
% endif
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
<div class="row">
Expand Down Expand Up @@ -37,8 +48,8 @@
<div class="field-pair">
<label class="clearfix" for="configure_show_options">
<ul>
<li><a href="${base_url + 'addShows/' + realpage + '/'}#tabs-1">Manage Directories</a></li>
<li><a href="${base_url + 'addShows/' + realpage + '/'}#tabs-2">Customize Options</a></li>
<li><app-link href="addShows/${'realpage + '/'}#tabs-1">Manage Directories</app-link></li>
<li><app-link href="addShows/${'realpage + '/'}#tabs-2">Customize Options</app-link></li>
</ul>
<div id="tabs-1" class="existingtabs">
<%include file="/inc_rootDirs.mako"/>
Expand Down Expand Up @@ -114,9 +125,9 @@
<div class="show-row" data-name="${cur_show.title}" data-rating="${cur_rating}" data-votes="${cur_votes}" data-anime="${cur_show.is_anime}">
<div class="recommended-container default-poster ${('', 'show-in-list')[cur_show.show_in_list or cur_show.mapped_series_id in removed_from_medusa]}">
<div class="recommended-image">
<a href="${anon_url(cur_show.image_href)}" target="_blank">
<app-link href="${anon_url(cur_show.image_href)}" target="_blank">
<img alt="" class="recommended-image" src="images/poster.png" data-original="${cur_show.image_src}" height="273px" width="186px"/>
</a>
</app-link>
</div>
<div id="check-overlay"></div>

Expand All @@ -127,23 +138,23 @@
<div class="clearfix show-attributes">
<p>${int(float(cur_rating)*10)}% <img src="images/heart.png">
% if cur_show.is_anime and cur_show.ids.get('aid'):
<a class="anidb-url" href='${anon_url("https://anidb.net/a{0}".format(cur_show.ids["aid"]))}'>
<app-link class="anidb-url" href='${anon_url("https://anidb.net/a{0}".format(cur_show.ids["aid"]))}'>
<img src="images/anidb_inline_refl.png" class="anidb-inline" alt=""/>
</a>
</app-link>
% endif
</p>
<i>${cur_votes} votes</i>

<div class="recommendedShowTitleIcons">
% if cur_show.show_in_list:
<button class="btn btn-xs"><a href="home/displayShow?indexername=${cur_show.mapped_indexer_name}&seriesid=${cur_show.mapped_series_id}">In List</a></button>
<button class="btn btn-xs"><app-link href="home/displayShow?indexername=${cur_show.mapped_indexer_name}&seriesid=${cur_show.mapped_series_id}">In List</app-link></button>
% else:
<button class="btn btn-xs" data-isanime="1" data-indexer="${cur_show.mapped_indexer_name}"
data-indexer-id="${cur_show.mapped_series_id}" data-show-name="${cur_show.title | u}"
data-add-show>Add</button>
% endif
% if cur_show.mapped_series_id in removed_from_medusa:
<button class="btn btn-xs"><a href="home/displayShow?indexername=${cur_show.mapped_indexer_name}&seriesid=${cur_show.mapped_series_id}">Watched</a></button>
<button class="btn btn-xs"><app-link href="home/displayShow?indexername=${cur_show.mapped_indexer_name}&seriesid=${cur_show.mapped_series_id}">Watched</app-link></button>
% endif
% if trakt_b and not (cur_show.show_in_list or cur_show.mapped_series_id in removed_from_medusa):
<button data-indexer-id="${cur_show.mapped_series_id}" class="btn btn-xs" data-blacklist-show>Blacklist</button>
Expand Down
15 changes: 13 additions & 2 deletions themes-default/slim/views/addShows_trendingShows.mako
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
% if enable_anime_options:
<script type="text/javascript" src="js/blackwhite.js?${sbPID}"></script>
% endif
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
<div class="row">
Expand Down Expand Up @@ -37,8 +48,8 @@
<div class="field-pair">
<label class="clearfix" for="configure_show_options">
<ul>
<li><a id="trakt-tab-1" href="${base_url + 'addShows/' + realpage + '/'}?traktList=${traktList}#tabs-1">Manage Directories</a></li>
<li><a id="trakt-tab-2" href="${base_url + 'addShows/' + realpage + '/'}?traktList=${traktList}#tabs-2">Customize Options</a></li>
<li><app-link id="trakt-tab-1" href="addShows/${'realpage + '/'}?traktList=${traktList}#tabs-1">Manage Directories</app-link></li>
<li><app-link id="trakt-tab-2" href="addShows/${'realpage + '/'}?traktList=${traktList}#tabs-2">Customize Options</app-link></li>
</ul>
<div id="tabs-1" class="existingtabs">
<%include file="/inc_rootDirs.mako"/>
Expand Down
24 changes: 8 additions & 16 deletions themes-default/slim/views/config.mako
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<tr v-if="release">
<td><i class="icon16-config-application"></i> Medusa Info:</td>
<td>
Branch: <a v-bind:href="sourceUrl + '/tree/' + branch" v-on:click="anonRedirect">{{branch}}</a><br>
Commit: <a v-bind:href="sourceUrl + '/commit/' + commitHash" v-on:click="anonRedirect">{{commitHash}}</a><br>
Version: <a v-bind:href="sourceUrl + '/releases/tag/' + release" v-on:click="anonRedirect">{{release}}</a><br>
Branch: <app-link :href="sourceUrl + '/tree/' + branch">{{branch}}</app-link><br>
Commit: <app-link :href="sourceUrl + '/commit/' + commitHash">{{commitHash}}</app-link><br>
Version: <app-link :href="sourceUrl + '/releases/tag/' + release">{{release}}</app-link><br>
Database: {{databaseVersion.major}}.{{databaseVersion.minor}}
</td>
</tr>
Expand All @@ -28,34 +28,26 @@
<tr v-if="webRoot"><td><i class="icon16-config-folder"></i> Web Root:</td><td>{{webRoot}}</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr class="infoTableSeperator"><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td><i class="icon16-config-web"></i> Website:</td><td><a v-bind:href="githubUrl" rel="noreferrer" v-on:click="anonRedirect">{{githubUrl}}</a></td></tr>
<tr><td><i class="icon16-config-wiki"></i> Wiki:</td><td><a v-bind:href="wikiUrl" rel="noreferrer" v-on:click="anonRedirect">{{wikiUrl}}</a></td></tr>
<tr><td><i class="icon16-config-github"></i> Source:</td><td><a v-bind:href="sourceUrl" rel="noreferrer" v-on:click="anonRedirect">{{sourceUrl}}</a></td></tr>
<tr><td><i class="icon16-config-mirc"></i> IRC Chat:</td><td><a href="irc://irc.freenode.net/#pymedusa" rel="noreferrer"><i>#pymedusa</i> on <i>irc.freenode.net</i></a></td></tr>
<tr><td><i class="icon16-config-web"></i> Website:</td><td><app-link :href="githubUrl">{{githubUrl}}</app-link></td></tr>
<tr><td><i class="icon16-config-wiki"></i> Wiki:</td><td><app-link :href="wikiUrl">{{wikiUrl}}</app-link></td></tr>
<tr><td><i class="icon16-config-github"></i> Source:</td><td><app-link :href="sourceUrl">{{sourceUrl}}</app-link></td></tr>
<tr><td><i class="icon16-config-mirc"></i> IRC Chat:</td><td><app-link href="irc://irc.freenode.net/#pymedusa" rel="noreferrer"><i>#pymedusa</i> on <i>irc.freenode.net</i></app-link></td></tr>
</table>
</div>
</%block>
<%block name="scripts">
<script src="js/lib/vue.js"></script>
<script src="js/lib/axios.min.js"></script>
<script src="js/lib/lodash.min.js"></script>
<script>
var app;
var startVue = function(){
app = new Vue({
el: '#config-content',
el: '#vue-wrap',
data: MEDUSA.config,
methods: {
anonRedirect: function(e){
e.preventDefault();
window.open(MEDUSA.info.anonRedirect + e.target.href, '_blank');
},
prettyPrintJSON: function(x){
return JSON.stringify(x, undefined, 4)
}
}
});
$('[v-cloak]').removeAttr('v-cloak');
};
</script>
</%block>
Expand Down
19 changes: 16 additions & 3 deletions themes-default/slim/views/config_anime.mako
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
from medusa import app
from medusa.helpers import anon_url
%>
<%block name="scripts">
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
<div id="content960">
<h1 class="header">${header}</h1>
Expand All @@ -11,14 +24,14 @@
<form id="configForm" action="config/anime/saveAnime" method="post">
<div id="config-components">
<ul>
<li><a href="${full_url}#animedb-settings">AnimeDB Settings</a></li>
<li><a href="${full_url}#anime-look-feel">Look &amp; Feel</a></li>
<li><app-link href="#animedb-settings">AnimeDB Settings</app-link></li>
<li><app-link href="#anime-look-feel">Look &amp; Feel</app-link></li>
</ul>
<div id="animedb-settings" class="tab-pane active component-group">
<div class="component-group-desc">
<span class="icon-notifiers-anime" title="AniDB"></span>
<h3>
<a href="${anon_url('http://anidb.info')}" onclick="window.open(this.href, '_blank'); return false;">AniDB</a>
<app-link href="${anon_url('http://anidb.info')}" onclick="window.open(this.href, '_blank'); return false;">AniDB</app-link>
</h3>
<p>AniDB is non-profit database of anime information that is freely open to the public</p>
</div><!-- .component-group-desc //-->
Expand Down
17 changes: 15 additions & 2 deletions themes-default/slim/views/config_backuprestore.mako
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
from medusa import metadata
from medusa.metadata.generic import GenericMetadata
%>
<%block name="scripts">
<script>
let app;
const startVue = () => {
app = new Vue({
el: '#vue-wrap',
data() {
return {};
}
});
};
</script>
</%block>
<%block name="content">
% if not header is UNDEFINED:
<h1 class="header">${header}</h1>
Expand All @@ -25,8 +38,8 @@
<form name="configForm" method="post" action="config/backuprestore">
<div id="config-components">
<ul>
<li><a href="${full_url}#backup">Backup</a></li>
<li><a href="${full_url}#restore">Restore</a></li>
<li><app-link href="#backup">Backup</app-link></li>
<li><app-link href="#restore">Restore</app-link></li>
</ul>
<div id="backup" class="component-group clearfix">
<div class="component-group-desc">
Expand Down
Loading