Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge branch 'dev' into torrent-btn-translation

Cette révision appartient à :
akuma06 2017-05-14 16:49:20 +02:00 révisé par GitHub
révision cc376d88de
8 fichiers modifiés avec 285 ajouts et 135 suppressions

Voir le fichier

@ -103,7 +103,7 @@ a:hover {
} }
:target { :target {
background-color: #585b4f; background-color: #b294bb;
} }
/* style the dropdown member menu */ /* style the dropdown member menu */
@ -149,3 +149,14 @@ a:hover {
background: #29363d; background: #29363d;
color: #cf9fff; color: #cf9fff;
} }
/*Comments*/
.commentList .commentData {
color: #fff;
}
.commentList .commentBody {
background: #29363d;
color: #fff;
}

Voir le fichier

@ -15,18 +15,18 @@
color: white; color: white;
} }
#mainmenu { #mainmenu {
position: fixed; position: fixed;
width: 100%; width: 100%;
z-index: 4; z-index: 4;
border: 0px solid white; border: 0px solid white;
} }
#mainmenu a { #mainmenu a {
background: none; background: none;
color: white; color: white;
} }
#mainmenu .divider { #mainmenu .divider {
background: black; background: black;
} }
#container { #container {
@ -54,7 +54,7 @@ body {
} }
.torrentNav { .torrentNav {
text-align: center; text-align: center;
} }
.pagination > .active > a { .pagination > .active > a {
@ -65,8 +65,8 @@ body {
/* Links, Text */ /* Links, Text */
a { a {
color: #106655; color: #106655;
text-decoration : none; text-decoration : none;
} }
.download-btn { .download-btn {
@ -87,25 +87,25 @@ td {
} }
.torrent-info .name { .torrent-info .name {
font-weight: bold; font-weight: bold;
overflow: hidden; overflow: hidden;
padding-bottom: 3px; padding-bottom: 3px;
padding-top: 3px; padding-top: 3px;
word-wrap: break-word; word-wrap: break-word;
} }
.torrent-hash { .torrent-hash {
font-family: monospace; font-family: monospace;
} }
.torrent-info .filesize { .torrent-info .filesize {
white-space: nowrap; white-space: nowrap;
} }
.comment-row td:first-of-type { .comment-row td:first-of-type {
vertical-align: top; vertical-align: top;
text-align: left; text-align: left;
color:#bbb; color:#bbb;
} }
/* Table style & fixes */ /* Table style & fixes */
@ -115,25 +115,25 @@ td {
} }
.table > tbody > tr > th, .table > tbody > tr > td { .table > tbody > tr > th, .table > tbody > tr > td {
padding: 4px; padding: 4px;
} }
.captcha-container { .captcha-container {
display: grid; display: grid;
grid-template-rows: auto; grid-template-rows: auto;
grid-template-columns: 240px; grid-template-columns: 240px;
} }
tr.torrent-info td.date { tr.torrent-info td.date {
white-space: nowrap; white-space: nowrap;
} }
.custom-table-hover > tbody > tr:hover { .custom-table-hover > tbody > tr:hover {
opacity: 0.82; opacity: 0.82;
} }
.comment-row { .comment-row {
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
} }
div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;} div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;}
@ -144,25 +144,25 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ
/* Mobile-friendly main table */ /* Mobile-friendly main table */
@media only screen and (max-width: 700px) { @media only screen and (max-width: 700px) {
table, thead, tbody, tr { table, thead, tbody, tr {
display: block; display: block;
} }
th { th {
display: none; display: none;
} }
td { td {
display: inline-block; display: inline-block;
} }
td:nth-of-type(1), td:nth-of-type(2) { td:nth-of-type(1), td:nth-of-type(2) {
display: block; display: block;
} }
.table > tbody > tr > td { .table > tbody > tr > td {
border: none; border: none;
} }
} }
/* Credit to bootsnipp.com for the css for the color graph */ /* Credit to bootsnipp.com for the css for the color graph */
@ -178,8 +178,8 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ
} }
.center-image { .center-image {
max-width: 100%; max-width: 100%;
max-height: 80vh; max-height: 80vh;
} }
/* the curved edges triggered my autism */ /* the curved edges triggered my autism */
@ -196,11 +196,11 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ
} }
#mainmenu button .search_text { #mainmenu button .search_text {
display: none; display: none;
} }
#mainmenu .navbar-form select.form-control #mainmenu .navbar-form select.form-control
{ {
width: 12rem; width: 12rem;
} }
#mainmenu .navbar-form select.form-control#max #mainmenu .navbar-form select.form-control#max
{ {
@ -365,10 +365,10 @@ select#bottom_language_selector {
/* Psuedo green-text fuckery. */ /* Psuedo green-text fuckery. */
#comments blockquote { #comments blockquote {
color: #789922; color: #789922;
} }
#comments blockquote:before { #comments blockquote:before {
content: ">"; content: ">";
} }
.completed { .completed {
@ -395,11 +395,108 @@ select#bottom_language_selector {
} }
.comment-date { .comment-date {
font-size: smaller; font-size: smaller;
width: auto; /* Undo bootstrap's fixed width */ width: auto; /* Undo bootstrap's fixed width */
} }
.text-error { .text-error {
background: white; background: white;
color: #cf9fff; color: #cf9fff;
} }
/* Wordbreak fix*/
.break {
word-break:break-all;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
/*Comments*/
.commentList::before,
.commentList::after {
content: "";
display: table;
clear: both;
}
.commentList ul {
list-style-type: none;
padding: 0;
}
.commentList img {
opacity: 1;
filter: Alpha(opacity=100);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
}
.commentList img.avatar {
position: relative;
float: left;
margin-left: 0;
margin-top: 0;
width: 65px;
height: 65px;
}
.commentList .commentBody {
border: 1px solid #eee;
margin-bottom: 20px;
margin-left: 85px;
margin-right: 0px;
padding: 10px 20px;
position: relative;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
background: #fff;
color: #6b6e80;
position: relative;
}
.commentList .commentData {
font-size: 13px;
color: #aaaaaa;
padding-bottom: 8px;
margin-bottom: 10px !important;
border-bottom: 1px solid #eee;
height: 2.5em;
}
.commentList ul.comments ul{
list-style-type: none;
padding: 0;
margin-left: 85px;
}
.commentList h3 {
margin-bottom: 40px;
font-size: 26px;
line-height: 30px;
font-weight: 800;
}
.comment {
margin: 1em;
padding: 1em;
width: 75%;
margin-left: 12%;
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
.comment {
width: 100%;
margin-left: 0;
}
}

Voir le fichier

@ -48,6 +48,12 @@ for(var i in list) {
e.innerText = date.toDateString() + " " + date.toLocaleTimeString(); e.innerText = date.toDateString() + " " + date.toLocaleTimeString();
} }
/*Fixed-Navbar offset fix*/
window.onload = function() {
var shiftWindow = function() { scrollBy(0, -70) };
if (location.hash) shiftWindow();
window.addEventListener("hashchange", shiftWindow);
};
function loadLanguages() { function loadLanguages() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {

Voir le fichier

@ -41,56 +41,56 @@ var FuncMap = template.FuncMap{
order := false order := false
if _, ok := values["order"]; ok { if _, ok := values["order"]; ok {
order, _ = strconv.ParseBool(values["order"][0]) order, _ = strconv.ParseBool(values["order"][0])
if values["sort"][0]==sortBy { if values["sort"][0] == sortBy {
order=!order //Flip order by repeat-clicking order = !order //Flip order by repeat-clicking
} else { } else {
order=false //Default to descending when sorting by something new order = false //Default to descending when sorting by something new
} }
} }
values.Set("sort", sortBy) values.Set("sort", sortBy)
values.Set("order", strconv.FormatBool(order)) values.Set("order", strconv.FormatBool(order))
url, _ := Router.Get("search").URL() url, _ := Router.Get("search").URL()
url.RawQuery=values.Encode() url.RawQuery = values.Encode()
return template.URL(url.String()) return template.URL(url.String())
}, },
"genNav": func(nav Navigation, currentUrl *url.URL, pagesSelectable int) template.HTML { "genNav": func(nav Navigation, currentUrl *url.URL, pagesSelectable int) template.HTML {
var ret = "" var ret = ""
if (nav.TotalItem > 0) { if nav.TotalItem > 0 {
maxPages := math.Ceil(float64(nav.TotalItem) / float64(nav.MaxItemPerPage)) maxPages := math.Ceil(float64(nav.TotalItem) / float64(nav.MaxItemPerPage))
if nav.CurrentPage-1 > 0 { if nav.CurrentPage-1 > 0 {
url, _ := Router.Get(nav.Route).URL("page", "1") url, _ := Router.Get(nav.Route).URL("page", "1")
ret = ret + "<li><a id=\"page-prev\" href=\"" + url.String() + "?" + currentUrl.RawQuery + "\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li>" ret = ret + "<li><a id=\"page-prev\" href=\"" + url.String() + "?" + currentUrl.RawQuery + "\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li>"
}
startValue := 1
if nav.CurrentPage > pagesSelectable/2 {
startValue = (int(math.Min((float64(nav.CurrentPage)+math.Floor(float64(pagesSelectable)/2)), maxPages)) - pagesSelectable + 1)
}
endValue := (startValue + pagesSelectable - 1)
if endValue > int(maxPages) {
endValue = int(maxPages)
}
log.Println(nav.TotalItem)
for i := startValue; i <= endValue; i++ {
pageNum := strconv.Itoa(i)
url, _ := Router.Get(nav.Route).URL("page", pageNum)
ret = ret + "<li"
if i == nav.CurrentPage {
ret = ret + " class=\"active\""
} }
startValue := 1
if nav.CurrentPage > pagesSelectable/2 {
startValue = (int(math.Min((float64(nav.CurrentPage)+math.Floor(float64(pagesSelectable)/2)), maxPages)) - pagesSelectable + 1)
}
endValue := (startValue + pagesSelectable - 1)
if endValue > int(maxPages) {
endValue = int(maxPages)
}
log.Println(nav.TotalItem)
for i := startValue; i <= endValue; i++ {
pageNum := strconv.Itoa(i)
url, _ := Router.Get(nav.Route).URL("page", pageNum)
ret = ret + "<li"
if i == nav.CurrentPage {
ret = ret + " class=\"active\""
}
ret = ret + "><a href=\"" + url.String() + "?" + currentUrl.RawQuery + "\">" + strconv.Itoa(i) + "</a></li>" ret = ret + "><a href=\"" + url.String() + "?" + currentUrl.RawQuery + "\">" + strconv.Itoa(i) + "</a></li>"
} }
if nav.CurrentPage < int(maxPages) { if nav.CurrentPage < int(maxPages) {
url, _ := Router.Get(nav.Route).URL("page", strconv.Itoa(nav.CurrentPage+1)) url, _ := Router.Get(nav.Route).URL("page", strconv.Itoa(nav.CurrentPage+1))
ret = ret + "<li><a id=\"page-next\" href=\"" + url.String() + "?" + currentUrl.RawQuery + "\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>" ret = ret + "<li><a id=\"page-next\" href=\"" + url.String() + "?" + currentUrl.RawQuery + "\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>"
} }
} }
return template.HTML(ret) return template.HTML(ret)
}, },
"T": i18n.IdentityTfunc, "T": i18n.IdentityTfunc,
"Ts": i18n.IdentityTfunc, "Ts": i18n.IdentityTfunc,
"getAvatar": func(hash string, size int) string { "getAvatar": func(hash string, size int) string {
return "https://www.gravatar.com/avatar/" + hash + "?s=" + strconv.Itoa(size) return "https://www.gravatar.com/avatar/" + hash + "?s=" + strconv.Itoa(size)
@ -105,9 +105,9 @@ var FuncMap = template.FuncMap{
return template.HTML(str) return template.HTML(str)
}, },
"calcWidthSeed": func(seed uint32, leech uint32) float64 { "calcWidthSeed": func(seed uint32, leech uint32) float64 {
return float64(float64(seed)/(float64(seed)+float64(leech)))*100 return float64(float64(seed)/(float64(seed)+float64(leech))) * 100
}, },
"calcWidthLeech": func(seed uint32, leech uint32) float64 { "calcWidthLeech": func(seed uint32, leech uint32) float64 {
return float64(float64(leech)/(float64(seed)+float64(leech)))*100 return float64(float64(leech)/(float64(seed)+float64(leech))) * 100
}, },
} }

Voir le fichier

@ -17,9 +17,9 @@
<a href="{{ genSearchWithOrdering .URL "1" }}">{{T "name"}}</a> <a href="{{ genSearchWithOrdering .URL "1" }}">{{T "name"}}</a>
</th> </th>
<th class="col-xs-1 hidden-xs"> <th class="col-xs-1 hidden-xs">
<a href="{{ genSearchWithOrdering .URL "4" }}">{{T "S"}}</a> / <a href="{{ genSearchWithOrdering .URL "5" }}">{{T "S"}}</a> /
<a href="{{ genSearchWithOrdering .URL "4" }}">{{T "L"}}</a> / <a href="{{ genSearchWithOrdering .URL "6" }}">{{T "L"}}</a> /
<a href="{{ genSearchWithOrdering .URL "3" }}">{{T "D"}}</a> <a href="{{ genSearchWithOrdering .URL "7" }}">{{T "D"}}</a>
</th> </th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "2" }}">{{T "date"}}</th></a> <th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "2" }}">{{T "date"}}</th></a>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "4" }}">{{T "size"}}</a></th> <th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "4" }}">{{T "size"}}</a></th>

Voir le fichier

@ -5,11 +5,11 @@
{{with .Torrent}} {{with .Torrent}}
<hr> <hr>
<div class="content" style="margin-bottom: 2em;"> <div class="content" style="margin-bottom: 2em;">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3 style="word-break:break-all" {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"{{end}}>{{.Name}}</h3> <h3 class="break" {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"{{end}}>{{.Name}}</h3>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div class="row" id="description"> <div class="row" id="description">
@ -18,8 +18,9 @@
<div class="uploaded_by"> <div class="uploaded_by">
<img style="float:left; margin-right: 1em;" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .SubCategory) }}"> <img style="float:left; margin-right: 1em;" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .SubCategory) }}">
<h4>{{ T "uploaded_by" }} <a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a></h4> <h4>{{ T "uploaded_by" }} <a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a></h4>
</div> </div>
</div>
<div style="float:right;"> <div style="float:right;">
<a style="margin: 5px;" aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-lg btn-success"> <a style="margin: 5px;" aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-lg btn-success">
<span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> {{ T "download_btn" }} <span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> {{ T "download_btn" }}
@ -42,13 +43,13 @@
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<h4>{{T "description"}}</h4> <h4>{{T "description"}}</h4>
<div style="word-break:break-all;">{{.Description}}</div> <div class="break">{{.Description}}</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<h4>{{T "hash"}}</h4> <h4>{{T "hash"}}</h4>
<p class="torrent-hash">{{.Hash}}</p> <p class="torrent-hash break">{{.Hash}}</p>
<hr> <hr>
<h4>{{T "date"}}</h4> <h4>{{T "date"}}</h4>
<p class="date-full">{{.Date}}</p> <p class="date-full">{{.Date}}</p>
@ -62,49 +63,72 @@
<hr> <hr>
{{end}} {{end}}
<div class="row"> <div class="row">
<div class="col-md-4">{{T "seeders"}}</div> <div class="col-md-4">{{T "seeders"}}</div>
<div class="col-md-4">{{T "leechers"}}</div> <div class="col-md-4">{{T "leechers"}}</div>
<div class="col-md-4">{{T "completed"}}</div> <div class="col-md-4">{{T "completed"}}</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4">{{.Seeders}}</div> <div class="col-md-4">{{.Seeders}}</div>
<div class="col-md-4">{{.Leechers}}</div> <div class="col-md-4">{{.Leechers}}</div>
<div class="col-md-4"><span class="completed" style="">{{.Completed}}</span></div> <div class="col-md-4"><span class="completed" style="">{{.Completed}}</span></div>
<div class="col-md-8"> <div class="col-md-8">
<div class="proSeedBar"> <div class="proSeedBar">
<div class="seeds" style="width: {{ calcWidthSeed .Seeders .Leechers }}%;"></div> <div class="seeds" style="width: {{ calcWidthSeed .Seeders .Leechers }}%;"></div>
<div class="leechs" style="width: {{ calcWidthLeech .Seeders .Leechers }}%;"></div> <div class="leechs" style="width: {{ calcWidthLeech .Seeders .Leechers }}%;"></div>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
</div> </div>
</div> </div>
<div class="row" id="comments"> <div class="row" id="comments">
<div class="col-md-12"> <div class="col-md-12">
<h4>{{T "comments"}}</h4> <div class="commentList">
{{ range $index, $element := .Comments }} <h4>{{T "comments"}}</h4>
<div class="row comment-row" id="comment_{{$index}}"> <hr/>
<div class="col-md-2"> <ul class="comments">
{{if eq .UserID -1}} {{ range $index, $element := .Comments }}
<a href="#comment_{{$index}}">{{$index}}</a> <li class="clearfix comment jumptarget" id="comment_{{$index}}">
{{.Username}} {{/* The following line is wrong. Should be using the MD5 User hash but i don't knwo how to access it. */}}
{{else}} {{/* Changing Gravatar for something else, so it can stay like this. */}}
<a href="#comment_{{$index}}">{{$index}}</a> <img src="https://www.gravatar.com/avatar/{{ .UserID }}?s=50" class="avatar" alt="">
<a href="{{$.URL.Parse (printf "/user/%d/-" .UserID ) }}">{{.Username}}</a> <div class="commentBody">
<div class="commentData">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-sm-9">
{{if eq .UserID -1}}
<a href="#comment_{{$index}}">#{{$index}}</a> by {{.Username}}
{{else}}
<a href="#comment_{{$index}}">#{{$index}}</a>
by <span class="break"><a href="{{$.URL.Parse (printf "/user/%d/-" .UserID ) }}">{{.Username}}</a></span>
{{end}}
</div>
<div class="col-sm-3">
<i class="pull-right date-short comment-date">
<small>
{{ .Date.Format ( Ts "date_format" ) }}
{{/* output: "2017-05-01 15:30"
Went with "Year-Month-Day" because it's the most unambiguous.
If you want it to be determined by where you're from, be my guest. */}}
</small>
</i>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{{.Content}}
</div>
</div>
</div>
</li>
{{end}} {{end}}
</div> </ul>
<div class="col-md-1 date-short comment-date">
{{ .Date.Format ( Ts "date_format" ) }}
{{/* output: "2017-05-01 15:30"
Went with "Year-Month-Day" because it's the most unambiguous.
If you want it to be determined by where you're from, be my guest. */}}
</div>
<div class="col-md-8">
{{.Content}}
</div>
</div> </div>
{{end}}
</div> </div>
</div> </div>
</div> </div>

Voir le fichier

@ -351,6 +351,10 @@
"id": "all_categories", "id": "all_categories",
"translation": "Toutes les catégories" "translation": "Toutes les catégories"
}, },
{
"id": "select_a_torrent_category",
"translation": "Choisir une catégorie de torrents"
},
{ {
"id": "anime", "id": "anime",
"translation": "Anime" "translation": "Anime"
@ -511,10 +515,6 @@
"id": "personal_info", "id": "personal_info",
"translation": "Informations personnelles" "translation": "Informations personnelles"
}, },
{
"id": "email",
"translation": "Adresse email"
},
{ {
"id": "language", "id": "language",
"translation": "Langue" "translation": "Langue"
@ -617,7 +617,11 @@
}, },
{ {
"id": "completed", "id": "completed",
"translation": "Terminé" "translation": "Complété"
},
{
"id": "change_language",
"translation": "Changer la langue"
}, },
{ {
"id": "language_name", "id": "language_name",

Voir le fichier

@ -225,7 +225,7 @@
}, },
{ {
"id": "notice_keep_seeding", "id": "notice_keep_seeding",
"translation": "ATTENZIONE: CONTINUA A SEEDARE I TORRENT E ABILITA IL DHT RITARDATO" "translation": "ATTENZIONE: CONTINUA A SEEDARE I TORRENT E ABILITA IL DHT IDIOTA"
}, },
{ {
"id": "official_nyaapocalipse_faq", "id": "official_nyaapocalipse_faq",
@ -317,7 +317,7 @@
}, },
{ {
"id": "answer_how_can_i_help", "id": "answer_how_can_i_help",
"translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei, <b>CARICALI!</b>." "translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei,per favore caricali."
}, },
{ {
"id": "your_design_sucks_found_a_bug", "id": "your_design_sucks_found_a_bug",
@ -351,6 +351,10 @@
"id": "all_categories", "id": "all_categories",
"translation": "Tutte le categorie" "translation": "Tutte le categorie"
}, },
{
"id": "select_a_torrent_category",
"translation": "Seleziona una Categoria Torrent"
},
{ {
"id": "anime", "id": "anime",
"translation": "Anime" "translation": "Anime"
@ -614,6 +618,10 @@
{ {
"id": "completed", "id": "completed",
"translation": "Completato" "translation": "Completato"
},
{
"id": "change_language",
"translation": "Cambia Lingua"
}, },
{ {
"id": "language_name", "id": "language_name",