-
-
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
Open
psyren99
wants to merge
39
commits into
internetarchive:master
Choose a base branch
from
psyren99:2283/linking_to_olid
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
link olid macro #9348
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
067929e
link olid macro
2f13250
fix typo
mekarpeles ee40b64
behind
psyren99 f6bd556
Merge branch 'internetarchive:master' into 2283/linking_to_olid
psyren99 1c2e082
Merge branch '2283/linking_to_olid' of github.com:psyren99/openlibrary
psyren99 a3d8728
new olid function to edition
psyren99 e14bf74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b488387
removing olid
psyren99 20c3c28
Merge branch '2283/linking_to_olid' of github.com:psyren99/openlibrar…
psyren99 11788b9
Merge branch 'master' of github.com:psyren99/openlibrary into 2283/li…
psyren99 4683a88
test olid link
psyren99 9dc27b4
olid test in wrong file
psyren99 0819948
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] df7e6af
Merge branch 'master' of https://github.com/internetarchive/openlibrary
psyren99 2a6b8ec
Merge branch '2283/linking_to_olid' of github.com:psyren99/openlibrary
psyren99 94814f6
olid
psyren99 6d798c3
pre commit
psyren99 b63f535
Revert "Deleted unused files. (#9454)"
psyren99 957679f
checkout master of merge conflict files
RayBB 3144f6f
Merge branch 'master' into 2283/linking_to_olid
RayBB da95568
Merge branch 'master' of https://github.com/internetarchive/openlibrary
psyren99 99d7e8d
Merge branch 'internetarchive:master' into 2283/linking_to_olid
psyren99 3101be4
adding authors and covers
psyren99 729729b
pre commit
psyren99 44739c5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f973d96
Merge branch 'master' of https://github.com/internetarchive/openlibrary
psyren99 4e72446
behind
psyren99 4c9ae72
link olid macro
669ae67
fix typo
mekarpeles 5e101cb
new olid function to edition
psyren99 b3784d5
removing olid
psyren99 fe359e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0ce0a36
test olid link
psyren99 41ce331
olid test in wrong file
psyren99 134d569
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 11963bd
olid
psyren99 aa8dcf1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] db0b27e
fixing working tree
psyren99 21ab22b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$def with (q="#") | ||
|
||
$ edition = query_param('edition', q) | ||
$ results = find_matches(olid, q) | ||
$ olid = edition.key. split("/")[-1]) | ||
mekarpeles marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
$if(olid == q): | ||
<a href="edition.key">edition.title</a> | ||
$else: | ||
<a href="results.key">olid</a> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-L1171I 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)