- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
R1-268: Scholarships - Ordering and labels #1105
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
base: master
Are you sure you want to change the base?
R1-268: Scholarships - Ordering and labels #1105
Conversation
        
          
                rca/scholarships/models.py
              
                Outdated
          
        
      | # Scholarship listing fields | ||
| scholarships_listing_background_color = models.CharField( | ||
| max_length=10, | ||
| choices=(("light", "Light"), ("dark", "Dark")), | 
There was a problem hiding this comment.
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",
    )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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" %} | 
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" %} | 
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
There was a problem hiding this 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 :)
…ature/268-scholarships-ordering-and-labels
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.