add detail
This commit is contained in:
@@ -354,6 +354,9 @@ class ResolutionCreateForm(forms.ModelForm):
|
|||||||
|
|
||||||
self.fields["option"].autofocus = True
|
self.fields["option"].autofocus = True
|
||||||
|
|
||||||
|
self.fields["voting_text"].cols = 30
|
||||||
|
self.fields["voting_text"].rows = 3
|
||||||
|
|
||||||
|
|
||||||
class ResolutionUpdateForm(forms.ModelForm):
|
class ResolutionUpdateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -381,6 +384,15 @@ class ResolutionUpdateForm(forms.ModelForm):
|
|||||||
|
|
||||||
self.fields["option"].autofocus = True
|
self.fields["option"].autofocus = True
|
||||||
|
|
||||||
|
# Config for textarea of comment. Calc rows for a better view.
|
||||||
|
self.fields["voting_text"].cols = 30
|
||||||
|
rows = (
|
||||||
|
len(kwargs["instance"].voting_text) / 90
|
||||||
|
+ kwargs["instance"].voting_text.count("\n")
|
||||||
|
+ 1
|
||||||
|
)
|
||||||
|
self.fields["voting_text"].rows = rows
|
||||||
|
|
||||||
|
|
||||||
class BillInlineForm(forms.ModelForm):
|
class BillInlineForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from .views import (
|
|||||||
BillListView,
|
BillListView,
|
||||||
BillUpdateView,
|
BillUpdateView,
|
||||||
ResolutionCreateView,
|
ResolutionCreateView,
|
||||||
|
ResolutionDetailView,
|
||||||
ResolutionListView,
|
ResolutionListView,
|
||||||
ResolutionUpdateView,
|
ResolutionUpdateView,
|
||||||
)
|
)
|
||||||
@@ -29,4 +30,9 @@ urlpatterns = [
|
|||||||
ResolutionUpdateView.as_view(),
|
ResolutionUpdateView.as_view(),
|
||||||
name="resolution_update",
|
name="resolution_update",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"resolutions/<str:id>/detail/",
|
||||||
|
ResolutionDetailView.as_view(),
|
||||||
|
name="resolution_detail",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ from django.db.models import Q
|
|||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from django.urls import reverse, reverse_lazy
|
from django.urls import reverse, reverse_lazy
|
||||||
from django.views.generic import ListView, TemplateView
|
from django.views.generic import ListView, TemplateView
|
||||||
|
from django.views.generic.detail import DetailView
|
||||||
from django.views.generic.edit import CreateView, UpdateView
|
from django.views.generic.edit import CreateView, UpdateView
|
||||||
|
|
||||||
from fet2020.utils import add_log_action
|
from fet2020.utils import add_log_action
|
||||||
|
from posts.models import FetMeeting
|
||||||
|
|
||||||
from .forms import (
|
from .forms import (
|
||||||
BillCreateForm,
|
BillCreateForm,
|
||||||
@@ -120,6 +122,21 @@ class ResolutionCreateView(LoginRequiredMixin, CreateView):
|
|||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
|
class ResolutionDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
model = Resolution
|
||||||
|
pk_url_kwarg = "id"
|
||||||
|
template_name = "finance/resolution_detail.html"
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
context = super().get_context_data(**kwargs)
|
||||||
|
|
||||||
|
context["fetmeeting"] = (
|
||||||
|
FetMeeting.objects.get_queryset().filter(date=self.object.date).first()
|
||||||
|
)
|
||||||
|
|
||||||
|
return context
|
||||||
|
|
||||||
|
|
||||||
class ResolutionListView(LoginRequiredMixin, ListView):
|
class ResolutionListView(LoginRequiredMixin, ListView):
|
||||||
model = Resolution
|
model = Resolution
|
||||||
template_name = "finance/resolution_list.html"
|
template_name = "finance/resolution_list.html"
|
||||||
|
|||||||
60
fet2020/templates/finance/resolution_detail.html
Normal file
60
fet2020/templates/finance/resolution_detail.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Beschluss {{ object.id }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<!-- Main Content -->
|
||||||
|
<main class="container mx-auto w-full px-4 my-8 flex-1 max-w-2xl">
|
||||||
|
<h1 class="page-title">Beschluss {{ object.id }}</h1>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<div class="grid grid-cols-1 gap-x-6 gap-y-6 sm:grid-cols-6">
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Bezeichnung</h2>
|
||||||
|
<p class="text-gray-700 dark:text-gray-200">{{ object.name }}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Abstimmungstext</h2>
|
||||||
|
<p class="text-gray-700 dark:text-gray-200">{{ object.voting_text|safe }}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Option</h2>
|
||||||
|
<p class="text-gray-700 dark:text-gray-200">{{ object.get_option_display }}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Datum</h2>
|
||||||
|
<p class="text-gray-700 dark:text-gray-200">{{ object.date }}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{% if fetmeeting %}
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Fachschaftsitzung</h2>
|
||||||
|
<div class="text-blue-700 dark:text-blue-200 underline">
|
||||||
|
<a href="{{ fetmeeting.get_absolute_url }}">Link zur {{ fetmeeting.title }}</a>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="col-span-full">
|
||||||
|
<label>
|
||||||
|
<h2 class="text-xl font-black text-gray-700 dark:text-gray-200">Abstimmungsverhalten</h2>
|
||||||
|
<p class="text-gray-700 dark:text-gray-200">{{ object.voting }}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="flex justify-end">
|
||||||
|
<a class="btn btn-small btn-primary" href="{% url 'finance:resolution_update' object.id %}">
|
||||||
|
<i class="fa-solid fa-pen-to-square mr-1"></i>Beschluss bearbeiten
|
||||||
|
</a>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="text-left">Nummer</th>
|
<th class="text-left">Nummer</th>
|
||||||
<th class="text-left">Bezeichnung</th>
|
<th class="text-left">Bezeichnung</th>
|
||||||
<th class="text-left">Abstimmungstext</th>
|
<!--<th class="text-left">Abstimmungstext</th>-->
|
||||||
<th class="text-left">Abstimmungsverhalten</th>
|
<th class="text-left">Abstimmungsverhalten</th>
|
||||||
<th class="text-left">Beschluss</th>
|
<th class="text-left">Beschluss</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
{% for result in object_list %}
|
{% for result in object_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right">{{ result.id }}</td>
|
<td class="text-right">{{ result.id }}</td>
|
||||||
<td>{{ result.name }}</td>
|
<td class="text-blue-700 dark:text-blue-200 underline"><a href="{%url 'finance:resolution_detail' result.id %}">{{ result.name }}</a></td>
|
||||||
<td class="text-left">{{ result.voting_text }}</td>
|
<!--<td class="text-left">{{ result.voting_text|truncatechars:300 }}</td>-->
|
||||||
<td class="text-left">{{ result.voting }}</td>
|
<td class="text-left">{{ result.voting }}</td>
|
||||||
<td class="text-left">{{ result.get_option_display }}</td>
|
<td class="text-left">{{ result.get_option_display }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user