Small fixes
This commit is contained in:
parent
4d5d7fdcc1
commit
0bb3895ce8
|
@ -13,7 +13,9 @@ $(document).on "DOMContentLoaded", ->
|
|||
else
|
||||
$("#ban-controls-time").show()
|
||||
|
||||
$("#until").addClass("remove-native-picker").datetimepicker
|
||||
parent.find("#until").datetimepicker
|
||||
defaultDate: parent.find("#until").val()
|
||||
sideBySide: true
|
||||
icons:
|
||||
time: "fa fa-clock-o"
|
||||
date: "fa fa-calendar"
|
||||
|
@ -39,8 +41,8 @@ $(document).on "DOMContentLoaded", ->
|
|||
data = {
|
||||
ban: checktostr "#_ban"
|
||||
permaban: checktostr "#_permaban"
|
||||
until: $("#until")[0].value
|
||||
reason: $("#reason")[0].value
|
||||
until: $("#until")[0].value.trim()
|
||||
reason: $("#reason")[0].value.trim()
|
||||
user: $("#_user")[0].value
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ class Ajax::ModerationController < ApplicationController
|
|||
unban = params[:ban] == "0"
|
||||
perma = params[:permaban] == "1"
|
||||
|
||||
buntil = DateTime.strptime params[:until], "%Y-%m-%dT%H:%M" unless unban or perma
|
||||
buntil = DateTime.strptime params[:until], "%m/%d/%Y %I:%M %p" unless unban or perma
|
||||
|
||||
if not unban and target.admin?
|
||||
@status = :nopriv
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#ban-controls{style: "#{"display: none" unless @user.banned?}"}
|
||||
= f.check_box :permaban, label: "Permanently?", checked: @user.permanently_banned?
|
||||
#ban-controls-time{style: "#{"display: none" unless not @user.permanently_banned?}"}
|
||||
= f.datetime_local_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%Y-%m-%dT%H:%M")
|
||||
= f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p")
|
||||
= f.text_field :reason, placeholder: "Reason", value: @user.ban_reason
|
||||
.modal-footer
|
||||
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }} Close
|
||||
|
|
Loading…
Reference in New Issue