Skip to content

Commit 76569e5

Browse files
committed
Changed some admin + misc
- Changed the frame image on the about page to the svg instead of the copyrighted png - Added a list display of all attributes and 'name' and 'about' attributes as search fields to the MemberAdmin class - Added id as a raw field to the CommitteeAdmin Class - Added logic for the CommitteeAPIView to only display Committee objects that have active set to true
1 parent 5df9d51 commit 76569e5

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

client/src/pages/about.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function AboutPage() {
122122
key={`top-${idx}`}
123123
className="flex flex-col items-start gap-0"
124124
>
125-
<div className="relative flex h-[11.5625rem] w-[11.25rem] items-center justify-center bg-[url('/frame.png')] bg-contain bg-center bg-no-repeat">
125+
<div className="relative flex h-[11.5625rem] w-[11.25rem] items-center justify-center bg-[url('/frame.svg')] bg-contain bg-center bg-no-repeat">
126126
<Image
127127
src={
128128
member.profile_picture === null
@@ -154,7 +154,7 @@ export default function AboutPage() {
154154
key={`bottom-${idx}`}
155155
className="flex flex-col items-start gap-0"
156156
>
157-
<div className="relative flex h-[11.5625rem] w-[11.25rem] items-center justify-center bg-[url('/frame.png')] bg-contain bg-center bg-no-repeat">
157+
<div className="relative flex h-[11.5625rem] w-[11.25rem] items-center justify-center bg-[url('/frame.svg')] bg-contain bg-center bg-no-repeat">
158158
<Image
159159
src={
160160
member.profile_picture === null

server/game_dev/admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44

55
class MemberAdmin(admin.ModelAdmin):
6-
pass
6+
list_display = ("id", "name", "active", "profile_picture", "about", "pronouns")
7+
search_fields = ["name", "about"]
78

89

910
# Sample EventsAdmin Class made
@@ -25,7 +26,7 @@ class GamesAdmin(admin.ModelAdmin):
2526

2627

2728
class CommitteeAdmin(admin.ModelAdmin):
28-
pass
29+
raw_id_fields = ["id"]
2930

3031

3132
admin.site.register(Member, MemberAdmin)

server/game_dev/views.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ def get_queryset(self):
8686
roleOrder = ("P", "VP", "SEC", "TRE", "MARK", "EVE", "PRO", "FRE")
8787
for i in roleOrder:
8888
try:
89-
outputList.append(Committee.objects.get(role=i).id)
89+
cur = Committee.objects.get(role=i).id
90+
if cur.active:
91+
outputList.append(Committee.objects.get(role=i).id)
92+
else:
93+
outputList.append({"name": "Position not filled", "profile_picture": "url('/landing_placeholder.png')",
94+
"about": "", "pronouns": ""})
9095
except Committee.DoesNotExist:
91-
outputList.append({"name": "Position not filled", "profile_picture": "url('/landing_placeholder.png')", "about": "", "pronouns": ""})
96+
outputList.append({"name": "Position not filled", "profile_picture": "url('/landing_placeholder.png')",
97+
"about": "", "pronouns": ""})
9298
return outputList

0 commit comments

Comments
 (0)