add new and update existing baseforms
This commit is contained in:
16
fet2020/templates/baseform/checkbox.html
Normal file
16
fet2020/templates/baseform/checkbox.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<label>
|
||||||
|
{% if field.errors %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
{% if field.value %}checked{% endif %}
|
||||||
|
class="rounded border-gray-300 dark:border-none text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
|
<span class="ml-2 text-gray-700 dark:text-gray-200">{{ field.label }}</span>
|
||||||
|
</label>
|
||||||
20
fet2020/templates/baseform/date.html
Normal file
20
fet2020/templates/baseform/date.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<label>
|
||||||
|
<span class="text-gray-700 dark:text-gray-200">{{ field.label }}</span>
|
||||||
|
{% if field.errors %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<input
|
||||||
|
type="date"
|
||||||
|
id="id_{{ field.name }}"
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.value %}value="{{ field.value|date:"Y-m-d" }}"{% endif %}
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
|
{% if field.help_text %}
|
||||||
|
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
@@ -5,8 +5,24 @@
|
|||||||
<div class="alert-body">{{ field.errors }}</div>
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<input type="date" id="id_{{ field.name }}_0" name="{{ field.name }}_0" value="{{ field.value|date:"Y-m-d" }}" {% if field.required %}required{% endif %} class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
|
<input
|
||||||
<input type="time" id="id_{{ field.name }}_1" name="{{ field.name }}_1" value="{{ field.value|time }}" {% if field.required %}required{% endif %} class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
|
type="date"
|
||||||
|
id="id_{{ field.name }}_0"
|
||||||
|
name="{{ field.name }}_0"
|
||||||
|
value="{{ field.value|date:"Y-m-d" }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="time"
|
||||||
|
id="id_{{ field.name }}_1"
|
||||||
|
name="{{ field.name }}_1"
|
||||||
|
value="{{ field.value|time }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
{% if field.help_text %}
|
{% if field.help_text %}
|
||||||
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
13
fet2020/templates/baseform/file.html
Normal file
13
fet2020/templates/baseform/file.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<label>
|
||||||
|
<span class="text-gray-700 dark:text-gray-200">{{ field.label }}</span>
|
||||||
|
{% if field.errors %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
name={{ field.name }}
|
||||||
|
class="text-gray-700 dark:text-gray-200 block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
|
</label>
|
||||||
@@ -5,7 +5,14 @@
|
|||||||
<div class="alert-body">{{ field.errors }}</div>
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<input type="password" id="id_{{ field.name }}" name="{{ field.name }}" {% if field.required %}required{% endif %} class="mt-1 block w-full rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
|
<input
|
||||||
|
type="password"
|
||||||
|
id="id_{{ field.name }}"
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
{% if field.help_text %}
|
{% if field.help_text %}
|
||||||
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -5,7 +5,12 @@
|
|||||||
<div class="alert-body">{{ field.errors }}</div>
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<select id="id_{{ field.name }}" name="{{ field.name }}" {% if field.required %}required{% endif %} class="block w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
|
<select
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="block {% if field.field.disabled %}bg-gray-200 dark:text-gray-500{% endif %} w-full mt-1 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
{% for elem in field %}
|
{% for elem in field %}
|
||||||
{{ elem }}
|
{{ elem }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -5,7 +5,14 @@
|
|||||||
<div class="alert-body">{{ field.errors }}</div>
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<input type="text" id="id_{{ field.name }}" name="{{ field.name }}" {% if field.value %}value="{{ field.value }}"{% endif %} {% if field.required %}required{% endif %} class="mt-1 block w-full rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
|
<input
|
||||||
|
type="text"
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.value %}value="{{ field.value }}"{% endif %}
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
class="mt-1 block w-full disabled:bg-gray-200 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
{% if field.help_text %}
|
{% if field.help_text %}
|
||||||
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
19
fet2020/templates/baseform/textarea.html
Normal file
19
fet2020/templates/baseform/textarea.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700 dark:text-gray-200">{{ field.label }}</span>
|
||||||
|
{% if field.errors %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">{{ field.errors }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<textarea
|
||||||
|
name="{{ field.name }}"
|
||||||
|
{% if field.field.required %}required{% endif %}
|
||||||
|
{% if field.field.disabled %}disabled{% endif %}
|
||||||
|
{% if field.field.placeholder %}placeholder="{{ field.field.placeholder }}"{% endif %}
|
||||||
|
{% if field.field.rows %}rows="{{ field.field.rows }}"{% endif %}
|
||||||
|
class="mt-1 block w-full disabled:bg-gray-200 rounded-md border-gray-300 dark:border-none shadow-sm focus:border-none focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>{% if field.value %}{{ field.value }}{% endif %}</textarea>
|
||||||
|
{% if field.help_text %}
|
||||||
|
<span class="text-gray-700 dark:text-gray-200">{{ field.help_text }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
Reference in New Issue
Block a user