Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

La opción de crear en Publicaciones #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard/pages/publications_pages/books_and_chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
70 changes: 35 additions & 35 deletions dashboard/pages/publications_pages/journals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 1 addition & 1 deletion dashboard/pages/publications_pages/presentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down