-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from arthur-schnitzler/main
WIP
- Loading branch information
Showing
16 changed files
with
249 additions
and
510 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
512 changes: 219 additions & 293 deletions
512
apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,9 +6,6 @@ | |
<script src="https://unpkg.com/[email protected]"></script> | ||
{% load django_tables2 %} | ||
{% load crispy_forms_tags %} | ||
<style> | ||
|
||
</style> | ||
<style> | ||
a { | ||
color: var(--{{ entity_type }}); | ||
|
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
apis_core/apis_labels/templates/apis_labels/label_create.html
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
apis_core/apis_labels/templates/apis_labels/labels_list.html
This file was deleted.
Oops, something went wrong.
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,57 +1,13 @@ | ||
from django.shortcuts import render, redirect, get_object_or_404 | ||
from django.urls import reverse_lazy | ||
from django.views import generic | ||
from django.views.generic.edit import DeleteView | ||
from django.contrib.auth.decorators import login_required | ||
from django.http import HttpResponse | ||
|
||
from .forms import LabelForm | ||
from .models import Label | ||
|
||
|
||
class LabelListView(generic.ListView): | ||
model = Label | ||
template_name = "apis_labels/labels_list.html" | ||
context_object_name = "object_list" | ||
|
||
def get_queryset(self): | ||
return Label.objects.order_by("label") | ||
|
||
|
||
def label_create(request): | ||
if request.method == "POST": | ||
form = LabelForm(request.POST) | ||
if form.is_valid(): | ||
form.save() | ||
return redirect("apis_labels:label_list") | ||
else: | ||
return render(request, "apis_labels/label_create.html", {"form": form}) | ||
else: | ||
form = LabelForm() | ||
return render(request, "apis_labels/label_create.html", {"form": form}) | ||
|
||
|
||
def label_edit(request, pk): | ||
instance = get_object_or_404(Label, pk=pk) | ||
if request.method == "POST": | ||
form = LabelForm(request.POST, instance=instance) | ||
if form.is_valid(): | ||
form.save() | ||
return redirect("apis_labels:label_list") | ||
else: | ||
return render( | ||
request, | ||
"apis_labels/label_create.html", | ||
{"form": form, "instance": instance}, | ||
) | ||
else: | ||
form = LabelForm(instance=instance) | ||
return render( | ||
request, | ||
"apis_labels/label_create.html", | ||
{"form": form, "instance": instance}, | ||
) | ||
from .models import Label | ||
|
||
|
||
class LabelDelete(DeleteView): | ||
model = Label | ||
template_name = "apis_templates/confirm_delete.html" | ||
success_url = reverse_lazy("apis_labels:label_list") | ||
@login_required | ||
def delete_label(request, label_id): | ||
instance = Label.objects.get(id=label_id) | ||
label = f"{instance}" | ||
instance.delete() | ||
return HttpResponse(f"<small>gelöschtes Label: {label}</small> ") |
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
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: 5 additions & 10 deletions
15
apis_core/apis_relations/templates/apis_relations/delete_button_label_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,14 +1,9 @@ | ||
<a | ||
class="btn" | ||
hx-trigger="click" | ||
hx-post="/apis/relations/ajax/get/" | ||
hx-target="#editFormDiv_PersonLabel" | ||
hx-vals='{ | ||
"FormName": "PersonLabelForm", | ||
"SiteID": "{{ record.temp_entity.id }}", | ||
"ObjectID": "{{ record.pk }}", | ||
"entity_type": "{{ entity_type }}", | ||
"ButtonText": "speichern" | ||
}'> | ||
<i class="bi bi bi-trash" title="Label: '{{ record }}' bearbeiten"> </i> | ||
hx-post="/apis/labels/delete-from-tabel/{{ record.pk }}/" | ||
hx-confirm="Sicher? Weil was weg ist ist weg" | ||
hx-target="closest tr" hx-swap="outerHTML swap:1s" | ||
> | ||
<i class="bi bi bi-trash" title="Label: '{{ record }}' löschen"> </i> | ||
</a> |
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
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