EGYADMIN commited on
Commit
deaeeda
·
verified ·
1 Parent(s): d924f97

Update utils/components/improved_sidebar.py

Browse files
utils/components/improved_sidebar.py CHANGED
@@ -241,15 +241,24 @@ def render_sidebar():
241
  )
242
 
243
  # إضافة معلومات المشروع الحالي
244
- if 'current_project' in st.session_state and st.session_state.current_project:
245
- project = st.session_state.current_project
246
-
247
- st.markdown('<div class="project-info">', unsafe_allow_html=True)
248
- st.markdown('<div class="info-title">المشروع الحالي</div>', unsafe_allow_html=True)
249
- st.markdown(f"**{project['name']}**")
250
- st.markdown(f"رقم المناقصة: {project['number']}")
251
- st.markdown(f"الجهة المالكة: {project['client']}")
252
- st.markdown('</div>', unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
253
 
254
  # إضافة زر للتبديل بين المشاريع
255
  if st.button("تبديل المشروع"):
 
241
  )
242
 
243
  # إضافة معلومات المشروع الحالي
244
+
245
+ if 'current_project' in st.session_state and st.session_state.current_project:
246
+ project_id = st.session_state.current_project
247
+ project = next((p for p in st.session_state.projects if p['id'] == project_id), None)
248
+
249
+ if project:
250
+ st.markdown('<div class="project-info">', unsafe_allow_html=True)
251
+ st.markdown('<div class="info-title">المشروع الحالي</div>', unsafe_allow_html=True)
252
+ st.markdown(f"**{project['name']}**")
253
+ st.markdown(f"رقم المناقصة: {project.get('number', 'غير متوفر')}")
254
+ st.markdown(f"الجهة المالكة: {project['client']}")
255
+ st.markdown('</div>', unsafe_allow_html=True)
256
+
257
+ if st.button("تبديل المشروع"):
258
+ pass
259
+ else:
260
+ st.warning("لم يتم العثور على تفاصيل المشروع الحالي.")
261
+ , unsafe_allow_html=True)
262
 
263
  # إضافة زر للتبديل بين المشاريع
264
  if st.button("تبديل المشروع"):