open-law/app/templates/book/interpretation_view.html

158 lines
10 KiB
HTML
Raw Normal View History

2023-04-25 11:29:40 +00:00
<!-- prettier-ignore -->
{% extends 'base.html' %}
{% include 'book/delete_section_modal.html' %}
2023-05-03 07:16:03 +00:00
{% include 'book/edit_section_modal.html' %}
<!-- show delete section btn on rightside bar -->
2023-05-05 16:51:55 +00:00
{% set show_delete_section = True %} {% set show_edit_section = True %}
<!-- prettier-ignore -->
{% block right_sidebar %}
{% include 'book/right_sidebar.html' %}
{% endblock %}
2023-04-25 11:29:40 +00:00
{% block content %}
{% include 'book/breadcrumbs_navigation.html'%}
<div class="overflow-x-auto shadow-md sm:rounded-lg md:mr-64">
2023-04-25 11:29:40 +00:00
<!-- prettier-ignore -->
2023-05-08 14:33:15 +00:00
<div class="fixed z-30 w-full md:w-4/5 top-28 pt-6 bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700">
<!-- prettier-ignore -->
<h1 class="text-l font-extrabold dark:text-white ml-4"> Interpretations page </h1>
<!-- prettier-ignore -->
2023-05-08 14:33:15 +00:00
<div class="mb-1">
2023-04-25 11:29:40 +00:00
<ul class="flex flex-wrap -mb-px text-sm font-medium text-center" id="myTab" data-tabs-toggle="#myTabContent" role="tablist">
2023-05-03 14:29:56 +00:00
<li class="mr-2" role="presentation">
<!-- prettier-ignore -->
2023-05-05 07:35:15 +00:00
<button class="flex items-center space-x-2 p-4 border-b-2 border-transparent rounded-t-lg hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300" id="text-tab" data-tabs-target="#section-text" type="button" role="tab" aria-controls="text" aria-selected="false">
2023-05-03 14:29:56 +00:00
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z" /> </svg>
2023-05-04 14:21:34 +00:00
<span>Text</span>
2023-05-03 14:29:56 +00:00
</button>
</li>
<li class="mr-2" role="presentation">
2023-05-04 06:56:09 +00:00
<button class="flex items-center space-x-2 p-4 border-b-2 rounded-t-lg" id="interpretation-tab" data-tabs-target="#interpretation" type="button" role="tab" aria-controls="interpretation" aria-selected="false">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 11.625a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /> </svg>
<span>Interpretations</span>
</button>
2023-05-03 14:29:56 +00:00
</li>
2023-04-25 11:29:40 +00:00
</ul>
2023-05-04 06:56:09 +00:00
</div>
</div>
<div id="myTabContent" class="mt-40">
2023-05-05 16:51:55 +00:00
<div
class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800"
id="section-text"
role="tabpanel"
aria-labelledby="text-tab">
<dl
class="bg-white dark:bg-gray-900 max-w-full p-3 text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700 m-3 border-2 border-gray-200 border-solid rounded-lg dark:border-gray-700">
2023-05-04 06:56:09 +00:00
<div class="flex flex-col w-full">
2023-05-03 14:29:56 +00:00
<!-- prettier-ignore -->
<dt class="flex w-full mb-1 text-gray-500 md:text-lg dark:text-gray-400 flex-col">
2023-05-04 06:56:09 +00:00
<div class="ql-snow">
2023-05-05 17:24:38 +00:00
<div class="ql-editor">
2023-05-04 06:56:09 +00:00
{{ section.about|safe }}
</div>
2023-05-03 14:29:56 +00:00
</div>
</dt>
</div>
</dl>
</div>
2023-05-05 16:51:55 +00:00
<div
class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800"
id="interpretation"
role="tabpanel"
aria-labelledby="interpretation-tab">
2023-04-26 09:35:43 +00:00
<!-- prettier-ignore -->
2023-05-05 16:51:55 +00:00
<form
2023-05-05 07:35:15 +00:00
{% if sub_collection %}
action="{{ url_for('book.interpretation_create', book_id=book.id, collection_id=collection.id, sub_collection_id=sub_collection.id,section_id=section.id) }}"
{% else %}
action="{{ url_for('book.interpretation_create', book_id=book.id, collection_id=collection.id,section_id=section.id) }}"
{% endif %}
method="post" class="bg-white rounded-lg shadow dark:bg-gray-700">
2023-05-05 07:35:15 +00:00
{{ form_hidden_tag() }}
<input type="hidden" name="section_id" id="section_id" value="{{section.id}}" />
<input type="hidden" name="label" id="label" value="{{section.label}}" />
2023-05-05 16:51:55 +00:00
2023-05-05 17:24:38 +00:00
<input type="hidden" name="text" id="interpretation-text-input" />
2023-05-05 07:35:15 +00:00
<!-- Form body -->
<div class="p-6 space-y-6">
<div class="grid gap-6">
<div class="col-span-6 sm:col-span-3 truncate">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white ">{{ section.label }}</h3>
2023-05-05 07:35:15 +00:00
</div>
</div>
</div>
2023-05-04 14:21:34 +00:00
<div class="p-6 pt-0 space-y-6">
<div class="w-full max-w-6xl mx-auto rounded-xl bg-gray-50 dark:bg-gray-600 shadow-lg text-white-900">
<div class="overflow-hidden rounded-md bg-gray-50 [&>*]:dark:bg-gray-600 text-black [&>*]:!border-none [&>*]:!stroke-black dark:text-white dark:[&>*]:!stroke-white">
2023-05-05 17:24:38 +00:00
<div id="interpretation-text" class="quill-editor dark:text-white h-64"></div>
2023-05-04 14:21:34 +00:00
</div>
</div>
</div>
2023-05-05 07:35:15 +00:00
<!-- Modal footer -->
<div class="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
<button name="submit" type="submit" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 ml-auto">Submit</button>
</div>
</form>
2023-05-05 16:51:55 +00:00
<!-- prettier-ignore -->
<dl class="w-md md:w-full text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700">
2023-04-25 11:29:40 +00:00
<!-- prettier-ignore -->
2023-05-05 09:02:35 +00:00
{% for interpretation in section.active_interpretations %}
2023-05-05 16:51:55 +00:00
<!-- prettier-ignore -->
<dl class="bg-white dark:bg-gray-900 max-w-full p-3 text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700 m-3 border-2 border-gray-200 border-solid rounded-lg dark:border-gray-700">
<div class="flex flex-row pb-3 p-3 w-2/3 md:w-10/12">
<div class="flex flex-col m-5 justify-center items-center">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18" /> </svg>
</div>
<span class="text-3xl">35</span>
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3" /> </svg>
</div>
</div>
2023-05-05 16:51:55 +00:00
<!-- prettier-ignore -->
<dt class="flex w-full mb-1 text-gray-500 md:text-lg dark:text-gray-400 flex-col">
2023-05-08 14:33:15 +00:00
<div class="ql-snow truncate md:max-w-xl">
2023-05-05 16:51:55 +00:00
<a
class="flex space-x-2"
{% if sub_collection %}
href="{{ url_for('book.qa_view', book_id=book.id, collection_id=collection.id, sub_collection_id=sub_collection.id, section_id=section.id, interpretation_id=interpretation.id) }}"
{% else %}
href="{{ url_for('book.qa_view', book_id=book.id, collection_id=collection.id, section_id=section.id, interpretation_id=interpretation.id) }}"
{% endif %}
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" />
</svg>
<span>{{ section.label }}</span>
</a>
2023-05-08 12:19:22 +00:00
<div class="dark:text-white h-30 ql-editor">
2023-05-05 16:51:55 +00:00
<p>{{ interpretation.text|safe }}</p>
2023-05-04 06:56:09 +00:00
</div>
2023-05-05 16:51:55 +00:00
</div>
2023-05-08 14:33:15 +00:00
<div class="flex mt-auto align-center justify-between md:w-full">
<div><span class="hidden md:inline-block">Interpretation by</span> {{interpretation.user.username}} on {{interpretation.created_at.strftime('%B %d, %Y')}}</div>
2023-05-05 16:51:55 +00:00
<div class="flex ml-auto justify-between w-24">
<span class="space-x-0.5 flex items-center">
2023-05-05 13:42:20 +00:00
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15m0-3l-3-3m0 0l-3 3m3-3V15" /> </svg>
2023-05-04 06:56:09 +00:00
</span>
2023-05-05 16:51:55 +00:00
<div class="space-x-0.5 flex items-center">
2023-05-05 13:42:20 +00:00
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155" /> </svg>
2023-05-09 09:42:04 +00:00
<p>{{interpretation.comments | length}}</p>
2023-05-05 16:51:55 +00:00
</div>
2023-05-04 06:56:09 +00:00
</div>
2023-05-05 16:51:55 +00:00
</div>
</dt>
</div>
</dl>
2023-04-25 11:29:40 +00:00
{% endfor %}
</dl>
</div>
</div>
</div>
2023-05-04 06:56:09 +00:00
<!-- prettier-ignore -->
{% endblock %}