Skip to content

Commit

Permalink
add: corret page titles, allow easier setting of platformname via set…
Browse files Browse the repository at this point in the history
…tings
  • Loading branch information
saemideluxe committed Nov 27, 2021
1 parent 6ec8890 commit 84c33bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bread/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
def bread_context(request):
from django.conf import settings

ret = {}
return ret
if hasattr(settings, "PLATFORMNAME"):
return {"PLATFORMNAME": settings.PLATFORMNAME}
return {}
6 changes: 6 additions & 0 deletions bread/views/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ def get_layout(self):
_layout.button.Button(_("Edit"), style="margin-top: 2rem"),
)

def get_context_data(self, *args, **kwargs):
return {
**super().get_context_data(*args, **kwargs),
"pagetitle": str(self.object),
}

def get_required_permissions(self, request):
return [f"{self.model._meta.app_label}.view_{self.model.__name__.lower()}"]

Expand Down

0 comments on commit 84c33bd

Please sign in to comment.