Commit 76c2230c authored by echel0n's avatar echel0n

Refactored display show view.

Fixed issue with gktorrent.
Fixed issue with newpct.
parent e54f2cc2
......@@ -35,17 +35,17 @@ module.exports = function (grunt) {
},
exec: {
// Translations
'crowdin_upload_sources': {cmd: 'venv\\Scripts\\crowdin-cli-py upload sources'},
'crowdin_upload_translations': {cmd: 'venv\\Scripts\\crowdin-cli-py upload translations'},
'crowdin_download_translations': {cmd: 'venv\\Scripts\\crowdin-cli-py download'},
'babel_extract': {cmd: 'venv\\Scripts\\python setup.py extract_messages'},
'babel_update': {cmd: 'venv\\Scripts\\python setup.py update_catalog'},
'babel_compile': {cmd: 'venv\\Scripts\\python setup.py compile_catalog'},
'crowdin_upload_sources': {cmd: 'crowdin-cli-py upload sources'},
'crowdin_upload_translations': {cmd: 'crowdin-cli-py upload translations'},
'crowdin_download_translations': {cmd: 'crowdin-cli-py download'},
'babel_extract': {cmd: 'python setup.py extract_messages'},
'babel_update': {cmd: 'python setup.py update_catalog'},
'babel_compile': {cmd: 'python setup.py compile_catalog'},
// PyPi Commands
'pypi_create': {cmd: 'venv\\Scripts\\python setup.py sdist bdist_wheel'},
'pypi_upload': {cmd: 'venv\\Scripts\\twine upload dist/*'},
'pypi_cleanup': {cmd: 'venv\\Scripts\\python setup.py clean'},
'pypi_create': {cmd: 'python setup.py sdist bdist_wheel'},
'pypi_upload': {cmd: 'twine upload dist/*'},
'pypi_cleanup': {cmd: 'python setup.py clean'},
// Git Commands
'git': {
......
# Changelog
- * 9409223 - 2018-12-10: Release v9.4.53
- * 8ec11a1 - 2018-12-16: Refactored display show view. Fixed issue with gktorrent. Fixed issue with newpct.
- * 91bc24c - 2018-12-10: Release v9.4.53
- * 7dd5263 - 2018-12-09: Release v9.4.52
- * c65074d - 2018-12-09: Fixed issues with display show poster positioning
- * 65486af - 2018-12-09: Release v9.4.51
......
This diff is collapsed.
......@@ -66,6 +66,6 @@
"underscore": "^1.9.1",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"webpack-spritesmith": "^0.4.1"
"webpack-spritesmith": "^0.5.4"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -98,9 +98,12 @@
<nav class="navbar navbar-expand-lg navbar-dark navbar-default py-0">
<div class="container-fluid">
<a class="navbar-brand" href="${srWebRoot}/home/">
<a class="navbar-brand d-none d-xl-block" href="${srWebRoot}/home/">
<img alt="SiCKRAGE" src="${srWebRoot}/images/logo.png" style="width: 400px;height: 50px;"/>
</a>
<a class="navbar-brand d-xl-none" href="${srWebRoot}/home/">
<img alt="SiCKRAGE" src="${srWebRoot}/images/logo-badge.png" style="width: 50px;height: 50px;"/>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
......
......@@ -141,11 +141,12 @@ class GKTorrentProvider(TorrentProvider):
with bs4_parser(data) as html:
downloads = html.find('div', {'class': 'download'})
for download in downloads.findAll('a'):
link = download['href']
if link.startswith("magnet"):
links["magnet"] = link
else:
links["torrent"] = urljoin(self.urls['base_url'], link)
if downloads:
for download in downloads.findAll('a'):
link = download['href']
if link.startswith("magnet"):
links["magnet"] = link
else:
links["torrent"] = urljoin(self.urls['base_url'], link)
return links[download_type]
......@@ -141,8 +141,11 @@ class NewpctProvider(TorrentProvider):
if not link:
return results
title = unidecode(html.find('h1').get_text().split('/')[1])
title = self._process_title(title, link['href'])
try:
title = unidecode(html.find('h1').get_text().split('/')[1])
title = self._process_title(title, link['href'])
except Exception:
title = None
try:
download_url = self.urls['download'] % re.search(
......
......@@ -53,6 +53,31 @@ $(document).ready(function ($) {
};
},
text_viewer: function () {
var minimized_elements = $('p.text-viewer');
minimized_elements.each(function(){
var t = $(this).text();
if(t.length < 500) return;
$(this).html(
t.slice(0,500)+'<span>... </span><a href="#" class="read-more"> Read More</a>'+
'<span style="display:none;">'+ t.slice(500,t.length)+' <a href="#" class="read-less"> Read Less </a></span>'
);
});
$('a.read-more', minimized_elements).click(function(event){
event.preventDefault();
$(this).hide().prev().hide();
$(this).next().show();
});
$('a.read-less', minimized_elements).click(function(event){
event.preventDefault();
$(this).parent().hide().prev().show().prev().show();
});
},
notify: function (type, title, message) {
PNotify.modules.Desktop.permission();
new PNotify({
......@@ -513,6 +538,8 @@ $(document).ready(function ($) {
$("#changelogModal").find('.modal-body').load(SICKRAGE.srWebRoot + '/changes');
$("#changelogModal").modal();
});
SICKRAGE.text_viewer();
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment