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

143 lines
7.3 KiB
HTML

<!-- prettier-ignore -->
{% extends 'base.html' %}
{% block title %}{{section.label}}{% endblock %}
{% block content %}
{% if current_user.is_authenticated %}
{% include 'book/modals/approve_interpretation_modal.html' %}
{% include 'book/modals/edit_interpretation_modal.html' %}
{% include 'book/modals/delete_interpretation_modal.html' %}
{% block right_sidebar %}
{% endblock %}
{% endif %}
{% include 'book/breadcrumbs_navigation.html'%}
<div class="overflow-x-auto sm:rounded-lg">
<!-- prettier-ignore -->
<div class="fixed z-30 w-full top-28 md:top-44 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">{{section.label}}</h1>
<!-- prettier-ignore -->
<div class="mb-1">
<ul class="flex flex-wrap -mb-px text-sm font-medium text-center" id="myTab" data-tabs-toggle="#myTabContent" role="tablist">
<li class="mr-2" role="presentation">
<button class="flex items-center space-x-2 p-4 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="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" /> </svg>
<span>Interpretations</span>
</button>
</li>
</ul>
</div>
</div>
<div id="myTabContent" class="mt-40">
<!-- prettier-ignore -->
<div class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800" id="interpretation" role="tabpanel" aria-labelledby="interpretation-tab">
{% if not current_user.is_authenticated %}
<div class="bg-white dark:bg-gray-900 max-w-full p-6 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="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 ">Connect you wallet to start contributing!</h3>
</div>
</div>
</div>
<!-- prettier-ignore -->
{% endif %}
{% if current_user.is_authenticated %}
<!-- prettier-ignore -->
<form
action="{{ url_for('book.interpretation_create', book_id=book.id, section_id=section.id) }}"
method="post" class="prevent-submit-on-enter bg-white rounded-lg shadow dark:bg-gray-700"
>
{{ 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}}" />
<input type="hidden" name="text" id="interpretation-text-input" />
<!-- Form body -->
<div class="p-6 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">
<div id="interpretation-text" class="quill-editor dark:text-white h-64">
</div>
</div>
</div>
</div>
<!-- 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>
<!-- prettier-ignore -->
{% endif %}
<!-- prettier-ignore -->
<dl class="w-md md:w-full text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700">
{% set access_to_delete_interpretation = has_permission(section, Access.D, EntityType.INTERPRETATION) %}
{% set access_to_approve_interpretation = has_permission(section, Access.A, EntityType.INTERPRETATION) %}
<!-- prettier-ignore -->
{% for interpretation in section.active_interpretations %}
<!-- prettier-ignore -->
{% with show_control_btns=True %}
{% include 'book/components/interpretation_list_item.html' %}
{% endwith %}
{% endfor %}
<span class="approved-interpretation-id hidden">
{% if section.approved_interpretation.approved %}
{{ section.approved_interpretation.id }}
{% endif %}
</span>
</dl>
</div>
</div>
<div class="flex p-10 justify-between">
<!-- prettier-ignore -->
{% set previous_section = section.previous_section %}
{% if previous_section %}
<a
href="{{url_for('book.interpretation_view', book_id=book.id, section_id=previous_section.id)}}"
type="button"
class="w-2/5 md:w-1/5 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 inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
<!-- prettier-ignore -->
<svg aria-hidden="true" class="w-5 h-5 mr-2 -ml-1 rotate-180" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
<div class="truncate flex flex-col ml-3 w-full">
<p class="hidden sm:inline p-3 text-right truncate">{{ book.label }}</p>
<p class="hidden sm:inline p-3 text-right truncate">
{{ previous_section.label }}
</p>
</div>
</a>
{% else %}
<div></div>
{% endif %}
<!-- prettier-ignore -->
{% set next_section = section.next_section %}
{% if next_section %}
<a
href="{{url_for('book.interpretation_view', book_id=book.id, section_id=next_section.id)}}"
type="button"
class="w-2/5 md:w-1/5 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 inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
<div class="truncate flex flex-col w-full">
<p class="hidden sm:inline p-3 text-left truncate">{{ book.label }}</p>
<p class="hidden sm:inline p-3 text-left truncate">
{{ next_section.label }}
</p>
</div>
<!-- prettier-ignore -->
<svg aria-hidden="true" class="w-5 h-5 ml-2 -mr-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
</a>
{% else %}
<div></div>
{% endif %}
</div>
</div>
<!-- prettier-ignore -->
{% endblock %}