Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	service/user/verification.go
Cette révision appartient à :
akuma06 2017-05-10 22:42:56 +02:00
révision 90b9c5ba2b
6 fichiers modifiés avec 9 ajouts et 18 suppressions

Voir le fichier

@ -70,21 +70,17 @@ Access the website by going to [localhost:9999](http://localhost:9999).
* file lists
* Downloads
* Accounts and Registration System(WIP)
* Report Feature and Moderation System
* blocking upload of torrent hashes
## Lower priority
* Get code up to standard of go lint recommendations
* Write tests
* fix sukebei categories
* Daily DB dumps
* Site theme
* original nyaa theme
* API improvement
* Scraping of fan subbing RSS feeds
* Daily DB dumps
* p2p sync of dbs?
# LICENSE
This project is licensed under the MIT License - see the LICENSE.md file for details

Voir le fichier

@ -10,8 +10,8 @@ type TorrentReport struct {
TorrentID uint `gorm:"column:torrent_id"`
UserID uint `gorm:"column:user_id"`
Torrent Torrent `gorm:"AssociationForeignKey:TorrentID;ForeignKey:torrent_id"`
User User `gorm:"AssociationForeignKey:UserID;ForeignKey:user_id"`
Torrent *Torrent `gorm:"AssociationForeignKey:TorrentID;ForeignKey:torrent_id"`
User *User `gorm:"AssociationForeignKey:UserID;ForeignKey:user_id"`
}
type TorrentReportJson struct {

Voir le fichier

@ -14,8 +14,6 @@ import (
"github.com/ewhal/nyaa/util/languages"
"github.com/ewhal/nyaa/util/log"
"github.com/gorilla/mux"
"fmt"
)
func ViewHandler(w http.ResponseWriter, r *http.Request) {
@ -84,17 +82,14 @@ func ReportTorrentHandler(w http.ResponseWriter, r *http.Request) {
idNum, err := strconv.Atoi(id)
userID := currentUser.ID
//torrent, _ := torrentService.GetTorrentById(id)
fmt.Println(userID)
fmt.Println(currentUser)
torrent, _ := torrentService.GetTorrentById(id)
report := model.TorrentReport{
Description: r.FormValue("report_type"),
TorrentID: uint(idNum),
UserID: userID,
//Torrent: torrent,
//User: *currentUser,
Torrent: &torrent,
User: currentUser,
}
err = db.ORM.Create(&report).Error

Voir le fichier

@ -41,7 +41,7 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{{.URL.Parse "/"}}">{{T "Nyaa Pantsu"}}</a/></li>
<li><a href="{{.URL.Parse "/"}}">{{T "Nyaa Pantsu"}}</a></li>
<li><a href="{{ genRoute "mod_tlist"}}">{{T "Torrents"}}</a></li>
<li><a href="{{ genRoute "mod_ulist"}}">{{T "Users"}}</a></li>
<li><a href="{{ genRoute "mod_clist"}}">{{T "Comments"}}</a></li>

Voir le fichier

@ -46,7 +46,7 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{{.URL.Parse "/upload"}}">{{T "upload"}}</a/></li>
<li><a href="{{.URL.Parse "/upload"}}">{{T "upload"}}</a></li>
<li><a href="{{.URL.Parse "/faq"}}">{{T "faq"}}</a></li>
<li><a href="{{ genRouteWithQuery "feed" .URL }}">RSS</a></li>
<li><a href="https://sukebei.pantsu.cat">{{T "fap"}}</a></li>

Voir le fichier

@ -44,7 +44,7 @@
<p>{{.Hash}}</p>
<hr>
<h4>{{T "date"}}</h4>
<p>{{.Date}}</p>
<p class="date-full">{{.Date}}</p>
<hr>
<h4>{{T "size"}}</h4>
<p>{{.Filesize}}</p>