- Try to move Add... functionality to overviews
This commit is contained in:
@@ -129,7 +129,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="/session_defaults" class="btn btn-sm bg-gradient-primary mb-0">
|
<a href="/session_defaults" class="btn btn-sm bg-gradient-primary mb-0">
|
||||||
{% if 'tenant' in session %}
|
{% if 'tenant' in session %}
|
||||||
TENANT: {{ session['tenant'].get('name', 'None') }}
|
TENANT {{ session['tenant'].get('id', 'None') }}: {{ session['tenant'].get('name', 'None') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -130,6 +130,21 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.querySelectorAll('textarea[data-handle-enter="true"]').forEach(function(textarea) {
|
||||||
|
textarea.addEventListener('keydown', function(e) {
|
||||||
|
if (e.key === 'Enter' && e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
const start = this.selectionStart;
|
||||||
|
const end = this.selectionEnd;
|
||||||
|
this.value = this.value.substring(0, start) + '\n' + this.value.substring(end);
|
||||||
|
this.selectionStart = this.selectionEnd = start + 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -24,9 +24,12 @@
|
|||||||
<!-- Tenant Selection Form -->
|
<!-- Tenant Selection Form -->
|
||||||
<form method="POST" action="{{ url_for('user_bp.handle_tenant_selection') }}">
|
<form method="POST" action="{{ url_for('user_bp.handle_tenant_selection') }}">
|
||||||
{{ render_selectable_table(headers=["Tenant ID", "Tenant Name", "Website", "Type"], rows=rows, selectable=True, id="tenantsTable") }}
|
{{ render_selectable_table(headers=["Tenant ID", "Tenant Name", "Website", "Type"], rows=rows, selectable=True, id="tenantsTable") }}
|
||||||
<div class="form-group mt-3">
|
<div class="form-group mt-3 d-flex justify-content-between">
|
||||||
<button type="submit" name="action" value="select_tenant" class="btn btn-primary">Set Session Tenant</button>
|
<div>
|
||||||
<button type="submit" name="action" value="edit_tenant" class="btn btn-secondary">Edit Tenant</button>
|
<button type="submit" name="action" value="select_tenant" class="btn btn-primary">Set Session Tenant</button>
|
||||||
|
<button type="submit" name="action" value="edit_tenant" class="btn btn-secondary">Edit Tenant</button>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="action" value="new_tenant" class="btn btn-secondary">New Tenant</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,8 @@ def handle_tenant_selection():
|
|||||||
return redirect(prefixed_url_for('user_bp.edit_tenant', tenant_id=tenant_id))
|
return redirect(prefixed_url_for('user_bp.edit_tenant', tenant_id=tenant_id))
|
||||||
case 'select_tenant':
|
case 'select_tenant':
|
||||||
return redirect(prefixed_url_for('user_bp.tenant_overview'))
|
return redirect(prefixed_url_for('user_bp.tenant_overview'))
|
||||||
|
case 'new_tenant':
|
||||||
|
return redirect(prefixed_url_for('user_bp.tenant'))
|
||||||
# Add more conditions for other actions
|
# Add more conditions for other actions
|
||||||
return redirect(prefixed_url_for('select_tenant'))
|
return redirect(prefixed_url_for('select_tenant'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user