put max attribute for days
parent
e5b21825aa
commit
a5c93d199b
|
@ -110,6 +110,9 @@ def git_head():
|
||||||
gitref = 'Error'
|
gitref = 'Error'
|
||||||
return (gitref, head_txt)
|
return (gitref, head_txt)
|
||||||
|
|
||||||
|
def max_days():
|
||||||
|
return int((2147483647-time.time())/86400)
|
||||||
|
|
||||||
@app.context_processor
|
@app.context_processor
|
||||||
def inject_constants():
|
def inject_constants():
|
||||||
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL,
|
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL,
|
||||||
|
@ -132,6 +135,6 @@ def inject_constants():
|
||||||
"PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS,
|
"PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS,
|
||||||
"TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME,
|
"TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME,
|
||||||
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE, "TAGLINES":TAGLINES, "IS_FISTMAS":IS_FISTMAS, "get_alt_graph":get_alt_graph, "current_registered_users":current_registered_users,
|
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE, "TAGLINES":TAGLINES, "IS_FISTMAS":IS_FISTMAS, "get_alt_graph":get_alt_graph, "current_registered_users":current_registered_users,
|
||||||
"git_head":git_head,
|
"git_head":git_head, "max_days":max_days,
|
||||||
"BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT,
|
"BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT,
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<input autocomplete="off" name="reason" id="ban-modal-link" class="form-control" placeholder="Enter reason" maxlength="256">
|
<input autocomplete="off" name="reason" id="ban-modal-link" class="form-control" placeholder="Enter reason" maxlength="256">
|
||||||
|
|
||||||
<label for="days" class="mt-3">Days</label>
|
<label for="days" class="mt-3">Days</label>
|
||||||
<input autocomplete="off" type="number" step="any" name="days" id="days" class="form-control" placeholder="Leave blank for permanent">
|
<input autocomplete="off" type="number" step="any" name="days" max="{{max_days()}}" id="days" class="form-control" placeholder="Leave blank for permanent">
|
||||||
|
|
||||||
<div class="custom-control custom-switch mt-3">
|
<div class="custom-control custom-switch mt-3">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="alts" name="alts">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="alts" name="alts">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
<input hidden name="reason" id="chud-modal-link">
|
<input hidden name="reason" id="chud-modal-link">
|
||||||
|
|
||||||
<label for="days">Days</label>
|
<label for="days">Days</label>
|
||||||
<input autocomplete="off" type="number" step="any" name="days" id="days" class="form-control" placeholder="Leave blank for permanent">
|
<input autocomplete="off" type="number" step="any" name="days" max="{{max_days()}}" id="days" class="form-control" placeholder="Leave blank for permanent">
|
||||||
|
|
||||||
<div class="modal-footer pr-0">
|
<div class="modal-footer pr-0">
|
||||||
<button type="button" class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<form class="my-3" action="/ban_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this, true)">
|
<form class="my-3" action="/ban_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this, true)">
|
||||||
<input hidden name="formkey" value="{{v|formkey}}">
|
<input hidden name="formkey" value="{{v|formkey}}">
|
||||||
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-ban-submit-{{deviceType}}" required>
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-ban-submit-{{deviceType}}" required>
|
||||||
<input autocomplete="off" style="font-size:11px" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
<input autocomplete="off" style="font-size:11px" type="number" step="any" class="form-control" name="days" max="{{max_days()}}" placeholder="Days (blank = permanent)">
|
||||||
<div class="custom-control custom-checkbox mb-1">
|
<div class="custom-control custom-checkbox mb-1">
|
||||||
<input autocomplete="off" type="checkbox" id="alts-2-{{deviceType}}" class="custom-control-input" name="alts" value="1">
|
<input autocomplete="off" type="checkbox" id="alts-2-{{deviceType}}" class="custom-control-input" name="alts" value="1">
|
||||||
<label class="custom-control-label" for="alts-2-{{deviceType}}">Include alts</label>
|
<label class="custom-control-label" for="alts-2-{{deviceType}}">Include alts</label>
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
<form class="my-3" action="/agendaposter/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this, true)">
|
<form class="my-3" action="/agendaposter/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this, true)">
|
||||||
<input hidden name="formkey" value="{{v|formkey}}">
|
<input hidden name="formkey" value="{{v|formkey}}">
|
||||||
<input autocomplete="off" type="number" step="any" name="days" class="form-control" placeholder="Days (0 or blank = permanent)">
|
<input autocomplete="off" type="number" step="any" name="days" max="{{max_days()}}" class="form-control" placeholder="Days (0 or blank = permanent)">
|
||||||
<input type="submit" class="btn btn-danger" value="Chud">
|
<input type="submit" class="btn btn-danger" value="Chud">
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue