Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fixing other peoples shit again & translation (#853)

* Fix login when running on localhost

* Translatable edit/delete buttons on view page

* Bold completed count on view page

* Don't create global variables in report button js

* Update german translation

* Update trackers (#803)

Remove baka-sub.cf as it's always broken
Add IPv6 version of leechers-paradise
Cette révision appartient à :
sfan5 2017-05-31 00:36:00 +02:00 révisé par ewhal
Parent aeb8039250
révision 3b6b81aa8d
5 fichiers modifiés avec 137 ajouts et 13 suppressions

Voir le fichier

@ -12,7 +12,7 @@ var Trackers = []string{
"udp://tracker.opentrackr.org:1337", "udp://tracker.opentrackr.org:1337",
"udp://tracker.internetwarriors.net:1337/announce", "udp://tracker.internetwarriors.net:1337/announce",
"http://mgtracker.org:6969/announce", "http://mgtracker.org:6969/announce",
"http://tracker.baka-sub.cf/announce"} "udp://ipv6.leechers-paradise.org:6969/announce"}
// NeededTrackers : Array indexes of Trackers for needed tracker in a torrent file // NeededTrackers : Array indexes of Trackers for needed tracker in a torrent file
var NeededTrackers = []int{ var NeededTrackers = []int{

Voir le fichier

@ -6,6 +6,7 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/NyaaPantsu/nyaa/config"
"github.com/NyaaPantsu/nyaa/db" "github.com/NyaaPantsu/nyaa/db"
"github.com/NyaaPantsu/nyaa/model" "github.com/NyaaPantsu/nyaa/model"
formStruct "github.com/NyaaPantsu/nyaa/service/user/form" formStruct "github.com/NyaaPantsu/nyaa/service/user/form"
@ -20,12 +21,11 @@ import (
const ( const (
// CookieName : Name of cookie // CookieName : Name of cookie
CookieName = "session" CookieName = "session"
// UserContextKey : key for user context
UserContextKey = "nyaapantsu.user"
// Domain name : The host domain so these can be shared across sukebei and nyaa // Domain name : The host domain so these can be shared across sukebei and nyaa
DomainName = "pantsu.cat" DomainName = "pantsu.cat"
// UserContextKey : key for user context
UserContextKey = "nyaapantsu.user"
) )
// If you want to keep login cookies between restarts you need to make these permanent // If you want to keep login cookies between restarts you need to make these permanent
@ -60,9 +60,13 @@ func EncodeCookie(userID uint) (string, error) {
// ClearCookie : Erase cookie session // ClearCookie : Erase cookie session
func ClearCookie(w http.ResponseWriter) (int, error) { func ClearCookie(w http.ResponseWriter) (int, error) {
domain := DomainName
if config.Environment == "DEVELOPMENT" {
domain = ""
}
cookie := &http.Cookie{ cookie := &http.Cookie{
Name: CookieName, Name: CookieName,
Domain: DomainName, Domain: domain,
Value: "", Value: "",
Path: "/", Path: "/",
HttpOnly: true, HttpOnly: true,
@ -103,9 +107,13 @@ func SetCookieHandler(w http.ResponseWriter, r *http.Request, email string, pass
if err != nil { if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
} }
domain := DomainName
if config.Environment == "DEVELOPMENT" {
domain = ""
}
cookie := &http.Cookie{ cookie := &http.Cookie{
Name: CookieName, Name: CookieName,
Domain: DomainName, Domain: domain,
Value: encoded, Value: encoded,
Path: "/", Path: "/",
HttpOnly: true, HttpOnly: true,

Voir le fichier

@ -52,7 +52,7 @@ udp://explodie.org:6969
udp://tracker.opentrackr.org:1337 udp://tracker.opentrackr.org:1337
udp://tracker.internetwarriors.net:1337/announce udp://tracker.internetwarriors.net:1337/announce
http://mgtracker.org:6969/announce http://mgtracker.org:6969/announce
http://tracker.baka-sub.cf/announce</pre> udp://ipv6.leechers-paradise.org:6969/announce</pre>
<h2>{{call $.T "how_can_i_help"}}</h2> <h2>{{call $.T "how_can_i_help"}}</h2>
<p>{{call $.T "answer_how_can_i_help"}}</p> <p>{{call $.T "answer_how_can_i_help"}}</p>

Voir le fichier

@ -55,7 +55,7 @@
</tr> </tr>
<tr class="torrent-info-row"> <tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{call $.T "hash"}}:</td><td style="font-family: monospace;" class="torrent-view-td torrent-info-data">{{.Hash}}</td> <td class="torrent-info-td torrent-info-label">{{call $.T "hash"}}:</td><td style="font-family: monospace;" class="torrent-view-td torrent-info-data">{{.Hash}}</td>
<td class="torrent-info-td torrent-info-label">{{call $.T "completed"}}:</td><td class="torrent-info-td">{{if .LastScrape.IsZero}}{{call $.T "unknown"}}{{else}}{{.Completed}}{{end}}</td> <td class="torrent-info-td torrent-info-label">{{call $.T "completed"}}:</td><td class="torrent-info-td"><b>{{if .LastScrape.IsZero}}{{call $.T "unknown"}}{{else}}{{.Completed}}{{end}}</b></td>
</tr> </tr>
<tr class="torrent-info-row"> <tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{call $.T "size"}}:</td><td class="torrent-view-td torrent-info-data">{{ fileSize .Filesize $.T }}</td> <td class="torrent-info-td torrent-info-label">{{call $.T "size"}}:</td><td class="torrent-view-td torrent-info-data">{{ fileSize .Filesize $.T }}</td>
@ -70,7 +70,7 @@
{{ if gt $.User.ID 0}} {{ if gt $.User.ID 0}}
<script> <script>
function reportPopup() { function reportPopup() {
reportContent = ` var reportContent = `
<h4>{{ call $.T "report_torrent_number" (print $.Torrent.ID) }}</h4> <h4>{{ call $.T "report_torrent_number" (print $.Torrent.ID) }}</h4>
<b>{{ call $.T "report_type" }}:</b> <b>{{ call $.T "report_type" }}:</b>
<form method="post" action="/report/{{$.Torrent.ID}}"> <form method="post" action="/report/{{$.Torrent.ID}}">
@ -81,16 +81,16 @@
<input type="radio" name="report_type" value="dup" id="dup" required> <label for="dup">{{ call $.T "duplicate_deprecated" }}</label><br /> <input type="radio" name="report_type" value="dup" id="dup" required> <label for="dup">{{ call $.T "duplicate_deprecated" }}</label><br />
<button type="submit" class="btn btn-default">{{ call $.T "report_btn" }}</button> <button type="submit" class="btn btn-default">{{ call $.T "report_btn" }}</button>
</form> <br /> </form> <br />
` `;
reportWindow = window.open("", 'reportWindow', "width=300,height=300"); // Opens a new window var reportWindow = window.open("", 'reportWindow', "width=300,height=300"); // Opens a new window
reportWindow.document.write(reportContent); reportWindow.document.write(reportContent);
} }
</script> </script>
<a onclick="reportPopup();" class="form-input">{{ call $.T "report_btn" }}</a> <a onclick="reportPopup();" class="form-input">{{ call $.T "report_btn" }}</a>
{{end}} {{end}}
{{ if HasAdmin $.User}} {{ if HasAdmin $.User}}
<a href="{{ genRoute "mod_tdelete" }}?id={{ .ID }}" class="form-input" onclick="if (!confirm('{{ call $.T "are_you_sure" }}')) return false;">Delete</a> <a href="{{ genRoute "mod_tdelete" }}?id={{ .ID }}" class="form-input" onclick="if (!confirm('{{ call $.T "are_you_sure" }}')) return false;">{{ call $.T "delete" }}</a>
<a href="{{ genRoute "mod_tedit" }}?id={{ .ID }}" class="form-input">Edit</a> <a href="{{ genRoute "mod_tedit" }}?id={{ .ID }}" class="form-input">{{ call $.T "edit" }}</a>
{{end}} {{end}}
</div> </div>
<p class="torrent-hr">{{call $.T "description"}}</p> <p class="torrent-hr">{{call $.T "description"}}</p>

Voir le fichier

@ -543,6 +543,10 @@
"id": "description", "id": "description",
"translation": "Beschreibung" "translation": "Beschreibung"
}, },
{
"id": "no_description",
"translation": "Keine Beschreibung vorhanden!"
},
{ {
"id": "comments", "id": "comments",
"translation": "Kommentare" "translation": "Kommentare"
@ -691,6 +695,10 @@
"id": "files", "id": "files",
"translation": "Dateien" "translation": "Dateien"
}, },
{
"id": "no_files",
"translation": "Nanu, wo sind denn die Dateien hin?"
},
{ {
"id": "filename", "id": "filename",
"translation": "Dateiname" "translation": "Dateiname"
@ -782,5 +790,113 @@
{ {
"id": "new_torrent_uploaded", "id": "new_torrent_uploaded",
"translation": "Neuer Torrent: \"%s\" von %s" "translation": "Neuer Torrent: \"%s\" von %s"
},
{
"id": "preferences",
"translation": "Einstellungen"
},
{
"id": "new_torrent_settings",
"translation": "Benachrichtigt werden wenn ein gefolgter Benutzer einen neuen Torrent hinzufügt"
},
{
"id": "new_torrent_email_settings",
"translation": "Per E-Mail benachrichtigt werden wenn ein gefolgter Benutzer einen neuen Torrent hinzufügt"
},
{
"id": "new_comment_settings",
"translation": "Benachrichtigt werden wenn deine Torrents kommentiert werden"
},
{
"id": "new_comment_email_settings",
"translation": "Per E-Mail benachrichtigt werden wenn deine Torrents kommentiert werden"
},
{
"id": "new_responses_settings",
"translation": "Benachrichtigt werden wenn auf deine Kommentare geantwortet wird"
},
{
"id": "new_responses_email_settings",
"translation": "Per E-Mail benachrichtigt werden wenn auf deine Kommentare geantwortet wird"
},
{
"id": "new_follower_settings",
"translation": "Benachrichtigt werden wenn du einen neuen Follower hast"
},
{
"id": "new_follower_email_settings",
"translation": "Per E-Mail benachrichtigt werden wenn du einen neuen Follower hast"
},
{
"id": "yes",
"translation": "Ja"
},
{
"id": "no",
"translation": "Nein"
},
{
"id": "new_comment_on_torrent",
"translation": "Neuer Kommentar zu einem Torrent: \"%s\""
},
{
"id": "select_one_element",
"translation": "Du musst mindestens ein Element auswählen!"
},
{
"id": "torrent_moved",
"translation": "Torrent %s verschoben!"
},
{
"id": "torrent_deleted",
"translation": "Torrent %s gelöscht!"
},
{
"id": "torrent_not_exist",
"translation": "Torrent mit ID %s existiert nicht!"
},
{
"id": "something_went_wrong",
"translation": "Da ist wohl etwas schief gelaufen..."
},
{
"id": "bad_captcha",
"translation": "Falsches Captcha!"
},
{
"id": "comment_empty",
"translation": "Kommentar ist leer!"
},
{
"id": "no_category_selected",
"translation": "Keine Kategorie ausgewählt!"
},
{
"id": "edit",
"translation": "Bearbeiten"
},
{
"id": "change_settings",
"translation": "Einstellungen ändern"
},
{
"id": "mascot",
"translation": "Maskottchen"
},
{
"id": "theme",
"translation": "Thema"
},
{
"id": "theme_select",
"translation": "Wähle ein Thema aus"
},
{
"id": "theme_none",
"translation": "Keins"
},
{
"id": "mark_as_hidden",
"translation": "Als Versteckt markieren"
} }
] ]