|
""" |
|
مكون الشريط الجانبي |
|
""" |
|
|
|
import streamlit as st |
|
from datetime import datetime |
|
import config |
|
from streamlit_option_menu import option_menu |
|
|
|
|
|
def render_sidebar(): |
|
""" |
|
عرض وإدارة الشريط الجانبي |
|
|
|
الإرجاع: |
|
اسم الوحدة المحددة |
|
""" |
|
with st.sidebar: |
|
st.image("static/images/logo.png", width=150) |
|
|
|
|
|
selected_module = option_menu( |
|
"نظام العقود والمناقصات", |
|
[ |
|
"الرئيسية", |
|
"إدارة المشاريع", |
|
"التسعير المتكاملة", |
|
"الموارد والتكاليف", |
|
"تحليل المستندات", |
|
"مقارنة المستندات", |
|
"تقييم مخاطر العقود", |
|
"التقارير والتحليلات", |
|
"متتبع حالة المشروع", |
|
"خريطة المشاريع", |
|
"نظام الإشعارات", |
|
"الترجمة الصوتية", |
|
"نظام الإنجازات", |
|
"المساعد الذكي", |
|
"ضبط نماذج الذكاء الاصطناعي" |
|
], |
|
icons=[ |
|
'house-fill', |
|
'folder-fill', |
|
'calculator-fill', |
|
'tools', |
|
'file-earmark-text-fill', |
|
'files', |
|
'exclamation-triangle-fill', |
|
'bar-chart-fill', |
|
'kanban-fill', |
|
'geo-alt-fill', |
|
'bell-fill', |
|
'mic-fill', |
|
'trophy-fill', |
|
'robot', |
|
'gear-fill' |
|
], |
|
menu_icon="cast", |
|
default_index=0, |
|
styles={ |
|
"container": {"padding": "5px", "background-color": "#f0f2f6", "direction": "rtl"}, |
|
"icon": {"color": "orange", "font-size": "18px", "margin-left": "10px"}, |
|
"nav-link": { |
|
"font-size": "14px", |
|
"text-align": "right", |
|
"margin": "0px", |
|
"direction": "rtl", |
|
"justify-content": "flex-end" |
|
}, |
|
"nav-link-selected": {"background-color": "#ff9a3c"}, |
|
} |
|
) |
|
|
|
|
|
st.markdown("---") |
|
|
|
|
|
if 'current_project' in st.session_state and st.session_state.current_project: |
|
project = st.session_state.current_project |
|
|
|
st.markdown("### المشروع الحالي") |
|
st.markdown(f"**{project['name']}**") |
|
st.markdown(f"رقم المناقصة: {project['number']}") |
|
st.markdown(f"الجهة المالكة: {project['client']}") |
|
|
|
|
|
if st.button("تبديل المشروع"): |
|
|
|
pass |
|
|
|
|
|
if 'user_info' in st.session_state and st.session_state.user_info: |
|
user = st.session_state.user_info |
|
|
|
st.markdown("---") |
|
st.markdown("### معلومات المستخدم") |
|
st.markdown(f"**{user['full_name']}**") |
|
st.markdown(f"الدور: {user['role']}") |
|
|
|
|
|
if st.button("تسجيل الخروج"): |
|
st.session_state.is_authenticated = False |
|
st.session_state.user_info = None |
|
st.rerun() |
|
|
|
|
|
st.markdown("---") |
|
st.markdown(f"الإصدار: 1.0.0") |
|
st.markdown(f"تاريخ الإصدار: 2025-03-15") |
|
st.markdown(f"© 2025 شركة شبه الجزيرة للمقاولات") |
|
|
|
return selected_module |