mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-31 04:52:12 +02:00
Small fixes
This commit is contained in:
parent
4d5d7fdcc1
commit
0bb3895ce8
3 changed files with 7 additions and 5 deletions
|
@ -13,7 +13,9 @@ $(document).on "DOMContentLoaded", ->
|
||||||
else
|
else
|
||||||
$("#ban-controls-time").show()
|
$("#ban-controls-time").show()
|
||||||
|
|
||||||
$("#until").addClass("remove-native-picker").datetimepicker
|
parent.find("#until").datetimepicker
|
||||||
|
defaultDate: parent.find("#until").val()
|
||||||
|
sideBySide: true
|
||||||
icons:
|
icons:
|
||||||
time: "fa fa-clock-o"
|
time: "fa fa-clock-o"
|
||||||
date: "fa fa-calendar"
|
date: "fa fa-calendar"
|
||||||
|
@ -39,8 +41,8 @@ $(document).on "DOMContentLoaded", ->
|
||||||
data = {
|
data = {
|
||||||
ban: checktostr "#_ban"
|
ban: checktostr "#_ban"
|
||||||
permaban: checktostr "#_permaban"
|
permaban: checktostr "#_permaban"
|
||||||
until: $("#until")[0].value
|
until: $("#until")[0].value.trim()
|
||||||
reason: $("#reason")[0].value
|
reason: $("#reason")[0].value.trim()
|
||||||
user: $("#_user")[0].value
|
user: $("#_user")[0].value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ class Ajax::ModerationController < ApplicationController
|
||||||
unban = params[:ban] == "0"
|
unban = params[:ban] == "0"
|
||||||
perma = params[:permaban] == "1"
|
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?
|
if not unban and target.admin?
|
||||||
@status = :nopriv
|
@status = :nopriv
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#ban-controls{style: "#{"display: none" unless @user.banned?}"}
|
#ban-controls{style: "#{"display: none" unless @user.banned?}"}
|
||||||
= f.check_box :permaban, label: "Permanently?", checked: @user.permanently_banned?
|
= f.check_box :permaban, label: "Permanently?", checked: @user.permanently_banned?
|
||||||
#ban-controls-time{style: "#{"display: none" unless not @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
|
= f.text_field :reason, placeholder: "Reason", value: @user.ban_reason
|
||||||
.modal-footer
|
.modal-footer
|
||||||
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }} Close
|
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }} Close
|
||||||
|
|
Loading…
Reference in a new issue