{{ extends "layouts/index_site" }} {{ import "layouts/partials/helpers/csrf" }} {{ import "layouts/partials/helpers/captcha" }} {{ import "layouts/partials/helpers/errors" }} {{ import "layouts/partials/helpers/tags" }} {{ import "layouts/partials/helpers/treeview" }} {{ import "layouts/partials/helpers/tag_form" }} {{block title()}}{{Torrent.Name}}{{end}} {{block content_body()}}

{{Torrent.Name}}


{{ if len(Torrent.Languages) > 0 && Torrent.Languages[0] != "" }} {{end}} {{ if Torrent.AnidbID > 0 || Torrent.VndbID > 0 || Torrent.VgmdbID > 0 || Torrent.Dlsite != "" }} {{ end }} {{ if len(Torrent.AcceptedTags) > 0 }} {{end}} {* if tags are not accepted and user is not logged, we don't display them *} {{ if User.ID > 0 }} {{ end }} {{ if Torrent.VideoQuality != "" }} {{ end }}
{{ T("category") }}: {{ CategoryName(Torrent.Category, Torrent.SubCategory) == "" ? T("unknown") : T(CategoryName(Torrent.Category, Torrent.SubCategory)) }}
{{ T("date") }}: {{formatDate(Torrent.FullDate, false)}}
{{ T("uploaded_by") }}: {{ genUploaderLink(Torrent.UploaderID, Torrent.UploaderName, Torrent.Hidden)|raw }} {{ T("seeders")}}: {{if Torrent.LastScrape.IsZero || formatDateRFC(Torrent.LastScrape) == "0001-01-01T00:00:00Z"}}{{ T("unknown")}}{{else}}{{Torrent.Seeders}}{{end}}
{{ T("website_link") }}: {{if Torrent.WebsiteLink != ""}} {{Torrent.WebsiteLink}} {{else}}N/A{{end}} {{ T("leechers")}}: {{if Torrent.LastScrape.IsZero || formatDateRFC(Torrent.LastScrape) == "0001-01-01T00:00:00Z"}}{{ T("unknown")}}{{else}}{{Torrent.Leechers}}{{end}}
{{ T("hash")}}: {{Torrent.Hash}} {{ T("completed")}}: {{if Torrent.LastScrape.IsZero || formatDateRFC(Torrent.LastScrape) == "0001-01-01T00:00:00Z"}}{{ T("unknown")}}{{else}}{{Torrent.Completed}}{{end}}
{{ T("size")}}: {{ fileSize(Torrent.Filesize, T) }} {{ T("last_scraped")}} {{formatDate(Torrent.LastScrape, false)}}{{else}}">{{ T("unknown")}}{{end}}
{{ T("torrent_language")}}: {{ range _, language := Torrent.Languages}} {{ if language != "" }} 5 }}class="big"{{ end }}> {{ LanguageNameFromCode(language, T) }} {{ LanguageNameFromCode(language, T) }} {{end}} {{end}}
{{ T("related_to") }} {{ if Torrent.AnidbID > 0 }} {{ T("tagtype_anidbid") }}: {{ Torrent.AnidbID }} {{end}} {{ if Torrent.VndbID > 0 }} {{ T("tagtype_vndbid") }}: {{ Torrent.VndbID }} {{end}} {{ if Torrent.VgmdbID > 0 }} {{ T("tagtype_vgmdbid") }}: {{ Torrent.VgmdbID }} {{end}} {{ if Torrent.Dlsite != "" }} {{ T("tagtype_dlsite") }}: {{ Torrent.Dlsite }} {{end}}
{{ T("accepted_tags")}}: {{ range Torrent.AcceptedTags }} {{ yield tag(tag=., accepted=true, torrentID=Torrent.ID) }} {{end}}
{{ T("recommended_tags")}}: {{ range Torrent.Tags }} {{ yield tag(tag=., accepted=false, torrentID=Torrent.ID) }} {{end}} {{ T("complement") }}
{{ T("tagtype_videoquality") }}: {{ T("tagvalue_"+Torrent.VideoQuality) }}
{{ T("magnet_link")}}
{{ T("torrent_file")}}
{{ if User.ID > 0}} {{ T("report_btn") }} {{ if User.HasAdmin()}}
{{ T("edit") }} {{ else if User.CurrentUserIdentical(Torrent.UploaderID) }}
{{ T("edit") }} {{end}} {{end}}

{{ T("description")}}

{{ if Torrent.Description != ""}}
{{Torrent.Description|raw}}
{{else}}

{{ T("no_description") }}

{{end}} 0}}checked{{end}}/>
{{ if len(Torrent.FileList) > 0 }} {* how do i concat lol *} {{ yield make_treeview(treeviewData=makeTreeViewData(RootFolder, 0, "root")) }}
{{ T("file_name")}} {{ T("size")}}
{{ else }}

{{ T("no_files") }}

{{ end }}

{{ T("comments")}}

{{idx := 1}} {{previousComment := ""}} {{previousUser := 0}} {{range index, element := Torrent.Comments}} {{if previousComment != element.Content || previousUser != element.UserID}}
{{idx}} {{formatDate(element.Date, false)}}

0}}href="/user/{{element.UserID}}/{{element.Username}}"{{end}} class="comment-user">{{if element.Username == ""}}れんちょん{{else}}{{element.Username}}{{end}}

{{element.Content|raw}}

{{idx = idx + 1}} {{end}} {{previousComment = element.Content}} {{previousUser = element.UserID}} {{end}} {{ if len(Torrent.Comments) == 0 }}

{{ T("torrent_no_comments") }}

{{ end }}
{{ yield csrf_field()}}

{{ if User.ID > 0}} {{ T("submit_a_comment_as_username", User.Username) }} {{else}} {{ T("submit_a_comment_as_anonymous")|raw}} {{end}}

{{ yield captcha(captchaid=CaptchaID)}}
{{ if User.ID > 0 }} {{end}} {{end}} {{ block footer_js()}} {{if Torrent.LastScrape.IsZero || formatDateRFC(Torrent.LastScrape) == "0001-01-01T00:00:00Z"}} {{end}} {{ if User.ID > 0 }} {{end}} {{end}}