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
Render custom organisation logos when provided #246
Conversation
* Restrict width of component to 25% to match HTML publication * Include image only when provided
@@ -31,4 +31,12 @@ def last_changed | |||
def organisations | |||
content_item["links"]["organisations"].sort_by { |o| o["title"] } | |||
end | |||
|
|||
def organisation_logo(organisation) | |||
super(organisation).tap do |logo| |
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.
You don't need to pass the organisation
argument here. It happens automagically.
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.
Fixed and rebased
example_logo = schema_item("updated")["links"]["organisations"][0]["details"]["logo"]["image"].symbolize_keys | ||
presented_logo = presented.organisation_logo(organisation)[:organisation][:image] | ||
|
||
refute presented.organisations.count > 1 |
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.
This hurts my head a bit. assert count < 2
or assert_equal 1, presented.organisations.count
?
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.
Fixed and rebased
* Custom organisation logos have varying heights and give undue prominence to those logos with a custom image, even if they are a secondary org * Keep the previous default which was to show a text only link for organisations with a custom logo
6915d89
to
89019a5
Compare
Goes with:
Part of https://trello.com/c/HtSGDoRb/594-add-organisation-logos-that-are-images-to-content-item-2
HTML pubs
Corp info pages