diff --git a/dashboard/pages/publications_pages/books_and_chapters.py b/dashboard/pages/publications_pages/books_and_chapters.py index 25b5eb6..e887af3 100644 --- a/dashboard/pages/publications_pages/books_and_chapters.py +++ b/dashboard/pages/publications_pages/books_and_chapters.py @@ -20,7 +20,7 @@ def books_and_chapters_page(router, **params): chapters = [c for c in BookChapter.all() if c.year == year] chapters.sort(key=lambda b: b.chapter) - if auth.is_user_logged(): + if auth.is_user_logged() and router.user_can_write: with st.expander("⭐ Nuevo libro / 📝 Editar"): if ( st.radio( diff --git a/dashboard/pages/publications_pages/journals.py b/dashboard/pages/publications_pages/journals.py index fddc94f..1629816 100644 --- a/dashboard/pages/publications_pages/journals.py +++ b/dashboard/pages/publications_pages/journals.py @@ -28,44 +28,44 @@ def journals_page(router: PageRouter, **params): presentations.sort(key=lambda p: p.title) st.write(f"#### 🗞️ Revistas `{len(journals)}`") + if router.user_can_write: + with st.expander("Editar revista"): + journal = st.selectbox("Revista", journals) - with st.expander("Editar revista"): - journal = st.selectbox("Revista", journals) - - journal.title = st.text_input( - "Título", key=f"journal_title_{journal.uuid}", value=journal.title - ) - journal.publisher = st.text_input( - "Editorial", - key=f"journal_publisher_{journal.uuid}", - value=journal.publisher, - ) - journal.issn = st.text_input( - "ISSN", key=f"journal_issn_{journal.uuid}", value=journal.issn - ) - journal.url = ( - st.text_input( - "URL", key=f"journal_url_{journal.uuid}", value=journal.url or "" + journal.title = st.text_input( + "Título", key=f"journal_title_{journal.uuid}", value=journal.title + ) + journal.publisher = st.text_input( + "Editorial", + key=f"journal_publisher_{journal.uuid}", + value=journal.publisher, + ) + journal.issn = st.text_input( + "ISSN", key=f"journal_issn_{journal.uuid}", value=journal.issn + ) + journal.url = ( + st.text_input( + "URL", key=f"journal_url_{journal.uuid}", value=journal.url or "" + ) + or None + ) + journal.indices = st.multiselect( + "Indexado en", + key=f"journal_indices_{journal.uuid}", + options=[ + "Web of Science", + "Scopus", + "RICYT", + "Scielo", + "Otro (Internacional)", + "Otro (Nacional)", + ], + default=journal.indices, ) - or None - ) - journal.indices = st.multiselect( - "Indexado en", - key=f"journal_indices_{journal.uuid}", - options=[ - "Web of Science", - "Scopus", - "RICYT", - "Scielo", - "Otro (Internacional)", - "Otro (Nacional)", - ], - default=journal.indices, - ) - if st.button("💾 Guardar"): - journal.save() - st.success("Cambios guardados") + if st.button("💾 Guardar"): + journal.save() + st.success("Cambios guardados") for journal in journals: st.write(journal.format()) diff --git a/dashboard/pages/publications_pages/presentations.py b/dashboard/pages/publications_pages/presentations.py index ed7dfbd..5768083 100644 --- a/dashboard/pages/publications_pages/presentations.py +++ b/dashboard/pages/publications_pages/presentations.py @@ -15,7 +15,7 @@ def presentations_page(router, **params): presentations = [p for p in ConferencePresentation.all() if p.year == year] presentations.sort(key=lambda p: p.title) - if auth.is_user_logged(): + if auth.is_user_logged() and router.user_can_write: with st.expander("⭐ Nueva presentación / 📝 Editar"): if ( st.radio(