From 1d8246b5565d59b3b0e64f7505d451ead8f76f94 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 5 May 2017 15:00:07 +0200 Subject: [PATCH 1/7] Style fixes --- css/style.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 406f043a..5dd91a5c 100644 --- a/css/style.css +++ b/css/style.css @@ -16,7 +16,7 @@ nav#mainmenu { position: fixed; color: white; width: 100%; - z-index: 3; + z-index: 4; } nav#mainmenu a { @@ -72,6 +72,11 @@ a { white-space: nowrap; } +.table > tbody > tr > td { + /* fix bootstrap uglyness */ + vertical-align: middle; +} + div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:first-of-type, div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(5){width:10%;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(3){width:15%;} From f9714e8f87e74b75a03ef9acfc47e8d81636f72a Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 5 May 2017 23:36:10 +1000 Subject: [PATCH 2/7] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aeeed88f..28f5b306 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,12 @@ The provided unit file uses options directly; if you prefer a config file, do th * Replace in the unit file the options by `-conf /etc/nyaa.conf` ## TODO -* RSS feeds(work in progress) -* torrent sorting (work in progress) +* uploading * API improvement +* improve view page +* make sukebei db schema compatible with current code * Site theme -* Torrent view and description page(work in progress) +* comments in torrent view page * accounts? * Adding new torrents * scraping From a23f62e08c9cf6aa0398bcecbb07a59dc67e9eb5 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 5 May 2017 23:37:40 +1000 Subject: [PATCH 3/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 28f5b306..51c32254 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The provided unit file uses options directly; if you prefer a config file, do th ## TODO * uploading * API improvement +* add rss link and generate link based on your current search * improve view page * make sukebei db schema compatible with current code * Site theme From 365c78194bcb4951da8dc35bcc24bcbc8d58b604 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 5 May 2017 23:38:02 +1000 Subject: [PATCH 4/7] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 51c32254..b01c24fb 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ The provided unit file uses options directly; if you prefer a config file, do th * Replace in the unit file the options by `-conf /etc/nyaa.conf` ## TODO -* uploading +* uploading/adding new magnet links * API improvement * add rss link and generate link based on your current search * improve view page @@ -42,7 +42,6 @@ The provided unit file uses options directly; if you prefer a config file, do th * Site theme * comments in torrent view page * accounts? -* Adding new torrents * scraping * Daily DB dumps * p2p sync of dbs? From ccf8e938f8eb66795e070cc9acbda708a922cc06 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 5 May 2017 23:39:18 +1000 Subject: [PATCH 5/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b01c24fb..698f2eb6 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The provided unit file uses options directly; if you prefer a config file, do th * API improvement * add rss link and generate link based on your current search * improve view page +* make renchon the favicon and official mascot * make sukebei db schema compatible with current code * Site theme * comments in torrent view page From f336dcfc68ed694c249c0fbcfe0e4254d10e51b4 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 5 May 2017 23:43:26 +1000 Subject: [PATCH 6/7] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 698f2eb6..828247fd 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,13 @@ The provided unit file uses options directly; if you prefer a config file, do th * Replace in the unit file the options by `-conf /etc/nyaa.conf` ## TODO -* uploading/adding new magnet links +* adding new magnet links * API improvement * add rss link and generate link based on your current search -* improve view page * make renchon the favicon and official mascot * make sukebei db schema compatible with current code -* Site theme * comments in torrent view page +* Site theme * accounts? * scraping * Daily DB dumps From 8828a07fdff97950cf8d7068e8f780c08d7c3471 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 5 May 2017 15:55:25 +0200 Subject: [PATCH 7/7] Less autistic date display --- js/main.js | 40 ++++++++++++++++++++++++++++++++++++++-- templates/home.html | 2 +- templates/view.html | 2 +- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index 04089014..2e9e87fa 100644 --- a/js/main.js +++ b/js/main.js @@ -22,12 +22,18 @@ var maxId = 5; for (var i = 0; i < maxId; i++) { var el = document.getElementById('page-' + i), n = prev + i; + if (el == null) + continue; el.href = pageString + n + query; el.innerHTML = n; } - document.getElementById('page-next').href = pageString + next + query; - document.getElementById('page-prev').href = pageString + prev + query; + var e = document.getElementById('page-next'); + if (e != null) + e.href = pageString + next + query; + var e = document.getElementById('page-prev'); + if (e != null) + e.href = pageString + prev + query; // Used by spoiler tags function toggleLayer(elem) { @@ -36,3 +42,33 @@ function toggleLayer(elem) { else elem.classList.add("hide"); } + +function formatDate(date) { // thanks stackoverflow + var monthNames = [ + "January", "February", "March", + "April", "May", "June", "July", + "August", "September", "October", + "November", "December" + ]; + + var day = date.getDate(); + var monthIndex = date.getMonth(); + var year = date.getFullYear(); + + return day + ' ' + monthNames[monthIndex] + ' ' + year; +} + +var list = document.getElementsByClassName("date-short"); +for(var i in list) { + var e = list[i]; + e.title = e.innerText; + e.innerText = formatDate(new Date(e.innerText)); +} + +var list = document.getElementsByClassName("date-full"); +for(var i in list) { + var e = list[i]; + e.title = e.innerText; + var date = new Date(e.innerText); + e.innerText = date.toDateString() + " " + date.toLocaleTimeString(); +} diff --git a/templates/home.html b/templates/home.html index ae84b500..a64d064c 100644 --- a/templates/home.html +++ b/templates/home.html @@ -31,7 +31,7 @@ {{.Name}} - {{.Date}} + {{.Date}} {{.Filesize}} diff --git a/templates/view.html b/templates/view.html index b113c36b..1f05062e 100644 --- a/templates/view.html +++ b/templates/view.html @@ -19,7 +19,7 @@ Date - {{.Date}} + {{.Date}} FileSize