-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
link olid macro #9348
base: master
Are you sure you want to change the base?
link olid macro #9348
Conversation
openlibrary/macros/OLID.html
Outdated
$def with (q="#") | ||
|
||
$ edition = query_param('edition', q) | ||
$ results = find_matches(olid, q) |
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.
find_matches isn't a public function that's available here. It either needs to be passed in as a parameter, made a @public
function, or be added to plugins/openlibrary/code.py as a template global: https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/openlibrary/code.py#L1146-L1171
I think though that find_matches is probably just the wrong function to use. We likely want to use some existing global function to do a web.ctx.site.things get for the specific olid (open library id)
@psyren99 please see code review comments, see if you can find a |
for more information, see https://pre-commit.ci
…y into 2283/linking_to_olid
for more information, see https://pre-commit.ci
Is this still open? |
I believe this may need a rebase, then we can throw on testing and if it works, merge :) |
@mekarpeles merge conflicts resolved. |
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.
There are accessibility issues in these changes.
openlibrary/macros/OLID.html
Outdated
$if(olid == q): | ||
<a href="$edition.key">$title</a> | ||
<h6>$edition.get_authors()</h6> | ||
<img src="/books/add?work=$edition.key" /> |
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 image is missing a text alternative. This is a problem for people using screen readers.
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.
included text alternative
openlibrary/macros/OLID.html
Outdated
$else: | ||
<a href="$result">$olid</a> | ||
<h6>$edition.get_authors()</h6> | ||
<img src="/books/add?work=$olid" /> |
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 image is missing a text alternative. This is a problem for people using screen readers.
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.
included text alternative
675f256
to
729729b
Compare
for more information, see https://pre-commit.ci
@psyren99 looks like the linter is getting an error related to infogami. Can you try to merge the latest master branch into your branch and push that up? I think that should fix it. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
4db6c98
to
21ab22b
Compare
Closes #2283
Create a macro for linking to an OLID
Technical
/macros/OLID.html added
/plugins/upstream/models.py
Testing
/plugins/upstream/tests/test_models.py
Screenshot
Stakeholders