-
Notifications
You must be signed in to change notification settings - Fork 0
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
Latest news and featured projects component #41
Conversation
{% image card.image fill-300x200 as img %} | ||
<img src="{{ img.url }}" alt="{{ img.alt }}" class="rounded-xl mb-4"/> | ||
<div class="flex flex-row gap-2 items-center text-sm font-medium text-gray-700 mb-4"> | ||
{{ card.category }} | ||
<svg class="xmlns" | ||
None="http://www.w3.org/2000/svg" | ||
width="4" | ||
height="5" | ||
viewBox="0 0 4 5" | ||
fill="none"> | ||
<path d="M1.99141 4.35869C1.64608 4.35869 1.33808 4.28402 1.06741 4.13469C0.806081 3.97602 0.596081 3.76602 0.437414 3.50469C0.288081 3.23402 0.213414 2.92602 0.213414 2.58069C0.213414 2.22602 0.288081 1.91802 0.437414 1.65669C0.596081 1.38602 0.806081 1.17602 1.06741 1.02669C1.33808 0.868023 1.64608 0.78869 1.99141 0.78869C2.34608 0.78869 2.65408 0.868023 2.91541 1.02669C3.18608 1.17602 3.39608 1.38602 3.54541 1.65669C3.70408 1.91802 3.78341 2.22602 3.78341 2.58069C3.78341 2.92602 3.70408 3.23402 3.54541 3.50469C3.39608 3.76602 3.18608 3.97602 2.91541 4.13469C2.65408 4.28402 2.34608 4.35869 1.99141 4.35869Z" fill="#5F5F5F"/> | ||
</svg> | ||
{% comment %} The metadata we display here will depend on the post category {% endcomment %} | ||
{% if self.impact_area %}{{ self.impact_area }}{% endif %} | ||
{% if card.date %}{{ card.date | date:"d M Y" }}{% endif %} | ||
</div> | ||
<h4 class="font-semibold leading-tight sm:text-xl md:text-2xl text-gray-900 mb-4">{{ card.heading }}</h4> | ||
<p class="text-base font-normal text-gray-700 mb-4">{{ card.blurb }}</p> | ||
{% comment %} The metadata we display here will depend on the post category {% endcomment %} | ||
{% if card.organisation %}<p class="text-base font-semibold text-gray-900 mb-7">{{ card.organisation }}</p>{% endif %} | ||
{% if card.author %}<p class="text-base font-semibold text-gray-900 mb-7">{{ card.author }}</p>{% endif %} | ||
</div> |
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.
In the future, we should define a carousel_card.html
template for each Page Type and include that via {% include page.card_template %}
, and use this code as the default implementation.
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.
Okay great - so the 'type' of data passed to the template e.g. news, projects, tools etc will depend on the Page Type?
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.
Yes I think that's wise.
Ohh, I see the point of having a generic |
|
should we set a series of default styles in the constructor and then have the options value property for overriding them for specific use cases? |
Sounds like a plan, but I wouldn't put it in the constructor. Stimulus has a system for default values. |
So I think it already does this by referencing here:
and defining here:
So if we're happy with these being the default options we can leave it as is? |
When merge conflicts are restored, feel that we can take another pass at review here, beyond a draft and get this in. It's quite a big deal to put this in the mix. |
|
Tests failing for the same reason as other branches, which is a security update within one of the packages. Should be a straightforward fix. |
Test failure coming from https://github.com/commonknowledge/hotosm-website/blob/main/poetry.lock#L968-L974 |
Note though that this is a false positive. The issue was assigned a CVE without much conversation, for an issue which is extremely low to non-existent risk. |
We'd have to jump all the way to the latest version https://github.com/pytest-dev/pytest/releases, but as we currently have minimal tests, do not see this as especially problematic. |
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.
Nice little find with the library here.
Looks good to go to me. This library gives us a lot useful functionality in other places.
I've not checked it out and run the code, but I presume @janbaykara has so proceeding.
class LatestArticles(CarouselBlock): | ||
class Meta: | ||
template = "app/blocks/latest_articles.html" | ||
|
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.
So latest the LatestArticles
block is a raw run of latest articles. Whereas projects can be selected. Cool.
Description
Motivation and Context
Addresses issues #218 and #216
Figma
How Can It Be Tested?
Download the branch and run locally. Include the 'carousel' block on a page template
Fill in the required fields in the CMS. View the page.
Screenshots (if appropriate):
Types of changes
Checklist: