link in table definition
This commit is contained in:
@@ -98,8 +98,9 @@
|
||||
<section class="builder-section">
|
||||
<h2>Add a column</h2>
|
||||
<div class="form-grid">
|
||||
<label>Column name
|
||||
<label>{% if page.draft.columns.show_link_target() %}Link alias{% else %}Column name{% endif %}
|
||||
<input name="column_name_input" value="{{ page.draft.columns.name_input }}" placeholder="number">
|
||||
{% if page.draft.columns.show_link_target() %}<small>The alias is the column name used to distinguish this relationship.</small>{% endif %}
|
||||
</label>
|
||||
<label>Column type
|
||||
<select name="column_type_input" hx-post="/admin/tables/builder" hx-trigger="change"
|
||||
@@ -147,6 +148,18 @@
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if page.draft.columns.show_link_target() %}
|
||||
<label>Referenced table
|
||||
<select name="link_table_input">
|
||||
<option value="">Choose a table</option>
|
||||
{% for table in page.draft.relation_tables %}
|
||||
<option value="{{ table }}" {% if page.draft.columns.link_table_input == *table %}selected{% endif %}>{{ table }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% if page.draft.relation_tables.is_empty() %}<small>No eligible tables exist in this scope.</small>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if page.draft.columns.show_money_options() %}
|
||||
<label>Currency
|
||||
<input name="column_currency_input" value="{{ page.draft.columns.currency_input }}" list="currency-codes"
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="form-grid">
|
||||
<label>Column name
|
||||
<label>{% if page.columns.show_link_target() %}Link alias{% else %}Column name{% endif %}
|
||||
<input name="column_name_input" value="{{ page.columns.name_input }}" placeholder="issued_on">
|
||||
{% if page.columns.show_link_target() %}<small>The alias is the column name used to distinguish this relationship.</small>{% endif %}
|
||||
</label>
|
||||
<label>Column type
|
||||
<select name="column_type_input"
|
||||
@@ -74,6 +75,18 @@
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if page.columns.show_link_target() %}
|
||||
<label>Referenced table
|
||||
<select name="link_table_input">
|
||||
<option value="">Choose a table</option>
|
||||
{% for table in page.link_target_tables() %}
|
||||
<option value="{{ table }}" {% if page.columns.link_table_input == *table %}selected{% endif %}>{{ table }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% if page.link_target_tables().is_empty() %}<small>No eligible tables exist in this scope.</small>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if page.columns.show_money_options() %}
|
||||
<label>Currency
|
||||
<input name="column_currency_input" value="{{ page.columns.currency_input }}" list="currency-codes"
|
||||
|
||||
Reference in New Issue
Block a user