mirror of https://github.com/logos-co/open-law.git
make book-view collections and subcollections as markdown titles #170
This commit is contained in:
parent
df1a447b34
commit
cb3f6d4467
|
@ -79,9 +79,19 @@ def build_qa_url_using_interpretation(interpretation: m.Interpretation):
|
|||
|
||||
# Using: {{ recursive_render("template.html", collection=collection, book=book) }}
|
||||
def recursive_render(
|
||||
template: str, collection: m.Collection, book: m.Book, version: m.BookVersion = None
|
||||
template: str,
|
||||
collection: m.Collection,
|
||||
book: m.Book,
|
||||
version: m.BookVersion = None,
|
||||
loop_index: int = 1,
|
||||
):
|
||||
return render_template(template, collection=collection, book=book, version=version)
|
||||
return render_template(
|
||||
template,
|
||||
collection=collection,
|
||||
book=book,
|
||||
version=version,
|
||||
loop_index=loop_index,
|
||||
)
|
||||
|
||||
|
||||
# Using: {{ has_permission(entity=book, required_permissions=[Access.create]) }}
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
{% if not collection.active_sections and not collection.active_children %}
|
||||
<p class="ml-3 my-3 italic text-sm">Collection is empty</p>
|
||||
{% endif %}
|
||||
{{recursive_render("book/components/sub_collection_preview_content.html",collection,book,version)|safe}}
|
||||
{{recursive_render("book/components/sub_collection_preview_content.html",collection,book,version,2)|safe}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<!-- prettier-ignore -->
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% for sub_collection in collection.active_children if not sub_collection.is_deleted%}
|
||||
|
||||
<p class="my-3 font-bold text-justify" id="collection-{{sub_collection.label}}">
|
||||
##{{sub_collection.label}}
|
||||
{{ "#" * loop_index }} {{sub_collection.label}}
|
||||
</p>
|
||||
<!-- prettier-ignore -->
|
||||
{% if not sub_collection.active_sections and not sub_collection.active_children%}
|
||||
|
@ -12,7 +12,7 @@
|
|||
{% endif %}
|
||||
<!-- prettier-ignore -->
|
||||
{% if sub_collection.active_children %}
|
||||
{{recursive_render("book/components/sub_collection_preview_content.html",sub_collection,book)|safe}}
|
||||
{{recursive_render("book/components/sub_collection_preview_content.html",sub_collection,book, loop_index=loop_index + 1)|safe}}
|
||||
{% else %}
|
||||
<!-- prettier-ignore -->
|
||||
{% for section in sub_collection.active_sections %}
|
||||
|
|
Loading…
Reference in New Issue