Skip to content

Commit

Permalink
Merge pull request #38 from reflejar/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mpvaldez authored Nov 24, 2023
2 parents 89f27e0 + 916826b commit 06ab78d
Show file tree
Hide file tree
Showing 7 changed files with 546 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@
width: 150px;
text-align: center!important;
font-family: Arial, Helvetica, sans-serif;
}

.card-jurisprudencia {
border-left: 20px solid #DEDE7C;
border-radius: 20px!important;

}
15 changes: 15 additions & 0 deletions pages/jurisprudencia/__init__.py
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",
)
15 changes: 15 additions & 0 deletions pages/jurisprudencia/componentes/encabezado.py
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
)
)
50 changes: 50 additions & 0 deletions pages/jurisprudencia/componentes/fallos.py
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
56 changes: 56 additions & 0 deletions pages/jurisprudencia/componentes/filtros.py
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
),
])
18 changes: 18 additions & 0 deletions pages/jurisprudencia/data/__init__.py
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
}



Loading

0 comments on commit 06ab78d

Please sign in to comment.