mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-15 08:16:28 +00:00
Merge branch 'develop' into kostia/fix/delete_contrinbutor_modal
This commit is contained in:
commit
25e8a13ace
File diff suppressed because one or more lines are too long
@ -43,10 +43,10 @@
|
|||||||
{% for collection in book.versions[-1].children_collections if not collection.is_root and not collection.is_deleted %}
|
{% for collection in book.versions[-1].children_collections if not collection.is_root and not collection.is_deleted %}
|
||||||
<div
|
<div
|
||||||
{% if not collection.active_children and not collection.active_sections %}id="empty-dnd-entity"
|
{% if not collection.active_children and not collection.active_sections %}id="empty-dnd-entity"
|
||||||
{% elif collection.active_children %}data-dnd="dnd-sub-collection"
|
{% elif collection.active_children %}{% if has_permission(collection, Access.U) %}data-dnd="dnd-sub-collection"{% endif %}
|
||||||
{% elif collection.active_sections %}id="draggableSectionItems"{% endif %}
|
{% elif collection.active_sections %}{% if has_permission(collection, Access.U) %}id="draggableSectionItems"{% endif %}{% endif %}
|
||||||
data-entity-type="collection"
|
data-entity-type="collection"
|
||||||
data-entity-id="{{collection.id}}" class="filter">
|
data-entity-id="{{collection.id}}" class="filter {% if not has_permission(collection, Access.U) %}denied{% endif %}">
|
||||||
<div data-entity-type="collection"
|
<div data-entity-type="collection"
|
||||||
data-entity-id="{{collection.id}}" class="flex items-center justify-start w-full font-medium text-left text-gray-500 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:text-gray-400">
|
data-entity-id="{{collection.id}}" class="flex items-center justify-start w-full font-medium text-left text-gray-500 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:text-gray-400">
|
||||||
<button class="bg-inherit" type="button" data-accordion-target="#accordion-collapse-body-{{collection.id}}" aria-expanded="true" aria-controls="accordion-collapse-body-{{collection.id}}">
|
<button class="bg-inherit" type="button" data-accordion-target="#accordion-collapse-body-{{collection.id}}" aria-expanded="true" aria-controls="accordion-collapse-body-{{collection.id}}">
|
||||||
@ -73,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% elif collection.active_sections %}
|
{% elif collection.active_sections %}
|
||||||
<div id="accordion-collapse-body-{{collection.id}}" class="hidden" aria-labelledby="accordion-collapse-heading-{{collection.id}}" >
|
<div id="accordion-collapse-body-{{collection.id}}" class="hidden" aria-labelledby="accordion-collapse-heading-{{collection.id}}" >
|
||||||
<div id="draggableSectionItems" data-entity-id="{{collection.id}}" data-entity-type="collection" data-book-id="{{book.id}}">
|
<div {% if has_permission(collection, Access.U) %}id="draggableSectionItems"{% endif %} data-entity-id="{{collection.id}}" data-entity-type="collection" data-book-id="{{book.id}}" class="{% if not has_permission(collection, Access.U) %}filter{% endif %}">
|
||||||
{% for section in collection.active_sections %}
|
{% for section in collection.active_sections %}
|
||||||
{% include 'book/components/section_tab_content.html' %}
|
{% include 'book/components/section_tab_content.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<div
|
<div
|
||||||
class="ml-6"
|
class="ml-6 {% if not has_permission(collection, Access.U) %}filter{% endif %}"
|
||||||
data-dnd="dnd-sub-collection"
|
{% if has_permission(collection, Access.U) %}data-dnd="dnd-sub-collection"{% endif %}
|
||||||
{% if collection %}
|
{% if collection %}
|
||||||
data-entity-type="collection"
|
data-entity-type="collection"
|
||||||
data-entity-id="{{collection.id}}"
|
data-entity-id="{{collection.id}}"
|
||||||
@ -55,14 +55,14 @@
|
|||||||
{% if sub_collection.active_children %}
|
{% if sub_collection.active_children %}
|
||||||
{{recursive_render("book/components/sub_collection_tab_content.html",sub_collection,book)|safe}}
|
{{recursive_render("book/components/sub_collection_tab_content.html",sub_collection,book)|safe}}
|
||||||
{% elif sub_collection.active_sections %}
|
{% elif sub_collection.active_sections %}
|
||||||
<div id="draggableSectionItems" data-entity-id="{{sub_collection.id}}" data-entity-type="sub_collection" data-book-id="{{book.id}}">
|
<div {% if has_permission(collection, Access.U) %}id="draggableSectionItems"{% endif %} data-entity-id="{{sub_collection.id}}" data-entity-type="sub_collection" data-book-id="{{book.id}}" class="{% if not has_permission(collection, Access.U) %}filter{% endif %}">
|
||||||
<!-- here comes for loop for all section in this sub_collection-->
|
<!-- here comes for loop for all section in this sub_collection-->
|
||||||
{% for section in sub_collection.active_sections %}
|
{% for section in sub_collection.active_sections %}
|
||||||
{% include 'book/components/section_tab_content.html' %}
|
{% include 'book/components/section_tab_content.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div id="empty-dnd-entity" data-entity-type="sub_collection" data-entity-id="{{sub_collection.id}}"></div>
|
<div id="empty-dnd-entity" data-entity-type="sub_collection" data-entity-id="{{sub_collection.id}}" class="{% if not has_permission(collection, Access.U) %}filter{% endif %}"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -71,8 +71,8 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<!-- if collection doesn't have sub_collection -->
|
<!-- if collection doesn't have sub_collection -->
|
||||||
<div
|
<div
|
||||||
class="ml-6"
|
class="ml-6 {% if not has_permission(collection, Access.U) %}filter{% endif %}"
|
||||||
id="draggableSectionItems"
|
{% if has_permission(collection, Access.U) %}id="draggableSectionItems"{% endif %}
|
||||||
data-entity-id="{{collection.id}}"
|
data-entity-id="{{collection.id}}"
|
||||||
data-entity-type="collection">
|
data-entity-type="collection">
|
||||||
<!-- here comes for loop for all section in this collection-->
|
<!-- here comes for loop for all section in this collection-->
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from flask import Blueprint, render_template, request, flash, redirect, url_for, jsonify
|
from flask import Blueprint, render_template, request, flash, redirect, url_for, jsonify
|
||||||
from flask_login import login_required, current_user, logout_user
|
from flask_login import login_required, current_user, logout_user
|
||||||
from app.controllers import create_pagination
|
from app.controllers import create_pagination
|
||||||
from sqlalchemy import not_
|
from sqlalchemy import func, not_, or_
|
||||||
|
|
||||||
from app import models as m, db
|
from app import models as m, db
|
||||||
from app import forms as f
|
from app import forms as f
|
||||||
@ -112,7 +112,7 @@ def profile_reactivate():
|
|||||||
@bp.route("/search", methods=["GET"])
|
@bp.route("/search", methods=["GET"])
|
||||||
@login_required
|
@login_required
|
||||||
def search():
|
def search():
|
||||||
q = request.args.get("q", type=str, default=None)
|
q = request.args.get("q", type=str, default="").lower()
|
||||||
if not q:
|
if not q:
|
||||||
return jsonify({"message": "q parameter is required"}), 422
|
return jsonify({"message": "q parameter is required"}), 422
|
||||||
|
|
||||||
@ -121,7 +121,12 @@ def search():
|
|||||||
query_user = m.User.query
|
query_user = m.User.query
|
||||||
query_user = query_user.order_by(m.User.username)
|
query_user = query_user.order_by(m.User.username)
|
||||||
|
|
||||||
query_user = query_user.filter(m.User.username.ilike(f"{q}%"))
|
query_user = query_user.filter(
|
||||||
|
or_(
|
||||||
|
func.lower(m.User.username).like(f"%{q}%"),
|
||||||
|
func.lower(m.User.wallet_id).like(f"%{q}%"),
|
||||||
|
)
|
||||||
|
)
|
||||||
if book_id:
|
if book_id:
|
||||||
book_contributors = m.BookContributor.query.filter_by(book_id=book_id).all()
|
book_contributors = m.BookContributor.query.filter_by(book_id=book_id).all()
|
||||||
user_ids = [contributor.user_id for contributor in book_contributors]
|
user_ids = [contributor.user_id for contributor in book_contributors]
|
||||||
|
@ -88,6 +88,7 @@ export function initDnD() {
|
|||||||
fallbackOnBody: true,
|
fallbackOnBody: true,
|
||||||
swapThreshold: 20,
|
swapThreshold: 20,
|
||||||
filter: '.filter',
|
filter: '.filter',
|
||||||
|
disabled: div.classList.contains('denied'),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ const contextSectionMenuTriggers: NodeListOf<HTMLElement> =
|
|||||||
let currentElement: DropdownInterface | null = null;
|
let currentElement: DropdownInterface | null = null;
|
||||||
|
|
||||||
const options: DropdownOptions = {
|
const options: DropdownOptions = {
|
||||||
offsetSkidding: 410,
|
offsetSkidding: 200,
|
||||||
offsetDistance: 0,
|
offsetDistance: 0,
|
||||||
onHide: () => {},
|
onHide: () => {},
|
||||||
onShow: tooltip => {
|
onShow: tooltip => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user