mirror of
https://github.com/ferdzo/serviceCRM.git
synced 2026-04-05 05:06:25 +00:00
Changed HTMX templates
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from .models import Insert
|
from .models import Insert
|
||||||
|
|
||||||
|
class DateInput(forms.DateInput):
|
||||||
|
input_type = 'date'
|
||||||
|
|
||||||
class InputForm(forms.ModelForm):
|
class InputForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Insert
|
model = Insert
|
||||||
fields = {"name", "phone", "description", "date","done"}
|
fields = {"name", "phone", "description", "date","done"}
|
||||||
labels = {'name': "Name", 'phone': "Phone", 'date': "Date", 'description': "Description",'done':"Done"}
|
labels = {'name': "Name", 'phone': "Phone", 'date': "Date", 'description': "Description",'done':"Done"}
|
||||||
|
widgets = {
|
||||||
|
'date': DateInput(),
|
||||||
|
}
|
||||||
field_order =["name", "phone", "description", "date","done"]
|
field_order =["name", "phone", "description", "date","done"]
|
||||||
|
|
||||||
# name = forms.CharField(label="Name", max_length=30)
|
# name = forms.CharField(label="Name", max_length=30)
|
||||||
|
|||||||
@@ -40,8 +40,11 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'crispy_forms'
|
'crispy_forms',
|
||||||
|
'crispy_bootstrap5'
|
||||||
]
|
]
|
||||||
|
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
|
||||||
|
CRISPY_TEMPLATE_PACK = "bootstrap5"
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
|||||||
21
serviceCRM/templates/serviceCRM/base.html
Normal file
21
serviceCRM/templates/serviceCRM/base.html
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||||
|
<title>Service </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-8">
|
||||||
|
<h1 class="mt-2">Django People</h1>
|
||||||
|
<hr class="mt-0 mb-4">
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,31 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
{% extends 'base.html' %}
|
||||||
<html lang="en">
|
{% block content %}
|
||||||
<head>
|
{% csrf_token %}
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
<title>Document</title>
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form action="/insert/" method="post">
|
<form action="/insert/" method="post">
|
||||||
{% comment %} <label for="name">Name</label></br>
|
|
||||||
<input type="text" name="name" id="name"></br>
|
|
||||||
<label for="phone">Phone</label></br>
|
|
||||||
<input type="text" name="phone" id="phone"></br>
|
|
||||||
<label for="date">Date</label></br>
|
|
||||||
<input type="date" name="date" id="date"></br>
|
|
||||||
<label for="Description">Description</label></br>
|
|
||||||
<input type="text" name="Description" id="Description"></br>
|
|
||||||
<br>
|
|
||||||
<input type="submit" value="OK"> {% endcomment %}
|
|
||||||
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{form.as_p}}
|
{{form.as_p}}
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" class="btn btn-success" value="Submit">
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</body>
|
{% endblock%}
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user