Update app.py
Browse files
app.py
CHANGED
@@ -138,6 +138,7 @@ def main():
|
|
138 |
else:
|
139 |
|
140 |
df_results=detalles_resultados(df,result)
|
|
|
141 |
batch_size = 5
|
142 |
pages = split_frame(df_results, batch_size)
|
143 |
top_menu = st.columns(3)
|
@@ -147,14 +148,16 @@ def main():
|
|
147 |
|
148 |
bottom_menu = st.columns((3))
|
149 |
with bottom_menu[2]:
|
150 |
-
|
|
|
151 |
current_page = st.number_input("Página", min_value=1, max_value=total_pages, step=1)
|
152 |
|
153 |
with bottom_menu[1]:
|
154 |
st.markdown(f"Página **{current_page}** de **{total_pages}** ")
|
155 |
|
156 |
with top_menu[0]:
|
157 |
-
|
|
|
158 |
|
159 |
with pagination:
|
160 |
|
|
|
138 |
else:
|
139 |
|
140 |
df_results=detalles_resultados(df,result)
|
141 |
+
cantidad_resultados=len(df_results)
|
142 |
batch_size = 5
|
143 |
pages = split_frame(df_results, batch_size)
|
144 |
top_menu = st.columns(3)
|
|
|
148 |
|
149 |
bottom_menu = st.columns((3))
|
150 |
with bottom_menu[2]:
|
151 |
+
st.write("---")
|
152 |
+
total_pages = (ceil(cantidad_resultados / batch_size) if ceil(cantidad_resultados / batch_size) > 0 else 1)
|
153 |
current_page = st.number_input("Página", min_value=1, max_value=total_pages, step=1)
|
154 |
|
155 |
with bottom_menu[1]:
|
156 |
st.markdown(f"Página **{current_page}** de **{total_pages}** ")
|
157 |
|
158 |
with top_menu[0]:
|
159 |
+
pagina_res_fin= batch_size*current_page if batch_size*current_page <= cantidad_resultados else cantidad_resultados
|
160 |
+
st.markdown(f"Artículos **{(current_page*batch_size)-batch_size+1}-{pagina_res_fin}** de **{cantidad_resultados}** ")
|
161 |
|
162 |
with pagination:
|
163 |
|