.
This commit is contained in:
@@ -24,6 +24,10 @@ from tinymce.widgets import TinyMCE
|
|||||||
|
|
||||||
from dal import autocomplete
|
from dal import autocomplete
|
||||||
|
|
||||||
|
class ConditionForm(ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = Condition
|
||||||
|
exclude = []
|
||||||
|
|
||||||
class SeriesFindingForm(ModelForm):
|
class SeriesFindingForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{condition.name}}<br/>
|
{{condition.name}}<br/>
|
||||||
{{condition.primary}}<br/>
|
{{condition.primary}}<br/delete>
|
||||||
{{condition.synonym}}<br/>
|
{{condition.synonym}}<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -11,7 +11,9 @@ urlpatterns = [
|
|||||||
path("author/", views.author_list, name="author_list"),
|
path("author/", views.author_list, name="author_list"),
|
||||||
path("cases/", views.CaseView.as_view(), name="case_view"),
|
path("cases/", views.CaseView.as_view(), name="case_view"),
|
||||||
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
||||||
path("condition/", views.condition_detail, name="condition_detail"),
|
path("condition/<int:pk>", views.condition_detail, name="condition_detail"),
|
||||||
|
path("condition/<int:pk>/delete", views.ConditionDelete.as_view(), name="condition_delete"),
|
||||||
|
path("condition/<int:pk>/update", views.ConditionUpdate.as_view(), name="condition_update"),
|
||||||
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
||||||
path("series/", views.SeriesView.as_view(), name="series_view"),
|
path("series/", views.SeriesView.as_view(), name="series_view"),
|
||||||
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ from django.http import HttpResponseRedirect, HttpResponse
|
|||||||
|
|
||||||
from .forms import (
|
from .forms import (
|
||||||
CaseForm,
|
CaseForm,
|
||||||
|
ConditionForm,
|
||||||
SeriesForm,
|
SeriesForm,
|
||||||
SeriesImageFormSet,
|
SeriesImageFormSet,
|
||||||
SeriesFormSet,
|
SeriesFormSet,
|
||||||
@@ -195,6 +196,17 @@ class SeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
|||||||
model = Series
|
model = Series
|
||||||
success_url = reverse_lazy("atlas:series_view")
|
success_url = reverse_lazy("atlas:series_view")
|
||||||
|
|
||||||
|
class ConditionDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
|
model = Condition
|
||||||
|
success_url = reverse_lazy("atlas:condition_view")
|
||||||
|
|
||||||
|
class FindingDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
|
model = Finding
|
||||||
|
success_url = reverse_lazy("atlas:finding_view")
|
||||||
|
|
||||||
|
class StructureDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
|
model = Structure
|
||||||
|
success_url = reverse_lazy("atlas:structure_view")
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@user_is_author_or_atlas_checker
|
@user_is_author_or_atlas_checker
|
||||||
@@ -315,6 +327,13 @@ class SeriesUpdate(
|
|||||||
return super().form_invalid(form)
|
return super().form_invalid(form)
|
||||||
|
|
||||||
|
|
||||||
|
class ConditionUpdate(
|
||||||
|
RevisionMixin, LoginRequiredMixin, AuthorOrCheckerRequiredMixin, UpdateView
|
||||||
|
):
|
||||||
|
model = Condition
|
||||||
|
form_class = ConditionForm
|
||||||
|
|
||||||
|
|
||||||
class AtlasCreateBase(RevisionMixin, LoginRequiredMixin):
|
class AtlasCreateBase(RevisionMixin, LoginRequiredMixin):
|
||||||
model = Case
|
model = Case
|
||||||
form_class = CaseForm
|
form_class = CaseForm
|
||||||
|
|||||||
Reference in New Issue
Block a user