import streamlit as st from firebaseadmin import firestore def app(): if 'db' not in…
- User
import streamlit as st from firebase_admin import firestore
def app():
codeif 'db' not in st.session_state: st.session_state.db = '' db=firestore.client() st.session_state.db=db # st.title(' :violet[Pondering] :sunglasses:') ph = '' if st.session_state.username=='': ph = 'Login to be able to post!!' else: ph='Post your Work' post=st.text_area(label=' :orange[+ New Key Work Highlight]',placeholder=ph,height=None, max_chars=500) if st.button('Post',use_container_width=20): if post!='': info = db.collection('Posts').document(st.session_state.username).get() if info.exists: info = info.to_dict() if 'Content' in info.keys(): pos=db.collection('Posts').document(st.session_state.username) pos.update({u'Content': firestore.ArrayUnion([u'{}'.format(post)])}) # st.write('Post uploaded!!') else: data={"Content":[post],'Username':st.session_state.username} db.collection('Posts').document(st.session_state.username).set(data) else: data={"Content":[post],'Username':st.session_state.username} db.collection('Posts').document(st.session_state.username).set(data) st.success('Work uploaded!!') st.header(' :violet[Latest Work HIghlights] ') docs = db.collection('Posts').get() for doc in docs: d=doc.to_dict() try: st.markdown(""" <style> .stTextArea [data-baseweb=base-input] [disabled=""]{ # background-color: #e3d8c8; -webkit-text-fill-color: white; } </style> """,unsafe_allow_html=True) st.text_area(label=':green[Posted by:] '+':orange[{}]'.format(d['Username']), value=d['Content'][-1], height=20, disabled=True) # st.text_area(label=':green[Posted by:] '+':orange[{}]'.format(d['Username']),value=d['Content'][-1],height=20) except: pass in this i want to add a date posted on right corner as well also add a month fiilter in side of latest work highlights that can sort the pots on the baiss of month ...like if i choose march show the post that are posted in march month also if no filter is setted show all the posts last modified - Assistant
- User
in this in latest work highlights we get to see only one post ...i wanted all the posts of that month in a scroabble conatiner
- Assistant
- User
still showing only one which is last posted not all for april
- Assistant
- User
i wanted them all posts in a scrollable conatiner of height 600
- Assistant