Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #109 from sfan5/stuff

Show category image on torrent view page
Cette révision appartient à :
keo 2017-05-06 23:51:33 +03:00 révisé par GitHub
révision fbfa82e4fa
2 fichiers modifiés avec 6 ajouts et 3 suppressions

Voir le fichier

@ -43,7 +43,7 @@ func GetFeeds() []model.Feed {
func GetTorrentById(id string) (model.Torrents, error) {
var torrent model.Torrents
if db.ORM.Where("torrent_id = ?", id).Find(&torrent).RecordNotFound() {
if db.ORM.Where("torrent_id = ?", id).Preload("Sub_Categories").Find(&torrent).RecordNotFound() {
return torrent, errors.New("Article is not found.")
}
@ -124,4 +124,4 @@ func CreateWhereParams(conditions string, params ...string) WhereParams {
}
return whereParams
}
}

Voir le fichier

@ -9,7 +9,10 @@
{{if eq .Status 3}}class="trusted"{{end}}
{{if eq .Status 4}}class="aplus"{{end}}>
<td>Name</td>
<td>{{.Name}}</td>
<td>
{{.Name}}
<img style="float:right" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .Sub_Category.Id) }}">
</td>
</tr>
<tr>
<td>Hash</td>