* Add new followers directly to user.Followers * Update user.go * Remove useless condition * Query an update of user followers if at 0 when looking at his profile * Fix comment not appearing until you refreshed the torrent page * call ViewHandler so that comments visually update properly * Remove now useless imports * Add "uploader" userstatus in comment * GetLikings() & GetFollowers() now return count too * Don't update follower count here * Update follower count directly here * show liking count * Update user.go * Update profile.jet.html * Update torrentParam.go * Fix locked torrents that were shown even when they should not * Update torrentParam_test.go * remove inline styling * Update main.css * Update upload.jet.html * Update main.css * Update tomorrow.css * Update classic.css * Update classic_colors.css * Update index_site.jet.html * Make announcements support markdown * Add markdown form to announcement creation * fix "report" text position * Add exclude search option to exclude words * Make sure the "NameLike" value is the search query because we edit it during a search * Show search content in page title for /feed too * rollback * Add "Search" variable that shows exactly what is being searched * Use "Search.Search" variable here instead of NameLike because NameLike is edited * Update torrentParam_test.go * Update torrentParam.go * remove redundant spaces from NameLike * Update torrentParam.go * Update torrentParam.go * Update torrentParam.go * Update torrentParam.go * turn date input into type date * bigger date inputs * add support for YYYY-MM-DD dates * rollback this change * rollback * Update search.jet.html * Update helpers.go * Update template_functions.go * Update torrentParam.go * only uploader & staff can comment on locked torrents * Add "Upload to Nyaa/Sukebei" button for mods * Update torrentlist.jet.html * Update view.jet.html * Update view.jet.html * fix wrong page title for notifications page
123 lignes
5,1 Kio
HTML
123 lignes
5,1 Kio
HTML
{{ extends "layouts/index_admin" }}
|
|
{{block title()}}{{ T("torrents_list") }}{{end}}
|
|
{{ block content_body()}}
|
|
<div class="results box">
|
|
<h1>{{ T("torrents_list") }}</h1>
|
|
<form method="post" action="">
|
|
<div class="toolbar">
|
|
<select class="cb_action" name="action">
|
|
<option value="">{{ T("action_select") }}</option>
|
|
<option value="status">{{ T("change_status") }}</option>
|
|
<option value="delete">{{ T("delete") }}</option>
|
|
</select>
|
|
<select class="cb_action" style="display: none;" name="status">
|
|
<option value="">{{ T("to_status") }}</option>
|
|
<option value="5">{{ T("torrent_status_blocked")}}</option>
|
|
<option value="1">{{ T("torrent_status_normal")}}</option>
|
|
<option value="2">{{ T("torrent_status_remake")}}</option>
|
|
<option value="3">{{ T("trusted")}}</option>
|
|
<option value="4">A+</option>
|
|
</select>
|
|
<input type="submit" class="form-input" value="Apply" />
|
|
<input type="reset" class="form-input" value="Reset" />
|
|
<div class="float-right">
|
|
<a href="/mod/torrents" class="form-input">{{ T("torrents_not_deleted") }}</a>
|
|
<a href="/mod/torrents/deleted" class="form-input">{{ T("torrents_deleted") }}</a>
|
|
</div>
|
|
</div>
|
|
<table class="table">
|
|
<thead class="torrent-info">
|
|
<tr>
|
|
<th class="tr-cb">
|
|
<input type="checkbox" name="checkall" data-selectall="checkbox" />
|
|
</th>
|
|
<th class="tr-name">{{ T("name") }}</th>
|
|
<th class="tr-actions">{{ T("uploaded_by") }}</th>
|
|
<th class="tr-actions" style="width:190px">{{ T("actions") }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range Models}}
|
|
<tr {{ if .Status == 5}}class="locked hidden"{{end}}>
|
|
<td class="tr-cb">
|
|
<input type="checkbox" class="selectable" name="torrent_id" value="{{.ID }}" />
|
|
</td>
|
|
<td class="tr-name home-td">
|
|
<a href="/view/{{ .ID }}">{{ .Name }}</a> {{ if User.IsModerator() }}
|
|
<a href="/mod/torrent?id={{.ID}}" class="form-input btn-blue float-right">
|
|
{{ T("edit")}}
|
|
</a> {{end}}
|
|
</td>
|
|
<td class="tr-size home-td">
|
|
{{ if .Uploader }}
|
|
<a href="/user/{{.UploaderID}}/{{.Uploader.Username}}">
|
|
{{ .Uploader.Username }}
|
|
</a> {{ else }}れんちょん{{end}}
|
|
</td>
|
|
<td class="tr-actions home-td"> <form></form>
|
|
<form method="POST" action="/mod/torrent/block" class="delete-form">
|
|
<input type="hidden" name="id" value="{{ .ID }}">
|
|
<button type="submit" class="form-input btn-orange" {{ if !User.IsModerator() }}onclick="if (!confirm('{{ T("are_you_sure") }}')) return false;"{{end}}><i class="icon-trash"></i>{{ if .IsBlocked() }}{{ T("torrent_unblock") }}{{else}}{{ T("torrent_block") }}{{end}}</button>
|
|
</form>
|
|
{{ if User.IsModerator() }}
|
|
<form method="POST" action="/mod/torrent/delete" class="delete-form">
|
|
<input type="hidden" name="id" value="{{ .ID }}">
|
|
{{ if .IsDeleted() }}<input type="hidden" name="definitely" value="true">{{ end }}
|
|
<button type="submit" class="form-input btn-red" onclick="if (!confirm('{{ T("are_you_sure") }} {{ if !.IsDeleted() }}{{ T("delete") }}{{else}}{{ T("delete_definitely_torrent_warning ")}}{{end}}')) return false;"><i class="icon-trash"></i>{{ if .IsDeleted() }}{{ T("delete_definitely") }}{{else}}{{ T("delete") }}{{end}}</button>
|
|
</form>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
{{ block footer_js()}}
|
|
<!-- JS Function for selecting multiple checkboxes -->
|
|
<script type="text/javascript" src="{{URL.Parse("/js/selectAll.js") }}"></script>
|
|
<script type="text/javascript">
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
document.querySelector("select[name='action']").addEventListener("change", function(e) {
|
|
var el = e.target;
|
|
if (el.value == "status")
|
|
document.querySelector("select[name='status']").style.display = "inline"
|
|
else
|
|
document.querySelector("select[name='status']").style.display = "none"
|
|
console.log(el.value);
|
|
});
|
|
});
|
|
|
|
var deleteButtons = document.querySelectorAll("button.form-input.btn-red")
|
|
|
|
for(var i = 0; i < deleteButtons.length; i++) {
|
|
var needConfirmation = (deleteButtons[i].onclick != null)
|
|
deleteButtons[i].onclick = null
|
|
|
|
deleteButtons[i].addEventListener("click", function (e) {
|
|
e.preventDefault()
|
|
if(needConfirmation && !confirm("Are you sure?")) {
|
|
return
|
|
} else {
|
|
var form = this.parentNode
|
|
var formInputs = form.querySelectorAll('input')
|
|
var query = ""
|
|
|
|
for(var x = 0; x < formInputs.length; x ++) {
|
|
if(query != "") query = query + "&"
|
|
query = query + formInputs[x].name + "=" + formInputs[x].value
|
|
}
|
|
|
|
Query.Post(form.action, query, function(data) {})
|
|
|
|
this.parentNode.parentNode.parentNode.className = this.parentNode.parentNode.className + " hidden"
|
|
this.innerText = "Deleted"
|
|
this.disabled = true
|
|
}
|
|
})
|
|
}
|
|
|
|
</script>
|
|
{{end}}
|