feat(cof_clubs): club edit view
This commit is contained in:
parent
e6e4a0a583
commit
3635b91793
3 changed files with 12 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="content container is-max-desktop"/>
|
<div class="content container is-max-desktop"/>
|
||||||
<h1>{{ object.name }}</h1>
|
<h1>{{ object.name }} {% if user.profile.is_buro %}<a class="button" href="{% url "cof_clubs:club-edit" object.id %}"><span class="icon"><i class="fa fa-gear"></i></span></a>{% endif %}</h1>
|
||||||
<h5>Respos:</h5>
|
<h5>Respos:</h5>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
{% for r in object.respos.all %}
|
{% for r in object.respos.all %}
|
||||||
|
|
|
@ -5,6 +5,9 @@ from . import views
|
||||||
app_name = "cof_clubs"
|
app_name = "cof_clubs"
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", views.ClubListView.as_view(), name="club-list"),
|
path("", views.ClubListView.as_view(), name="club-list"),
|
||||||
|
path("club/add", views.ClubCreateView.as_view(), name="club-create"),
|
||||||
|
path("club/<int:pk>", views.ClubDetailView.as_view(), name="club-detail"),
|
||||||
|
path("club/<int:pk>/edit", views.ClubEditView.as_view(), name="club-edit"),
|
||||||
path(
|
path(
|
||||||
"acct-period/add",
|
"acct-period/add",
|
||||||
views.ClubBudgetAccountingPeriodCreateView.as_view(),
|
views.ClubBudgetAccountingPeriodCreateView.as_view(),
|
||||||
|
@ -15,8 +18,6 @@ urlpatterns = [
|
||||||
views.ClubBudgetAccountingPeriodUpdateView.as_view(),
|
views.ClubBudgetAccountingPeriodUpdateView.as_view(),
|
||||||
name="acct-period-update",
|
name="acct-period-update",
|
||||||
),
|
),
|
||||||
path("club/<int:pk>", views.ClubDetailView.as_view(), name="club-detail"),
|
|
||||||
path("club/add", views.ClubCreateView.as_view(), name="club-create"),
|
|
||||||
path(
|
path(
|
||||||
"line/<int:club>/<int:acct_period>/add",
|
"line/<int:club>/<int:acct_period>/add",
|
||||||
views.BudgetLineCreate.as_view(),
|
views.BudgetLineCreate.as_view(),
|
||||||
|
|
|
@ -149,6 +149,14 @@ class ClubDetailView(AccessMixin, DetailView):
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
|
class ClubEditView(BuroRequiredMixin, UpdateView):
|
||||||
|
model = Club
|
||||||
|
fields = ["name", "description", "respos", "budget_managers"]
|
||||||
|
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse("cof_clubs:club-detail", kwargs={"pk": self.object.id})
|
||||||
|
|
||||||
|
|
||||||
class BudgetLineCreate(BudgetLineAccessMixin, CreateView):
|
class BudgetLineCreate(BudgetLineAccessMixin, CreateView):
|
||||||
|
|
||||||
model = ClubBudgetLine
|
model = ClubBudgetLine
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue