-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
569 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def verbose_name(instance): | ||
return instance._meta.verbose_name | ||
|
||
|
||
@register.filter | ||
def get_fields(instance, fields=None): | ||
return ( | ||
(field, field.value_to_string(instance)) | ||
for field in instance._meta.fields | ||
if not fields or field.name in fields.split(" ") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/genlab_bestilling/migrations/0004_alter_equimentorderquantity_equipment_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by Django 5.0.6 on 2024-06-11 06:20 | ||
|
||
import django.db.models.deletion | ||
import taggit.managers | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("genlab_bestilling", "0003_alter_order_notes"), | ||
( | ||
"taggit", | ||
"0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="equimentorderquantity", | ||
name="equipment", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="orders", | ||
to="genlab_bestilling.equipmenttype", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="equimentorderquantity", | ||
name="order", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="equipments", | ||
to="genlab_bestilling.equipmentorder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="order", | ||
name="tags", | ||
field=taggit.managers.TaggableManager( | ||
blank=True, | ||
help_text="A comma-separated list of tags.", | ||
through="taggit.TaggedItem", | ||
to="taggit.Tag", | ||
verbose_name="Tags", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,36 @@ | ||
import django_tables2 as tables | ||
|
||
from .models import Order | ||
from .models import Order, Project | ||
|
||
|
||
class OrderTable(tables.Table): | ||
polymorphic_ctype = tables.Column(verbose_name="Type") | ||
name = tables.Column(linkify=True) | ||
|
||
class Meta: | ||
model = Order | ||
fields = ("name", "species", "sample_types") | ||
fields = ("name", "species", "sample_types", "polymorphic_ctype") | ||
|
||
empty_text = "No Orders" | ||
|
||
def render_polymorphic_ctype(self, value): | ||
return value.name | ||
|
||
|
||
class ProjectTable(tables.Table): | ||
number = tables.Column(linkify=True) | ||
|
||
class Meta: | ||
model = Project | ||
fields = ( | ||
"number", | ||
"name", | ||
"area", | ||
"species", | ||
"sample_types", | ||
"analysis_types", | ||
"expected_total_samples", | ||
"analysis_timerange", | ||
) | ||
|
||
empty_text = "No Projects" |
22 changes: 22 additions & 0 deletions
22
src/genlab_bestilling/templates/genlab_bestilling/analysisorder_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends "base.html" %} | ||
{% load neapolitan %} | ||
{% load i18n %} | ||
|
||
|
||
{% block content %} | ||
|
||
<h3 class="text-4xl mb-5">Order #{{ object.id }} - {{ object.name }}</h3> | ||
<div class="flex gap-5 mb-5"> | ||
<a class="btn bg-primary" href="{% url 'project-order-list' project_id=project.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
</div> | ||
|
||
{% object-detail object=object %} | ||
|
||
|
||
<h5 class="text-2xl mb-5">Samples</h5> | ||
|
||
<div class="flex gap-5"> | ||
<a class="btn bg-primary" href="{% url 'project-analysis-update' project_id=object.project_id pk=object.id %}">Edit</a> | ||
<button class="btn bg-secondary">Confirm Order</button> | ||
</div> | ||
{% endblock %} |
16 changes: 16 additions & 0 deletions
16
src/genlab_bestilling/templates/genlab_bestilling/analysisorder_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% extends "base.html" %} | ||
{% load core %} | ||
|
||
{% block content %} | ||
<h3 class="text-4xl mb-5">{% if object.id %}{{ object }}{% else %}Create {{ object|verbose_name }}{% endif %}</h3> | ||
|
||
<div class="flex gap-5 mb-5"> | ||
{% if object.id %} | ||
<a class="btn bg-primary" href="{% url 'project-analysis-detail' project_id=project.id pk=object.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% else %} | ||
<a class="btn bg-primary" href="{% url 'project-order-list' project_id=project.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% endif %} | ||
</div> | ||
{% formset endpoint=request.path csrf_token=csrf_token form_collection=form_collection %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/genlab_bestilling/templates/genlab_bestilling/equipmentorder_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends "base.html" %} | ||
{% load core %} | ||
|
||
{% block content %} | ||
<h3 class="text-4xl mb-5">{% if object.id %}{{ object }}{% else %}Create {{ object|verbose_name }}{% endif %}</h3> | ||
<div class="flex gap-5 mb-5"> | ||
{% if object.id %} | ||
<a class="btn bg-primary" href="{% url 'project-equipment-detail' project_id=project.id pk=object.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% else %} | ||
<a class="btn bg-primary" href="{% url 'project-order-list' project_id=project.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% endif %} </div> | ||
{% formset endpoint=request.path csrf_token=csrf_token form_collection=form_collection %} | ||
|
||
{% endblock %} |
15 changes: 4 additions & 11 deletions
15
src/genlab_bestilling/templates/genlab_bestilling/generic_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% block content %} | ||
<h3 class="text-2xl">{{ title }}</h3> | ||
{% load core %} | ||
|
||
{% load formsetify %} | ||
{% block content %} | ||
<h3 class="text-2xl">{% if object.id %}{{ object }}{% else %}Create {{ object|verbose_name }}{% endif %}</h3> | ||
|
||
<django-formset endpoint="{{ request.path }}" csrf-token="{{ csrf_token }}"> | ||
{{ form_collection }} | ||
<button type="button" df-click="disable -> submit -> proceed !~ scrollToError">Submit</button> | ||
<button type="button" df-click="reset">Reset to initial</button> | ||
</django-formset> | ||
{% formset endpoint=request.path csrf_token=csrf_token form_collection=form_collection %} | ||
|
||
<link href="{% static 'formset/css/collections.css' %}" rel="stylesheet"> | ||
<script type="module" src="{% static 'formset/js/django-formset.js' %}"></script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 9 additions & 6 deletions
15
src/genlab_bestilling/templates/genlab_bestilling/project_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
{% extends "base.html" %} | ||
{% load neapolitan %} | ||
{% load core %} | ||
{% load i18n %} | ||
|
||
{% block content %} | ||
<h3 class="text-2xl">{{ object.name }} - {{ object.number }}</h3> | ||
<h3 class="text-4xl mb-5">{{ object.name }} - {{ object.number }}</h3> | ||
|
||
{% object_detail object view.fields %} | ||
|
||
<div class="flex"> | ||
<a href="{% url 'project-equipment-create' project_id=object.id %}"><i class="fas fa-plus"></i> {% translate 'Equipment order' %}</a> | ||
{% object-detail object=object fields="name verified area expected_total_samples analysis_timerange" %} | ||
|
||
<div class="flex gap-5 my-5"> | ||
<a class="btn bg-primary" href="{% url 'project-list' %}"><i class="fas fa-arrow-left"></i> back</a> | ||
<a class="btn bg-primary" href="{% url 'project-update' pk=project.id %}"><i class="fas fa-edit"></i> Edit</a> | ||
<a class="btn bg-primary" href="{% url 'project-order-list' project_id=project.id %}"><i class="fas fa-eye"></i> Orders</a> | ||
<a class="btn bg-primary" href="{% url 'project-equipment-create' project_id=project.id %}"><i class="fas fa-plus"></i> Equipment order</a> | ||
<a class="btn bg-primary" href="{% url 'project-analysis-create' project_id=project.id %}"><i class="fas fa-plus"></i> Analysis order</a> | ||
</div> | ||
{% endblock %} |
15 changes: 15 additions & 0 deletions
15
src/genlab_bestilling/templates/genlab_bestilling/project_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "base.html" %} | ||
{% load core %} | ||
|
||
{% block content %} | ||
<h3 class="text-4xl mb-5">{% if object.id %}{{ object }}{% else %}Create {{ object|verbose_name }}{% endif %}</h3> | ||
<div class="flex gap-5 mb-5"> | ||
{% if object.id %} | ||
<a class="btn bg-primary" href="{% url 'project-detail' pk=object.id %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% else %} | ||
<a class="btn bg-primary" href="{% url 'project-list' %}"><i class="fas fa-arrow-left"></i> back</a> | ||
{% endif %} | ||
</div> | ||
{% formset endpoint=request.path csrf_token=csrf_token form=form request=request %} | ||
|
||
{% endblock %} |
Oops, something went wrong.