final final final final final version (version 1.5)
This commit is contained in:
@@ -16,12 +16,11 @@ class BundleForm(forms.ModelForm):
|
|||||||
("Accessory", "Accessorio"),
|
("Accessory", "Accessorio"),
|
||||||
("Computer", "Computer")
|
("Computer", "Computer")
|
||||||
)
|
)
|
||||||
product_type = forms.ChoiceField(choices=type_choices, initial="")
|
product_type = forms.ChoiceField(choices=type_choices, initial="", label= "Tipo prodotto")
|
||||||
delivery_date = forms.DateField(widget=SelectDateWidget(), initial=datetime.now().date() )
|
delivery_date = forms.DateField(widget=SelectDateWidget(), initial=datetime.now().date(), label="Data di Consegna")
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Bundle
|
model = Bundle
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
"product_type": "Tipo Prodotto",
|
"product_type": "Tipo Prodotto",
|
||||||
"product_name": "Nome Prodotto",
|
"product_name": "Nome Prodotto",
|
||||||
@@ -219,8 +218,14 @@ class ResignationForm(forms.ModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class StudentForm(forms.ModelForm):
|
class StudentForm(forms.ModelForm):
|
||||||
|
choice=(
|
||||||
|
("ok","Ok"),
|
||||||
|
("resigned", "Dimesso")
|
||||||
|
)
|
||||||
|
|
||||||
birth_date = forms.DateField(widget=SelectDateWidget(), label="Data di Nascita")
|
birth_date = forms.DateField(widget=SelectDateWidget(), label="Data di Nascita")
|
||||||
resignation_date = forms.DateField(widget=SelectDateWidget(), label="Data di Dimissioni:")
|
resignation_date = forms.DateField(widget=SelectDateWidget(), required=False, label="Data di Dimissioni:")
|
||||||
|
student_status = forms.ChoiceField(choices=choice, label="Status Studente")
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Student
|
model = Student
|
||||||
fields= "__all__"
|
fields= "__all__"
|
||||||
@@ -248,7 +253,7 @@ class StudentForm(forms.ModelForm):
|
|||||||
"nation_birth": "Nazione di Nascita",
|
"nation_birth": "Nazione di Nascita",
|
||||||
"course_id": "Corso"
|
"course_id": "Corso"
|
||||||
}
|
}
|
||||||
exclude = ["course_acronym", "course_code", "course_status", "course_year", "course_name"]
|
exclude = ["course_code", "course_status", "course_year", "course_name"]
|
||||||
|
|
||||||
|
|
||||||
class AssignmentComputerForm(forms.Form):
|
class AssignmentComputerForm(forms.Form):
|
||||||
|
|||||||
@@ -7,10 +7,11 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
{% if bundle.product_type == "Computer" %}
|
|
||||||
<a href="/import/serials" class="pure-button pure-button-primary add-button">Importa Computer</a>
|
|
||||||
{% endif %}
|
|
||||||
<div class="detail-content">
|
<div class="detail-content">
|
||||||
|
{% if bundle.product_type == "Computer" %}
|
||||||
|
<a href="/import/serials" class="pure-button pure-button-primary add-button">Importa Computer</a>
|
||||||
|
{% endif %}
|
||||||
<table class="pure-table pure-table-horizontal width-100">
|
<table class="pure-table pure-table-horizontal width-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -12,16 +12,16 @@
|
|||||||
<p>{{ err_str }}</p>
|
<p>{{ err_str }}</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h3>Stai modificando: </h3>
|
<h3>Stai modificando lo studente {{ id }}:</h3>
|
||||||
<form action="/edit/student/{{ id }}" method="post" enctype="multipart/form-data" class="pure-form pure-form-2 pure-form-stacked">
|
<form action="/edit/student/{{ id }}" method="post" enctype="multipart/form-data" class="pure-form pure-form-2 pure-form-stacked">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="from-content width-100">
|
<div class="from-content width-100">
|
||||||
{{ form }}
|
{{ form }}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-buttons">
|
<div class="form-buttons">
|
||||||
<button type="submit" class="pure-button pure-button-primary">Modifica</button>
|
<button type="submit" class="pure-button pure-button-primary">Modifica</button>
|
||||||
<button type="reset" class="pure-button button-warning">Reset</button>
|
<button type="reset" class="pure-button button-warning">Reset</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ def assignment_cespite(request):
|
|||||||
computer = get_object_or_404(Computer, serial=form["serial"])
|
computer = get_object_or_404(Computer, serial=form["serial"])
|
||||||
computer_copy = copy.deepcopy(computer)
|
computer_copy = copy.deepcopy(computer)
|
||||||
computer.cespite = form["cespite"]
|
computer.cespite = form["cespite"]
|
||||||
computer.save
|
computer.save()
|
||||||
|
|
||||||
record.date = datetime.now().date()
|
record.date = datetime.now().date()
|
||||||
record.action = "assignment"
|
record.action = "assignment"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from ..models import Bundle, Supplier, Student, Course, Ticket
|
|||||||
|
|
||||||
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
||||||
def storage(request):
|
def storage(request):
|
||||||
bundles = Bundle.objects.all()
|
bundles = Bundle.objects.all().order_by("-id")
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
return render(request, "gestionale/list/storage.html", {
|
return render(request, "gestionale/list/storage.html", {
|
||||||
"bundles": bundles
|
"bundles": bundles
|
||||||
@@ -31,7 +31,7 @@ def suppliers(request):
|
|||||||
|
|
||||||
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
||||||
def students(request):
|
def students(request):
|
||||||
students = Student.objects.all().order_by("course_acronym")
|
students = Student.objects.all().order_by("course_id")
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
return render(request, "gestionale/list/students.html", {
|
return render(request, "gestionale/list/students.html", {
|
||||||
"students": students
|
"students": students
|
||||||
|
|||||||
Reference in New Issue
Block a user