Spaces:
Sleeping
Sleeping
Upload Advisernote.py
Browse files- Advisernote.py +13 -4
Advisernote.py
CHANGED
|
@@ -1581,14 +1581,14 @@ if check_password():
|
|
| 1581 |
# TAB 2: 이메일 검색창
|
| 1582 |
with tab_contacts:
|
| 1583 |
with st.container(border=True):
|
| 1584 |
-
st.caption("Pull customer
|
| 1585 |
contact_col1, contact_col2 = st.columns([5, 1])
|
| 1586 |
contact_search = contact_col1.text_input(
|
| 1587 |
-
"
|
| 1588 |
key="notion_contact_search",
|
| 1589 |
-
placeholder="Leave blank
|
| 1590 |
)
|
| 1591 |
-
contact_pull_btn = contact_col2.button("Pull
|
| 1592 |
|
| 1593 |
selected_contact_fields = st.multiselect(
|
| 1594 |
"Fields to pull",
|
|
@@ -1626,6 +1626,15 @@ if check_password():
|
|
| 1626 |
contacts_df = st.session_state.get("notion_contacts")
|
| 1627 |
if isinstance(contacts_df, pd.DataFrame):
|
| 1628 |
st.dataframe(contacts_df, use_container_width=True, hide_index=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1629 |
|
| 1630 |
with tab_email:
|
| 1631 |
with st.container(border=True):
|
|
|
|
| 1581 |
# TAB 2: 이메일 검색창
|
| 1582 |
with tab_contacts:
|
| 1583 |
with st.container(border=True):
|
| 1584 |
+
st.caption("Pull the full customer list from Notion with only the fields you choose.")
|
| 1585 |
contact_col1, contact_col2 = st.columns([5, 1])
|
| 1586 |
contact_search = contact_col1.text_input(
|
| 1587 |
+
"Optional filter",
|
| 1588 |
key="notion_contact_search",
|
| 1589 |
+
placeholder="Leave blank for the full list"
|
| 1590 |
)
|
| 1591 |
+
contact_pull_btn = contact_col2.button("Pull Full List", use_container_width=True, key="notion_contact_pull")
|
| 1592 |
|
| 1593 |
selected_contact_fields = st.multiselect(
|
| 1594 |
"Fields to pull",
|
|
|
|
| 1626 |
contacts_df = st.session_state.get("notion_contacts")
|
| 1627 |
if isinstance(contacts_df, pd.DataFrame):
|
| 1628 |
st.dataframe(contacts_df, use_container_width=True, hide_index=True)
|
| 1629 |
+
csv_data = contacts_df.to_csv(index=False).encode("utf-8-sig")
|
| 1630 |
+
st.download_button(
|
| 1631 |
+
"Download CSV",
|
| 1632 |
+
data=csv_data,
|
| 1633 |
+
file_name=f"notion_customer_list_{datetime.now().strftime('%Y%m%d_%H%M')}.csv",
|
| 1634 |
+
mime="text/csv",
|
| 1635 |
+
use_container_width=True,
|
| 1636 |
+
key="download_notion_contacts_csv"
|
| 1637 |
+
)
|
| 1638 |
|
| 1639 |
with tab_email:
|
| 1640 |
with st.container(border=True):
|