Skip to content

Conversation

@patrickcuagan
Copy link
Collaborator

Ticket: https://torchbox.atlassian.net/browse/R1-268

This MR moves the scholarships filters section to be below the title in the scholarships listing page. Additionally, editors can choose its background color.

As for the filter label, we just add a simple rename to be 'Fee status' as requested.

# Scholarship listing fields
scholarships_listing_background_color = models.CharField(
max_length=10,
choices=(("light", "Light"), ("dark", "Dark")),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion:

class BackgroundColor(models.TextChoices):
    LIGHT = "light", "Light"
    DARK = "dark", "Dark"

class ScholarshipsListingPage(ContactFieldsMixin, BasePage):
    # ...
    scholarships_listing_background_color = models.CharField(
        max_length=10,
        choices=BackgroundColor.choices,
        default=BackgroundColor.LIGHT,
        help_text="Select the background color for this section",
        verbose_name="Background Color",
    )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion: Avoid using autogenerated migration names :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

<nav class="section filter-bar filter-bar--large {% if not results %}filter-bar--no-results-large{% endif %} " data-filter-bar>
<div class="grid">
<div class="layout__start-one layout__span-two layout__@large-start-two layout__@large-span-three">
{% if page.scholarships_listing_background_color == "dark" %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue: Avoid using hard coded values (i.e. "dark") in templates

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

</form>

<section class="section bg bg--light">
{% if page.scholarships_listing_background_color == "dark" %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue: Avoid using hard coded values in templates :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

Copy link
Collaborator

@neilbulloch neilbulloch left a comment

Choose a reason for hiding this comment

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

Thanks @patrickcuagan looks nice, just a couple of things :)

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