Merge branch 'develop' into kostia/feature/interpretations

This commit is contained in:
Kostiantyn Stoliarskyi 2023-05-05 10:36:03 +03:00
commit 18e353968f
4 changed files with 53 additions and 42 deletions

View File

@ -56,7 +56,7 @@
<!-- prettier-ignore -->
{% if not current_user.is_authenticated %}
<button id="connectWalletBtn" type="button" class="text-white bg-gradient-to-r from-cyan-500 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Connect wallet</button>
<button id="connectWalletBtn" type="button" class="text-white bg-gradient-to-r from-cyan-500 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Connect wallet</button>
{% endif %}
{% if current_user.is_authenticated %}
<div class="flex">
@ -103,7 +103,7 @@
<!-- Dropdown menu -->
<!--Those notification for now with dummy data-->
<!-- prettier-ignore -->
<div id="dropdownNotification" class="shadow-md z-20 hidden w-screen bg-white divide-y divide-gray-100 rounded-lg dark:bg-gray-800 dark:divide-gray-700 border border-gray-600 dark:shadow-gray-600" aria-labelledby="dropdownNotificationButton">
<div id="dropdownNotification" class="shadow-md z-20 hidden w-screen bg-white divide-y divide-gray-100 rounded-lg dark:bg-gray-800 dark:divide-gray-700 border border-gray-600 dark:shadow-gray-600 md:w-1/2" aria-labelledby="dropdownNotificationButton">
<div class="block px-4 py-2 font-medium text-center text-gray-700 rounded-t-lg bg-gray-50 dark:bg-gray-800 dark:text-white"> Notifications </div>
<div class="divide-y divide-gray-100 dark:divide-gray-700">
<a

View File

@ -5,18 +5,22 @@
<div class="h-full px-3 pb-4 overflow-y-auto bg-white dark:bg-gray-800">
<!-- prettier-ignore -->
<ul class="space-y-2 font-medium">
{% if current_user.is_authenticated %}
<li class="md:hidden">
<!-- prettier-ignore -->
<span class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white bg-gray-200 dark:bg-gray-700" >
<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="M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z" /> </svg>
<p class="ml-2">{{ current_user.username }}</p>
</span>
<span class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white bg-gray-200 dark:bg-gray-700" >
<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="M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z" /> </svg>
<a class="ml-2" href="{{ url_for('user.profile') }}"> Edit profile</a>
</span>
</li>
<li>
<a
href="{{ url_for('user.profile') }}"
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
<!-- 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="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" /> </svg>
<span class="ml-3">Edit profile</span>
</a>
</li>
<li class="md:hidden" id="dropdownNotificationButton" data-dropdown-toggle="dropdownNotification" >
<!-- prettier-ignore -->
<span class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700" >
@ -28,6 +32,7 @@
<p class="ml-2">Notifications</p>
</span>
</li>
{% endif %}
<li>
<a
href="{{ url_for('home.get_all') }}"
@ -37,6 +42,16 @@
<span class="ml-3">Home</span>
</a>
</li>
<li>
<a
href="{{ url_for('book.get_all') }}"
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
<!-- 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="M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9" /> </svg>
<span class="ml-3">Books</span>
</a>
</li>
{% if current_user.is_authenticated %}
<li>
<a
href="{{ url_for('book.my_books') }}"
@ -64,6 +79,7 @@
<span class="flex-1 ml-3 whitespace-nowrap">Users</span>
</a>
</li>
{% endif %}
<li>
<a
href="https://github.com/Simple2B/open_law"

View File

@ -1,10 +1,8 @@
{% extends "base.html" %}
<!-- prettier-ignore -->
{% block body %}
{% extends 'base.html' %}
{% block content %}
<!-- component -->
<div class="bg-gray-50 dark:bg-gray-900 h-screen pt-20">
<section>
<section>
<div class="w-full lg:w-4/12 px-4 mx-auto pt-6">
<div>
<!-- prettier-ignore -->
@ -31,9 +29,7 @@
</div>
</div>
</div>
</section>
</div>
{% endblock %}
</section>
{% block right_sidebar %}{% endblock %}
<!-- prettier-ignore -->
{% block scripts %}
{% endblock %}

View File

@ -2,7 +2,7 @@ from flask import (
Blueprint,
render_template,
)
from flask_login import current_user, login_required
from flask_login import current_user
from app import models as m
@ -10,7 +10,6 @@ bp = Blueprint("home", __name__, url_prefix="/home")
@bp.route("/", methods=["GET"])
@login_required
def get_all():
books: m.Book = m.Book.query.order_by(m.Book.id).limit(5)
sections: m.Section = m.Section.query.order_by(m.Section.id).limit(5)