bans: change expires_at field to duration.

Changes:

* Change the `expires_at` field to `duration`.
* Make moderators choose from a fixed set of standard ban lengths,
  instead of allowing arbitrary ban lengths.
* List `duration` in seconds in the /bans.json API.
* Dump bans to BigQuery.

Note that some old bans have a negative duration. This is because their
expiration date was before their creation date, which is because in 2013
bans were migrated to Danbooru 2 and the original ban creation dates
were lost.
This commit is contained in:
evazion
2021-03-10 17:20:52 -06:00
parent 791b8c61f6
commit 81fe68d392
16 changed files with 90 additions and 86 deletions

View File

@@ -2,11 +2,7 @@
<div id="a-edit">
<h1>Edit Ban</h1>
<%= edit_form_for(@ban) do |f| %>
<%= f.input :duration, :hint => "in days" %>
<%= f.input :reason %>
<%= f.button :submit, :value => "Ban" %>
<% end %>
<%= render "form", ban: @ban %>
</div>
</div>