Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
akuma06 2017-05-07 22:00:57 +02:00
révision 0bc12029bc
6 fichiers modifiés avec 70 ajouts et 47 suppressions

Voir le fichier

@ -1,10 +1,13 @@
/* Night mode image */ /* Night mode switcher */
#sunmoon { .nightswitch {
position: fixed; position: fixed;
top: 10px; top: 12px;
height: 30px; right: 48px;
} }
.nightswitch > a > img {
width: 24px;
}
/* Torrent status colors */ /* Torrent status colors */
.remake { .remake {
background-color: #795c46; background-color: #795c46;
@ -55,12 +58,8 @@ body {
text-align: center; text-align: center;
} }
.pagination {
background-color: #264040;
}
.pagination > .active > a { .pagination > .active > a {
background-color: #ececec; background: #ececec;
border-color: #ececec; border-color: #ececec;
color: #337ab7; /* restore usual text color */ color: #337ab7; /* restore usual text color */
} }
@ -115,6 +114,12 @@ a {
padding: 4px; padding: 4px;
} }
.captcha-container {
display: grid;
grid-template-rows: auto;
grid-template-columns: 240px;
}
tr.torrent-info td.date { tr.torrent-info td.date {
white-space: nowrap; white-space: nowrap;
} }
@ -154,13 +159,23 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ
.table > tbody > tr > td { .table > tbody > tr > td {
border: none; border: none;
} }
#container.cont-home { }
background: #29363d url(/img/megumin.png) no-repeat;
} /* Credit to bootsnipp.com for the css for the color graph */
#container.cont-view { .colorgraph {
background: #29363d url(/img/megumin.png) no-repeat; height: 5px;
background-size: 75px, 100px; border-top: 0;
} background: #c4e17f;
border-radius: 5px;
background-image: -webkit-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
background-image: -moz-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
background-image: -o-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
background-image: linear-gradient(to right, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
}
.center-image {
max-width: 100%;
max-height: 80vh;
} }
.navbar { .navbar {

Voir le fichier

@ -1,9 +1,13 @@
/* Night mode image */ /* Night mode switcher */
#sunmoon { .nightswitch {
position: fixed; position: fixed;
top: 10px; top: 12px;
height: 30px; right: 48px;
} }
.nightswitch > a > img {
width: 24px;
}
/* Torrent status colors */ /* Torrent status colors */
.remake { .remake {
background-color: rgb(240, 176, 128); background-color: rgb(240, 176, 128);

Voir le fichier

@ -1,25 +1,20 @@
// Night mode // Night mode
// also sorry that this code is soo bad, literally nothing else worked.. ima remake it in a near future
var night = localStorage.getItem("night"); var night = localStorage.getItem("night");
if (night=="true") { if (night == "true") {
document.getElementById("style").href = "/css/style-night.css"; $("#style")[0].href = "/css/style-night.css";
document.getElementById("nightbutton").innerHTML = "<img id='sunmoon' src='/img/sun.png' alt='Day!'>"; $("#nighticon")[0].src = "/img/sun.png";
} }
function toggleNightMode() { function toggleNightMode() {
var styleshieeet = document.getElementById("style").href; var night = localStorage.getItem("night");
var styleshieet = new RegExp("style.css"); if(night == "true") {
var stylesheet = styleshieet.test(styleshieeet); $("#style")[0].href = "/css/style.css";
if (stylesheet==true) { $("#nighticon")[0].src = "/img/moon.png";
document.getElementById("style").href = "/css/style-night.css"; } else {
document.getElementById("nightbutton").innerHTML = "<img id='sunmoon' src='/img/sun.png' alt='Day!'>"; $("#style")[0].href = "/css/style-night.css";
localStorage.setItem("night", "true"); $("#nighticon")[0].src = "/img/sun.png";
}
else {
document.getElementById("style").href = "/css/style.css";
document.getElementById("nightbutton").innerHTML = "<img id='sunmoon' src='/img/moon.png' alt='Night!'>";
localStorage.setItem("night", "false");
} }
localStorage.setItem("night", (night == "true") ? "false" : "true");
} }
// Used by spoiler tags // Used by spoiler tags
@ -30,6 +25,7 @@ function toggleLayer(elem) {
elem.classList.add("hide"); elem.classList.add("hide");
} }
// Date formatting
function formatDate(date) { // thanks stackoverflow function formatDate(date) { // thanks stackoverflow
var monthNames = [ var monthNames = [
"January", "February", "March", "January", "February", "March",

Voir le fichier

@ -56,7 +56,13 @@ func GetTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offs
var torrents []model.Torrents var torrents []model.Torrents
var dbQuery *gorm.DB var dbQuery *gorm.DB
var count int var count int
conditions := "torrent_hash is not null" //filter out broken entries conditions := "torrent_hash IS NOT NULL" // filter out broken entries
if strings.HasPrefix(orderBy, "filesize") {
// torrents w/ NULL filesize fuck up the sorting on postgres
// TODO: fix this properly
conditions += " AND filesize IS NOT NULL"
}
var params []interface{} var params []interface{}
if parameters != nil { // if there is where parameters if parameters != nil { // if there is where parameters
conditions += " AND " + parameters.Conditions conditions += " AND " + parameters.Conditions
@ -65,9 +71,9 @@ func GetTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offs
db.ORM.Model(&torrents).Where(conditions, params...).Count(&count) db.ORM.Model(&torrents).Where(conditions, params...).Count(&count)
dbQuery = db.ORM.Model(&torrents).Where(conditions, params...) dbQuery = db.ORM.Model(&torrents).Where(conditions, params...)
if orderBy == "" { if orderBy == "" { // default OrderBy
orderBy = "torrent_id DESC" orderBy = "torrent_id DESC"
} // Default OrderBy }
if limit != 0 || offset != 0 { // if limits provided if limit != 0 || offset != 0 { // if limits provided
dbQuery = dbQuery.Limit(limit).Offset(offset) dbQuery = dbQuery.Limit(limit).Offset(offset)
} }

Voir le fichier

@ -47,7 +47,6 @@
<li><a href="irc://irc.rizon.net/nyaapantsu">IRC</a></li> <li><a href="irc://irc.rizon.net/nyaapantsu">IRC</a></li>
<li><a href="{{ genRouteWithQuery "feed" .URL }}">RSS</a></li> <li><a href="{{ genRouteWithQuery "feed" .URL }}">RSS</a></li>
<li><a href="https://sukebei.pantsu.cat">Fap</a></li> <li><a href="https://sukebei.pantsu.cat">Fap</a></li>
<li><a href="javascript:void(0);" id="nightbutton" onclick='toggleNightMode();'><img id="sunmoon" src="/img/moon.png" alt="Night!"></a></li>
</ul> </ul>
<form class="navbar-form navbar-right" role="search" action="/search" method="get"> <form class="navbar-form navbar-right" role="search" action="/search" method="get">
@ -56,6 +55,9 @@
{{block "search_button" .}}{{end}} {{block "search_button" .}}{{end}}
</div> </div>
</form> </form>
<div class="nightswitch" style="position:absolute;right:1em">
<a href="javascript:toggleNightMode();" ><img id="nighticon" src="/img/moon.png"></a>
</div>
</div> </div>
</div> </div>
</nav> </nav>

Voir le fichier

@ -7,16 +7,16 @@ import (
func FormatFilesize(bytes int64) string { func FormatFilesize(bytes int64) string {
var unit string var unit string
var value float64 var value float64
if bytes > 1024*1024*1024*1024 { if bytes >= 1024*1024*1024*1024 {
unit = "TiB" unit = "TiB"
value = float64(bytes) / (1024*1024*1024*1024) value = float64(bytes) / (1024*1024*1024*1024)
} else if bytes > 1024*1024*1024 { } else if bytes >= 1024*1024*1024 {
unit = "GiB" unit = "GiB"
value = float64(bytes) / (1024*1024*1024) value = float64(bytes) / (1024*1024*1024)
} else if bytes > 1024*1024 { } else if bytes >= 1024*1024 {
unit = "MiB" unit = "MiB"
value = float64(bytes) / (1024*1024) value = float64(bytes) / (1024*1024)
} else if bytes > 1024 { } else if bytes >= 1024 {
unit = "KiB" unit = "KiB"
value = float64(bytes) / (1024) value = float64(bytes) / (1024)
} else { } else {