File size: 2,930 Bytes
fb20480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"""

مكون ترويسة الصفحة

"""

import streamlit as st
from datetime import datetime
import config


def render_header():
    """

    عرض ترويسة الصفحة

    """
    # إنشاء مكون الترويسة باستخدام HTML
    header_html = """

    <div class="header-container">

        <div class="header-title">

            <h1>نظام تحليل العقود والمناقصات</h1>

            <p>الحلول الشاملة للتسعير والتحليل بالذكاء الاصطناعي</p>

        </div>

        <div class="header-info">

            <div class="date-box">

                <div class="date-day">{day}</div>

                <div class="date-info">

                    <div class="date-month">{month}</div>

                    <div class="date-year">{year}</div>

                </div>

            </div>

        </div>

    </div>

    """
    
    # الحصول على معلومات التاريخ الحالي
    today = datetime.now()
    day = today.day
    month_names = [
        "يناير", "فبراير", "مارس", "إبريل", "مايو", "يونيو",
        "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"
    ]
    month = month_names[today.month - 1]
    year = today.year
    
    # استبدال القيم في قالب HTML
    header_html = header_html.format(day=day, month=month, year=year)
    
    # عرض الترويسة
    st.markdown(header_html, unsafe_allow_html=True)
    
    # إضافة شريط التنقل الرئيسي
    if 'is_authenticated' in st.session_state and st.session_state.is_authenticated:
        render_navigation_menu()
    
    # إضافة خط فاصل
    st.markdown("<hr>", unsafe_allow_html=True)


def render_navigation_menu():
    """

    عرض قائمة التنقل الرئيسية

    """
    # إنشاء قائمة التنقل المختصرة
    menu_items = [
        {"icon": "🏠", "label": "الرئيسية", "url": "/?page=home"},
        {"icon": "📊", "label": "لوحة المعلومات", "url": "/?page=dashboard"},
        {"icon": "⚙️", "label": "الإعدادات", "url": "/?page=settings"},
        {"icon": "❓", "label": "المساعدة", "url": "/?page=help"}
    ]
    
    # إنشاء قائمة HTML
    menu_html = """

    <div class="nav-menu">

        <ul>

    """
    
    for item in menu_items:
        menu_html += f"""

            <li>

                <a href="{item['url']}">

                    <span class="nav-icon">{item['icon']}</span>

                    <span class="nav-label">{item['label']}</span>

                </a>

            </li>

        """
    
    menu_html += """

        </ul>

    </div>

    """
    
    # عرض قائمة التنقل
    st.markdown(menu_html, unsafe_allow_html=True)