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

feat: Implement new design for asset cards #253

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

petesfrench
Copy link
Contributor

Done

  • Makes a two new cards, one for images and one for everything else, based on the figma
  • Fixes how we handle base 64 encoding, allowing reading of width and height on the back end
  • Create a new route /details for a detailed view of each asset

QA

  • Run this branch locally
  • Use the search to display some cards and see that the fields for image and others matches that of the design
  • Text the 'full asset details' link works and goes to separate page where all the stored details can be seen
  • Upload a new asset and see the width and height is calculated

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-15205

Copy link
Member

@immortalcodes immortalcodes left a comment

Choose a reason for hiding this comment

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

Works nicely. I think there are couple of things we could improve here but given we are working towards MVP and will get a more refined design to work with, it's better to work on them later.

I know it's not part of design but the button to get image tag seems necessary if this version is made live at any point of time.
Thanks for the awesome work 🥳

Comment on lines +1 to +23
<div class="p-asset-card p-equal-height-row__col" style="">
<div class="p-equal-height-row__item" style="max-height:6rem;">
{% if asset.asset_type == "whitepaper" %}
<img class="p-asset-card--thumbnail" src="https://assets.ubuntu.com/v1/b061c401-White+paper.svg" alt="">
{% else %}
<img class="p-asset-card--thumbnail" src="https://assets.ubuntu.com/v1/fd84bbdc-Document-open.svg" alt="">
{% endif %}
</div>
<div class="p-equal-height-row__item">
{% if asset.name %}
<p><strong>{{ asset.name }}</strong></p>
{% else %}
<p><strong>{{ asset.file_path.split('.')[0] }}</strong></p>
{% endif %}
<p class="u-no-margin--bottom">File type: <strong>.{{ asset.file_path.split('.', 1)[1] }}</strong></p>
<p>Asset type: <strong>{{ asset.asset_type }}</strong></p>
<p>
Tags:
{% for tag in asset.tags %}
<strong>{{ tag.name }}{% if not loop.last %},{% endif %}</strong>
{% endfor %}
</p>
<p>
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering if we could use a single template with some conditions for asset-card and asset-card-image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should keep them separate for now as we don't know how different they are going to look in the end.

@petesfrench petesfrench merged commit 2d0c45f into feature_assets_improvement Nov 7, 2024
5 checks passed
@petesfrench petesfrench deleted the wd-15205 branch November 7, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants