Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Allow marking uploads as remake

Cette révision appartient à :
sfan5 2017-05-10 22:03:14 +02:00
Parent 64473e68ad
révision d98d918301
5 fichiers modifiés avec 20 ajouts et 12 suppressions

Voir le fichier

@ -28,6 +28,7 @@ type UploadForm struct {
Name string
Magnet string
Category string
Remake bool
Description string
captcha.Captcha
@ -40,19 +41,12 @@ type UploadForm struct {
// TODO: these should be in another package (?)
// form value for torrent name
// form names
const UploadFormName = "name"
// form value for torrent file
const UploadFormTorrent = "torrent"
// form value for magnet uri (?)
const UploadFormMagnet = "magnet"
// form value for category
const UploadFormCategory = "c"
// form value for description
const UploadFormRemake = "remake"
const UploadFormDescription = "desc"
// error indicating that you can't send both a magnet link and torrent
@ -84,6 +78,7 @@ func (f *UploadForm) ExtractInfo(r *http.Request) error {
f.Category = r.FormValue(UploadFormCategory)
f.Description = r.FormValue(UploadFormDescription)
f.Magnet = r.FormValue(UploadFormMagnet)
f.Remake = r.FormValue(UploadFormRemake) == "on"
f.Captcha = captcha.Extract(r)
if !captcha.Authenticate(f.Captcha) {

Voir le fichier

@ -34,7 +34,9 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
fmt.Printf("error %+v\n", err)
}
status := 1 // normal
if user.Status == 1 {
if uploadForm.Remake { // overrides trusted
status = 2
} else if user.Status == 1 {
status = 3 // mark as trusted if user is trusted
}
//add to db and redirect depending on result

Voir le fichier

@ -40,7 +40,10 @@
<option value="1_1" {{if eq .Category "1_1"}}selected{{end}}>{{T "software_applications"}}</option>
<option value="1_2" {{if eq .Category "1_2"}}selected{{end}}>{{T "software_games"}}</option>
</select>
</div>
<div class="form-group">
<input type="checkbox" name="remake">
<label for="remake">{{T "mark_as_remake"}}</label>
</div>
<div class="form-group">

Voir le fichier

@ -45,7 +45,7 @@
},
{
"id":"confirm_password",
"translation": "Bestätige dein Passwort"
"translation": "Passwort-Bestätigung"
},
{
"id":"i_agree",
@ -566,5 +566,9 @@
{
"id": "moderation",
"translation": "Moderation"
},
{
"id": "mark_as_remake",
"translation": "Als Remake markieren"
}
]

Voir le fichier

@ -574,5 +574,9 @@
{
"id": "renchon_anon_explanation",
"translation": "れんちょん is the username assigned to uploads and comments made anonymously. It is also used for torrent imported from the original nyaa, though the original uploader may be displayed alongside."
},
{
"id": "mark_as_remake",
"translation": "Mark as remake"
}
]