Skip to content

Commit

Permalink
form class="core" and fixed red delete buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Sep 3, 2024
1 parent a24a963 commit 09d2a04
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions datasette_edit_schema/templates/edit_schema_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
font-size: 1em;
font-family: Helvetica, sans-serif;
}
body form .button-red {
background-color: red;
border-color: red;
}
body form .button-small {
input[type=submit].button-small {
font-size: 0.7em;
}
form input[type=submit].button-red {
background: red;
border-color: rgb(171, 112, 112);
}

select {
border: 1px solid #ccc;
border-radius: 3px;
Expand Down Expand Up @@ -91,15 +92,15 @@ <h1>Edit table <a href="{{ base_url }}{{ database.name|quote_plus }}/{{ tilde_en
{% if can_rename_table %}
<h2>Rename table</h2>

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<p><label>New name&nbsp; <input type="text" name="name"></label>
<input type="hidden" name="rename_table" value="1">
<input type="submit" value="Rename">
</form>
{% endif %}

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<h2>Change existing columns</h2>
<ul class="sortable-columns">
{% for column in columns %}
Expand Down Expand Up @@ -134,7 +135,7 @@ <h2>Change existing columns</h2>

<h2>Add a column</h2>

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<input type="hidden" name="add_column" value="1">
<p><label>Name &nbsp;<input type="text" name="name"></label>
Expand All @@ -156,7 +157,7 @@ <h2>Update foreign key relationships</h2>
}
</style>

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<input type="hidden" name="action" value="update_foreign_keys">
<table class="foreign-key-options">
Expand All @@ -180,7 +181,7 @@ <h2>{% if is_rowid_table %}Set a primary key{% else %}Change the primary key{% e

<p>The primary key column uniquely identifies each row in the table.</p>

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<input type="hidden" name="action" value="update_primary_key">
<label for="primary_key">Primary key column &nbsp;</label>
Expand All @@ -201,7 +202,7 @@ <h2>Table indexes</h2>

<p>Indexes can speed up filter and sort operations against indexed columns.</p>

<form action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
{% if non_primary_key_columns %}
<p><label for="id_add_index_column">
Expand Down Expand Up @@ -233,7 +234,7 @@ <h3>Existing indexes</h3>
{% if can_drop_table %}
<h2>Drop table</h2>

<form id="drop-table-form" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<form class="core" id="drop-table-form" action="{{ base_url }}-/edit-schema/{{ database.name|quote_plus }}/{{ tilde_encode(table) }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<input type="hidden" name="drop_table" value="1">
<input type="submit" class="button-red" value="Drop this table">
Expand Down

0 comments on commit 09d2a04

Please sign in to comment.