Skip to content

Commit

Permalink
Merge pull request #25 from oarepo/miroslavsimek/ep-82-add-edit-linkb…
Browse files Browse the repository at this point in the history
…utton-on-detail-page

Changed is_record to oarepo's is_published_record
  • Loading branch information
mesemus authored Mar 27, 2024
2 parents 6d1ad36 + 5418e2a commit 6edcc34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions oarepo_model_builder_drafts/datatypes/components/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,31 @@ def process_links(self, datatype, section: Section, **kwargs):
name="self",
link_class="ConditionalLink",
link_args=[
"cond=is_record",
"cond=is_published_record",
f'if_=RecordLink("{{+api}}{url_prefix}{{id}}")',
f'else_=RecordLink("{{+api}}{url_prefix}{{id}}/draft")',
],
imports=[
Import("invenio_records_resources.services.ConditionalLink"),
Import("invenio_records_resources.services.RecordLink"),
Import(
"invenio_drafts_resources.services.records.config.is_record"
"oarepo_runtime.records.is_published_record"
),
],
),
Link(
name="self_html",
link_class="ConditionalLink",
link_args=[
"cond=is_record",
"cond=is_published_record",
f'if_=RecordLink("{{+ui}}{html_url_prefix}{{id}}")',
f'else_=RecordLink("{{+ui}}{html_url_prefix}{{id}}/edit")',
],
imports=[
Import("invenio_records_resources.services.ConditionalLink"),
Import("invenio_records_resources.services.RecordLink"),
Import(
"invenio_drafts_resources.services.records.config.is_record"
"oarepo_runtime.records.is_published_record"
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-model-builder-drafts
version = 4.0.22
version = 4.0.23
description =
authors = Ronald Krist <[email protected]>
readme = README.md
Expand Down

0 comments on commit 6edcc34

Please sign in to comment.