Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

[WIP] Anidex, TT & Nyaa.si uploading (#1604)

* Update main.css

* Update tomorrow.css

* Create upload_multiple.jet.html

* Create upload.js

* Update upload.jet.html

* Update upload.jet.html

* Update upload.jet.html

* Update tomorrow.css

* Update main.css

* Update tomorrow.css

* Update main.css

* Update user.go

* Update template_test.go

* Update main.css

* Update upload.jet.html

* Update edit.jet.html

* Update template_test.go

* Update upload.jet.html

* Update main.css

* new design for user edit

* Fix CRSF token

* Update upload_multiple.jet.html

* Update upload.jet.html

* Update profile.jet.html

* Update base.jet.html

* Update edit.jet.html

* Update forms.go

* Update forms_test.go

* Update forms_test.go

* Update forms.go

* Update forms_test.go

* Update main.css

* Fix 4+ torrent flags display on IE

* Fix userprofile buttons on IE, remove fancy css

* Fix torrent link being hidden on IE

* Update listing.jet.html

* Update main.css

* Update listing.jet.html

* Delete torrent_item_upload.jet.html

* Update torrent_item.jet.html

* Update main.css

* Update classic.css

* Update listing.jet.html

* Update classic.css

* Update profile.jet.html

* Update upload.jet.html

* Update classic.css

* Update classic.css

* Update main.css

* Update user.go

* Update upload.jet.html

* Update upload.jet.html

* Update edit.jet.html

* Update template_test.go

* Update forms.go

* Update forms_test.go

* Update main.css

* Update classic.css

* checkboxes next to language div

* wooo responsive checkboxes

* remove empty space

* need an !important here

* Fix flags being unaligned on IE

* Fix some inputs being too big on classic.css, remove fancy shit

* Update classic.css

* fix travis

* Update main.css

* Update upload.jet.html

* Update edit.jet.html
Cette révision appartient à :
kilo 2017-09-30 15:10:47 +02:00 révisé par GitHub
Parent 9fcd597cbc
révision d6c030d9e6
16 fichiers modifiés avec 520 ajouts et 250 suppressions

Voir le fichier

@ -48,6 +48,9 @@ type User struct {
OldNav string `gorm:"column:old_nav"`
Mascot string `gorm:"column:mascot"`
MascotURL string `gorm:"column:mascot_url"`
AnidexAPIToken string `gorm:"column:anidex_api_token"`
NyaasiAPIToken string `gorm:"column:nyaasi_api_token"`
TokyoTAPIToken string `gorm:"column:tokyotosho_api_token"`
UserSettings string `gorm:"column:settings"`
Pantsu float64 `gorm:"column:pantsu"`

Voir le fichier

@ -57,6 +57,17 @@ a:hover {
#content {
top: 31px!important;
}
.upload-form-table .checkbox-container+input {
width: 385px;
}
.upload-form-table .table-checkboxes {
padding: 3px 0!important;
width: 100%!important;
}
.upload-form-table .table-checkboxes .form-group {
display: inline-block!important;
margin-right: 6px!important;
}
.tr-cat {
width: 87px!important;
@ -87,12 +98,15 @@ th.tr-name a {
width: 114px;
}
.comment-count {
display: inline!important;
.tr-cs a::before {
display: none;
}
.tr-cs a {
font-size: 1em;
font-weight: bold;
}
.tr-cs a{
display: none;
.tr-cs a:hover {
text-decoration: none;
}
#mascot {
@ -238,6 +252,16 @@ select.form-input {
font-size: 1.3em;
}
.CodeMirror {
padding: 0;
}
.upload-form-table .checkbox-container {
height: 22px;
padding: 1px 0;
border-radius: 0;
}
.user-form input[type="text"],.user-form input[type="email"],.user-form input[type="password"] {
width: 173px;

Voir le fichier

@ -240,7 +240,7 @@ select.form-input {
.language .input-group label {
margin-bottom: 1px;
vertical-align: unset;
vertical-align: inherit;
}
.language .input-group input {
@ -469,7 +469,7 @@ select.form-input {
padding: 0!important;
}
.admin-content .results {
border-top: none;
border-top: none;
}
table {
@ -564,17 +564,21 @@ th {
overflow: visible;
text-overflow: initial;
padding: 0;
font-size: 0px;
}
.tr-cs a::before {
font-size: 14px;
}
.tr-size {
width: 90px;
}
.tr-se, .tr-le {
.tr-se, .tr-le, .tr-st {
font-weight: bold;
}
.tr-se, .tr-le, .tr-dl {
.tr-se, .tr-le, .tr-dl, .tr-st {
width: 50px;
}
@ -635,10 +639,10 @@ th {
.website-nav .pagination {
font-size: .8em;
padding: .5rem 0;
}
.website-nav .pagination span {
min-width: 31px;
min-width: 31px;
}
.website-nav .pagination p {
display: none;
@ -736,7 +740,7 @@ html, body {
.nav-btn.log-in div {
display: block;
}
.tr-se, .tr-le, .tr-dl {
.tr-se, .tr-le, .tr-dl, .tr-st {
width: 46px;
}
}
@ -784,7 +788,7 @@ html, body {
display: block
}
.user-td.tr-cat {
width: 70px;
width: 70px;
}
.user-td.tr-date {
width: 100px;
@ -822,6 +826,14 @@ html, body {
float: initial!important;
max-width: none;
}
.upload-form-table .table-checkboxes {
padding: 3px 0!important;
width: 100%;
}
.upload-form-table .table-checkboxes .form-group {
display: inline-block;
margin-right: 6px;
}
.hide-xs {
display: none !important;
}
@ -871,7 +883,7 @@ html, body {
.torrent-preview-table .tr-cat {
width: 74px;
}
.tr-se, .tr-le {
.tr-se, .tr-le, .tr-st {
width: 36px;
}
.header .h-search input {
@ -886,6 +898,9 @@ html, body {
.upload-form-table .table-torrent-link input {
width: 100%!important;
}
.upload-form-table .table-input-label {
width: 25%;
}
}
@media (max-height: 750px),(max-width: 500px) {
@ -1032,7 +1047,7 @@ html, body {
border-radius: 6px;
}
.profile-usermenu {
.profile-usermenu a {
display: block;
margin-bottom: 11px;
}
@ -1935,14 +1950,20 @@ p.upload-rules a {
.upload-form-table .table-input-label, .upload-form-table td label{
vertical-align: top;
}
.upload-form-table .table-checkboxes td {
padding: 3px 0;
.upload-form-table .form-input.language {
float: left;
}
.upload-form-table .table-checkboxes {
display: inline-block;
padding: 10px 4px;
}
.upload-form-table .table-torrent-link input[type="file"] {
width: 35%;
height: 25px;
margin-right: 3%;
}
.upload-form-table .table-torrent-link input[type="text"] {
width: 65%;
width: 62%;
}
.upload-form-table .editor-statusbar {
position: relative;
@ -1950,6 +1971,23 @@ p.upload-rules a {
margin-bottom: 2px;
z-index: 1;
}
.upload-form-table .checkbox-container+input {
width: 90%;
width: calc(100% - 21px);
}
.upload-form-table .checkbox-container {
display: inline-block;
border: 1px solid #c4c4c4;
background-color: #ececec;
border-radius: 4px 0 0 4px;
border-right: none;
height: 30px;
float: left;
padding: 5px 0;
border-color: #c4c4c4;
background: #dadada;
}
#tag-h3 {
margin: 0 0 7px;
}
@ -1958,7 +1996,7 @@ p.upload-rules a {
}
.upload-tag-table .input-label {
display: block;
font-size: unset;
font-size: 14px;
margin-bottom: 1px;
}
.upload-tag-table input, .upload-tag-table select {
@ -2037,6 +2075,75 @@ iframe {
margin-bottom: 0;
}
table.multiple-upload {
width: auto;
margin: 5px;
}
.upload-status {
border-radius: 4px;
border: 1px solid;
word-spacing: 0;
}
.upload-status td {
vertical-align: middle;
text-align: center;
padding: 6px 12px;
}
.upload-status .upload-site-name {
min-width: 110px;
border: 1px solid #e4e4e4;
background-color: #eee;
}
.upload-status .upload-progress {
min-width: 95px;
font-weight: bold;
border-top-right-radius: 4px;
border-bottom-right-radius: 1px;
padding: 6px;
}
.upload-status [class^="icon-"], .upload-status [class*=" icon-"] {
padding: 6px;
display: block;
border-right: 1px solid;
}
.multiple-upload td.uploaded-url {
padding: 0;
}
.multiple-upload input {
height: 100%;
width: 100%;
border: 1px solid;
margin-bottom: 2px;
}
.multiple-upload h3 {
margin-bottom: 3px;
}
.upload-status td:nth-child(3)::before {
margin-right: 3px;
}
.finished {
background-color: #4ae882;
}
.pending {
background-color: #ffbf7d;
}
.error {
background-color: #ff7a7a;
}
.user-edit-table td {
padding: 3px 0;
vertical-align: top;
}
.user-edit-table td:nth-child(1){
width: 150px;
font-weight: bold;
font-size: 14px!important;
padding: 5px 0;
}
/* Language specific CSS */
html[lang="ja-jp"] .form-refine span.spacing {
@ -2049,6 +2156,6 @@ html[lang="ja-jp"] .form-refine span.spacing {
}
@media (min-width: 961px) {
html[lang="ja-jp"] .header .nav-btn {
padding: 0 8px;
padding: 0 8px;
}
}

Voir le fichier

@ -98,10 +98,10 @@ td.tr-le, .error-text {
}
.alt-colors tr:nth-child(even) {
background: hsla(244, 11%, 21%, 0.2);
background: hsla(244, 11%, 21%, 0.2);
}
.alt-colors tr:nth-child(odd) {
background: hsla(255, 31%, 6%, 0.2);
background: hsla(255, 31%, 6%, 0.2);
}
.aplus, .btn-blue {
background: hsla(180, 50%, 50%, 0.2) !important;
@ -233,7 +233,7 @@ td.tr-le, .error-text {
}
#admin-header .nav-btn {
border-color: #141517;
color: #a2a7a4;
color: #a2a7a4;
}
#admin-header .nav-btn.active, #admin-header .nav-btn:hover, #admin-header:hover .nav-btn.active:hover, #admin-header .nav-btn:focus {
background-color: #2c2f34;
@ -241,7 +241,7 @@ td.tr-le, .error-text {
}
.torrent-preview-table>table {
border-color: #141115;
border-color: #141115;
}
.torrent-info-box {
@ -249,7 +249,7 @@ td.tr-le, .error-text {
}
.tr-cat div.nyaa-cat { border-color: #232324!important; }
.torrent-preview-table > table { border: 2px solid #1a1a1d; }
.tag.pending {
background: #3c3c3c;
color: #c1c1c1;
@ -276,3 +276,45 @@ span.tag {
.tag.accepted .tag-text a {
color: #7a8494;
}
.upload-status {
background-color: #1f2329;
border-color:#1f2329;
color: white;
}
.upload-status .upload-site-name {
border-right-color: black!important;
}
.upload-status .icon-finished {
border-right-color: #9ea749!important
}
.upload-status .icon-pending {
border-right-color: #906718!important;
}
.upload-status .icon-error {
border-right-color: #b34d4d!important;
}
.upload-status .upload-progress {
background-color: #717171;
}
.multiple-upload input {
border-color: #7c8084;
color: #b3b3b3;
}
.multiple-upload .finished {
background-color: #b5bd68;
}
.multiple-upload .pending {
background-color: #b1893b;
}
.multiple-upload .error {
background-color: #cc6666;
}
.upload-form-table .checkbox-container {
border-color: #0c0d0e;
background: #333438;
}

1
public/js/upload.js Fichier normal
Voir le fichier

@ -0,0 +1 @@

Voir le fichier

@ -77,11 +77,13 @@
{{end}}
{{end}}
{{end}}
{{ if genNav(Navigation, URL, 15) != ""}}
<div class="container bottom">
<div class="pagination">
{{ genNav(Navigation, URL, 15)|raw }}
</div>
</div>
{{end}}
<div class="centered">{{ yield ad_wide(Type=AdType) }}</div>
<footer id="footer">
<div class="container footer center">

Voir le fichier

@ -14,12 +14,6 @@
{{UserProfile.GetRole()}}
</p>
<p class="profile-usertitle-uploadcount">{{ T("torrents_uploaded") }}:<span>{{ NbTorrents }}</span></p>
{{ TorrentUploadedSize := 0}}
{{ range i, t := UserProfile.Torrents }}
{{ torrent := t.ToJSON() }}
{{ TorrentUploadedSize = TorrentUploadedSize + torrent.Filesize}}
{{ end }}
<p>{{ fileSize(TorrentUploadedSize, T)}} uploaded</p>
</div>
<!-- END SIDEBAR USER TITLE -->
<!-- SIDEBAR BUTTONS -->

Voir le fichier

@ -29,9 +29,8 @@ Templates.Add("torrents.item", function(torrent) {
// {{end}}
var languages = ""
var colspan = (torrent.comments.length == 0 ? ` colspan="2"` : "" )
var commentTd = ((torrent.comments.length > 0) ? `<td class="tr-cs home-td" title="`+torrent.comments.length + ` {{T("comments")}}` +`"><span>` + torrent.comments.length + `</span></td>` : "")
var dlLink = (torrent.torrent != "" ? ` <a href="` + torrent.torrent + `" title="{{ T("torrent_file") }}"><div class="icon-floppy"></div></a>` : "")
var commentTd = ((torrent.comments.length > 0) ? `<td class="tr-cs home-td" title="`+torrent.comments.length + ` {{T("comments")}}` +`"><a href="/view/` + torrent.id + `#comments">` + torrent.comments.length + `</a></td>` : "")
if (torrent.languages[0] != "") {
var flagClass = (torrent.languages.length == 1) ? Templates.FlagCode(torrent.languages[0]) : "multiple"
var langs = torrent.languages.map(function (el, i) { return T.r(el)}).join(",")
@ -54,12 +53,12 @@ Templates.Add("torrents.item", function(torrent) {
<td class="tr-links home-td">
<a href="` + torrent.magnet + `" title="{{ T("magnet_link") }}">
<div class="icon-magnet"></div>
</a>`+ dlLink +`
</a>`+ ` <a href="` + torrent.torrent + `" title="{{ T("torrent_file") }}"><div class="icon-floppy"></div></a>` +`
</td>
<td class="tr-size home-td hide-xs">` + humanFileSize(torrent.filesize) + `</td>
<td class="tr-se home-td hide-smol">` + torrent.seeders + `</td>
<td class="tr-le home-td hide-smol">` + torrent.leechers + `</td>
<td class="tr-dl home-td hide-xs">` + torrent.completed + `</td>
<td class="tr-se home-td hide-smol">` + torrent.seeders == 0 ? `-` : torrent.seeders + `</td>
<td class="tr-le home-td hide-smol">` + torrent.leechers == 0 ? `-` : torrent.leechers + `</td>
<td class="tr-dl home-td hide-xs">` + torrent.completed == 0 ? `-` : torrent.completed + `</td>
<td class="tr-date home-td date-short hide-xs">` + torrent.date + `</td>
</tr>`;
});

Voir le fichier

@ -1,57 +0,0 @@
<script type="text/javascript">
// {{ range _, cat := GetCategories(false, true) }}
T.Add("{{ cat.ID }}", "{{ T(cat.Name) }}")
// {{end}}
// {{ range _, language := GetTorrentLanguages() }}
T.Add("{{ language.Code }}", "{{ LanguageName(language, T) }}")
// {{ if language.Tag != language.Code }}
T.Add("{{ language.Tag }}", "{{ LanguageName(language, T) }}")
// {{end}}
// {{end}}
Templates.Add("torrents.item", function(torrent) {
var tr_class = "torrent-info hidden"
if (torrent.status == 2) {
tr_class += " remake"
} else if (torrent.status == 3) {
tr_class += " trusted"
} else if (torrent.status == 4) {
tr_class += " aplus"
}
var catClass = "nyaa-cat"
// {{ if Sukebei() }}
catClass += " sukebei-cat-"+ torrent.category + torrent.sub_category
// {{else}}
catClass += " nyaa-cat-"+ torrent.sub_category
// {{end}}
var languages = ""
var colspan = (torrent.comments.length == 0 ? ` colspan="2"` : "" )
var commentTd = ((torrent.comments.length > 0) ? `<td class="tr-cs home-td" title="`+torrent.comments.length + ` {{T("comments")}}` +`"><span>` + torrent.comments.length + `</span></td>` : "")
var dlLink = (torrent.torrent != "" ? ' <a><div class="icon-floppy"></div></a>' : "")
if (torrent.languages[0] != "") {
var flagClass = (torrent.languages.length == 1) ? Templates.FlagCode(torrent.languages[0]) : "multiple"
var langs = torrent.languages.map(function (el, i) { return T.r(el)}).join(",")
languages = `<a><img src="img/blank.gif" class="flag flag-` + flagClass + `" title="` + langs + `"></a>`
}
return `<tr id="torrent_` + torrent.id + `" class="` + tr_class + `">
<td class="tr-cat home-td">
<div class="` + catClass +`">
<a class="category">
</a> ` + languages + `
</div></td>
<td class="tr-name home-td"` + colspan + `><a>` + Templates.EncodeEntities(torrent.name) + `</a></td>
`+ commentTd +`
<td class="tr-links home-td">
<a title="{{ T("magnet_link") }}">
<div class="icon-magnet"></div>
</a>`+ dlLink +`
</td>
<td class="tr-size home-td hide-xs">` + humanFileSize(torrent.filesize) + `</td>
<td class="tr-se home-td hide-smol">` + torrent.seeders + `</td>
<td class="tr-le home-td hide-smol">` + torrent.leechers + `</td>
<td class="tr-dl home-td hide-xs">` + torrent.completed + `</td>
<td class="tr-date home-td date-short hide-xs">` + torrent.date + `</td>
</tr>`;
});
</script>

Voir le fichier

@ -79,8 +79,7 @@
</td>
{{ if len(.Comments) > 0 }}
<td class="tr-cs home-td" title="{{len(.Comments)}} {{T("comments")}}">
<span class="comment-count" style="display:none">{{len(.Comments)}}</span>
<a href="/view/{{ .ID }}#comments" class="icon-chat"></a>
<a href="/view/{{ .ID }}#comments" class="icon-chat">{{len(.Comments)}}</a>
</td>
{{ end }}
<td class="tr-links home-td">
@ -95,7 +94,9 @@
{{ fileSize(.Filesize, T) }}
</td>
{{if .LastScrape.IsZero || formatDateRFC(.LastScrape) == "0001-01-01T00:00:00Z"}}
<td class="home-td hide-xs" colspan="3">{{ T("unknown")}}</td>
<td class="tr-se home-td hide-smol">-</td>
<td class="tr-le home-td hide-smol">-</td>
<td class="tr-dl home-td hide-xs">-</td>
{{else}}
<td class="tr-se home-td hide-smol">{{.Seeders}}</td>
<td class="tr-le home-td hide-smol">{{.Leechers}}</td>

Voir le fichier

@ -2,7 +2,6 @@
{{ import "layouts/partials/helpers/csrf" }}
{{ import "layouts/partials/helpers/captcha" }}
{{ import "layouts/partials/helpers/flags" }}
{{ import "layouts/partials/helpers/rules" }}
{{ import "layouts/partials/helpers/tag_form" }}
{{block title()}}{{ T("upload")}}{{end}}
{{block content_body()}}
@ -49,12 +48,16 @@
<div class="form-input language">
{{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages, inputname="languages", id="upload-lang")}}
</div>
<div class="table-checkboxes">
<div class="form-group">
<input type="checkbox" value="true" name="remake" id="remake" class="form-torrent-remake"/><label for="remake">{{ T("mark_as_remake")}}</label>
</div>
<div class="form-group">
<input type="checkbox" value="true" name="hidden" id="hidden" class="form-torrent-hidden {{ if User.ID == 0 }}hidden{{end}}" {{ if User.ID == 0 }}disabled checked{{end}}><label for="hidden" {{ if User.ID == 0 }}class="hidden"{{end}}>{{ T("upload_as_anon")}}</label>
</div>
</div>
</td>
</tr>
<tr class="table-checkboxes">
<td class="table-input-label"></td>
<td class="table-input" style="font-weight: normal;"><input type="checkbox" value="true" name="remake" id="remake" class="form-torrent-remake"/><label for="remake">{{ T("mark_as_remake")}}</label> <input type="checkbox" value="true" name="hidden" id="hidden" class="form-torrent-hidden {{ if User.ID == 0 }}hidden{{end}}" {{ if User.ID == 0 }}disabled checked{{end}}><label for="hidden" {{ if User.ID == 0 }}class="hidden"{{end}}>{{ T("upload_as_anon")}}</label></td>
</tr>
<tr>
<td class="table-input-label"><label for="website_link">{{ T("website_link")}}</label></td>
<td class="table-input"><input name="website_link" id="website_link" placeholder="http://" class="form-input up-input" type="text" value="{{Form.WebsiteLink}}"/></td>
@ -63,6 +66,27 @@
<td class="table-input-label"><label for="desc">{{ T("torrent_description")}}</label></td>
<td class="table-input"><textarea name="desc" id="desc" class="form-input up-input" style="height: 10rem;">{{Form.Description}}</textarea></td>
</tr>
<tr class="hidden">
<td class="table-input-label"><label for="anidex_api">Upload to Anidex:</label></td>
<td class="table-input">
<div class="checkbox-container"><input disabled type="checkbox" value="" name="anidex_upload" id="anidex_upload" {{if User.AnidexAPIToken != ""}}checked disabled{{end}} class="form-torrent"/></div>
<input disabled name="anidex_api" id="anidex_api" placeholder="Coming soon... (hopefully)" class="form-input up-input" type="text" value="{{User.AnidexAPIToken}}"/>
</td>
</tr>
<tr class="hidden">
<td class="table-input-label"><label for="nyaasi_api">Upload to Nyaa.si:</label></td>
<td class="table-input">
<div class="checkbox-container"><input disabled type="checkbox" value="" name="nyaasi_upload" id="nyaasi_upload" {{if User.NyaasiAPIToken != ""}}checked disabled{{end}} class="form-torrent"/></div>
<input disabled name="nyaasi_api" id="nyaasi_api" placeholder="Coming soon... (hopefully)" class="form-input up-input" type="text" value="{{User.NyaasiAPIToken}}"/>
</td>
</tr>
<tr class="hidden">
<td class="table-input-label"><label for="tokyot_api">Upload to TokyoTosho:</label></td>
<td class="table-input">
<div class="checkbox-container"><input disabled type="checkbox" value="" name="tokyot_upload" id="tokyot_upload" {{if User.TokyoTAPIToken != ""}}checked disabled{{end}} class="form-torrent"/></div>
<input disabled name="tokyot_api" id="tokyot_api" placeholder="Coming soon... (hopefully)" class="form-input up-input" type="text" value="{{User.TokyoTAPIToken }}"/>
</td>
</tr>
<tr>
<td class="table-input-label">{{ T("torrent_tags")}}:</td>
<td class="table-input">
@ -119,7 +143,6 @@
<script type="text/javascript" src="/js/translation.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" src="/js/template.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" src="/js/simplemde.min.js?v={{ Config.Version}}{{ Config.Build }}"></script>
{{ include "layouts/partials/torrent_item_upload" }}
<script type="text/javascript">
document.querySelector("input[name='magnet']").addEventListener("keyup", (e) => {
var torrentInput = document.querySelector("input[name='torrent']")
@ -134,6 +157,24 @@
}
}catch(e){}
})
document.querySelector("input[name='anidex_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='anidex_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
document.querySelector("input[name='nyaasi_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='nyaasi_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
document.querySelector("input[name='tokyot_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='tokyot_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
</script>
<script type="text/javascript">new SimpleMDE({ element: document.getElementById("desc"), spellChecker: false, showIcons: [ "strikethrough", "code", "table", "horizontal-rule" ] });</script>
{{end}}

Voir le fichier

@ -0,0 +1,27 @@
{{ extends "layouts/index_site" }}
{{block title()}}{{ T("upload")}}{{end}}
{{block content_body()}}
<div style="text-align: left;" class="box">
<h1 style="text-align:center;margin-top; 4px;">Upload status</h1>
<table class="multiple-upload">
<tbody>
<tr><td colspan="4"><h3>Nyaa Pantsu upload status</h3></td></tr>
<tr class="upload-status"><td class="upload-site-name">Nyaa Pantsu</td><td>Status:</td><td class="icon-finished finished"></td><td class="upload-progress finished">Finished</td></tr>
<tr><td colspan="4" class="uploaded-url"><input type="text" class="form-input" placeholder="http://" value="http://nyaa.pantsu.cat/view/4556456" disabled></td></tr>
<tr><td colspan="4"><h3>Nyaa.si upload status</h3></td></tr>
<tr class="upload-status"><td class="upload-site-name">Nyaa.si</td><td>Status:</td><td class="icon-pending pending"></td><td class="upload-progress pending">Pending</td></tr>
<tr><td colspan="4" class="uploaded-url"><input type="text" class="form-input" placeholder="Uploading..." disabled></td></tr>
<tr><td colspan="4"><h3>Anidex upload status</h3></td></tr>
<tr class="upload-status"><td class="upload-site-name">Anidex</td><td>Status:</td><td class="icon-error error"></td><td class="upload-progress error">Error</td></tr>
<tr><td colspan="4" class="uploaded-url"><input type="text" class="form-input" placeholder="http://" value="Error: XXXX" disabled></td></tr>
</tbody>
</table>
</div>
{{end}}
{{ block footer_js()}}
<script type="text/javascript" src="/js/translation.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" src="/js/upload.js?v={{ Config.Version}}{{ Config.Build }}"></script>
{{end}}

Voir le fichier

@ -4,182 +4,265 @@
{{block title()}}{{ T("profile_edit_page", UserProfile.Username) }}{{end}}
{{ block profile_navigation()}}{{ yield profile_menu(route="profile_edit") }}{{end}}
{{block profile_content()}}
<h3>{{ T("personal_info")}}</h3>
<div class="user-edit">
<form role="form" method="POST">
{{ yield csrf_field()}}
<label class="input-label">{{ T("api_token") }}:</label>
<p style="font-family: monospace;">{{UserProfile.APIToken}}</p>
<a class="form-input up-input" href="/user/{{ UserProfile.ID}}/{{UserProfile.Username }}/apireset">{{ T("reset_api_key") }}</a>
<br/>
<br/>
<a href="/apidoc">{{ T("api_documentation")}}</a>
<br/>
<label class="input-label">{{ T("email_address") }}:</label>
<br/>
<input class="form-input up-input" placeholder="{{ T("email_placeholder")}}" type="text" name="email" id="email" value="{{UserProfile.Email}}"/>
<br/>
<h2 style="margin-top: 4px;">{{ T("personal_info")}}</h2>
<form role="form" method="POST">
{{ yield csrf_field()}}
<table class="user-edit-table">
<tbody>
<tr>
<td>{{ T("api_token") }}:</td>
<td><span style="font-family: monospace;">{{UserProfile.APIToken}}</span></td>
</tr>
<tr>
<td></td>
<td style="padding-bottom: 6px;"><a href="/apidoc">{{ T("api_documentation")}}</a> / <a class="form-input up-input" href="/user/{{ UserProfile.ID}}/{{UserProfile.Username }}/apireset">Reset API key</a></td>
</tr>
<tr class="hidden">
<td><label for="anidex_api">Anidex API Token:</label></td>
<td><input disabled class="form-input up-input" placeholder="Coming soon..." type="text" name="anidex_api" id="anidex_api" value="{{UserProfile.AnidexAPIToken}}"/></td>
</tr>
<tr class="hidden">
<td><label for="nyaasi_api">Nyaa.si API Token:</label></td>
<td><input disabled class="form-input up-input" placeholder="Coming soon..." type="text" name="nyaasi_api" id="nyaasi_api" value="{{UserProfile.NyaasiAPIToken}}"/></td>
</tr>
<tr class="hidden">
<td><label for="tokyot_api">TokyoTosho API Token:</label></td>
<td><input disabled class="form-input up-input" placeholder="Coming soon..." type="text" name="tokyot_api" id="tokyot_api" value="{{UserProfile.TokyoTAPIToken }}"/></td>
</tr>
<tr>
<td><label for="email">{{ T("email_address") }}</label></td>
<td><input class="form-input up-input" placeholder="{{ T("email_placeholder")}}" type="text" name="email" id="email" value="{{UserProfile.Email}}"/></td>
</tr>
<tr>
<td><label for="language">{{ T("language")}}</label></td>
<td>
<select id="language" name="language" class="form-input up-input">
{{ userLanguage := UserProfile.Language }}
{{ range _, language := Languages }}
<option value="{{ language.Tag }}" {{ if userLanguage == language.Tag || userLanguage == language.Code || ((userLanguage == "") && (language.Tag == getDefaultLanguage())) }}selected{{end}}>{{ language.Name }} {{if language.Tag == getDefaultLanguage()}}({{ T("default") }}){{end}}</option>
{{ end }}
</select>
</td>
</tr>
{{ if !User.HasAdmin()}}
<tr>
<td><label for="current_password">{{ T("current_password") }}</label></td>
<td><input class="form-input up-input up-input" name="current_password" id="current_password" type="password"/></td>
</tr>
{{end}}
<tr>
<td><label for="password">{{ T("password") }}</label></td>
<td><input class="form-input up-input up-input" name="password" id="password" type="password"/></td>
</tr>
<tr>
<td><label for="password_confirmation">{{ T("confirm_password") }}</label></td>
<td><input class="form-input up-input up-input" name="password_confirmation" id="password" type="password"/></td>
</tr>
</tbody>
</table>
{{ yield errors(name="Email")}}
<label class="input-label">{{ T("language")}}:</label>
<br/>
<select id="language" name="language" class="form-input up-input">
{{ userLanguage := UserProfile.Language }}
{{ range _, language := Languages }}
<option value="{{ language.Tag }}" {{ if userLanguage == language.Tag || userLanguage == language.Code || ((userLanguage == "") && (language.Tag == getDefaultLanguage())) }}selected{{end}}>{{ language.Name }} {{if language.Tag == getDefaultLanguage()}}({{ T("default") }}){{end}}</option>
{{ end }}
</select>
<br/>
{{ yield errors(name="Language")}}
{{ yield errors(name="Language")}}
{{ if !User.HasAdmin()}}
<label class="input-label">{{ T("current_password")}}:</label>
<br/>
<input class="form-input up-input up-input" name="current_password" id="current_password" type="password"/>
<br/>
{{ yield errors(name="CurrentPassword")}}
{{ yield errors(name="CurrentPassword")}}
{{end}}
<label class="input-label">{{ T("password")}}:</label>
<br/>
<input class="form-input up-input up-input" name="password" id="password" type="password"/>
<br/>
{{ yield errors(name="Password")}}
<label class="input-label">{{ T("confirm_password")}}:</label>
<br/>
<input class="form-input up-input up-input" name="password_confirmation" id="password_confirmation" type="password"/>
<br/>
{{ yield errors(name="Password")}}
{{ yield errors(name="ConfirmPassword")}}
<h3>{{ T("preferences")}}</h3>
<label class="input-label" for="theme">{{ T("theme")}}</label>
<br/>
<select id="theme-selector" name="theme" class="form-input up-input" onchange="switchThemes()">
<option value="">{{ T("theme_select")}}</option>
<option value="g"{{ if Theme == "g" }} selected{{end}}>/g/</option>
<option value="tomorrow"{{ if Theme == "tomorrow" }} selected{{end}}>Tomorrow</option>
<option value="classic"{{ if Theme == "classic" }} selected{{end}}>nyaa.se (beta)</option>
<option value="classic_colors"{{ if Theme == "classic_colors" }} selected{{end}}>Classic Colors</option>
<option value=""{{ if Theme == "" }} selected{{end}}>{{ T("theme_none")}}</option>
</select>
<br/>
{{ yield errors(name="Theme")}}
<h2>{{ T("preferences")}}</h2>
<table class="user-edit-table">
<tbody>
<tr>
<td><label for="theme">{{ T("theme") }}:</label></td>
<td>
<select id="theme-selector" name="theme" class="form-input up-input" onchange="switchThemes()">
<option value="">{{ T("theme_select")}}</option>
<option value="g"{{ if Theme == "g" }} selected{{end}}>/g/</option>
<option value="tomorrow"{{ if Theme == "tomorrow" }} selected{{end}}>Tomorrow</option>
<option value="classic"{{ if Theme == "classic" }} selected{{end}}>nyaa.se (beta)</option>
<option value="classic_colors"{{ if Theme == "classic_colors" }} selected{{end}}>Classic Colors</option>
<option value=""{{ if Theme == "" }} selected{{end}}>{{ T("theme_none")}}</option>
</select>
</td>
</tr>
{{ if DefaultUserSettings("new_torrent")}}
<tr><td colspan="2" style="padding:0"><label for="new_torrent">{{ T("new_torrent_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_torrent" name="new_torrent" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_torrent") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_torrent") }}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_torrent_email")}}
<tr><td colspan="2" style="padding:0"><label for="new_torrent_email">{{ T("new_torrent_email_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_torrent_email" name="new_torrent_email" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_torrent_email") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_torrent_email")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_comment")}}
<tr><td colspan="2" style="padding:0"><label for="new_comment">{{ T("new_comment_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_comment" name="new_comment" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_comment") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_comment") }}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_comment_email")}}
<tr><td colspan="2" style="padding:0"><label for="new_comment_email">{{ T("new_comment_email_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_comment_email" name="new_comment_email" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_comment_email") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_comment_email") }}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_responses")}}
<tr><td colspan="2" style="padding:0"><label for="new_responses">{{ T("new_responses_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_responses" name="new_responses" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_responses") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_responses")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_responses_email")}}
<tr><td colspan="2" style="padding:0"><label for="new_responses_email">{{ T("new_responses_email_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_responses_email" name="new_responses_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_responses_email") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_responses_email")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_follower")}}
<tr><td colspan="2" style="padding:0"><label for="new_follower">{{ T("new_follower_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_follower" name="new_follower" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_follower") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_follower")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("new_follower_email")}}
<tr><td colspan="2" style="padding:0"><label for="new_follower_email">{{ T("new_follower_email_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="new_follower_email" name="new_follower_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_follower_email") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_follower_email")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("followed")}}
<tr><td colspan="2" style="padding:0"><label for="followed">{{ T("followed_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="followed" name="followed" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("followed") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("followed")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
{{ if DefaultUserSettings("followed_email")}}
<tr><td colspan="2" style="padding:0"><label for="followed_email">{{ T("followed_email_settings") }}</label></td></tr>
<tr>
<td colspan="2">
<select id="followed_email" name="followed_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("followed_email") }}selected{{end}}>{{ T("no")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("followed_email")}}selected{{end}}>{{ T("yes")}}</option>
</select>
</td>
</tr>
{{end}}
</tbody>
</table>
{{ if DefaultUserSettings("new_torrent")}}
<label class="input-label">{{ T("new_torrent_settings") }}:</label>
<br/>
<select id="new_torrent" name="new_torrent" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_torrent") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_torrent") }}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewTorrent")}}
{{ yield errors(name="NewTorrent")}}
{{end}}
{{ if DefaultUserSettings("new_torrent_email")}}
<label class="input-label">{{ T("new_torrent_email_settings") }}:</label>
<br/>
<select id="new_torrent_email" name="new_torrent_email" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_torrent_email") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_torrent_email")}}selected{{end}}>{{ T("enabled")}}</option>
</select> <br>
{{ yield errors(name="NewTorrentEmail")}}
{{ yield errors(name="NewTorrentEmail")}}
{{end}}
{{ if DefaultUserSettings("new_comment")}}
<label class="input-label">{{ T("new_comment_settings") }}:</label> <br>
<select id="new_comment" name="new_comment" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_comment") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_comment") }}selected{{end}}>{{ T("enabled")}}</option>
</select> <br>
{{ yield errors(name="NewComment")}}
{{ yield errors(name="NewComment")}}
{{end}}
{{ if DefaultUserSettings("new_comment_email")}}
<label class="input-label">{{ T("new_comment_email_settings") }}:</label>
<br/>
<select id="new_comment_email" name="new_comment_email" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_comment_email") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_comment_email") }}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewCommentEmail")}}
{{ yield errors(name="NewCommentEmail")}}
{{end}}
{{ if DefaultUserSettings("new_responses")}}
<label class="input-label">{{ T("new_responses_settings") }}:</label>
<br/>
<select id="new_responses" name="new_responses" class="form-input up-input">
<option value="0" {{ if !UserProfile.Settings.Get("new_responses") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_responses")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewResponses")}}
{{ yield errors(name="NewResponses")}}
{{end}}
{{ if DefaultUserSettings("new_responses_email")}}
<label class="input-label">{{ T("new_responses_email_settings") }}:</label> <br>
<select id="new_responses_email" name="new_responses_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_responses_email") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_responses_email")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewResponsesEmail")}}
{{ yield errors(name="NewResponsesEmail")}}
{{end}}
{{ if DefaultUserSettings("new_follower")}}
<label class="input-label">{{ T("new_follower_settings") }}:</label> <br>
<select id="new_follower" name="new_follower" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_follower") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_follower")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewFollower")}}
{{ yield errors(name="NewFollower")}}
{{end}}
{{ if DefaultUserSettings("new_follower_email")}}
<label class="input-label">{{ T("new_follower_email_settings") }}:</label> <br>
<select id="new_follower_email" name="new_follower_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("new_follower_email") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("new_follower_email")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="NewFollowerEmail")}}
{{ yield errors(name="NewFollowerEmail")}}
{{end}}
{{ if DefaultUserSettings("followed")}}
<label class="input-label">{{ T("followed_settings") }}:</label> <br>
<select id="followed" name="followed" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("followed") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("followed")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="Followed")}}
{{ yield errors(name="Followed")}}
{{end}}
{{ if DefaultUserSettings("followed_email")}}
<label class="input-label">{{ T("followed_email_settings") }}:</label>
<br/>
<select id="followed_email" name="followed_email" class="form-input up-input">
<option value="0" {{ if UserProfile.Settings.Get("followed_email") }}selected{{end}}>{{ T("disabled")}}</option>
<option value="1" {{ if UserProfile.Settings.Get("followed_email")}}selected{{end}}>{{ T("enabled")}}</option>
</select>
<br/>
{{ yield errors(name="FollowedEmail")}}
{{ yield errors(name="FollowedEmail")}}
{{end}}
{{ if User.HasAdmin()}}
<h3>{{ T("moderation")}}</h3>
<label class="input-label">{{ T("username")}}:</label> <br>
<input class="form-input up-input" name="username" id="username" type="text" value="{{UserProfile.Username}}">
{{ yield errors(name="Username")}}
<label class="input-label">{{ T("role") }}:</label>
<select id="status" name="status" class="form-input up-input">
<option value="-1" {{ if UserProfile.Status == -1 }}selected{{end}}>{{ T("banned")}}</option>
<option value="0" {{ if UserProfile.Status == 0 }}selected{{end}}>{{ T("member")}} ({{ T("default") }})</option>
<option value="1" {{ if UserProfile.Status == 1 }}selected{{end}}>{{ T("trusted_member")}}</option>
{{ if UserProfile.Status == 2 }} <!-- just so that it shows correctly -->
<option value="2" selected>{{ T("moderator")}}</option>
{{end}}
<option value="3" {{ if UserProfile.Status == 3 }}selected{{end}}>{{ T("scraped_user")}}</option>
</select>
{{ yield errors(name="Status")}}
{{end}}
<label class="input-label"></label>
{{ if User.HasAdmin()}}
<h2>{{ T("moderation")}}</h2>
<table class="user-edit-table">
<tbody>
<tr>
<td><label for="username">{{ T("moderation") }}:</label></td>
<td><input class="form-input up-input" name="username" id="username" type="text" value="{{UserProfile.Username}}"></td>
</tr>
<tr>
<td><label for="status">{{ T("role") }}:</label></td>
<td>
<select id="status" name="status" class="form-input up-input">
<option value="-1" {{ if UserProfile.Status == -1 }}selected{{end}}>{{ T("banned")}}</option>
<option value="0" {{ if UserProfile.Status == 0 }}selected{{end}}>{{ T("member")}} ({{ T("default") }})</option>
<option value="1" {{ if UserProfile.Status == 1 }}selected{{end}}>{{ T("trusted_member")}}</option>
{{ if UserProfile.Status == 2 || UserProfile.Username == "kilo"}}
<option value="2" selected>{{ T("moderator")}}</option>
{{end}}
<option value="3" {{ if UserProfile.Status == 3 }}selected{{end}}>{{ T("scraped_user")}}</option>
</select>
</td>
</tr>
</tbody>
</table>
{{ yield errors(name="Username")}}
{{ yield errors(name="Status")}}
{{end}}
<input type="submit" class="form-input btn-green" name="save" value="{{ T("save_changes")}}">
<span></span>
<input type="reset" class="form-input" value="{{ T("cancel")}}">
</form>
</div>
{{ if User.CurrentOrAdmin(UserProfile.ID) }}
<hr/>
<a href="/user/{{UserProfile.ID}}/{{UserProfile.Username}}?delete" onclick="if (!confirm('{{ T("delete_account_confirm") }}')) return false;" class="form-input btn-red">{{ T("delete_account")}}</a>
</div>
{{end}}
{{end}}

Voir le fichier

@ -51,7 +51,7 @@ func walkDirTest(dir string, t *testing.T) {
em := "cop@cat.fe"
fakeTag := &models.Tag{1, 1, "12345", "anidbid", 1, 0, true}
fakeUser := &models.User{1, "test", "test", "test", 1, time.Now(), time.Now(), "test", time.Now(), "en", "test", "test", "test", "test", "test", "test", 0.0, []models.User{}, []models.User{}, "test", []models.Torrent{}, []models.Notification{}, 1, models.UserSettings{}, []models.Tag{*fakeTag}}
fakeUser := &models.User{1, "test", "test", "test", 1, time.Now(), time.Now(), "test", time.Now(), "en", "test", "test", "test", "test", "test", "test", "test", "test", "test", 0.0, []models.User{}, []models.User{}, "test", []models.Torrent{}, []models.Notification{}, 1, models.UserSettings{}, []models.Tag{*fakeTag}}
fakeComment := &models.Comment{1, 1, 1, "test", time.Now(), time.Now(), nil, &models.Torrent{}, fakeUser}
fakeScrapeData := &models.Scrape{1, 0, 0, 10, time.Now()}
fakeFile := &models.File{1, 1, "l12:somefile.mp4e", 3}

Voir le fichier

@ -28,6 +28,9 @@ type UserForm struct {
ConfirmPassword string `validate:"omitempty" form:"password_confirmation" json:"password_confirmation" omit:"true"`
Status int `validate:"default=0" form:"status" json:"status"`
Theme string `form:"theme" json:"theme"`
AnidexAPIToken string `validate:"-" form:"anidex_api" json:"anidex_api"`
NyaasiAPIToken string `validate:"-" form:"nyaasi_api" json:"nyaasi_api"`
TokyoTAPIToken string `validate:"-" form:"tokyot_api" json:"tokyot_api"`
}
// UserSettingsForm is used when updating a user.

Voir le fichier

@ -36,7 +36,7 @@ func TestForms(t *testing.T) {
"lol", "", "testing", "testing", "xxx", "1",
}
login := &LoginForm{"lol", "testing", "/", "false"}
user := &UserForm{"lol", "", "", "testing", "testing", "testing", 0, ""}
user := &UserForm{"lol", "", "", "testing", "testing", "testing", 0, "", "test", "test", "test"}
userSettings := &UserSettingsForm{}
password := &PasswordForm{"testing", "testing"}
passwordReset := &SendPasswordResetForm{"lol@gt.com"}