Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow basic theme changes to be done from Django Admin #396

Closed
wants to merge 3 commits into from

Conversation

untari
Copy link
Contributor

@untari untari commented Apr 11, 2022

Work in progress for issue #343. Do not merge yet.

This PR is here to show my progress and be able to receive feedback on my work.

Task list

  • Extract colors, fonts and Font sizes being used and convert them to CSS variables. These values are in CSS files as well as embedded in JS.
  • Allow modification of these variables from the backend from ZubHub settings. Add a new item called "Theme" in the area below (see issue Allow basic theme changes to be done from Django Admin #343).

Breakdown into steps

First try for one value

  • Get familiar with Makefile commands.
  • Get familiar with codebase.
  • Identify one color variable you can modify.
  • Create a Button for it in then admin panel.
  • Add code, so the Button modifies the color value'.

Extend for all the CSS values

  • Extract colors, fonts and Font sizes being used and convert them to CSS variables.
  • Add them to the "Theme" Item.

@untari untari changed the title Create a theme button in django admin panel Allow basic theme changes to be done from Django Admin Apr 11, 2022
@@ -66,6 +66,7 @@
path('api/help/', HelpAPIView.as_view()),
path('api/privacy/', PrivacyAPIView.as_view()),
path('api/faqs/', FAQAPIView.as_view()),
path('api/faqs/', ThemeAPIView.as_view()),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's choose a new URL for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ritsyy I was thinking to name it api/theme. What do you think ?

Comment on lines 254 to 258
obj = self.get_queryset()[:1]
if obj:
return obj[0]
return None

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can replace this block with -
self.get_queryset().last()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ritsyy I just replaced it. Thanks

@srish srish closed this Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants