mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2024-12-22 17:10:11 +00:00
Hide email input on admin when disabled
This commit is contained in:
parent
331dbc3d28
commit
7f250b13fb
@ -170,9 +170,11 @@ $("form#inviteForm").submit(function() {
|
|||||||
'<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" style="margin-right: 0.5rem;"></span>' +
|
'<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" style="margin-right: 0.5rem;"></span>' +
|
||||||
'Loading...';
|
'Loading...';
|
||||||
var send_object = $("form#inviteForm").serializeObject();
|
var send_object = $("form#inviteForm").serializeObject();
|
||||||
|
if (document.getElementById('sent_to_address') != null) {
|
||||||
if (document.getElementById('send_to_address_enabled').checked) {
|
if (document.getElementById('send_to_address_enabled').checked) {
|
||||||
send_object['email'] = document.getElementById('send_to_address').value;
|
send_object['email'] = document.getElementById('send_to_address').value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
var send = JSON.stringify(send_object);
|
var send = JSON.stringify(send_object);
|
||||||
$.ajax('/generateInvite', {
|
$.ajax('/generateInvite', {
|
||||||
data : send,
|
data : send,
|
||||||
|
@ -120,6 +120,7 @@
|
|||||||
<select class="form-control" id="minutes" name="minutes">
|
<select class="form-control" id="minutes" name="minutes">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
{% if email_enabled %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="send_to_address">Send invite to address</label>
|
<label for="send_to_address">Send invite to address</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@ -131,6 +132,7 @@
|
|||||||
<input type="email" class="form-control" placeholder="example@example.com" id="send_to_address" disabled>
|
<input type="email" class="form-control" placeholder="example@example.com" id="send_to_address" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<button type="submit" id="generateSubmit" class="btn btn-primary">Generate</button>
|
<button type="submit" id="generateSubmit" class="btn btn-primary">Generate</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,9 @@ def page_not_found(e):
|
|||||||
def admin():
|
def admin():
|
||||||
# return app.send_static_file('admin.html')
|
# return app.send_static_file('admin.html')
|
||||||
return render_template('admin.html',
|
return render_template('admin.html',
|
||||||
contactMessage='')
|
contactMessage='',
|
||||||
|
email_enabled=config.getboolean(
|
||||||
|
'invite_emails', 'enabled'))
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<path:path>')
|
@app.route('/<path:path>')
|
||||||
@ -27,7 +29,6 @@ def static_proxy(path):
|
|||||||
contactMessage=config['ui']['contact_message']), 404
|
contactMessage=config['ui']['contact_message']), 404
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/invite/<path:path>')
|
@app.route('/invite/<path:path>')
|
||||||
def inviteProxy(path):
|
def inviteProxy(path):
|
||||||
if checkInvite(path):
|
if checkInvite(path):
|
||||||
@ -48,7 +49,8 @@ def inviteProxy(path):
|
|||||||
helpMessage=config['ui']['help_message'],
|
helpMessage=config['ui']['help_message'],
|
||||||
successMessage=config['ui']['success_message'],
|
successMessage=config['ui']['success_message'],
|
||||||
jfLink=config['jellyfin']['server'],
|
jfLink=config['jellyfin']['server'],
|
||||||
validate=config.getboolean('password_validation',
|
validate=config.getboolean(
|
||||||
|
'password_validation',
|
||||||
'enabled'),
|
'enabled'),
|
||||||
requirements=validator.getCriteria(),
|
requirements=validator.getCriteria(),
|
||||||
email=email)
|
email=email)
|
||||||
|
Loading…
Reference in New Issue
Block a user