Added add column button
This commit is contained in:
@@ -73,6 +73,7 @@
|
||||
document.getElementById('form_edit_column_type').value = column_types[clmn_index];
|
||||
document.getElementById('modal_caller').innerHTML = column_names[clmn_index];
|
||||
document.getElementById('form_delete_column_idintbl').value = clmn_index + 1;
|
||||
document.getElementById('form_edit_column_idintbl').value = clmn_index + 1;
|
||||
}
|
||||
</script>
|
||||
{% endblock script %}
|
||||
@@ -84,7 +85,7 @@
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar mt-2" role="toolbar">
|
||||
<div class="btn-group me-2">
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#new_item"><i class="bi bi-plus-lg"></i></button>
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#create_entry_modal"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
<form method="get" action="/table/{{ tblid }}">
|
||||
<div class="input-group">
|
||||
@@ -116,6 +117,7 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn" data-bs-toggle="modal" data-bs-target="#create_column_modal" type="button" onclick=""><i class="bi bi-bookmark-plus"></i></button>
|
||||
<form method="GET" action="/table/{{ tblid }}">
|
||||
<input value="0" name="sort_field" hidden />
|
||||
<input value="{% if sort_field == 0 %}{{ (sort_dir + 1) % 2}}{% else %}0{% endif %}" name="sort_dir" hidden />
|
||||
@@ -170,12 +172,12 @@
|
||||
|
||||
{% block more_modals %}
|
||||
<!-- Add new item -->
|
||||
<div class="modal fade" id="new_item" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal fade" id="create_entry_modal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5">Add entry</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="document.getElementById('form_edit_entry').reset();"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h5>Cell values:</h5>
|
||||
@@ -216,7 +218,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5"><div class="row"><div class="col-auto">Row <span id="modal_caller"></span></div><div class="col-auto"><i class="bi bi-pencil-fill"></i></div></div></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="document.getElementById('form_edit_entry').reset();"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="/row/edit" method="post" id="form_edit_entry">
|
||||
@@ -255,6 +257,44 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add column -->
|
||||
<div class="modal fade" id="create_column_modal" tabindex="-1" aria-hidden="true" onclick="document.getElementById('form_edit_entry').reset();">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5">New column</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="/column/create" method="post" id="form_create_column">
|
||||
<input name="tblid" value="{{ tblid }}" hidden>
|
||||
<div class="mb-3">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<label for="form_create_column_name" class="form-label">Name:</label>
|
||||
<input type="text" class="form-control" name="name" id="form_create_column_name" />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="form_create_column_type" class="form-label">Type</label>
|
||||
<select class="form-select" name="column_type" id="form_create_column_type">
|
||||
<option value="0">Text</option>
|
||||
<option value="1">Number</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal" type="button" onclick="document.getElementById('form_create_column').reset();"><i class="bi bi-x"></i></button>
|
||||
<button class="btn btn-primary" type="button" onclick="document.getElementById('form_create_column').submit().reset();"><i class="bi bi-check-lg"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit column -->
|
||||
<div class="modal fade" id="edit_column_modal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@@ -266,6 +306,7 @@
|
||||
<div class="modal-body">
|
||||
<form action="/column/edit" method="post" id="form_edit_column">
|
||||
<input name="tblid" value="{{ tblid }}" hidden>
|
||||
<input name="id_in_table" id="form_edit_column_idintbl" hidden>
|
||||
<div class="mb-3">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
@@ -301,4 +342,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock more_modals %}
|
||||
|
||||
Reference in New Issue
Block a user