refactor: remove emojis from titles and buttons for a cleaner UI
All checks were successful
Build & Deploy Shannon / 🏗️ Build & Deploy Shannon (push) Successful in 1m3s
All checks were successful
Build & Deploy Shannon / 🏗️ Build & Deploy Shannon (push) Successful in 1m3s
This commit is contained in:
@@ -11,17 +11,17 @@ from core.database import write_contribution, search_contributions, delete_contr
|
||||
def render():
|
||||
"""Render the Contributions page."""
|
||||
|
||||
st.markdown("# 💬 Community Contributions")
|
||||
st.markdown("# Community Contributions")
|
||||
st.markdown(
|
||||
"Share your observations about Shannon's theorem, satellite communications, "
|
||||
"or suggest improvements. Contributions are stored locally and shared with all users."
|
||||
)
|
||||
|
||||
tab_read, tab_write = st.tabs(["📖 Read Contributions", "✍️ Write Contribution"])
|
||||
tab_read, tab_write = st.tabs(["Read Contributions", "Write Contribution"])
|
||||
|
||||
# ── Read Contributions ──
|
||||
with tab_read:
|
||||
st.markdown("### 🔍 Search Contributions")
|
||||
st.markdown("### Search Contributions")
|
||||
|
||||
db_choice = st.radio(
|
||||
"Database",
|
||||
@@ -39,7 +39,7 @@ def render():
|
||||
kw_filter = st.text_input("Filter by Keywords", key="filter_kw")
|
||||
content_filter = st.text_input("Filter by Content", key="filter_content")
|
||||
|
||||
if st.button("🔍 Search", type="primary", key="btn_search"):
|
||||
if st.button("Search", type="primary", key="btn_search"):
|
||||
results = search_contributions(
|
||||
db_name,
|
||||
name_filter=name_filter,
|
||||
@@ -60,10 +60,10 @@ def render():
|
||||
):
|
||||
st.markdown(contrib["text"])
|
||||
if contrib["keywords"]:
|
||||
st.caption(f"🏷️ Keywords: {contrib['keywords']}")
|
||||
st.caption(f"Keywords: {contrib['keywords']}")
|
||||
|
||||
# Delete functionality
|
||||
with st.popover("🗑️ Delete"):
|
||||
with st.popover("Delete"):
|
||||
st.warning("This action cannot be undone.")
|
||||
del_password = st.text_input(
|
||||
"Enter contribution password",
|
||||
@@ -72,7 +72,7 @@ def render():
|
||||
)
|
||||
if st.button("Confirm Delete", key=f"del_btn_{contrib['num']}"):
|
||||
if delete_contribution(db_name, contrib["num"], del_password):
|
||||
st.success(f"✅ Contribution #{contrib['num']} deleted.")
|
||||
st.success(f"Contribution #{contrib['num']} deleted.")
|
||||
# Refresh results
|
||||
st.session_state["contrib_results"] = search_contributions(
|
||||
db_name,
|
||||
@@ -83,13 +83,13 @@ def render():
|
||||
)
|
||||
st.rerun()
|
||||
else:
|
||||
st.error("❌ Incorrect password or contribution not found.")
|
||||
st.error("Incorrect password or contribution not found.")
|
||||
elif "contrib_results" in st.session_state:
|
||||
st.info("No contributions found matching your filters.")
|
||||
|
||||
# ── Write Contribution ──
|
||||
with tab_write:
|
||||
st.markdown("### ✍️ New Contribution")
|
||||
st.markdown("### New Contribution")
|
||||
|
||||
db_choice_w = st.radio(
|
||||
"Database",
|
||||
@@ -109,17 +109,16 @@ def render():
|
||||
type="password",
|
||||
)
|
||||
|
||||
submitted = st.form_submit_button("📤 Submit", type="primary")
|
||||
submitted = st.form_submit_button("Submit", type="primary")
|
||||
|
||||
if submitted:
|
||||
if not name or not title or not text:
|
||||
st.error("❌ Please fill in all required fields (marked with *).")
|
||||
st.error("Please fill in all required fields (marked with *).")
|
||||
else:
|
||||
new_id = write_contribution(db_name_w, name, title, keywords, text, password)
|
||||
st.success(f"✅ Thank you! Your contribution has been stored with ID #{new_id}.")
|
||||
st.balloons()
|
||||
st.success(f"Thank you. Your contribution has been stored with ID #{new_id}.")
|
||||
|
||||
with st.expander("❓ Help"):
|
||||
with st.expander("Help"):
|
||||
st.markdown(
|
||||
"Write your contribution as a free text. Contributions should be:\n\n"
|
||||
"- Candid observations about the technical subject\n"
|
||||
|
||||
Reference in New Issue
Block a user