-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from reflejar/dev
Dev
- Loading branch information
Showing
7 changed files
with
546 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dash import html | ||
import dash_bootstrap_components as dbc | ||
|
||
from .componentes.encabezado import Encabezado | ||
from .componentes.filtros import Filtros | ||
from .componentes.fallos import Fallos | ||
|
||
|
||
layout = dbc.Container([ | ||
Encabezado, | ||
Filtros, | ||
Fallos | ||
], | ||
className="my-5 min-vh-100", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dash import html | ||
import dash_bootstrap_components as dbc | ||
|
||
Encabezado = dbc.Row(dbc.Col([ | ||
html.H3(['Jurisprudencia', html.A("V 1.0", href="#metodologia-jurisprudencia", className="btn btn-sm text-primary")], className="text-white pt-3 fw-bolder space-grotesk"), | ||
html.Br(), | ||
html.H6(""" | ||
Compendio jurídico sobre el uso de agroquímicos en la Argentina. | ||
Podrás encontrar fallos judiciales, resoluciones, administrativas, dictámenes y más. | ||
Buscá por palabras clave o aplica filtros para encontrar el caso que sea de tu interés | ||
""", className="text-white poppins"), | ||
], | ||
className="text-white mt-5", md=12 | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from dash import dash, html, dcc, Input, Output, State, callback | ||
import dash_bootstrap_components as dbc | ||
from ..data import DATA | ||
|
||
Fallos = dbc.Row(dbc.Col(html.Div(id='fallos-judiciales'), class_name="mt-5")) | ||
|
||
@callback( | ||
Output('fallos-judiciales','children'), | ||
[ | ||
Input("select-voces-tematicas",'value'), | ||
Input("select-provincia",'value'), | ||
Input("select-tipo-fallo",'value'), | ||
Input("select-organismo",'value') | ||
] | ||
) | ||
def update_fallos(voces, provincia, tipo, organismo): | ||
df = DATA['contenido'].copy() | ||
cards = [] | ||
|
||
if voces: | ||
df = df[df['Voces temáticas']==voces] | ||
if provincia: | ||
df = df[df['Provincia']==provincia] | ||
if tipo: | ||
df = df[df['Tipo de fallo']==tipo] | ||
if organismo: | ||
df = df[df['Organismo judicial o administrativo']==organismo] | ||
|
||
for _, row in df.iterrows(): | ||
cards.append(dbc.Card(dbc.CardBody( | ||
html.Div([ | ||
html.Div([ | ||
html.Span([html.B('AÑO: '), f"{row['Año']}"], className="mx-3"), | ||
html.Span([html.B('PROVINCIA: '), f"{row['Provincia']}"], className="mx-3"), | ||
html.Span([html.B('CIUDAD: '), f"{row['Ciudad']}"], className="mx-3"), | ||
], className="text-end"), | ||
html.Hr(), | ||
html.P([html.B("VOCES TEMÁTICAS: "), row['Voces temáticas']]), | ||
html.P([html.B("JURISDICCIÓN TERRITORIAL: "), row['Jurisdicción territorial']]), | ||
html.P([html.B("ORGANISMO: "), row['Organismo judicial o administrativo']]), | ||
html.P([html.B("AUTOS: "), row['Autos']]), | ||
html.Hr(), | ||
html.P([html.B("TIPO DE FALLO: "), row['Tipo de fallo']]), | ||
html.P([html.B("SÍNTESIS DE FALLO: "), html.U(f"Página: {row['Página']}")]), | ||
html.P(row['Sintesis del fallo']), | ||
html.A("Ver fallo completo", className="btn btn-primary text-dark") | ||
], className="poppins small mx-2") | ||
), className="mt-4 p-3 card-jurisprudencia")) | ||
|
||
return cards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from dash import html, dcc | ||
import dash_bootstrap_components as dbc | ||
|
||
from ..data import DATA | ||
|
||
Filtros = dbc.Row([ | ||
dbc.Col( | ||
html.H5("Filtrar por", className="text-white fw-bold"), | ||
xs=12, | ||
class_name="mt-3" | ||
), | ||
dbc.Col([ | ||
dcc.Dropdown( | ||
id="select-voces-tematicas", | ||
options=DATA['filtros']['voces-tematicas'], | ||
searchable = True, | ||
placeholder = 'Voces temáticas', | ||
className="mt-1" | ||
) | ||
], | ||
md=6, lg=3, xs=12 | ||
), | ||
dbc.Col([ | ||
dcc.Dropdown( | ||
id="select-provincia", | ||
options=DATA['filtros']['provincia'], | ||
searchable = True, | ||
placeholder = 'Provincia', | ||
className="mt-1" | ||
) | ||
], | ||
md=6, lg=3, xs=12 | ||
), | ||
dbc.Col([ | ||
dcc.Dropdown( | ||
id="select-tipo-fallo", | ||
options=DATA['filtros']['tipo-fallo'], | ||
searchable = True, | ||
placeholder = 'Tipo de fallo', | ||
className="mt-1" | ||
) | ||
], | ||
md=6, lg=3, xs=12 | ||
), | ||
dbc.Col([ | ||
dcc.Dropdown( | ||
id="select-organismo", | ||
options=DATA['filtros']['organismo'], | ||
searchable = True, | ||
placeholder = 'Organismo', | ||
className="mt-1" | ||
) | ||
], | ||
md=6, lg=3, xs=12 | ||
), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pandas as pd | ||
|
||
data = pd.read_csv('pages/jurisprudencia/data/doctrinario.csv') | ||
|
||
|
||
|
||
DATA = { | ||
'filtros': { | ||
'voces-tematicas': data['Voces temáticas'].dropna().unique(), | ||
'provincia': data['Provincia'].dropna().unique(), | ||
'tipo-fallo': data['Tipo de fallo'].dropna().unique(), | ||
'organismo': data['Organismo judicial o administrativo'].dropna().unique(), | ||
}, | ||
'contenido': data | ||
} | ||
|
||
|
||
|
Oops, something went wrong.