Skip to content

Commit

Permalink
feat: enable header links and disable new and events on homepage (#2836)
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali145 authored Nov 30, 2023
1 parent 739b8c5 commit 5ec8a24
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
6 changes: 6 additions & 0 deletions cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,12 @@ def news_and_events(self):
"""
Gets the news and events section subpage
"""
webinar_or_blog_enabled = settings.FEATURES.get(
"WEBINARS", False
) or settings.FEATURES.get("ENABLE_BLOG", False)
if webinar_or_blog_enabled:
return None

return self._get_child_page_of_type(NewsAndEventsPage)

@property
Expand Down
20 changes: 10 additions & 10 deletions static/js/components/TopAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ const TopAppBar = ({ currentUser, location, errorPageHeader, courseTopics }: Pro
id="nav"
className="collapse navbar-collapse px-0 justify-content-end"
>
{
SETTINGS.webinars ? (
<li>
<a href={routes.webinars} className="" aria-label="webinars">
Webinars
</a>
</li>
) : null
}
<li>
{
SETTINGS.course_dropdown ? (
Expand All @@ -86,10 +77,19 @@ const TopAppBar = ({ currentUser, location, errorPageHeader, courseTopics }: Pro
)
}
</li>
{
SETTINGS.webinars ? (
<li>
<a href={routes.webinars} className="webinar-link" aria-label="webinars">
Webinars
</a>
</li>
) : null
}
{
SETTINGS.enable_blog ? (
<li>
<a href={routes.blog} className="" aria-label="blog">
<a href={routes.blog} className="blog-link" aria-label="blog">
Blog
</a>
</li>
Expand Down
4 changes: 4 additions & 0 deletions static/scss/top-app-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
text-decoration: none;
display: block;

&.blog-link {
margin-right: 10px;
}

&:hover {
color: $primary;
}
Expand Down

0 comments on commit 5ec8a24

Please sign in to comment.