omkar-surve126 commited on
Commit
46d40d0
·
1 Parent(s): f719c92

login_form

Browse files
Files changed (3) hide show
  1. app.py +9 -15
  2. requirements.txt +1 -0
  3. ui.py +111 -0
app.py CHANGED
@@ -132,18 +132,17 @@ def login_form():
132
  st.title("Welcome to NOVAScholar")
133
 
134
  with st.form("login_form"):
135
- col1, col2 = st.columns(2)
136
-
137
- with col1:
138
- user_type = st.selectbox(
139
- "Please select your Role",
140
- ["student", "faculty", "research_assistant", "analyst"]
141
- )
142
- username = st.text_input("Username or Email")
143
 
144
- with col2:
145
- password = st.text_input("Password", type="password")
 
146
 
 
147
  submit = st.form_submit_button("Login")
148
 
149
  if submit:
@@ -830,13 +829,8 @@ def create_course_form(faculty_name, faculty_id):
830
  except Exception as e:
831
  st.error(f"Error saving course: {e}")
832
 
833
-
834
-
835
  from research_assistant_dashboard import display_research_assistant_dashboard
836
-
837
  from goals2 import display_analyst_dashboard
838
-
839
-
840
  def enroll_in_course(course_id, course_title, student):
841
  """Enroll a student in a course"""
842
  if student:
 
132
  st.title("Welcome to NOVAScholar")
133
 
134
  with st.form("login_form"):
135
+ # Role selection at the top
136
+ user_type = st.selectbox(
137
+ "Please select your Role",
138
+ ["student", "faculty", "research_assistant", "analyst"]
139
+ )
 
 
 
140
 
141
+ # Username/email and password stacked vertically
142
+ username = st.text_input("Username or Email")
143
+ password = st.text_input("Password", type="password")
144
 
145
+ # Login button
146
  submit = st.form_submit_button("Login")
147
 
148
  if submit:
 
829
  except Exception as e:
830
  st.error(f"Error saving course: {e}")
831
 
 
 
832
  from research_assistant_dashboard import display_research_assistant_dashboard
 
833
  from goals2 import display_analyst_dashboard
 
 
834
  def enroll_in_course(course_id, course_title, student):
835
  """Enroll a student in a course"""
836
  if student:
requirements.txt CHANGED
@@ -25,3 +25,4 @@ google-auth
25
  transformers
26
  textstat
27
  spacy
 
 
25
  transformers
26
  textstat
27
  spacy
28
+ streamlit_option_menu
ui.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_option_menu import option_menu
3
+
4
+
5
+ # Page Configuration
6
+ st.set_page_config(page_title="Enhanced Navigation Demo", layout="wide")
7
+
8
+ # Top Navigation Bar using option_menu
9
+ selected = option_menu(
10
+ menu_title=None,
11
+ options=["Home", "Documentation", "Examples", "Community", "About"],
12
+ icons=["house", "book", "code", "people", "info-circle"],
13
+ menu_icon="cast",
14
+ default_index=0,
15
+ orientation="horizontal",
16
+ styles={
17
+ "container": {"padding": "0!important", "background-color": "#fafafa"},
18
+ "icon": {"color": "orange", "font-size": "25px"},
19
+ "nav-link": {
20
+ "font-size": "15px",
21
+ "text-align": "center",
22
+ "margin":"0px",
23
+ "--hover-color": "#eee",
24
+ },
25
+ "nav-link-selected": {"background-color": "#0083B8"},
26
+ }
27
+ )
28
+
29
+ # Sidebar Navigation
30
+ with st.sidebar:
31
+ st.header("Navigation Menu")
32
+
33
+ # Main Menu Items
34
+ selected_side = option_menu(
35
+ menu_title="Go to",
36
+ options=["Dashboard", "Analytics", "Reports", "Settings"],
37
+ icons=["speedometer2", "graph-up", "file-text", "gear"],
38
+ menu_icon="list",
39
+ default_index=0,
40
+ )
41
+
42
+ # Expandable Reports Section
43
+ if selected_side == "Reports":
44
+ with st.expander("Reports", expanded=True):
45
+ st.button("Weekly Report")
46
+ st.button("Monthly Report")
47
+ st.button("Annual Report")
48
+
49
+ # Main Content Area based on top navigation
50
+ if selected == "Home":
51
+ st.title("Welcome to Home")
52
+ st.write("This is the home page content.")
53
+
54
+ # Dashboard Content
55
+ st.header("Dashboard")
56
+ col1, col2, col3 = st.columns(3)
57
+ with col1:
58
+ st.metric("Sales", "$12,345", "+2.5%")
59
+ with col2:
60
+ st.metric("Users", "1,234", "-8%")
61
+ with col3:
62
+ st.metric("Conversion", "3.2%", "+1.2%")
63
+
64
+ elif selected == "Documentation":
65
+ st.title("Documentation")
66
+ st.write("Documentation content goes here.")
67
+
68
+ elif selected == "Examples":
69
+ st.title("Examples")
70
+ st.write("Example content goes here.")
71
+
72
+ elif selected == "Community":
73
+ st.title("Community")
74
+ st.write("Community content goes here.")
75
+
76
+ elif selected == "About":
77
+ st.title("About")
78
+ st.write("About content goes here.")
79
+
80
+ # Content based on sidebar selection
81
+ if selected_side == "Analytics":
82
+ st.header("Analytics")
83
+ st.line_chart({"data": [1, 5, 2, 6, 2, 1]})
84
+ elif selected_side == "Settings":
85
+ st.header("Settings")
86
+ st.toggle("Dark Mode")
87
+ st.toggle("Notifications")
88
+ st.slider("Volume", 0, 100, 50)
89
+
90
+ # Footer
91
+ st.markdown(
92
+ """
93
+ <style>
94
+ .footer {
95
+ position: fixed;
96
+ left: 0;
97
+ bottom: 0;
98
+ width: 100%;
99
+ background-color: #0E1117;
100
+ color: white;
101
+ text-align: center;
102
+ padding: 10px;
103
+ font-size: 14px;
104
+ }
105
+ </style>
106
+ <div class='footer'>
107
+ © 2024 Your App Name • Privacy Policy • Terms of Service
108
+ </div>
109
+ """,
110
+ unsafe_allow_html=True
111
+ )