mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-03 10:35:41 +00:00
Merge branch 'develop' into svyat/fix/issues
This commit is contained in:
commit
592de90567
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -17,6 +17,7 @@
|
|||||||
"CLEANR",
|
"CLEANR",
|
||||||
"CUDA",
|
"CUDA",
|
||||||
"Divs",
|
"Divs",
|
||||||
|
"favorited",
|
||||||
"flowbite",
|
"flowbite",
|
||||||
"indeterminated",
|
"indeterminated",
|
||||||
"jsonify",
|
"jsonify",
|
||||||
|
@ -267,14 +267,14 @@ def contributor_notification(
|
|||||||
book: m.Book = db.session.get(m.Book, entity_id)
|
book: m.Book = db.session.get(m.Book, entity_id)
|
||||||
match action:
|
match action:
|
||||||
case m.Notification.Actions.CONTRIBUTING:
|
case m.Notification.Actions.CONTRIBUTING:
|
||||||
text = f"You've been added to {book.label} as an Editor/Moderator"
|
text = f"You've been added to {book.label} as an Contributor"
|
||||||
link = url_for(
|
link = url_for(
|
||||||
"book.collection_view",
|
"book.collection_view",
|
||||||
book_id=book.id,
|
book_id=book.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
case m.Notification.Actions.DELETE:
|
case m.Notification.Actions.DELETE:
|
||||||
text = f"You've been removed from {book.label} as an Editor/Moderator"
|
text = f"You've been removed from {book.label} as an Contributor"
|
||||||
link = url_for(
|
link = url_for(
|
||||||
"book.collection_view",
|
"book.collection_view",
|
||||||
book_id=book.id,
|
book_id=book.id,
|
||||||
|
@ -5,7 +5,7 @@ from app.controllers import create_pagination
|
|||||||
|
|
||||||
def sort_by(query, sort: str):
|
def sort_by(query, sort: str):
|
||||||
match sort:
|
match sort:
|
||||||
case "favored":
|
case "favorited":
|
||||||
query = query.order_by(text("stars_count DESC"))
|
query = query.order_by(text("stars_count DESC"))
|
||||||
case "upvoted":
|
case "upvoted":
|
||||||
query = query.order_by(text("score DESC"))
|
query = query.order_by(text("score DESC"))
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,10 +1,12 @@
|
|||||||
<div class="bg-white dark:bg-gray-800 mr-5">
|
<div class="bg-white dark:bg-gray-800 mr-5">
|
||||||
<ul class="flex font-medium">
|
<ul class="flex font-medium">
|
||||||
<li>
|
<li>
|
||||||
|
{% if not selected_tab=='my_contributions' %}
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<button type="button" data-modal-target="add-book-modal" data-modal-toggle="add-book-modal" class="text-white ml-2 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2.5 text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> </svg>
|
<button type="button" data-modal-target="add-book-modal" data-modal-toggle="add-book-modal" class="text-white ml-2 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2.5 text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> </svg>
|
||||||
New book
|
New book
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
@ -30,8 +32,8 @@
|
|||||||
|
|
||||||
{% if selected_tab=='my_library' or selected_tab=='favorite_books' or selected_tab=='explore_books'%}
|
{% if selected_tab=='my_library' or selected_tab=='favorite_books' or selected_tab=='explore_books'%}
|
||||||
<li>
|
<li>
|
||||||
<a href="?sort=favored" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
|
<a href="?sort=favorited" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
|
||||||
Most favored
|
Most favorited
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -26,7 +26,10 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div class="ql-snow">
|
<div class="ql-snow">
|
||||||
<div class="dark:text-white h-30 ql-editor-readonly !px-0">
|
<div class="dark:text-white h-30 ql-editor-readonly !px-0">
|
||||||
<p> {{display_inline_elements(section.approved_interpretation.text)|safe }} </p>
|
<p>
|
||||||
|
{{display_inline_elements(section.approved_interpretation.text)|safe
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@ -35,11 +38,11 @@
|
|||||||
Interpretation by
|
Interpretation by
|
||||||
<a
|
<a
|
||||||
href="{{url_for('user.profile', user_id=section.approved_interpretation.user.id)}}"
|
href="{{url_for('user.profile', user_id=section.approved_interpretation.user.id)}}"
|
||||||
class="text-blue-500 {% if section.approved_interpretation.user.is_deleted %}line-through{% endif %}"
|
class="text-blue-500 {% if section.approved_interpretation.user.is_deleted %}line-through{% endif %}">
|
||||||
>
|
|
||||||
{{section.approved_interpretation.user.username}}
|
{{section.approved_interpretation.user.username}}
|
||||||
</a>
|
</a>
|
||||||
on {{section.approved_interpretation.created_at.strftime('%B %d, %Y')}}
|
on {{section.approved_interpretation.created_at.strftime('%B %d,
|
||||||
|
%Y')}}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
data-tooltip-target="tooltip-click"
|
data-tooltip-target="tooltip-click"
|
||||||
@ -47,16 +50,14 @@
|
|||||||
id="copyLinkButton"
|
id="copyLinkButton"
|
||||||
type="button"
|
type="button"
|
||||||
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
||||||
data-link="{{ build_qa_url(section.approved_interpretation) }}"
|
data-link="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
>
|
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<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>
|
<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>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div
|
||||||
id="tooltip-click"
|
id="tooltip-click"
|
||||||
role="tooltip"
|
role="tooltip"
|
||||||
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"
|
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700">
|
||||||
>
|
|
||||||
Link copied!
|
Link copied!
|
||||||
<div class="tooltip-arrow" data-popper-arrow></div>
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,8 +76,7 @@
|
|||||||
class="flex items-center bg-inherit justify-start w-full p-5 font-medium text-left"
|
class="flex items-center bg-inherit justify-start w-full p-5 font-medium text-left"
|
||||||
data-accordion-target="#accordion-comments-collapse-{{loop.index}}-body-{{loop.index}}"
|
data-accordion-target="#accordion-comments-collapse-{{loop.index}}-body-{{loop.index}}"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
aria-controls="accordion-collapse-body-1"
|
aria-controls="accordion-collapse-body-1">
|
||||||
>
|
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<svg data-accordion-icon class="w-6 h-6 rotate-180 shrink-0" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
|
<svg data-accordion-icon class="w-6 h-6 rotate-180 shrink-0" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
|
||||||
<span><i>Comments:</i></span>
|
<span><i>Comments:</i></span>
|
||||||
@ -85,8 +85,7 @@
|
|||||||
<div
|
<div
|
||||||
id="accordion-comments-collapse-{{loop.index}}-body-{{loop.index}}"
|
id="accordion-comments-collapse-{{loop.index}}-body-{{loop.index}}"
|
||||||
class="hidden"
|
class="hidden"
|
||||||
aria-labelledby="accordion-collapse-heading-{{loop.index}}"
|
aria-labelledby="accordion-collapse-heading-{{loop.index}}">
|
||||||
>
|
|
||||||
{% for comment in section.approved_comments %}
|
{% for comment in section.approved_comments %}
|
||||||
<div class="p-5 ml-6">
|
<div class="p-5 ml-6">
|
||||||
<div class="dark:text-white h-30">
|
<div class="dark:text-white h-30">
|
||||||
@ -97,39 +96,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex w-full ml-auto align-center justify-between space-x-3 border-t py-3"
|
class="flex w-full ml-auto align-center justify-between space-x-3 border-t py-3">
|
||||||
>
|
|
||||||
<span class="text-sm">
|
<span class="text-sm">
|
||||||
Created by
|
Created by
|
||||||
<a href="{{ url_for('user.profile', user_id=comment.user.id) }}" class="text-blue-500 {% if comment.user.is_deleted %}line-through{% endif %}" >
|
<a
|
||||||
|
href="{{ url_for('user.profile', user_id=comment.user.id) }}"
|
||||||
|
class="text-blue-500 {% if comment.user.is_deleted %}line-through{% endif %}">
|
||||||
{{comment.user.username}}
|
{{comment.user.username}}
|
||||||
</a>
|
</a>
|
||||||
on {{comment.created_at.strftime('%B %d, %Y')}}
|
on {{comment.created_at.strftime('%B %d, %Y')}}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<div>
|
||||||
data-tooltip-target="tooltip-click"
|
<!-- prettier-ignore -->
|
||||||
data-tooltip-trigger="click"
|
<a class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white" href="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
id="copyLinkButton"
|
<!-- prettier-ignore -->
|
||||||
type="button"
|
<button data-tooltip-target="tooltip-click" data-tooltip-trigger="click" id="copyLinkButton" type="button" class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white" data-link="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
<!-- prettier-ignore -->
|
||||||
data-link="{{ build_qa_url(section.approved_interpretation) }}">
|
|
||||||
<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>
|
<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>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div id="tooltip-click" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"> Link copied! <div class="tooltip-arrow" data-popper-arrow></div> </div>
|
||||||
id="tooltip-click"
|
|
||||||
role="tooltip"
|
|
||||||
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"
|
|
||||||
>
|
|
||||||
Link copied!
|
|
||||||
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %} {% endif %}
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -139,10 +131,9 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for section in collection.active_sections %}
|
{% for section in collection.active_sections %}
|
||||||
<a href="{{url_for('book.interpretation_view', book_id=book.id, section_id=section.copy_of or section.id)}}">
|
<a
|
||||||
<p id="section-{{section.label}}" class="my-3">
|
href="{{url_for('book.interpretation_view', book_id=book.id, section_id=section.copy_of or section.id)}}">
|
||||||
{{ section.label }}
|
<p id="section-{{section.label}}" class="my-3">{{ section.label }}</p>
|
||||||
</p>
|
|
||||||
</a>
|
</a>
|
||||||
{% if not section.active_interpretations %}
|
{% if not section.active_interpretations %}
|
||||||
<p class="ml-3 my-3 italic text-sm">This section is empty</p>
|
<p class="ml-3 my-3 italic text-sm">This section is empty</p>
|
||||||
@ -154,35 +145,32 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex w-full ml-auto align-center justify-between space-x-3 border-t py-3">
|
<div
|
||||||
|
class="flex w-full ml-auto align-center justify-between space-x-3 border-t py-3">
|
||||||
<span class="text-sm">
|
<span class="text-sm">
|
||||||
Interpretation by
|
Interpretation by
|
||||||
<a
|
<a
|
||||||
href="{{url_for('user.profile',user_id=section.approved_interpretation.user.id)}}"
|
href="{{url_for('user.profile',user_id=section.approved_interpretation.user.id)}}"
|
||||||
class="text-blue-500 {% if section.approved_interpretation.user.is_deleted %}line-through{% endif %}"
|
class="text-blue-500 {% if section.approved_interpretation.user.is_deleted %}line-through{% endif %}">
|
||||||
>
|
|
||||||
{{section.approved_interpretation.user.username}}
|
{{section.approved_interpretation.user.username}}
|
||||||
</a>
|
</a>
|
||||||
on {{section.approved_interpretation.created_at.strftime('%B %d, %Y')}}
|
on {{section.approved_interpretation.created_at.strftime('%B %d, %Y')}}
|
||||||
</span>
|
</span>
|
||||||
|
<div>
|
||||||
|
<!-- prettier-ignore -->
|
||||||
|
<a class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white" href="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
|
<!-- prettier-ignore -->
|
||||||
<button
|
<button
|
||||||
data-tooltip-target="tooltip-click"
|
data-tooltip-target="tooltip-click"
|
||||||
data-tooltip-trigger="click"
|
data-tooltip-trigger="click"
|
||||||
id="copyLinkButton"
|
id="copyLinkButton"
|
||||||
type="button"
|
type="button"
|
||||||
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
||||||
data-link="{{ build_qa_url(section.approved_interpretation) }}"
|
data-link="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
>
|
<!-- prettier-ignore -->
|
||||||
<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>
|
<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>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div id="tooltip-click" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"> Link copied! <div class="tooltip-arrow" data-popper-arrow></div> </div> </div>
|
||||||
id="tooltip-click"
|
|
||||||
role="tooltip"
|
|
||||||
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"
|
|
||||||
>
|
|
||||||
Link copied!
|
|
||||||
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Comments-->
|
<!--Comments-->
|
||||||
@ -191,28 +179,18 @@
|
|||||||
<p>No comments for current section</p>
|
<p>No comments for current section</p>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div
|
<!-- prettier-ignore -->
|
||||||
id="accordion-comments-collapse-nest{{loop.index}}"
|
<div id="accordion-comments-collapse-nest{{loop.index}}" data-accordion="collapse" class="mb-3">
|
||||||
data-accordion="collapse"
|
|
||||||
class="mb-3"
|
|
||||||
>
|
|
||||||
<h2 id="accordion-comments-collapse-nest{{loop.index}}-heading-{{loop.index}}">
|
<h2 id="accordion-comments-collapse-nest{{loop.index}}-heading-{{loop.index}}">
|
||||||
<button
|
<!-- prettier-ignore -->
|
||||||
type="button"
|
<button type="button" class="flex items-center bg-inherit justify-start w-full p-5 font-medium text-left" data-accordion-target="#accordion-comments-collapse-nest{{loop.index}}-body-{{loop.index}}" aria-expanded="false" aria-controls="accordion-collapse-body-1">
|
||||||
class="flex items-center bg-inherit justify-start w-full p-5 font-medium text-left"
|
<!-- prettier-ignore -->
|
||||||
data-accordion-target="#accordion-comments-collapse-nest{{loop.index}}-body-{{loop.index}}"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-controls="accordion-collapse-body-1"
|
|
||||||
>
|
|
||||||
<svg data-accordion-icon class="w-6 h-6 rotate-180 shrink-0" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
|
<svg data-accordion-icon class="w-6 h-6 rotate-180 shrink-0" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path> </svg>
|
||||||
<span><i>Comments:</i> </span>
|
<span><i>Comments:</i> </span>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
<div
|
<!-- prettier-ignore -->
|
||||||
id="accordion-comments-collapse-nest{{loop.index}}-body-{{loop.index}}"
|
<div id="accordion-comments-collapse-nest{{loop.index}}-body-{{loop.index}}" class="hidden" aria-labelledby="accordion-collapse-heading-1">
|
||||||
class="hidden"
|
|
||||||
aria-labelledby="accordion-collapse-heading-1"
|
|
||||||
>
|
|
||||||
{% for comment in section.approved_comments %}
|
{% for comment in section.approved_comments %}
|
||||||
<div class="p-5 ml-6">
|
<div class="p-5 ml-6">
|
||||||
<div class="dark:text-white h-30">
|
<div class="dark:text-white h-30">
|
||||||
@ -233,30 +211,27 @@
|
|||||||
</a>
|
</a>
|
||||||
on {{comment.created_at.strftime('%B %d, %Y')}}
|
on {{comment.created_at.strftime('%B %d, %Y')}}
|
||||||
</span>
|
</span>
|
||||||
|
<div>
|
||||||
|
<!-- prettier-ignore -->
|
||||||
|
<a class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white" href="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
|
<!-- prettier-ignore -->
|
||||||
|
<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="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" /> </svg>
|
||||||
|
</a>
|
||||||
<button
|
<button
|
||||||
data-tooltip-target="tooltip-click"
|
data-tooltip-target="tooltip-click"
|
||||||
data-tooltip-trigger="click"
|
data-tooltip-trigger="click"
|
||||||
id="copyLinkButton"
|
id="copyLinkButton"
|
||||||
type="button"
|
type="button"
|
||||||
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
class="hover:dark:text-white hover:text-black focus:ring-2 rounded-full font-medium text-sm p-2.5 text-center inline-flex items-center dark:hover:text-white"
|
||||||
data-link="{{ build_qa_url(section.approved_interpretation) }}"
|
data-link="{{ build_qa_url(section.approved_interpretation) }}">
|
||||||
>
|
<!-- prettier-ignore -->
|
||||||
<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>
|
<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>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div id="tooltip-click" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"> Link copied! <div class="tooltip-arrow" data-popper-arrow></div> </div>
|
||||||
id="tooltip-click"
|
|
||||||
role="tooltip"
|
|
||||||
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"
|
|
||||||
>
|
|
||||||
Link copied!
|
|
||||||
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %} {% endif %} {% endfor %} {% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
<div class="ql-snow">
|
<div class="ql-snow">
|
||||||
{% set local_breadcrumbs = interpretation.section.breadcrumbs_path %}
|
{% set local_breadcrumbs = interpretation.section.breadcrumbs_path %}
|
||||||
{% include 'book/local_breadcrumbs_navigation.html'%}
|
{% include 'book/local_breadcrumbs_navigation.html'%}
|
||||||
|
<a href="{{url_for('book.interpretation_view', book_id=interpretation.book.id, section_id=interpretation.section.id)}}">
|
||||||
<p>{{ interpretation.section.label }}</p>
|
<p>{{ interpretation.section.label }}</p>
|
||||||
</a>
|
</a>
|
||||||
<div class="dark:text-white h-30 ql-editor-readonly">
|
<div class="dark:text-white h-30 ql-editor-readonly">
|
||||||
|
@ -13,8 +13,9 @@ export function initWallet() {
|
|||||||
// protocol, hostname and port number of the URL
|
// protocol, hostname and port number of the URL
|
||||||
const origin = window.location.origin;
|
const origin = window.location.origin;
|
||||||
// connect to ethereum network and sign transactions with Metamask
|
// connect to ethereum network and sign transactions with Metamask
|
||||||
const showExtensionAlert = localStorage.getItem('showExtensionAlert');
|
|
||||||
if (!window.hasOwnProperty('ethereum') && showExtensionAlert != 'false') {
|
async function signInWithEthereum() {
|
||||||
|
if (!window.hasOwnProperty('ethereum')) {
|
||||||
let result = confirm(
|
let result = confirm(
|
||||||
"You don't have needed extension! Do you want to install it?",
|
"You don't have needed extension! Do you want to install it?",
|
||||||
);
|
);
|
||||||
@ -24,15 +25,13 @@ export function initWallet() {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (showExtensionAlert == 'false' && !window.hasOwnProperty('ethereum')) {
|
if (!window.hasOwnProperty('ethereum')) {
|
||||||
console.error('Required extension not found');
|
console.error('Required extension not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const eOwner: IEthereumOwner = window as any;
|
const eOwner: IEthereumOwner = window as any;
|
||||||
const provider = new ethers.providers.Web3Provider(eOwner.ethereum);
|
const provider = new ethers.providers.Web3Provider(eOwner.ethereum);
|
||||||
const signer = provider.getSigner();
|
const signer = provider.getSigner();
|
||||||
|
|
||||||
async function signInWithEthereum() {
|
|
||||||
// create siwe message and call backend to get a nonce
|
// create siwe message and call backend to get a nonce
|
||||||
const res1 = await fetch('/nonce', {
|
const res1 = await fetch('/nonce', {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
@ -57,7 +57,7 @@ def test_notifications(client: FlaskClient):
|
|||||||
)
|
)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
# check that user_2 have notification about he was added, deleted as Editor/Moderator and his comment was approved
|
# check that user_2 have notification about he was added, deleted as Contributor and his comment was approved
|
||||||
assert len(user_2.active_notifications) == 3
|
assert len(user_2.active_notifications) == 3
|
||||||
|
|
||||||
response: Response = client.post(
|
response: Response = client.post(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user