Skip to content

Commit

Permalink
Added mpc to admin and templstes
Browse files Browse the repository at this point in the history
  • Loading branch information
reinout committed Dec 16, 2024
1 parent 07ce0bb commit 0b4af8a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
15 changes: 11 additions & 4 deletions trs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ class GroupAdmin(admin.ModelAdmin):
list_display = ["name", "description"]


class MPCAdmin(admin.ModelAdmin):
list_display = ["name", "description"]


class PersonAdmin(admin.ModelAdmin):
list_display = [
"name",
"group",
"mpc",
"archived",
"user",
"is_office_management",
"is_management",
]
list_editable = ["group", "archived", "is_office_management"]
list_filter = ["archived", "group", "is_management", "is_office_management"]
list_editable = ["group", "mpc", "archived", "is_office_management"]
list_filter = ["archived", "group", "mpc", "is_management", "is_office_management"]
search_fields = ["name"]


Expand All @@ -25,13 +30,14 @@ class ProjectAdmin(admin.ModelAdmin):
"code",
"description",
"group",
"mpc",
"wbso_project",
"wbso_percentage",
"internal",
"archived",
]
list_filter = ["internal", "archived", "group", "wbso_project"]
list_editable = ["group", "wbso_project", "wbso_percentage"]
list_filter = ["internal", "archived", "group", "mpc", "wbso_project"]
list_editable = ["group", "mpc", "wbso_project", "wbso_percentage"]
search_fields = ["code", "description"]


Expand Down Expand Up @@ -76,6 +82,7 @@ class ThirdPartyEstimateAdmin(admin.ModelAdmin):


admin.site.register(models.Group, GroupAdmin)
admin.site.register(models.MPC, MPCAdmin)
admin.site.register(models.Person, PersonAdmin)
admin.site.register(models.Project, ProjectAdmin)
admin.site.register(models.WbsoProject, WbsoProjectAdmin)
Expand Down
5 changes: 5 additions & 0 deletions trs/templates/trs/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ <h1>
<th>Groep</th>
<td>{{ view.person.group }}</td>
</tr>
{% if view.person.mpc %}
<tr>
<th>Markt-product-combinatie</th>
<td>{{ view.person.mpc }}</td>
</tr>
{% endif %}
<tr>
<th>Extra rollen</th>
Expand Down
6 changes: 6 additions & 0 deletions trs/templates/trs/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ <h1>
<td>{{ view.project.group }}</td>
</tr>
{% endif %}
{% if view.project.mpc %}
<tr>
<th>Markt-product-combinatie</th>
<td>{{ view.project.mpc }}</td>
</tr>
{% endif %}
<tr>
<th>Startweek</th>
<td>{{ view.project.start.friendly|default:"Niet ingevuld" }}</td>
Expand Down

0 comments on commit 0b4af8a

Please sign in to comment.