Compare commits
53 Commits
1.0.0-RC1
...
706b3dc275
| Author | SHA1 | Date | |
|---|---|---|---|
| 706b3dc275 | |||
| ff78f9da54 | |||
| 3a14528402 | |||
| 5c276faf78 | |||
| 95b17947b2 | |||
| f20635e10e | |||
| 8d4d64076a | |||
| f9867b3e2b | |||
| b89d043880 | |||
| 0ecbb99423 | |||
| 61bd5589ff | |||
| 72065c0d0d | |||
| cd8bb58dfb | |||
| 9ab1571067 | |||
| 2948e9b961 | |||
| 191a3d0018 | |||
| 8885969a07 | |||
| a997e54891 | |||
| 0b12f8718a | |||
| d5d2f31178 | |||
| 1bd2774cdd | |||
| e5375edda8 | |||
| ae306bb89e | |||
| e877c36a3d | |||
| 7f639fc5a0 | |||
| 7fbba953cd | |||
| 4e52999b5d | |||
| 392d66b03e | |||
| dc6616bba6 | |||
| f3f0ddc004 | |||
| 0b9d5d42cb | |||
| bb0ecb5c13 | |||
| 5a5f1b3519 | |||
| 2adecb99d2 | |||
| 3db7c62b09 | |||
| 78c4ee119a | |||
| 46ac3295e3 | |||
| 2349f4c804 | |||
| 334150bc0f | |||
|
|
da19ef652e | ||
|
|
015fc00f6f | ||
| e22c197d3a | |||
| becab58c73 | |||
| 70a863f6e1 | |||
| 2b55d206e2 | |||
| f35182233b | |||
| 43474c960f | |||
| b3566b39b8 | |||
| 7bebc05e08 | |||
| 6b49b688ac | |||
| 7dbe4a1716 | |||
| 701ac8e1dc | |||
| 2ba34a675d |
12
Makefile
Normal file
12
Makefile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
publish:
|
||||||
|
git checkout $(TAG)
|
||||||
|
docker build -f back/Dockerfile.prod -t git.dorfsvald.net/ewandor/cht-lawfirm-back-prod back
|
||||||
|
docker tag git.dorfsvald.net/ewandor/cht-lawfirm-back-prod:latest git.dorfsvald.net/ewandor/cht-lawfirm-back-prod:$(TAG)
|
||||||
|
docker push git.dorfsvald.net/ewandor/cht-lawfirm-back-prod:latest
|
||||||
|
docker push git.dorfsvald.net/ewandor/cht-lawfirm-back-prod:$(TAG)
|
||||||
|
docker build -f front/Dockerfile.prod -t git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod front
|
||||||
|
docker tag git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod:latest git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod:$(TAG)
|
||||||
|
docker push git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod:latest
|
||||||
|
docker push git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod:$(TAG)
|
||||||
|
git switch -
|
||||||
@@ -1,17 +1,14 @@
|
|||||||
FROM python:3.10
|
FROM python:3.13
|
||||||
|
|
||||||
RUN apt update && apt install -y xfonts-base xfonts-75dpi python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 \
|
RUN apt update && apt install -y xfonts-base xfonts-75dpi python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
|
|
||||||
# copy both 'package.json' and 'package-lock.json' (if available)
|
|
||||||
COPY ./requirements.txt /code/requirements.txt
|
COPY ./requirements.txt /code/requirements.txt
|
||||||
|
|
||||||
# install project dependencies
|
|
||||||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||||
|
|
||||||
# copy project files and folders to the current working directory (i.e. 'app' folder)
|
|
||||||
COPY ./app /code/app
|
COPY ./app /code/app
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|||||||
15
back/Dockerfile.prod
Normal file
15
back/Dockerfile.prod
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM python:3.10
|
||||||
|
|
||||||
|
RUN apt update && apt install -y xfonts-base xfonts-75dpi python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /code
|
||||||
|
|
||||||
|
COPY ./requirements.txt /code/requirements.txt
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||||
|
|
||||||
|
COPY ./app /code/app
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import datetime
|
import datetime
|
||||||
from typing import List, Literal
|
from typing import List, Literal, Optional
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field, validator
|
||||||
from beanie.operators import ElemMatch
|
from beanie.operators import ElemMatch
|
||||||
|
|
||||||
from ..core.models import CrudDocument, RichtextSingleline, RichtextMultiline, DictionaryEntry
|
from ..core.models import CrudDocument, RichtextSingleline, RichtextMultiline, DictionaryEntry
|
||||||
@@ -52,10 +52,10 @@ class DraftParty(BaseModel):
|
|||||||
class Party(BaseModel):
|
class Party(BaseModel):
|
||||||
entity: Entity
|
entity: Entity
|
||||||
part: str
|
part: str
|
||||||
representative: Entity = None
|
representative: Optional[Entity] = None
|
||||||
signature_uuid: str
|
signature_uuid: str
|
||||||
signature_affixed: bool = False
|
signature_affixed: bool = False
|
||||||
signature_png: str = None
|
signature_png: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
class ProvisionGenuine(BaseModel):
|
class ProvisionGenuine(BaseModel):
|
||||||
@@ -90,7 +90,7 @@ class DraftProvision(BaseModel):
|
|||||||
provision: ContractProvisionTemplateReference | ProvisionGenuine = Field(..., discriminator='type')
|
provision: ContractProvisionTemplateReference | ProvisionGenuine = Field(..., discriminator='type')
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
title = 'Provision'
|
title = 'Clause'
|
||||||
|
|
||||||
|
|
||||||
class Provision(BaseModel):
|
class Provision(BaseModel):
|
||||||
@@ -166,6 +166,10 @@ class ContractDraft(CrudDocument):
|
|||||||
|
|
||||||
|
|
||||||
class Contract(CrudDocument):
|
class Contract(CrudDocument):
|
||||||
|
"""
|
||||||
|
Contrat publié. Les contrats ne peuvent pas être modifiés.
|
||||||
|
Ils peuvent seulement être signés par les parties et imprimés par l'avocat
|
||||||
|
"""
|
||||||
name: str = Field(title="Nom")
|
name: str = Field(title="Nom")
|
||||||
title: str = Field(title="Titre")
|
title: str = Field(title="Titre")
|
||||||
parties: List[Party] = Field(title="Parties")
|
parties: List[Party] = Field(title="Parties")
|
||||||
@@ -177,6 +181,19 @@ class Contract(CrudDocument):
|
|||||||
lawyer: Entity = Field(title="Avocat en charge")
|
lawyer: Entity = Field(title="Avocat en charge")
|
||||||
location: str = Field(title="Lieu")
|
location: str = Field(title="Lieu")
|
||||||
date: datetime.date = Field(title="Date")
|
date: datetime.date = Field(title="Date")
|
||||||
|
label: Optional[str] = None
|
||||||
|
|
||||||
|
@validator("label", always=True)
|
||||||
|
def generate_label(cls, v, values, **kwargs):
|
||||||
|
if not v:
|
||||||
|
contract_label = values['title']
|
||||||
|
for p in values['parties']:
|
||||||
|
contract_label = contract_label + f" - {p.entity.label}"
|
||||||
|
|
||||||
|
contract_label = contract_label + f" - {values['date'].strftime('%m/%d/%Y')}"
|
||||||
|
return contract_label
|
||||||
|
|
||||||
|
return v
|
||||||
|
|
||||||
class Settings(CrudDocument.Settings):
|
class Settings(CrudDocument.Settings):
|
||||||
fulltext_search = ['name', 'title']
|
fulltext_search = ['name', 'title']
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ async def render_css(root_url, contract):
|
|||||||
async def preview_draft(draft_id: str, request: Request) -> str:
|
async def preview_draft(draft_id: str, request: Request) -> str:
|
||||||
draft = await build_model(await ContractDraft.get(draft_id))
|
draft = await build_model(await ContractDraft.get(draft_id))
|
||||||
|
|
||||||
return await render_print(f'{request.url.scheme}://{request.url.hostname}', draft)
|
return await render_print('', draft)
|
||||||
|
|
||||||
|
|
||||||
@print_router.get("/preview/signature/{signature_id}", response_class=HTMLResponse)
|
@print_router.get("/preview/signature/{signature_id}", response_class=HTMLResponse)
|
||||||
@@ -91,7 +91,7 @@ async def preview_contract_by_signature(signature_id: str, request: Request) ->
|
|||||||
if p.signature_affixed:
|
if p.signature_affixed:
|
||||||
p.signature_png = retrieve_signature_png(f'media/signatures/{p.signature_uuid}.png')
|
p.signature_png = retrieve_signature_png(f'media/signatures/{p.signature_uuid}.png')
|
||||||
|
|
||||||
return await render_print(f'{request.url.scheme}://{request.url.hostname}', contract)
|
return await render_print('', contract)
|
||||||
|
|
||||||
|
|
||||||
@print_router.get("/preview/{contract_id}", response_class=HTMLResponse)
|
@print_router.get("/preview/{contract_id}", response_class=HTMLResponse)
|
||||||
@@ -101,7 +101,7 @@ async def preview_contract(contract_id: str, request: Request) -> str:
|
|||||||
if p.signature_affixed:
|
if p.signature_affixed:
|
||||||
p.signature_png = retrieve_signature_png(f'media/signatures/{p.signature_uuid}.png')
|
p.signature_png = retrieve_signature_png(f'media/signatures/{p.signature_uuid}.png')
|
||||||
|
|
||||||
return await render_print(f'{request.url.scheme}://{request.url.hostname}', contract)
|
return await render_print('', contract)
|
||||||
|
|
||||||
|
|
||||||
@print_router.get("/pdf/{contract_id}", response_class=FileResponse)
|
@print_router.get("/pdf/{contract_id}", response_class=FileResponse)
|
||||||
@@ -130,7 +130,7 @@ async def create_pdf(contract_id: str) -> str:
|
|||||||
return FileResponse(
|
return FileResponse(
|
||||||
contract_path,
|
contract_path,
|
||||||
media_type="application/pdf",
|
media_type="application/pdf",
|
||||||
filename=contract.name)
|
filename=contract.label)
|
||||||
|
|
||||||
|
|
||||||
def retrieve_signature_png(filepath):
|
def retrieve_signature_png(filepath):
|
||||||
@@ -139,3 +139,18 @@ def retrieve_signature_png(filepath):
|
|||||||
base64_utf8_str = base64.b64encode(b_content).decode('utf-8')
|
base64_utf8_str = base64.b64encode(b_content).decode('utf-8')
|
||||||
ext = filepath.split('.')[-1]
|
ext = filepath.split('.')[-1]
|
||||||
return f'data:image/{ext};base64,{base64_utf8_str}'
|
return f'data:image/{ext};base64,{base64_utf8_str}'
|
||||||
|
|
||||||
|
|
||||||
|
@print_router.get("/opengraph/{signature_id}", response_class=HTMLResponse)
|
||||||
|
async def get_signature_opengraph(signature_id: str, request: Request) -> str:
|
||||||
|
contract = await Contract.find_by_signature_id(signature_id)
|
||||||
|
signature = contract.get_signature(signature_id)
|
||||||
|
template = templates.get_template("opengraph.html")
|
||||||
|
|
||||||
|
signatory = signature.representative.label if signature.representative else signature.entity.label
|
||||||
|
|
||||||
|
return template.render({
|
||||||
|
"signatory": signatory,
|
||||||
|
"title": contract.label,
|
||||||
|
"origin_url": f"{request.url.scheme}://{request.url.hostname}"
|
||||||
|
})
|
||||||
|
|||||||
10
back/app/contract/print/templates/opengraph.html
Normal file
10
back/app/contract/print/templates/opengraph.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta property="og:title" content="{{ title }}" />
|
||||||
|
<meta property="og:description" content="Cette page est à la destination exclusive de {{ signatory }}
|
||||||
|
Si vous n'êtes pas {{ signatory }}, veuillez fermer cette page immédiatement et surpprimer tous les liens en votre possession menant vers celle-ci.
|
||||||
|
En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour usurpation d'identité et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.
|
||||||
|
Le cabinet Cooper, Hillman & Toshi LLC" />
|
||||||
|
<meta property="og:image" content="{{ origin_url }}/assets/logo.png" />
|
||||||
|
</head>
|
||||||
|
</html>
|
||||||
@@ -109,6 +109,11 @@ h2 {
|
|||||||
text-indent: 2em;
|
text-indent: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content td p {
|
||||||
|
text-indent: 0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.provision {
|
.provision {
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
@@ -117,13 +122,17 @@ p {
|
|||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mention {
|
.mention {
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,4 +144,4 @@ p {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 3cm;
|
height: 3cm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ from beanie.odm.operators.find.comparison import In
|
|||||||
from beanie.operators import And, RegEx, Eq
|
from beanie.operators import And, RegEx, Eq
|
||||||
|
|
||||||
from fastapi import APIRouter, HTTPException, Depends
|
from fastapi import APIRouter, HTTPException, Depends
|
||||||
from fastapi_paginate import Page, Params, add_pagination
|
from fastapi_pagination import Page, Params, add_pagination
|
||||||
from fastapi_paginate.ext.motor import paginate
|
from fastapi_pagination.ext.beanie import paginate
|
||||||
|
|
||||||
from ..user.manager import get_current_user, get_current_superuser
|
from ..user.manager import get_current_user, get_current_superuser, get_current_user_and_firm
|
||||||
|
|
||||||
|
|
||||||
def parse_sort(sort_by):
|
def parse_sort(sort_by):
|
||||||
@@ -39,7 +39,10 @@ def parse_query(query: str, model):
|
|||||||
|
|
||||||
or_array = []
|
or_array = []
|
||||||
for field in model.Settings.fulltext_search:
|
for field in model.Settings.fulltext_search:
|
||||||
or_array.append(RegEx(field, value, 'i'))
|
words_and_array = []
|
||||||
|
for word in value.split(' '):
|
||||||
|
words_and_array.append(RegEx(field, word, 'i'))
|
||||||
|
or_array.append(And(*words_and_array) if len(words_and_array) > 1 else words_and_array[0])
|
||||||
operand = Or(or_array) if len(or_array) > 1 else or_array[0]
|
operand = Or(or_array) if len(or_array) > 1 else or_array[0]
|
||||||
|
|
||||||
elif operator == 'eq':
|
elif operator == 'eq':
|
||||||
@@ -60,28 +63,27 @@ def get_crud_router(model, model_create, model_read, model_update):
|
|||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/", response_description="{} added to the database".format(model.__name__))
|
@router.post("/", response_description="{} added to the database".format(model.__name__))
|
||||||
async def create(item: model_create, user=Depends(get_current_user)) -> dict:
|
async def create(instance: str, firm: str, item: model_create, user=Depends(get_current_user)) -> dict:
|
||||||
await item.validate_foreign_key()
|
await item.validate_foreign_key()
|
||||||
o = await model(**item.dict()).create()
|
o = await model(**item.dict()).create()
|
||||||
return {"message": "{} added successfully".format(model.__name__), "id": o.id}
|
return {"message": "{} added successfully".format(model.__name__), "id": o.id}
|
||||||
|
|
||||||
@router.get("/{id}", response_description="{} record retrieved".format(model.__name__))
|
@router.get("/{id}", response_description="{} record retrieved".format(model.__name__))
|
||||||
async def read_id(id: PydanticObjectId, user=Depends(get_current_user)) -> model_read:
|
async def read_id(instance: str, firm: str, id: PydanticObjectId, user=Depends(get_current_user)) -> model_read:
|
||||||
item = await model.get(id)
|
item = await model.get(id)
|
||||||
return model_read(**item.dict())
|
return model_read(**item.dict())
|
||||||
|
|
||||||
@router.get("/", response_model=Page[model_read], response_description="{} records retrieved".format(model.__name__))
|
@router.get("/", response_model=Page[model_read], response_description="{} records retrieved".format(model.__name__))
|
||||||
async def read_list(size: int = 50, page: int = 1, sort_by: str = None, query: str = None,
|
async def read_list(instance: str, firm: str, size: int = 50, page: int = 1, sort_by: str = None, query: str = None,
|
||||||
user=Depends(get_current_user)) -> Page[model_read]:
|
user=Depends(get_current_user_and_firm)) -> Page[model_read]:
|
||||||
sort = parse_sort(sort_by)
|
sort = parse_sort(sort_by)
|
||||||
query = parse_query(query, model_read)
|
query = parse_query(query, model_read)
|
||||||
|
|
||||||
collection = model.get_motor_collection()
|
items = paginate(model.find(query), Params(**{'size': size, 'page': page}))
|
||||||
items = paginate(collection, query, Params(**{'size': size, 'page': page}), sort=sort)
|
|
||||||
return await items
|
return await items
|
||||||
|
|
||||||
@router.put("/{id}", response_description="{} record updated".format(model.__name__))
|
@router.put("/{id}", response_description="{} record updated".format(model.__name__))
|
||||||
async def update(id: PydanticObjectId, req: model_update, user=Depends(get_current_user)) -> model_read:
|
async def update(instance: str, firm: str, id: PydanticObjectId, req: model_update, user=Depends(get_current_user)) -> model_read:
|
||||||
req = {k: v for k, v in req.dict().items() if v is not None}
|
req = {k: v for k, v in req.dict().items() if v is not None}
|
||||||
update_query = {"$set": {
|
update_query = {"$set": {
|
||||||
field: value for field, value in req.items()
|
field: value for field, value in req.items()
|
||||||
@@ -98,7 +100,7 @@ def get_crud_router(model, model_create, model_read, model_update):
|
|||||||
return model_read(**item.dict())
|
return model_read(**item.dict())
|
||||||
|
|
||||||
@router.delete("/{id}", response_description="{} record deleted from the database".format(model.__name__))
|
@router.delete("/{id}", response_description="{} record deleted from the database".format(model.__name__))
|
||||||
async def delete(id: PydanticObjectId, user=Depends(get_current_superuser)) -> dict:
|
async def delete(instance: str, firm: str, id: PydanticObjectId, user=Depends(get_current_superuser)) -> dict:
|
||||||
item = await model.get(id)
|
item = await model.get(id)
|
||||||
|
|
||||||
if not item:
|
if not item:
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ from beanie import init_beanie
|
|||||||
from .user import User, AccessToken
|
from .user import User, AccessToken
|
||||||
from .entity.models import Entity
|
from .entity.models import Entity
|
||||||
from .template.models import ContractTemplate, ProvisionTemplate
|
from .template.models import ContractTemplate, ProvisionTemplate
|
||||||
from .order.models import Order
|
|
||||||
from .contract.models import ContractDraft, Contract
|
from .contract.models import ContractDraft, Contract
|
||||||
|
|
||||||
DATABASE_URL = "mongodb://root:example@mongo:27017/"
|
DB_PASSWORD = "IBO3eber0mdw2R9pnInLdtFykQFY2f06"
|
||||||
|
DATABASE_URL = f"mongodb://root:{DB_PASSWORD}@mongo:27017/"
|
||||||
|
|
||||||
|
|
||||||
async def init_db():
|
async def init_db():
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ class Individual(EntityType):
|
|||||||
props={"items-per-row": "4", "numbered": True},
|
props={"items-per-row": "4", "numbered": True},
|
||||||
title="Surnoms"
|
title="Surnoms"
|
||||||
)
|
)
|
||||||
day_of_birth: date = Field(default=None, title='Date de naissance')
|
day_of_birth: Optional[date] = Field(default=None, title='Date de naissance')
|
||||||
place_of_birth: str = Field(default="", title='Lieu de naissance')
|
place_of_birth: Optional[str] = Field(default="", title='Lieu de naissance')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def label(self) -> str:
|
def label(self) -> str:
|
||||||
if len(self.surnames) > 0:
|
# if len(self.surnames) > 0:
|
||||||
return '{} "{}" {}'.format(self.firstname, self.surnames[0], self.lastname)
|
# return '{} "{}" {}'.format(self.firstname, self.surnames[0], self.lastname)
|
||||||
|
|
||||||
return '{} {}'.format(self.firstname, self.lastname)
|
return '{} {}'.format(self.firstname, self.lastname)
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ async def on_startup():
|
|||||||
|
|
||||||
app.include_router(get_auth_router(), prefix="/auth", tags=["auth"], )
|
app.include_router(get_auth_router(), prefix="/auth", tags=["auth"], )
|
||||||
app.include_router(user_router, prefix="/users", tags=["users"], )
|
app.include_router(user_router, prefix="/users", tags=["users"], )
|
||||||
app.include_router(entity_router, prefix="/entity", tags=["entity"], )
|
|
||||||
app.include_router(template_router, prefix="/template", tags=["template"], )
|
multitenant_prefix = "/{instance}/{firm}"
|
||||||
app.include_router(contract_router, prefix="/contract", tags=["contract"], )
|
|
||||||
# app.include_router(order_router, prefix="/order", tags=["order"], )
|
app.include_router(entity_router, prefix=f"{multitenant_prefix}/entity", tags=["entity"], )
|
||||||
|
app.include_router(template_router, prefix=f"{multitenant_prefix}/template", tags=["template"], )
|
||||||
|
app.include_router(contract_router, prefix=f"{multitenant_prefix}/contract", tags=["contract"], )
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Dict, Generic, Optional
|
from typing import Any
|
||||||
from bson import ObjectId
|
from bson import ObjectId
|
||||||
|
|
||||||
from fastapi import Depends
|
from fastapi import Depends
|
||||||
@@ -109,6 +109,9 @@ fastapi_users = FastAPIUsers[User, uuid.UUID](
|
|||||||
get_current_user = fastapi_users.current_user(active=True)
|
get_current_user = fastapi_users.current_user(active=True)
|
||||||
get_current_superuser = fastapi_users.current_user(active=True, superuser=True)
|
get_current_superuser = fastapi_users.current_user(active=True, superuser=True)
|
||||||
|
|
||||||
|
def get_current_user_and_firm(user=Depends(get_current_user)):
|
||||||
|
return user
|
||||||
|
|
||||||
|
|
||||||
def get_auth_router():
|
def get_auth_router():
|
||||||
return fastapi_users.get_auth_router(auth_backend)
|
return fastapi_users.get_auth_router(auth_backend)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import Optional, TypeVar
|
from typing import Optional, TypeVar
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
from beanie import PydanticObjectId
|
from beanie import Document
|
||||||
|
|
||||||
from fastapi_users.db import BeanieBaseUser, BeanieUserDatabase
|
from fastapi_users.db import BeanieBaseUser, BeanieUserDatabase
|
||||||
from fastapi_users_db_beanie.access_token import BeanieAccessTokenDatabase, BeanieBaseAccessToken
|
from fastapi_users_db_beanie.access_token import BeanieAccessTokenDatabase, BeanieBaseAccessToken
|
||||||
@@ -9,11 +9,11 @@ from fastapi_users_db_beanie.access_token import BeanieAccessTokenDatabase, Bean
|
|||||||
from pymongo import IndexModel
|
from pymongo import IndexModel
|
||||||
|
|
||||||
|
|
||||||
class AccessToken(BeanieBaseAccessToken[PydanticObjectId]):
|
class AccessToken(BeanieBaseAccessToken, Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class User(BeanieBaseUser[PydanticObjectId]):
|
class User(BeanieBaseUser, Document):
|
||||||
login: str
|
login: str
|
||||||
entity_id: str
|
entity_id: str
|
||||||
created_at: datetime = Field(default=datetime.utcnow(), nullable=False)
|
created_at: datetime = Field(default=datetime.utcnow(), nullable=False)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
from pydantic import BaseModel
|
from typing import Annotated
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
from fastapi_users import schemas
|
from fastapi_users import schemas
|
||||||
|
|
||||||
from .models import User
|
from .models import User
|
||||||
@@ -9,12 +11,8 @@ class UserBase(schemas.CreateUpdateDictModel):
|
|||||||
|
|
||||||
|
|
||||||
class UserRead(User):
|
class UserRead(User):
|
||||||
class Config:
|
_id: Annotated[str, Field(alias='id')]
|
||||||
fields = {
|
hashed_password: Annotated[str, Field(exclude=True)]
|
||||||
'_id': {'alias': 'id'},
|
|
||||||
'hashed_password': {'exclude': True}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class UserCreate(UserBase):
|
class UserCreate(UserBase):
|
||||||
login: str
|
login: str
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import asyncio
|
|||||||
import json
|
import json
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from app.db import init_db, Entity, Order, Contract, User, AccessToken
|
from app.db import init_db, Entity, Contract, ContractTemplate, ProvisionTemplate, User
|
||||||
|
|
||||||
|
|
||||||
models = [Entity, Order, Contract, User]
|
models = [Entity, Contract, User, ContractTemplate, ProvisionTemplate]
|
||||||
|
|
||||||
|
|
||||||
async def handle_migration(args):
|
async def handle_migration(args):
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
fastapi==0.88.0
|
fastapi
|
||||||
fastapi_users==10.2.1
|
fastapi_users
|
||||||
fastapi_users_db_beanie==1.1.2
|
fastapi_users_db_beanie
|
||||||
motor==3.1.1
|
fastapi-pagination
|
||||||
fastapi-paginate==0.1.0
|
|
||||||
uvicorn
|
uvicorn
|
||||||
jinja2
|
jinja2
|
||||||
weasyprint
|
weasyprint
|
||||||
|
|||||||
27
docker-compose.prod.yml
Normal file
27
docker-compose.prod.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
back:
|
||||||
|
image: git.dorfsvald.net/ewandor/cht-lawfirm-back-prod:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ${ROOT_PATH}/back/media:/code/media
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: git.dorfsvald.net/ewandor/cht-lawfirm-nginx-prod:latest
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "3820:80"
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: "mongo:4.4.19"
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: IBO3eber0mdw2R9pnInLdtFykQFY2f06
|
||||||
|
volumes:
|
||||||
|
- database:/data/db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
database:
|
||||||
42
docker-compose.prod.yml.back
Normal file
42
docker-compose.prod.yml.back
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
back:
|
||||||
|
build:
|
||||||
|
context: ${ROOT_PATH}/back
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
volumes:
|
||||||
|
- ${ROOT_PATH}/back/app:/code/app
|
||||||
|
- ${ROOT_PATH}/back/media:/code/media
|
||||||
|
|
||||||
|
front:
|
||||||
|
build:
|
||||||
|
context: ${ROOT_PATH}/front
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "4200:4200"
|
||||||
|
volumes:
|
||||||
|
- ${ROOT_PATH}/front/app/src:/app/src
|
||||||
|
- ${ROOT_PATH}/front/app/public:/app/public
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
build:
|
||||||
|
context: ${ROOT_PATH}/nginx
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "3820:80"
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: "mongo:4.4.18"
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: IBO3eber0mdw2R9pnInLdtFykQFY2f06
|
||||||
|
volumes:
|
||||||
|
- database:/data/db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
database:
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
version: "3.9"
|
|
||||||
services:
|
services:
|
||||||
back:
|
back:
|
||||||
build:
|
build:
|
||||||
context: ./back
|
context: ./back
|
||||||
|
image: cht-lawfirm-back-dev
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
@@ -13,6 +13,7 @@ services:
|
|||||||
front:
|
front:
|
||||||
build:
|
build:
|
||||||
context: ./front
|
context: ./front
|
||||||
|
image: cht-lawfirm-front-dev
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "4200:4200"
|
- "4200:4200"
|
||||||
@@ -23,18 +24,19 @@ services:
|
|||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
context: ./nginx
|
context: ./nginx
|
||||||
|
image: cht-lawfirm-nginx-dev
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
image: "mongo:4.4.18"
|
image: "mongo:4.4.19"
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
environment:
|
environment:
|
||||||
MONGO_INITDB_ROOT_USERNAME: root
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
MONGO_INITDB_ROOT_PASSWORD: example
|
MONGO_INITDB_ROOT_PASSWORD: IBO3eber0mdw2R9pnInLdtFykQFY2f06
|
||||||
volumes:
|
volumes:
|
||||||
- database:/data/db
|
- database:/data/db
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,11 @@
|
|||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
# install simple http server for serving static content
|
|
||||||
RUN npm install -g http-server
|
|
||||||
|
|
||||||
# make the 'app' folder the current working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN npm install -g @angular/cli http-server
|
||||||
RUN npm install -g @angular/cli
|
|
||||||
# copy both 'package.json' and 'package-lock.json' (if available)
|
|
||||||
COPY app/package*.json ./
|
COPY app/package*.json ./
|
||||||
|
|
||||||
# install project dependencies
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# copy project files and folders to the current working directory (i.e. 'app' folder)
|
|
||||||
COPY app/ .
|
COPY app/ .
|
||||||
|
|
||||||
# build app for production with minification
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 4200
|
EXPOSE 4200
|
||||||
|
|||||||
17
front/Dockerfile.prod
Normal file
17
front/Dockerfile.prod
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM node:lts-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm install -g @angular/cli
|
||||||
|
|
||||||
|
COPY app/package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY app/ .
|
||||||
|
|
||||||
|
RUN npm run build --prod
|
||||||
|
|
||||||
|
FROM nginx:alpine
|
||||||
|
COPY nginx.prod.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
COPY --from=builder /app/dist/app/fr/ /usr/share/nginx/html/
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
"sourceLocale": "en-US",
|
"sourceLocale": "en-US",
|
||||||
"locales": {
|
"locales": {
|
||||||
"fr": {
|
"fr": {
|
||||||
"translation": "src/locale/messages.fr.xlf"
|
"translation": "src/locale/messages.fr.xlf",
|
||||||
|
"baseHref": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -63,9 +64,6 @@
|
|||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"namedChunks": true
|
"namedChunks": true
|
||||||
},
|
|
||||||
"fr": {
|
|
||||||
"localize": ["fr"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
@@ -80,7 +78,7 @@
|
|||||||
"browserTarget": "app:build:development"
|
"browserTarget": "app:build:development"
|
||||||
},
|
},
|
||||||
"fr": {
|
"fr": {
|
||||||
"browserTarget": "App:build:fr"
|
"browserTarget": "app:build:fr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import {ContractsModule} from "./views/contracts/contracts.module";
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -30,6 +29,11 @@ const routes: Routes = [
|
|||||||
loadChildren: () =>
|
loadChildren: () =>
|
||||||
import('./views/templates/templates.module').then((m) => m.TemplatesModule)
|
import('./views/templates/templates.module').then((m) => m.TemplatesModule)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'contract-drafts',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('./views/contract-drafts/contract-drafts.module').then((m) => m.ContractDraftsModule)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'contracts',
|
path: 'contracts',
|
||||||
loadChildren: () =>
|
loadChildren: () =>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.sidenav {
|
||||||
|
background-image: url("/assets/leather_texture.png");
|
||||||
|
background-size: 220px;
|
||||||
|
max-width: 220px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<main style="margin-top: 0px;">
|
<main style="margin-top: 0px;">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<div class="col-auto col-md-3 col-xl-2 px-sm-2 px-0 bg-dark" style="max-width: 200px;">
|
<div class="sidenav col-auto col-md-3 col-xl-2 px-sm-2 px-0 bg-dark">
|
||||||
<sidenav class="sticky-top"></sidenav>
|
<sidenav class="sticky-top"></sidenav>
|
||||||
</div>
|
</div>
|
||||||
<div class="col py-3">
|
<div class="col py-3">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import {Title} from "@angular/platform-browser";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@@ -8,5 +9,7 @@ import { Component } from '@angular/core';
|
|||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
title = 'Cooper, Hillman & Toshi';
|
title = 'Cooper, Hillman & Toshi';
|
||||||
|
|
||||||
constructor() {}
|
constructor(private titleService: Title) {
|
||||||
|
titleService.setTitle(this.title)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
||||||
<ngb-toast
|
<ngb-toast
|
||||||
*ngFor="let flashmessage of flashmessagesService.toasts"
|
*ngFor="let flashmessage of flashmessagesService.toasts"
|
||||||
[header]="flashmessage.type" [autohide]="true" [delay]="flashmessage.delay || 1500"
|
[header]="flashmessage.type" [autohide]="true" [delay]="flashmessage.delay || 5000"
|
||||||
(hiddden)="flashmessagesService.remove(flashmessage)"
|
(hiddden)="flashmessagesService.remove(flashmessage)"
|
||||||
>
|
>
|
||||||
<ng-container [ngSwitch]="flashmessage.type">
|
<ng-container [ngSwitch]="flashmessage.type">
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.logout {
|
||||||
|
margin-top: 25px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<li><logout></logout></li>
|
<li class="logout"><logout></logout></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,13 +3,21 @@ import { Router } from '@angular/router';
|
|||||||
import { IconNamesEnum } from "ngx-bootstrap-icons";
|
import { IconNamesEnum } from "ngx-bootstrap-icons";
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
|
|
||||||
|
|
||||||
|
interface MenuItem {
|
||||||
|
title: string,
|
||||||
|
link: string,
|
||||||
|
icon: IconNamesEnum
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "sidenav",
|
selector: "sidenav",
|
||||||
templateUrl: "./sidenav.component.html",
|
templateUrl: "./sidenav.component.html",
|
||||||
styleUrls: ["./sidenav.component.css"]
|
styleUrls: ["./sidenav.component.css"]
|
||||||
})
|
})
|
||||||
export class SidenavComponent {
|
export class SidenavComponent {
|
||||||
Menu = [
|
Menu: MenuItem[] = [
|
||||||
{
|
{
|
||||||
title: $localize`Dashboard`,
|
title: $localize`Dashboard`,
|
||||||
link: "/dashboard",
|
link: "/dashboard",
|
||||||
@@ -32,7 +40,7 @@ export class SidenavComponent {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $localize`Contracts Drafts`,
|
title: $localize`Contracts Drafts`,
|
||||||
link: "/contracts/drafts",
|
link: "/contract-drafts",
|
||||||
icon: IconNamesEnum.PencilSquare
|
icon: IconNamesEnum.PencilSquare
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,7 +62,7 @@ export class SidenavComponent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
is_current_page(menu_item: any) {
|
is_current_page(menu_item: MenuItem) {
|
||||||
return this.router.url.indexOf(menu_item.link) > -1;
|
return this.router.url.startsWith(menu_item.link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent } from "./drafts.component";
|
||||||
|
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
data: {
|
||||||
|
title: 'Contract Drafts',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
component: DraftsListComponent,
|
||||||
|
data: {
|
||||||
|
title: 'List',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'new',
|
||||||
|
component: DraftsNewComponent,
|
||||||
|
data: {
|
||||||
|
title: 'New',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
component: DraftsCardComponent,
|
||||||
|
data: {
|
||||||
|
title: 'Card',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class ContractDraftsRoutingModule {}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
import { BaseViewModule } from "../base-view/base-view.module";
|
||||||
|
import { ContractDraftsRoutingModule } from './contract-drafts-routing.module';
|
||||||
|
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent, DraftsNewFormComponent } from "./drafts.component";
|
||||||
|
import { FormlyModule } from "@ngx-formly/core";
|
||||||
|
import { FormlyBootstrapModule } from "@ngx-formly/bootstrap";
|
||||||
|
import { ForeignkeyTypeComponent } from "@common/crud/types/foreignkey.type";
|
||||||
|
import { CrudService, ImageUploaderCrudService } from "@common/crud/crud.service";
|
||||||
|
|
||||||
|
import { NgbAccordionModule, NgbCollapseModule } from "@ng-bootstrap/ng-bootstrap";
|
||||||
|
import { allIcons, NgxBootstrapIconsModule } from "ngx-bootstrap-icons";
|
||||||
|
import { ClipboardModule } from "@angular/cdk/clipboard";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
BaseViewModule,
|
||||||
|
ContractDraftsRoutingModule,
|
||||||
|
NgbAccordionModule,
|
||||||
|
NgbCollapseModule,
|
||||||
|
NgxBootstrapIconsModule.pick(allIcons),
|
||||||
|
FormlyModule.forRoot({
|
||||||
|
types: [
|
||||||
|
{ name: 'foreign-key', component: ForeignkeyTypeComponent }
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
FormlyBootstrapModule,
|
||||||
|
ClipboardModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
DraftsListComponent,
|
||||||
|
DraftsNewComponent,
|
||||||
|
DraftsCardComponent,
|
||||||
|
DraftsNewFormComponent
|
||||||
|
],
|
||||||
|
providers: [CrudService, ImageUploaderCrudService]
|
||||||
|
})
|
||||||
|
export class ContractDraftsModule {
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import { CrudService } from "@common/crud/crud.service";
|
|||||||
import { ActivatedRoute, ParamMap, Router } from "@angular/router";
|
import { ActivatedRoute, ParamMap, Router } from "@angular/router";
|
||||||
|
|
||||||
import { formatDate } from "@angular/common";
|
import { formatDate } from "@angular/common";
|
||||||
|
import {FlashmessagesService} from "../../layout/flashmessages/flashmessages.service";
|
||||||
|
|
||||||
|
|
||||||
export class BaseDraftsComponent {
|
export class BaseDraftsComponent {
|
||||||
@@ -97,10 +98,10 @@ export class DraftsNewComponent extends BaseDraftsComponent implements OnInit {
|
|||||||
(resourceReceived)="this.onResourceReceived($event)"
|
(resourceReceived)="this.onResourceReceived($event)"
|
||||||
>
|
>
|
||||||
</base-card>
|
</base-card>
|
||||||
<a class="btn btn-link" href="/api/v1/contract/print/preview/draft/{{this.resource_id}}" target="_blank">Preview</a>
|
<a class="btn btn-link" href="/api/v1/contract/print/preview/draft/{{this.resource_id}}" target="_blank" i18n>Preview</a>
|
||||||
<ng-container *ngIf="this.isReadyForPublication;">
|
<ng-container *ngIf="this.isReadyForPublication;">
|
||||||
<formly-form [fields]="newContractFormfields" [form]="newContractForm" [model]="newContractModel"></formly-form>
|
<formly-form [fields]="newContractFormfields" [form]="newContractForm" [model]="newContractModel"></formly-form>
|
||||||
<button class="btn btn-success" (click)="publish()">Publish</button>
|
<button class="btn btn-success" (click)="publish()" i18n>Publish</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
@@ -142,6 +143,7 @@ export class DraftsCardComponent extends BaseDraftsComponent implements OnInit {
|
|||||||
private formlyJsonschema: CrudFormlyJsonschemaService,
|
private formlyJsonschema: CrudFormlyJsonschemaService,
|
||||||
private crudService: CrudService,
|
private crudService: CrudService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
private flashService: FlashmessagesService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@@ -159,8 +161,9 @@ export class DraftsCardComponent extends BaseDraftsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publish() {
|
publish() {
|
||||||
this.crudService.create('contract', this.newContractModel).subscribe((response: any) => {
|
this.crudService.create('contract', this.newContractModel).subscribe({
|
||||||
this.router.navigate([`../../${response.id}`], {relativeTo: this.route});
|
next: (response: any) => this.router.navigate([`../../contracts/${response.id}`], {relativeTo: this.route}),
|
||||||
|
error: (err) => this.flashService.error(err)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent } from "./drafts.component";
|
|
||||||
import { ContractsCardComponent, ContractsListComponent, ContractsNewComponent, ContractsSignatureComponent} from "./contracts.component";
|
import { ContractsCardComponent, ContractsListComponent, ContractsNewComponent, ContractsSignatureComponent} from "./contracts.component";
|
||||||
|
|
||||||
|
|
||||||
@@ -13,6 +12,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
||||||
|
{ path: 'drafts', redirectTo: '/contract-drafts/list' },
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: 'list',
|
||||||
component: ContractsListComponent,
|
component: ContractsListComponent,
|
||||||
@@ -34,36 +34,6 @@ const routes: Routes = [
|
|||||||
title: 'New',
|
title: 'New',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'drafts',
|
|
||||||
data: {
|
|
||||||
title: 'Drafts',
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
|
||||||
{
|
|
||||||
path: 'list',
|
|
||||||
component: DraftsListComponent,
|
|
||||||
data: {
|
|
||||||
title: 'List',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'new',
|
|
||||||
component: DraftsNewComponent,
|
|
||||||
data: {
|
|
||||||
title: 'New',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':id',
|
|
||||||
component: DraftsCardComponent,
|
|
||||||
data: {
|
|
||||||
title: 'Card',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
component: ContractsCardComponent,
|
component: ContractsCardComponent,
|
||||||
|
|||||||
@@ -78,37 +78,22 @@ export class ContractsCardComponent extends BaseContractsComponent{
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-1">
|
<div>
|
||||||
<ngb-panel>
|
<iframe width="100%"
|
||||||
<ng-template ngbPanelTitle>
|
[src]="getPreview()"
|
||||||
<span>Preview</span>
|
onload='javascript:(function(o){o.style.height=o.contentWindow.document.body.scrollHeight+"px";o.style.width=o.contentWindow.document.body.scrollWidth+"px";}(this));' style="height:200px;width:100%;border:none;overflow:hidden;">
|
||||||
</ng-template>
|
</iframe>
|
||||||
<ng-template ngbPanelContent>
|
</div>
|
||||||
<iframe width="100%"
|
<div class="row" *ngIf="!this.affixed">
|
||||||
[src]="getPreview()"
|
<signature-drawer class="col-7"
|
||||||
onload='javascript:(function(o){o.style.height=o.contentWindow.document.body.scrollHeight+"px";o.style.width=o.contentWindow.document.body.scrollWidth+"px";}(this));' style="height:200px;width:100%;border:none;overflow:hidden;"></iframe>
|
(signatureDrawn$)="postSignature($event)"></signature-drawer>
|
||||||
</ng-template>
|
<div class="col-5" i18n>
|
||||||
</ngb-panel>
|
<p>Cette page est à la destination exclusive de <strong>{{ this.signatory }}</strong></p>
|
||||||
<ngb-panel>
|
<p>Si vous n'êtes <strong>pas</strong> {{ this.signatory }}, veuillez <strong>fermer cette page immédiatement</strong> et surpprimer tous les liens en votre possession menant vers celle-ci.</p>
|
||||||
<ng-template ngbPanelTitle>
|
<p>En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour <strong>usurpation d'identité</strong> et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.</p>
|
||||||
<span>Signature</span>
|
<p>Le cabinet Cooper, Hillman & Toshi LLC</p>
|
||||||
</ng-template>
|
</div>
|
||||||
<ng-template ngbPanelContent>
|
</div>`
|
||||||
<ng-container *ngIf="this.affixed">This Contract has already been signed by {{ this.signatory }}</ng-container>
|
|
||||||
<div class="row" *ngIf="!this.affixed">
|
|
||||||
<signature-drawer class="col-7"
|
|
||||||
(signatureDrawn$)="postSignature($event)"></signature-drawer>
|
|
||||||
<div class="col-5">
|
|
||||||
<p>Cette page est à la destination exclusive de <strong>{{ this.signatory }}</strong></p>
|
|
||||||
<p>Si vous n'êtes <strong>pas</strong> {{ this.signatory }}, veuillez <strong>fermer cette page immédiatement</strong> et surpprimer tous les liens en votre possession menant vers celle-ci.</p>
|
|
||||||
<p>En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour <strong>usurpation d'identité</strong> et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.</p>
|
|
||||||
<p>Le cabinet Cooper, Hillman & Toshi LLC</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
</ngb-panel>
|
|
||||||
</ngb-accordion>
|
|
||||||
`
|
|
||||||
})
|
})
|
||||||
export class ContractsSignatureComponent implements OnInit {
|
export class ContractsSignatureComponent implements OnInit {
|
||||||
signature_id: string | null = null;
|
signature_id: string | null = null;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
|
|||||||
|
|
||||||
import { BaseViewModule } from "../base-view/base-view.module";
|
import { BaseViewModule } from "../base-view/base-view.module";
|
||||||
import { ContractsRoutingModule } from './contracts-routing.module';
|
import { ContractsRoutingModule } from './contracts-routing.module';
|
||||||
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent, DraftsNewFormComponent } from "./drafts.component";
|
|
||||||
import { FormlyModule } from "@ngx-formly/core";
|
import { FormlyModule } from "@ngx-formly/core";
|
||||||
import { FormlyBootstrapModule } from "@ngx-formly/bootstrap";
|
import { FormlyBootstrapModule } from "@ngx-formly/bootstrap";
|
||||||
import { ForeignkeyTypeComponent } from "@common/crud/types/foreignkey.type";
|
import { ForeignkeyTypeComponent } from "@common/crud/types/foreignkey.type";
|
||||||
@@ -33,10 +32,6 @@ import { ClipboardModule } from "@angular/cdk/clipboard";
|
|||||||
ClipboardModule,
|
ClipboardModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DraftsListComponent,
|
|
||||||
DraftsNewComponent,
|
|
||||||
DraftsCardComponent,
|
|
||||||
DraftsNewFormComponent,
|
|
||||||
ContractsListComponent,
|
ContractsListComponent,
|
||||||
ContractsNewComponent,
|
ContractsNewComponent,
|
||||||
ContractsCardComponent,
|
ContractsCardComponent,
|
||||||
|
|||||||
BIN
front/app/src/assets/leather_texture.png
Normal file
BIN
front/app/src/assets/leather_texture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
@@ -112,10 +112,10 @@ export class CardComponent implements OnInit {
|
|||||||
model._id = this.resource_id;
|
model._id = this.resource_id;
|
||||||
this.crudService.update(this.resource!, model).subscribe( {
|
this.crudService.update(this.resource!, model).subscribe( {
|
||||||
next: (model: any) => {
|
next: (model: any) => {
|
||||||
this.model = model;
|
|
||||||
this._modelLoading$.next(false);
|
|
||||||
this.resourceUpdated.emit(model._id);
|
this.resourceUpdated.emit(model._id);
|
||||||
this.resourceReceived.emit(model);
|
this.resourceReceived.emit(model);
|
||||||
|
this.model = model;
|
||||||
|
this._modelLoading$.next(false);
|
||||||
},
|
},
|
||||||
error: (err) => this.error.emit("Error updating the entity:" + err)
|
error: (err) => this.error.emit("Error updating the entity:" + err)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ListComponent } from "./list/list.component";
|
|||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', component: ListComponent },
|
{ path: '', component: ListComponent },
|
||||||
{ path: ':id', component: CardComponent },
|
{ path: ':id', component: CardComponent },
|
||||||
];;
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export class JsonschemasService {
|
|||||||
buildResource(resourceName: string) {
|
buildResource(resourceName: string) {
|
||||||
let resource;
|
let resource;
|
||||||
|
|
||||||
resource = { ... this.rawSchemas.components.schemas[resourceName]};
|
resource = structuredClone(this.rawSchemas.components.schemas[resourceName]);
|
||||||
resource.components = { schemas: {} };
|
resource.components = { schemas: {} };
|
||||||
for (let prop_name in resource.properties) {
|
for (let prop_name in resource.properties) {
|
||||||
let prop = resource.properties[prop_name];
|
let prop = resource.properties[prop_name];
|
||||||
@@ -162,6 +162,14 @@ export class JsonschemasService {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (this.is_enum(resource)) {
|
||||||
|
for (const ref of resource.allOf!) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (this.has_descendant(ref, property_name)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
throw new Error("Jsonschema format not implemented in property finder");
|
throw new Error("Jsonschema format not implemented in property finder");
|
||||||
return false;
|
return false;
|
||||||
@@ -186,6 +194,14 @@ export class JsonschemasService {
|
|||||||
return this.get_descendant(ref, property_name);
|
return this.get_descendant(ref, property_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (this.is_enum(resource)) {
|
||||||
|
for (const ref of resource.allOf!) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (this.has_descendant(ref, property_name)) {
|
||||||
|
// @ts-ignore
|
||||||
|
return this.get_descendant(ref, property_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
throw new Error("property not found or Jsonschema format not implemented");
|
throw new Error("property not found or Jsonschema format not implemented");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,14 @@ import {CrudFormlyJsonschemaService} from "@common/crud/crud-formly-jsonschema.s
|
|||||||
export class FilterListComponent implements OnInit {
|
export class FilterListComponent implements OnInit {
|
||||||
@Input() filters: string[] = [];
|
@Input() filters: string[] = [];
|
||||||
@Input() schema = "";
|
@Input() schema = "";
|
||||||
|
@Input() values = {};
|
||||||
|
|
||||||
@Output() filterChange: EventEmitter<{[key: string]: any}> = new EventEmitter();
|
@Output() filterChange: EventEmitter<{[key: string]: any}> = new EventEmitter();
|
||||||
|
|
||||||
form = new FormGroup({});
|
form = new FormGroup({});
|
||||||
fields: FormlyFieldConfig[] = [];
|
fields: FormlyFieldConfig[] = [];
|
||||||
|
|
||||||
searchTerms = {}
|
searchTerms: {[key: string]: string | {}} = {}
|
||||||
|
|
||||||
public fieldJson = {
|
public fieldJson = {
|
||||||
components: {},
|
components: {},
|
||||||
@@ -48,6 +49,16 @@ export class FilterListComponent implements OnInit {
|
|||||||
prop = schema.components.schemas[prop.allOf![0]['$ref'].replace('#/components/schemas/', '')];
|
prop = schema.components.schemas[prop.allOf![0]['$ref'].replace('#/components/schemas/', '')];
|
||||||
prop.type = "array";
|
prop.type = "array";
|
||||||
prop.items = {"type": "string", "enum": prop.enum};
|
prop.items = {"type": "string", "enum": prop.enum};
|
||||||
|
|
||||||
|
if (filter in this.values) {
|
||||||
|
this.searchTerms[filter] = {};
|
||||||
|
// @ts-ignore
|
||||||
|
for (let val of this.values[filter]) {
|
||||||
|
// @ts-ignore
|
||||||
|
this.searchTerms[filter][val] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prop.hasOwnProperty('readOnly') && prop.readOnly) {
|
if (prop.hasOwnProperty('readOnly') && prop.readOnly) {
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.table-row-link {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -14,20 +14,27 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3 col-sm-auto">
|
<div class="col-xs-3 col-sm-auto">
|
||||||
<crud-list-filter-list [filters]="this.filters" [schema]="this.schema!" (filterChange)="onFilterChange($event)"></crud-list-filter-list>
|
<crud-list-filter-list
|
||||||
|
[filters]="this.filters"
|
||||||
|
[schema]="this.schema!"
|
||||||
|
[values]="this.searchFilters"
|
||||||
|
(filterChange)="onFilterChange($event)"
|
||||||
|
></crud-list-filter-list>
|
||||||
</div>
|
</div>
|
||||||
<span class="col col-form-label" i18n *ngIf="loading$ | async">Loading...</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive-md">
|
<div class="table-responsive-md">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th *ngFor="let col of this.displayedColumns" scope="col" sortable="name" (sort)="onSort($event)">{{ col.title }}</th>
|
<th *ngFor="let col of this.displayedColumns" scope="col" sortable="name" (sort)="onSort($event)">{{ col.title }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let row of listData$ | async" (click)="onSelect(row._id)">
|
<tr *ngIf="loading$ | async">
|
||||||
<td *ngFor="let col of this.displayedColumns">
|
<td class="text-center" [attr.colspan]="this.displayedColumns.length" i18n>Loading...</td>
|
||||||
|
</tr>
|
||||||
|
<tr *ngFor="let row of listData$ | async" (click)="onRowClick(row._id)" (auxclick)="onRowMiddleClick(row._id);" class="table-row-link">
|
||||||
|
<td class="text-truncate" *ngFor="let col of this.displayedColumns" style="max-width: 150px;">
|
||||||
<ngb-highlight [result]="getColumnValue(row, col.path)" [term]="searchTerm"></ngb-highlight>
|
<ngb-highlight [result]="getColumnValue(row, col.path)" [term]="searchTerm"></ngb-highlight>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -35,7 +42,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between p-2">
|
<div class="d-flex justify-content-between p-2" *ngIf="! (loading$ | async)" >
|
||||||
<ngb-pagination [collectionSize]="(total$ | async)!" [(page)]="page" [pageSize]="pageSize">
|
<ngb-pagination [collectionSize]="(total$ | async)!" [(page)]="page" [pageSize]="pageSize">
|
||||||
</ngb-pagination>
|
</ngb-pagination>
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ export class ListComponent implements OnInit {
|
|||||||
public displayedColumns: Column[] = [];
|
public displayedColumns: Column[] = [];
|
||||||
|
|
||||||
private _loading$ = new BehaviorSubject<boolean>(true);
|
private _loading$ = new BehaviorSubject<boolean>(true);
|
||||||
//private _search$ = new Subject<void>();
|
|
||||||
private _listData$ = new BehaviorSubject<any[]>([]);
|
private _listData$ = new BehaviorSubject<any[]>([]);
|
||||||
private _total$ = new BehaviorSubject<number>(0);
|
private _total$ = new BehaviorSubject<number>(0);
|
||||||
|
|
||||||
@@ -64,7 +63,13 @@ export class ListComponent implements OnInit {
|
|||||||
next: (schema: any) => this.getColumnDefinition(schema),
|
next: (schema: any) => this.getColumnDefinition(schema),
|
||||||
error: (err) => this.error.emit("Error loading the schema:" + err)
|
error: (err) => this.error.emit("Error loading the schema:" + err)
|
||||||
});
|
});
|
||||||
this._search();
|
this.route.queryParams.subscribe(params => {
|
||||||
|
let parsedParams = {...params};
|
||||||
|
if (parsedParams.hasOwnProperty('searchFilters')) {
|
||||||
|
parsedParams['searchFilters'] = JSON.parse(parsedParams['searchFilters']);
|
||||||
|
}
|
||||||
|
this._set(parsedParams)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumnDefinition(schema: JSONSchema7) {
|
getColumnDefinition(schema: JSONSchema7) {
|
||||||
@@ -100,7 +105,7 @@ export class ListComponent implements OnInit {
|
|||||||
parent = parent[key];
|
parent = parent[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return parent;
|
return parent.replace(/<[^>]*>/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
private _search() {
|
private _search() {
|
||||||
@@ -144,10 +149,15 @@ export class ListComponent implements OnInit {
|
|||||||
this.sortDirection = direction;
|
this.sortDirection = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelect(id: string) {
|
onRowClick(id: string) {
|
||||||
this.router.navigate([`../${id}`], {relativeTo: this.route});
|
this.router.navigate([`../${id}`], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRowMiddleClick(id: string) {
|
||||||
|
let newUrl = window.location.href.replace('list', id).split('?')[0]
|
||||||
|
window.open(newUrl, '_blank');
|
||||||
|
}
|
||||||
|
|
||||||
onCreate() {
|
onCreate() {
|
||||||
this.router.navigate([`../new`], {relativeTo: this.route});
|
this.router.navigate([`../new`], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
@@ -177,30 +187,43 @@ export class ListComponent implements OnInit {
|
|||||||
return this._state.searchTerm;
|
return this._state.searchTerm;
|
||||||
}
|
}
|
||||||
get searchFilters() {
|
get searchFilters() {
|
||||||
return this._state.searchFilters;
|
return this._state.searchFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
set page(page: number) {
|
set page(page: number) {
|
||||||
this._set({ page });
|
this.updateState({ page });
|
||||||
}
|
}
|
||||||
set pageSize(pageSize: number) {
|
|
||||||
this._set({ pageSize });
|
set pageSize(pageSize: number) {
|
||||||
}
|
this.updateState({ pageSize });
|
||||||
set searchTerm(searchTerm: string) {
|
}
|
||||||
this._set({ searchTerm });
|
|
||||||
}
|
set searchTerm(searchTerm: string) {
|
||||||
set searchFilters(searchFilters: {[key: string]: any}) {
|
this.updateState({ searchTerm });
|
||||||
this._set({ searchFilters });
|
}
|
||||||
}
|
|
||||||
set sortColumn(sortColumn: SortColumn) {
|
|
||||||
this._set({ sortColumn });
|
|
||||||
}
|
|
||||||
set sortDirection(sortDirection: SortDirection) {
|
|
||||||
this._set({ sortDirection });
|
|
||||||
}
|
|
||||||
|
|
||||||
private _set(patch: Partial<State>) {
|
set searchFilters(searchFilters: {[key: string]: any}) {
|
||||||
Object.assign(this._state, patch);
|
this.updateState({ searchFilters: JSON.stringify(searchFilters) });
|
||||||
this._search();
|
}
|
||||||
}
|
|
||||||
|
set sortColumn(sortColumn: SortColumn) {
|
||||||
|
this.updateState({ sortColumn });
|
||||||
|
}
|
||||||
|
|
||||||
|
set sortDirection(sortDirection: SortDirection) {
|
||||||
|
this.updateState({ sortDirection });
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateState(patch: any) {
|
||||||
|
this.router.navigate([], {
|
||||||
|
relativeTo: this.route,
|
||||||
|
queryParams: patch ,
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private _set(patch: Partial<State>) {
|
||||||
|
Object.assign(this._state, patch);
|
||||||
|
this._search();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,36 +2,44 @@ import {Component, OnInit} from '@angular/core';
|
|||||||
import { FieldArrayType } from '@ngx-formly/core';
|
import { FieldArrayType } from '@ngx-formly/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'formly-array-type',
|
selector: 'formly-array-type',
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div class="mb-3">
|
||||||
<label *ngIf="props.label" class="form-label">{{ props.label }}</label>
|
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
|
||||||
<p *ngIf="props.description">{{ props.description }}</p>
|
<ngb-panel id="ngb-panel-0">
|
||||||
<div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
|
<ng-template ngbPanelTitle>
|
||||||
<formly-validation-message [field]="field"></formly-validation-message>
|
<label *ngIf="props.label" class="form-label">{{ props.label }}</label>
|
||||||
</div>
|
<p *ngIf="props.description">{{ props.description }}</p>
|
||||||
<div class="row row-cols-1 row-cols-md-{{this.itemsPerRow}} g-1">
|
<div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
|
||||||
<div *ngFor="let entry of field.fieldGroup; let i = index" class="col">
|
<formly-validation-message [field]="field"></formly-validation-message>
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<div *ngIf="props['numbered']" class="float-start">
|
|
||||||
<strong>{{ i + 1 }}</strong>
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="! this.field.props.readonly" class="btn-group float-end">
|
</ng-template>
|
||||||
<button class="btn btn-primary btn-sm" [attr.disabled]="i == 0 ? 'disabled' : null" type="button" (click)="move(i, i-1)"><i-bs name="caret-up-fill"></i-bs></button>
|
<ng-template ngbPanelContent>
|
||||||
<button class="btn btn-primary btn-sm" [attr.disabled]="i == this.field.fieldGroup!.length-1 ? 'disabled' : null" type="button" (click)="move(i, i+1)"><i-bs name="caret-down-fill"></i-bs></button>
|
<div class="row row-cols-1 row-cols-md-{{this.itemsPerRow}} g-1">
|
||||||
<button class="btn btn-danger btn-sm" [attr.disabled]="field.props!['removable'] === false ? 'disabled' : null" type="button" (click)="remove(i)"><i-bs name="x-octagon-fill"></i-bs></button>
|
<div *ngFor="let entry of field.fieldGroup; let i = index" class="col">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<div *ngIf="props['numbered']" class="float-start">
|
||||||
|
<strong>{{ i + 1 }}</strong>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="! this.field.props.readonly" class="btn-group float-end">
|
||||||
|
<button class="btn btn-primary btn-sm" [attr.disabled]="i == 0 ? 'disabled' : null" type="button" (click)="move(i, i-1)"><i-bs name="caret-up-fill"></i-bs></button>
|
||||||
|
<button class="btn btn-primary btn-sm" [attr.disabled]="i == this.field.fieldGroup!.length-1 ? 'disabled' : null" type="button" (click)="move(i, i+1)"><i-bs name="caret-down-fill"></i-bs></button>
|
||||||
|
<button class="btn btn-danger btn-sm" [attr.disabled]="field.props!['removable'] === false ? 'disabled' : null" type="button" (click)="remove(i)"><i-bs name="x-octagon-fill"></i-bs></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<formly-field class="col" [field]="entry"></formly-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<button *ngIf="! this.field.props.readonly" class="btn btn-success col-sm-12 gap-3" type="button" (click)="add()"><i-bs name="plus-square-fill"></i-bs></button>
|
||||||
<div class="card-body">
|
</ng-template>
|
||||||
<formly-field class="col" [field]="entry"></formly-field>
|
</ngb-panel>
|
||||||
</div>
|
</ngb-accordion>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<button *ngIf="! this.field.props.readonly" class="btn btn-success col-sm-12" type="button" (click)="add()"><i-bs name="plus-square-fill"></i-bs></button>
|
`,
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
})
|
})
|
||||||
export class ArrayTypeComponent extends FieldArrayType implements OnInit {
|
export class ArrayTypeComponent extends FieldArrayType implements OnInit {
|
||||||
colSm: string = "col-sm-6"
|
colSm: string = "col-sm-6"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {FormlyJsonschema} from "@ngx-formly/core/json-schema";
|
|||||||
template: `
|
template: `
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
|
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
|
||||||
<ngb-panel>
|
<ngb-panel id="ngb-panel-0">
|
||||||
<ng-template ngbPanelTitle>
|
<ng-template ngbPanelTitle>
|
||||||
<label *ngIf="props.label && props['hideLabel'] !== true" [attr.for]="id"
|
<label *ngIf="props.label && props['hideLabel'] !== true" [attr.for]="id"
|
||||||
class="form-label">{{ props.label }}
|
class="form-label">{{ props.label }}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {Component, OnInit} from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { FormlyFieldInput } from "@ngx-formly/bootstrap/input";
|
import { FormlyFieldInput } from "@ngx-formly/bootstrap/input";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'formly-richtext-type',
|
selector: 'formly-richtext-type',
|
||||||
template: `
|
template: `
|
||||||
@@ -42,11 +43,20 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
statusbar: false,
|
statusbar: false,
|
||||||
autoresize_bottom_margin: 0,
|
autoresize_bottom_margin: 0,
|
||||||
body_class: "contract-body",
|
body_class: "contract-body",
|
||||||
content_style: ".contract-body { font-family: 'Century Schoolbook', 'sans-serif' }"
|
content_style: ".contract-body { font-family: 'Century Schoolbook', 'sans-serif' }",
|
||||||
|
entity_encoding: 'raw',
|
||||||
|
paste_preprocess: function (plugin: any, args: any) {
|
||||||
|
console.log(args.content)
|
||||||
|
let container = document.createElement('div');
|
||||||
|
container.innerHTML = args.content.trim();
|
||||||
|
cleanPastedElement(container)
|
||||||
|
console.log(container.innerHTML);
|
||||||
|
args.content = container.innerHTML;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init_multiline = {
|
init_multiline = {
|
||||||
plugins: 'lists image imagetools table code searchreplace autoresize',
|
plugins: 'lists image imagetools table code searchreplace paste autoresize',
|
||||||
menubar: 'edit insert format tools table',
|
menubar: 'edit insert format tools table',
|
||||||
menu: {
|
menu: {
|
||||||
edit: { title: 'Edit', items: 'undo redo | cut copy paste | selectall | searchreplace' },
|
edit: { title: 'Edit', items: 'undo redo | cut copy paste | selectall | searchreplace' },
|
||||||
@@ -59,7 +69,7 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init_singleline = {
|
init_singleline = {
|
||||||
plugins: 'autoresize',
|
plugins: 'paste autoresize',
|
||||||
menubar: '',
|
menubar: '',
|
||||||
toolbar: 'undo redo | bold italic underline',
|
toolbar: 'undo redo | bold italic underline',
|
||||||
}
|
}
|
||||||
@@ -71,7 +81,7 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getInitConfig() {
|
getInitConfig(): any {
|
||||||
return {...this.init_common, ...( this.multiline ? this.init_multiline : this.init_singleline)};
|
return {...this.init_common, ...( this.multiline ? this.init_multiline : this.init_singleline)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +102,49 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanPastedElement(htmlElement: HTMLElement): string {
|
||||||
|
if (! htmlElement.innerHTML) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
let innerHtml = ""
|
||||||
|
for(let i = 0; i < htmlElement.childNodes.length; i++){
|
||||||
|
const childNode = htmlElement.childNodes[i] as HTMLElement
|
||||||
|
if (childNode.nodeName == "#text") {
|
||||||
|
innerHtml += childNode.nodeValue;
|
||||||
|
} else {
|
||||||
|
innerHtml += cleanPastedElement(childNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
htmlElement.innerHTML = innerHtml
|
||||||
|
|
||||||
}
|
if (htmlElement.tagName == "SPAN") {
|
||||||
|
let text = htmlElement.innerHTML
|
||||||
|
const style = htmlElement.style
|
||||||
|
|
||||||
|
if (style.fontWeight == "700") {
|
||||||
|
let strong = document.createElement('b');
|
||||||
|
strong.innerHTML = text
|
||||||
|
text = strong.outerHTML;
|
||||||
|
}
|
||||||
|
if (style.textDecoration == "underline") {
|
||||||
|
let underline = document.createElement('u');
|
||||||
|
underline.innerHTML = text;
|
||||||
|
text = underline.outerHTML;
|
||||||
|
}
|
||||||
|
if (style.fontStyle == "italic") {
|
||||||
|
let italic = document.createElement('em');
|
||||||
|
italic.innerHTML = text;
|
||||||
|
text = italic.outerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
htmlElement.style.removeProperty("line-height")
|
||||||
|
htmlElement.style.removeProperty("margin")
|
||||||
|
|
||||||
|
return htmlElement.outerHTML
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 318 B |
@@ -2,10 +2,13 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>App</title>
|
<title>Cooper, Hillman & Toshi</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<meta property="og:title" content="Cooper, Hillman & Toshi">
|
||||||
|
<meta property="og:description" content="Interface d'administration des contrats">
|
||||||
|
<meta property="og:image" content="/assets/logo.png">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
|||||||
@@ -354,5 +354,69 @@
|
|||||||
<target>Mettre à jour</target>
|
<target>Mettre à jour</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="6061331044524123789">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Authentication required</source>
|
||||||
|
<target>Authentification nécessaire</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="3624268617519726175">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Permissions too low</source>
|
||||||
|
<target>Permissions trop basses</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="6833883791906187270">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Download Link:</source>
|
||||||
|
<target>Lien de téléchargement:</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="8168599357858858911">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Preview Link:</source>
|
||||||
|
<target>Lien de prévisualisation:</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="1295614462098694869">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Preview</source>
|
||||||
|
<target>Prévisualisation</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="2445188258613609179">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Signature</source>
|
||||||
|
<target>Signature</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="8474971383445371291">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>
|
||||||
|
<pc id="0" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Cette page est à la destination exclusive de <pc id="1" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>"><ph id="2" equiv="INTERPOLATION" disp="{{ this.signatory }}"/></pc></pc>
|
||||||
|
<pc id="3" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Si vous n'êtes <pc id="4" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">pas</pc> <ph id="5" equiv="INTERPOLATION" disp="{{ this.signatory }}"/>, veuillez <pc id="6" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">fermer cette page immédiatement</pc> et surpprimer tous les liens en votre possession menant vers celle-ci.</pc>
|
||||||
|
<pc id="7" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour <pc id="8" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">usurpation d'identité</pc> et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.</pc>
|
||||||
|
<pc id="9" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Le cabinet Cooper, Hillman & Toshi LLC</pc>
|
||||||
|
</source>
|
||||||
|
<target>
|
||||||
|
<pc id="0" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Cette page est à la destination exclusive de <pc id="1" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>"><ph id="2" equiv="INTERPOLATION" disp="{{ this.signatory }}"/></pc></pc>
|
||||||
|
<pc id="3" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Si vous n'êtes <pc id="4" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">pas</pc> <ph id="5" equiv="INTERPOLATION" disp="{{ this.signatory }}"/>, veuillez <pc id="6" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">fermer cette page immédiatement</pc> et surpprimer tous les liens en votre possession menant vers celle-ci.</pc>
|
||||||
|
<pc id="7" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour <pc id="8" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">usurpation d'identité</pc> et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.</pc>
|
||||||
|
<pc id="9" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Le cabinet Cooper, Hillman & Toshi LLC</pc>
|
||||||
|
</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="7430416142942514215">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>Publish</source>
|
||||||
|
<target>Publier</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="2990108023996257960">
|
||||||
|
<segment state="initial">
|
||||||
|
<source>This Contract has already been signed by</source>
|
||||||
|
<target>Ce contrat a déjà été signé par</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
@@ -292,5 +292,55 @@
|
|||||||
<source>100 items per page</source>
|
<source>100 items per page</source>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="3624268617519726175">
|
||||||
|
<segment>
|
||||||
|
<source>Permissions too low</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="6061331044524123789">
|
||||||
|
<segment>
|
||||||
|
<source>Authentication required</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="6833883791906187270">
|
||||||
|
<segment>
|
||||||
|
<source>Download Link:</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="8168599357858858911">
|
||||||
|
<segment>
|
||||||
|
<source>Preview Link:</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="1295614462098694869">
|
||||||
|
<segment>
|
||||||
|
<source>Preview</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="2445188258613609179">
|
||||||
|
<segment>
|
||||||
|
<source>Signature</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="7430416142942514215">
|
||||||
|
<segment>
|
||||||
|
<source>Publish</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="8474971383445371291">
|
||||||
|
<segment>
|
||||||
|
<source>
|
||||||
|
<pc id="0" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Cette page est à la destination exclusive de <pc id="1" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>"><ph id="2" equiv="INTERPOLATION" disp="{{ this.signatory }}"/></pc></pc>
|
||||||
|
<pc id="3" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Si vous n'êtes <pc id="4" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">pas</pc> <ph id="5" equiv="INTERPOLATION" disp="{{ this.signatory }}"/>, veuillez <pc id="6" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">fermer cette page immédiatement</pc> et surpprimer tous les liens en votre possession menant vers celle-ci.</pc>
|
||||||
|
<pc id="7" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">En vous maintenant et/ou en interagissant avec cette page, vous enfreignez l'article L.229 du code pénal de l'Etat de San Andreas pour <pc id="8" equivStart="START_TAG_STRONG" equivEnd="CLOSE_TAG_STRONG" type="other" dispStart="<strong>" dispEnd="</strong>">usurpation d'identité</pc> et vous vous exposez ainsi à une amende de 20 000$ ainsi qu'à des poursuites civiles.</pc>
|
||||||
|
<pc id="9" equivStart="START_PARAGRAPH" equivEnd="CLOSE_PARAGRAPH" type="other" dispStart="<p>" dispEnd="</p>">Le cabinet Cooper, Hillman & Toshi LLC</pc>
|
||||||
|
</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
|
<unit id="2990108023996257960">
|
||||||
|
<segment>
|
||||||
|
<source>This Contract has already been signed by</source>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
@@ -26,3 +26,15 @@
|
|||||||
.contract-body {
|
.contract-body {
|
||||||
font-family: 'Century Schoolbook';
|
font-family: 'Century Schoolbook';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
color: #D2BA6F;
|
||||||
|
--bs-nav-link-hover-color: #9c8a51;
|
||||||
|
--bs-nav-pills-link-active-color: #D2BA6F;
|
||||||
|
--bs-nav-pills-link-active-bg: #114856;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link.active {
|
||||||
|
border: #D2BA6F solid 2px;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|||||||
72
front/nginx.prod.conf
Normal file
72
front/nginx.prod.conf
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events { worker_connections 1024; }
|
||||||
|
|
||||||
|
http {
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
|
||||||
|
upstream docker-back {
|
||||||
|
server back:8000;
|
||||||
|
}
|
||||||
|
|
||||||
|
types {
|
||||||
|
module js;
|
||||||
|
}
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
gzip_comp_level 9;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html?$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* ^.+\.css$ {
|
||||||
|
default_type text/css;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* ^.+\.js$ {
|
||||||
|
default_type text/javascript;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /contracts/signature/ {
|
||||||
|
set $is_robot 0;
|
||||||
|
if ($http_user_agent ~* "Discordbot|googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp") {
|
||||||
|
rewrite /contracts/signature/(.*) /api/v1/contract/print/opengraph/$1 last;
|
||||||
|
proxy_pass http://docker-back;
|
||||||
|
set $is_robot 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($is_robot = 0) {
|
||||||
|
rewrite ^ /index.html?$args last;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/v1/ {
|
||||||
|
proxy_pass http://docker-back/;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,26 @@ http {
|
|||||||
proxy_set_header X-Forwarded-Host $server_name;
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /contracts/signature/ {
|
||||||
|
set $is_robot 0;
|
||||||
|
if ($http_user_agent ~* "Discordbot|googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp") {
|
||||||
|
rewrite /contracts/signature/(.*) /api/v1/contract/print/opengraph/$1 last;
|
||||||
|
proxy_pass http://docker-back;
|
||||||
|
break;
|
||||||
|
set $is_robot 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($is_robot = 0) {
|
||||||
|
proxy_pass http://docker-front;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
}
|
||||||
|
|
||||||
location /api/v1/ {
|
location /api/v1/ {
|
||||||
proxy_pass http://docker-back/;
|
proxy_pass http://docker-back/;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|||||||
Reference in New Issue
Block a user