diff --git a/__pycache__/models.cpython-310.pyc b/__pycache__/models.cpython-310.pyc index d30c33f..50790ce 100644 Binary files a/__pycache__/models.cpython-310.pyc and b/__pycache__/models.cpython-310.pyc differ diff --git a/__pycache__/models.cpython-313.pyc b/__pycache__/models.cpython-313.pyc index a67a5f0..1bd54ee 100644 Binary files a/__pycache__/models.cpython-313.pyc and b/__pycache__/models.cpython-313.pyc differ diff --git a/app.py b/app.py index 73f7158..ada0440 100644 --- a/app.py +++ b/app.py @@ -5,9 +5,10 @@ from datetime import datetime from models import db, User, Question, Answer, Event, Job import os +from sqlalchemy import or_ app = Flask(__name__) -app.config['SECRET_KEY'] = 'your-secret-key-here' # Change this to a secure key in production +app.config['SECRET_KEY'] = '123456' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///campus2career.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False @@ -30,9 +31,10 @@ def init_db(): admin = User( username='admin', email='admin@campus2career.com', - role='admin' + role='admin', + profile_image='@images/default.png' ) - admin.set_password('admin') # Change this in production + admin.set_password('admin') db.session.add(admin) db.session.commit() @@ -45,19 +47,52 @@ def index(): @app.route('/login', methods=['GET', 'POST']) def login(): + # Check if admin login is requested via query parameter + login_type = request.args.get('type', '') + if request.method == 'POST': username = request.form.get('username') password = request.form.get('password') user_type = request.form.get('user_type') - user = User.query.filter_by(username=username).first() - if user and user.check_password(password) and user.role == user_type: - login_user(user) - return redirect(url_for('dashboard')) - flash('Invalid username or password') - return render_template('auth/login.html') + # Admin specific login logic + if user_type == 'admin': + if username == 'admin' and password == 'admin': + # Check if admin user exists in database + admin = User.query.filter_by(username='admin', role='admin').first() + + # Create admin user if it doesn't exist + if not admin: + admin = User( + username='admin', + email='admin@campus2career.com', + name='Administrator', + role='admin', + profile_image='images/default.png' # Make sure this exists + ) + admin.set_password('admin') + db.session.add(admin) + db.session.commit() + + login_user(admin) + flash('Welcome to the admin dashboard') + return redirect(url_for('admin_dashboard')) + else: + flash('Invalid admin credentials') + # Regular user login + else: + user = User.query.filter_by(username=username).first() + if user and user.check_password(password) and user.role == user_type: + login_user(user) + return redirect(url_for('dashboard')) + else: + flash('Invalid username or password') + + # Pass login_type to template + return render_template('auth/login.html', login_type=login_type) @app.route('/signup', methods=['GET', 'POST']) + def signup(): if request.method == 'POST': username = request.form.get('username') @@ -148,7 +183,7 @@ def admin_dashboard(): events = Event.query.all() questions = Question.query.all() jobs = Job.query.all() - return render_template('dashboard/admin.html', users=users, events=events, questions=questions, jobs=jobs) + return render_template('dashboard/admin.html', users=users, events=events, questions=questions, jobs=jobs, now=datetime.now()) @app.route('/teacher/dashboard') @login_required @@ -205,6 +240,164 @@ def update_profile(): return redirect(url_for('dashboard')) +@app.route('/admin', methods=['GET', 'POST']) +@app.route('/admin/', methods=['GET', 'POST']) +@login_required +def admin_dashboard_action(action=None): + if current_user.role != 'admin': + flash('You do not have permission to access the admin dashboard') + return redirect(url_for('dashboard')) + + if request.method == 'POST': + if action == 'delete_user': + user_id = request.form.get('user_id') + user = User.query.get(user_id) + if user: + db.session.delete(user) + db.session.commit() + flash('User deleted successfully') + else: + flash('User not found') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'delete_event': + event_id = request.form.get('event_id') + event = Event.query.get(event_id) + if event: + db.session.delete(event) + db.session.commit() + flash('Event deleted successfully') + else: + flash('Event not found') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'delete_job': + job_id = request.form.get('job_id') + job = Job.query.get(job_id) + if job: + db.session.delete(job) + db.session.commit() + flash('Job deleted successfully') + else: + flash('Job not found') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'post_job': + job_title = request.form.get('job_title') + company = request.form.get('company') + job_description = request.form.get('job_description') + new_job = Job(title=job_title, company=company, description=job_description, posted_by=current_user.id) + db.session.add(new_job) + db.session.commit() + flash('Job posted successfully') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'create_event': + event_title = request.form.get('event_title') + event_description = request.form.get('event_description') + event_date_str = request.form.get('event_date') + + # Convert the date string to a datetime object + event_date = datetime.strptime(event_date_str, '%Y-%m-%dT%H:%M') + + new_event = Event(title=event_title, description=event_description, date=event_date, created_by=current_user.id) + db.session.add(new_event) + db.session.commit() + flash('Event created successfully') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'add_user': + username = request.form.get('username') + email = request.form.get('email') + name = request.form.get('name') + role = request.form.get('role') + password = request.form.get('password') + + if User.query.filter_by(username=username).first(): + flash(f'Username {username} already exists') + return redirect(url_for('admin_dashboard_action')) + + if User.query.filter_by(email=email).first(): + flash(f'Email {email} already exists') + return redirect(url_for('admin_dashboard_action')) + + new_user = User( + username=username, + email=email, + name=name, + role=role, + profile_image='noimg.jpg' + ) + new_user.set_password(password) + db.session.add(new_user) + db.session.commit() + flash(f'User {username} created successfully') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'update_user': + user_id = request.form.get('user_id') + user = User.query.get(user_id) + if user: + user.username = request.form.get('username') + user.email = request.form.get('email') + user.name = request.form.get('name') + user.role = request.form.get('role') + + new_password = request.form.get('password') + if new_password: + user.set_password(new_password) + + db.session.commit() + flash(f'User {user.username} updated successfully') + else: + flash('User not found') + return redirect(url_for('admin_dashboard_action')) + + elif action == 'delete_question': + question_id = request.form.get('question_id') + question = Question.query.get(question_id) + if question: + db.session.delete(question) + db.session.commit() + flash('Question deleted successfully') + else: + flash('Question not found') + return redirect(url_for('admin_dashboard_action')) + + users = User.query.all() + events = Event.query.all() + jobs = Job.query.all() + return render_template('dashboard/admin.html', users=users, events=events, jobs=jobs, now=datetime.now()) + +@app.route('/search') +def search_users(): + query = request.args.get('q', '').strip().lower() + if len(query) < 2: + return render_template('search_results.html', users=[]) + + # Search users by username + users = User.query.filter(User.username.ilike(f'%{query}%')).all() + + return render_template('search_results.html', users=users) + +@app.route('/about') +def about(): + return render_template('about.html') + +@app.route('/contact') +def contact(): + return render_template('contact.html') + +@app.route('/profile') +@login_required +def profile(): + return render_template('profile.html', user=current_user) + +@app.route('/jobs') +def job_listings(): + jobs = Job.query.all() # Fetch all jobs + return render_template('jobs.html', jobs=jobs) + if __name__ == '__main__': init_db() - app.run(debug=True) + app.run(host="0.0.0.0", port=5000) diff --git a/campus2career.db b/campus2career.db index 467e1c9..9192849 100644 Binary files a/campus2career.db and b/campus2career.db differ diff --git a/images/default.png b/images/default.png new file mode 100644 index 0000000..ccb8472 Binary files /dev/null and b/images/default.png differ diff --git a/images/download.jpg b/images/download.jpg new file mode 100644 index 0000000..0755aa9 Binary files /dev/null and b/images/download.jpg differ diff --git a/models.py b/models.py index eb7cd92..2ba3ff7 100644 --- a/models.py +++ b/models.py @@ -17,10 +17,10 @@ class User(UserMixin, db.Model): profile_image = db.Column(db.String(120), default='noimg.jpg') created_at = db.Column(db.DateTime, default=datetime.utcnow) - questions = db.relationship('Question', backref='author', lazy=True) - answers = db.relationship('Answer', backref='author', lazy=True) - events = db.relationship('Event', backref='creator', lazy=True) - jobs = db.relationship('Job', backref='poster', lazy=True) + questions = db.relationship('Question', backref='author', lazy=True, cascade='all, delete-orphan') + answers = db.relationship('Answer', backref='author', lazy=True, cascade='all, delete-orphan') + events = db.relationship('Event', backref='creator', lazy=True, cascade='all, delete-orphan') + jobs = db.relationship('Job', backref='poster', lazy=True, cascade='all, delete-orphan') def set_password(self, password): self.password_hash = generate_password_hash(password) diff --git a/requirements.txt b/requirements.txt index 586c1eb..a826f19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,167 @@ -Flask==2.0.1 -Flask-SQLAlchemy==2.5.1 -Flask-Login==0.5.0 -Werkzeug==2.0.1 -python-dotenv==0.19.0 -Pillow==8.3.2 -email-validator==1.1.3 -SQLAlchemy==1.4.23 +absl-py==1.4.0 +aio-pika==8.2.3 +aiofiles==24.1.0 +aiogram==2.15 +aiohttp==3.9.5 +aiohttp-retry==2.9.1 +aiormq==6.4.2 +aiosignal==1.3.2 +APScheduler==3.9.1.post1 +asgiref==3.8.1 +astunparse==1.6.3 +async-timeout==4.0.3 +attrs==22.1.0 +babel==2.17.0 +bidict==0.23.1 +blinker==1.9.0 +boto3==1.37.4 +botocore==1.37.4 +CacheControl==0.12.14 +cachetools==5.5.2 +certifi==2025.1.31 +cffi==1.17.1 +charset-normalizer==3.4.1 +click==8.1.8 +cloudpickle==3.1.1 +colorama==0.4.6 +colorclass==2.2.2 +coloredlogs==15.0.1 +colorhash==1.2.1 +confluent-kafka==2.8.2 +cryptography==44.0.1 +cycler==0.12.1 +dask==2022.10.2 +Django==5.1.6 +django-allauth==65.4.1 +dnspython==2.7.0 +docopt==0.6.2 +email-validator==1.1.3 +fbmessenger==6.0.0 +filelock==3.17.0 +fire==0.7.0 +Flask==2.0.1 +Flask-Login==0.5.0 +Flask-SQLAlchemy==2.5.1 +flatbuffers==25.2.10 +fonttools==4.56.0 +frozenlist==1.5.0 +fsspec==2025.2.0 +future==1.0.0 +gast==0.4.0 +google-auth==2.38.0 +google-auth-oauthlib==1.0.0 +google-pasta==0.2.0 +greenlet==3.1.1 +grpcio==1.70.0 +gunicorn==23.0.0 +h11==0.14.0 +h5py==3.13.0 +httptools==0.6.4 +huggingface-hub==0.29.1 +humanfriendly==10.0 +idna==3.10 +itsdangerous==2.2.0 +jax==0.4.30 +jaxlib==0.4.30 +Jinja2==3.1.6 +jmespath==1.0.1 +joblib==1.4.2 +jsonpickle==3.0.4 +jsonschema==4.17.3 +jwt==1.3.1 +keras==2.12.0 +kiwisolver==1.4.8 +libclang==18.1.1 +locket==1.0.0 +Markdown==3.7 +MarkupSafe==3.0.2 +matplotlib==3.5.3 +mattermostwrapper==2.2 +ml_dtypes==0.5.1 +msgpack==1.1.0 +multidict==5.2.0 +networkx==2.6.3 +numpy==1.23.5 +oauthlib==3.2.2 +opt_einsum==3.4.0 +packaging==20.9 +pamqp==3.2.1 +partd==1.4.2 +Pillow==8.3.2 +pluggy==1.5.0 +portalocker==2.10.1 +prompt-toolkit==3.0.28 +propcache==0.3.0 +protobuf==4.23.3 +psycopg2-binary==2.9.10 +pyasn1==0.6.1 +pyasn1_modules==0.4.1 +pycparser==2.22 +pydantic==1.10.9 +pydot==1.4.2 +PyJWT==2.10.1 +pykwalify==1.8.0 +pymongo==4.3.3 +pyparsing==3.2.1 +pyreadline3==3.5.4 +pyrsistent==0.20.0 +python-crfsuite==0.9.11 +python-dateutil==2.8.2 +python-dotenv==0.19.0 +python-engineio==4.11.2 +python-socketio==5.12.1 +pytz==2022.7.1 +PyYAML==6.0.2 +questionary==1.10.0 +randomname==0.1.5 + +redis==4.6.0 +regex==2022.10.31 +requests==2.32.3 +requests-oauthlib==2.0.0 +requests-toolbelt==1.0.0 +rocketchat-API==1.30.0 +rsa==4.9 +ruamel.yaml==0.17.21 +ruamel.yaml.clib==0.2.12 +s3transfer==0.11.3 +safetensors==0.4.5 +sanic==21.12.2 +Sanic-Cors==2.0.1 +sanic-jwt==1.8.0 +sanic-routing==0.7.2 +scikit-learn==1.1.3 +scipy==1.10.1 +sentry-sdk==1.14.0 +simple-websocket==1.1.0 +six==1.17.0 +sklearn-crfsuite==0.3.6 +skops==0.9.0 +slack_sdk==3.34.0 +SQLAlchemy==1.4.23 +sqlparse==0.5.3 +structlog==23.3.0 +structlog-sentry==2.1.0 +tabulate==0.9.0 +tarsafe==0.0.4 +tensorboard==2.12.3 +tensorboard-data-server==0.7.2 +termcolor==2.5.0 +terminaltables==3.1.10 +threadpoolctl==3.5.0 +toolz==1.0.0 +tqdm==4.67.1 +twilio==8.2.2 +typing-utils==0.1.0 +typing_extensions==4.12.2 +tzdata==2025.1 +tzlocal==5.3 +ujson==5.10.0 +urllib3==2.3.0 +wcwidth==0.2.13 +webexteamssdk==1.6.1 +websockets==10.4 +Werkzeug==2.0.1 +wrapt==1.14.1 +wsproto==1.2.0 +yarl==1.18.3 diff --git a/static/images/default.png b/static/images/default.png new file mode 100644 index 0000000..ccb8472 Binary files /dev/null and b/static/images/default.png differ diff --git a/static/images/download.ico b/static/images/download.ico new file mode 100644 index 0000000..7ba5f6f Binary files /dev/null and b/static/images/download.ico differ diff --git a/static/images/noimg.jpg b/static/images/noimg.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/static/images/vlcsnap-2024-12-30-15h30m48s606.png b/static/images/vlcsnap-2024-12-30-15h30m48s606.png new file mode 100644 index 0000000..1db1409 Binary files /dev/null and b/static/images/vlcsnap-2024-12-30-15h30m48s606.png differ diff --git a/templates/Events/list.html b/templates/Events/list.html index d253587..ac0f980 100644 --- a/templates/Events/list.html +++ b/templates/Events/list.html @@ -137,7 +137,7 @@ -
+ +{% endblock content %} {% block extra_js %} -{% endblock %} +{% endblock extra_js %} diff --git a/templates/about.html b/templates/about.html index 3f2825e..53de0df 100644 --- a/templates/about.html +++ b/templates/about.html @@ -3,9 +3,127 @@ - About page + About Us + + + + + - Hello about us + + + + +
+
+

About Us

+

We are building a platform to facilitate communication between students and alumni, providing opportunities for mentorship, networking, and career guidance.

+
+
Our Mission
+

Our goal is to connect students with alumni who can offer valuable insights and support as they navigate their educational and professional journeys.

+
+
+
+ + +
+
+
+
+
About Campus2Career
+

Connecting students with opportunities and knowledge to shape their future careers.

+
+
+
Quick Links
+ +
+
+
Connect With Us
+
+ + + + +
+
+
+
+
+ © 2025 Campus2Career. All rights reserved. +
+
+
+ + + \ No newline at end of file diff --git a/templates/auth/login.html b/templates/auth/login.html index 45608e0..c125218 100644 --- a/templates/auth/login.html +++ b/templates/auth/login.html @@ -20,7 +20,8 @@

- + @@ -31,12 +32,13 @@

Alumni

- -
- - + +
+ +
@@ -48,7 +50,8 @@

- + @@ -118,6 +121,7 @@

+{% endblock %} {% block extra_js %} {% endblock %} -{% endblock %} diff --git a/templates/base.html b/templates/base.html index f6bb2fe..dcf98d5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,67 +4,99 @@ {% block title %}Campus2Career{% endblock %} + + + {% block extra_css %}{% endblock %} @@ -110,7 +319,8 @@ -
- {% with messages = get_flashed_messages() %} - {% if messages %} - {% for message in messages %} -
- {{ message }} - -
- {% endfor %} - {% endif %} - {% endwith %} - - {% block content %}{% endblock %} +
+
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} + + {% endfor %} + {% endif %} + {% endwith %} + + {% block content %}{% endblock %} +
-
-

Campus2Career

-

Your bridge to success! 🚀

+
+
About Campus2Career
+

Connecting students with opportunities and knowledge to shape their future careers.

-
-

Made with ❤️ by Team AMP Devs

-

- © 2025 Campus2Career - - - -

+
+
Quick Links
+
+
+
Connect With Us
+
+ + + + +
+
+
+
+
+ © 2025 Campus2Career. All rights reserved.
+ {% block extra_js %}{% endblock %} diff --git a/templates/contact.html b/templates/contact.html index 88cf5ba..593c6ff 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -4,9 +4,130 @@ Contact + + + + + + - Hello there - + + + + +
+
+

Contact Us

+

If you have any questions, feel free to reach out to us:

+
+
Contact Information
+ +
+
+
+ +
+
+
+
+
About Campus2Career
+

Connecting students with opportunities and knowledge to shape their future careers.

+
+
+
Quick Links
+ +
+
+
Connect With Us
+
+ + + + +
+
+
+
+
+ © 2025 Campus2Career. All rights reserved. +
+
+
+ + + + \ No newline at end of file diff --git a/templates/dashboard/admin.html b/templates/dashboard/admin.html index 9f022bd..527c5b8 100644 --- a/templates/dashboard/admin.html +++ b/templates/dashboard/admin.html @@ -61,283 +61,501 @@ } .user-avatar { - width: 32px; - height: 32px; + width: 50px; + height: 50px; border-radius: 50%; - margin-right: 10px; + object-fit: cover; } -.nav-tabs { - margin-bottom: 20px; +.badge-role { + font-size: 85%; } + +.badge-student { background-color: #17a2b8; } +.badge-alumni { background-color: #6f42c1; } +.badge-teacher { background-color: #fd7e14; } +.badge-admin { background-color: #dc3545; } {% endblock %} {% block content %} -
-
-

Admin Dashboard

-

Welcome back, {{ current_user.username }}

+
+
+
+

Admin Dashboard

+

Manage your platform

+
+
+ + + Logged in as {{ current_user.username }} + +
-
- -
-
-
-
{{ users|length }}
-
Total Users
+ +
+
+
+
+ +
+
+
{{ users|length }}
+
Total Users
+
+
-
-
-
-
{{ questions|length }}
-
Questions
+
+
+
+ +
+
+
{{ questions|length }}
+
Questions
+
+
-
-
-
-
{{ events|length }}
-
Events
+
+
+
+ +
+
+
{{ events|length }}
+
Events
+
+
-
-
-
-
{{ jobs|length }}
-
Job Postings
+
+
+
+ +
+
+
{{ jobs|length }}
+
Job Postings
+
+
-
- -
-
- - - - -
- -
-
-
-
-
-

User Management

-
-
- -
+ +
+
+ + + + +
+ +
+
+
+
User Management
+
-
-
-
- - - - - - - - - - - - - {% for user in users %} - - - - - - - - - {% endfor %} - -
UserRoleEmailJoinedStatusActions
- Profile - {{ user.username }} - {{ user.role }}{{ user.email }}{{ user.created_at.strftime('%Y-%m-%d') }}Active - - -
+
+
+ + + + + + + + + + + + + {% for user in users %} + + + + + + + + + {% endfor %} + +
UserRoleEmailJoinedStatusActions
+
+ Profile + {{ user.username }} +
+
+ + {% if user.role == 'student' %} + + {% elif user.role == 'alumni' %} + + {% elif user.role == 'teacher' %} + + {% elif user.role == 'admin' %} + + {% endif %} + {{ user.role|capitalize }} + + {{ user.email }}{{ user.created_at.strftime('%Y-%m-%d') if user.created_at else 'N/A' }} + Active + +
+ + +
+ + +
+
+
+
-
- -
-
-
-

Question Management

-
-
-
- - - - - - - - - - - - {% for question in questions %} - - - - - - - - {% endfor %} - -
TitleAuthorPostedAnswersActions
{{ question.title }}{{ question.author.username }}{{ question.created_at.strftime('%Y-%m-%d') }}{{ question.answers|length }} - - - - -
+ +
+
+
+
Question Management
+
+
+
+ + + + + + + + + + + + {% for question in questions %} + + + + + + + + {% endfor %} + +
TitleAuthorPostedAnswersActions
{{ question.title }} +
+ Profile + {{ question.author.username }} +
+
{{ question.created_at.strftime('%Y-%m-%d') }} + + {{ question.answers|length }} + + +
+ + + + + +
+
+
-
- -
-
-
-
-
-

Event Management

-
-
- + +
+
+
+
Event Management
+ +
+
+
+ + + + + + + + + + + + {% for event in events %} + + + + + + + + {% endfor %} + +
EventDateOrganizerStatusActions
{{ event.title }}{{ event.date.strftime('%Y-%m-%d %H:%M') }} +
+ Profile + {{ event.creator.username if event.creator else 'Unknown' }} +
+
+ {% if event.date > now %} + Upcoming + {% else %} + Past + {% endif %} + +
+ +
+ + +
+
+
-
-
- - - - - - - - - - - {% for event in events %} - - - - - - - {% endfor %} - -
EventDateOrganizerActions
{{ event.title }}{{ event.date.strftime('%Y-%m-%d %H:%M') }}{{ event.creator.username }} - - -
+
+ + +
+
+
+
Job Management
+ +
+
+
+ + + + + + + + + + + + + {% for job in jobs %} + + + + + + + + + {% endfor %} + +
PositionCompanyPosted ByPosted DateTypeActions
{{ job.title }}{{ job.company }} +
+ Profile + {{ job.poster.username if job.poster else 'Unknown' }} +
+
{{ job.created_at.strftime('%Y-%m-%d') }} + {{ job.job_type }} + +
+
+ + +
+ +
+
+
+
+
+
- -
-
-
-
-
-

Job Management

-
-
- -
-
+ +
- Profile +

{{ current_user.username }}

diff --git a/templates/dashboard/student.html b/templates/dashboard/student.html index 3401da2..a0cc29f 100644 --- a/templates/dashboard/student.html +++ b/templates/dashboard/student.html @@ -53,8 +53,9 @@

Welcome back, {{ current_user.name }}

-

4

+

2

Active Courses

+
diff --git a/templates/dashboard/teacher.html b/templates/dashboard/teacher.html deleted file mode 100644 index 31c92a7..0000000 --- a/templates/dashboard/teacher.html +++ /dev/null @@ -1,349 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Alumni Dashboard - Campus2Career{% endblock %}} - -{% block extra_css %} -

{{ current_user.username }}

-{% endblock %}

Teacher

-
- s Posted

-
-
-
-
-
-
- -
-

Post a Job

-
l-default"> -

Share opportunities with students!

- ="panel-title">Manage Events -
-
iv class="col-md-6 text-right"> -

{{ event.description }}

-

- - {{ event.date.strftime('%B %d, %Y at %I:%M %p') }} -

- - class="col-md-3 text-right"> -
utton class="btn btn-sm btn-primary" onclick="editEvent({{ event.id }})"> -
it"> -

- Mentorship Requests" onclick="deleteEvent({{ event.id }})"> -

-
-
iv> -
-
-
-
-
John Doe
et.

-

Looking for guidance in web development career path

- - Computer Science - -
-
- > - text-right"> -
ass="btn btn-primary btn-sm" data-toggle="modal" data-target="#createJobModal"> -
class="fas fa-plus"> Post Job -
button> - -
-
-
iv class="panel-body"> - {% if jobs %} - b in jobs %} -
s="job-card"> -
-

div class="col-md-9"> - Your Answers -

{{ job.company }}

-

{{ job.description[:200] }}{% if job.description|length > 200 %}...{% endif %}

-
iv> - {% if answers %}
- {% for answer in answers %}ss="btn btn-sm btn-primary" onclick="editJob({{ job.id }})"> -
dit"> -
-
btn-sm btn-danger" onclick="deleteJob({{ job.id }})"> - - {{ answer.question.title }} - -
-

{{ answer.content[:150] }}...

-
-

- - {{ answer.created_at.strftime('%B %d, %Y') }} -
- - View Discussion - -
">Recent Questions -
-
body"> - {% endfor %}stions %} - {% else %} question in recent_questions %} -
> - -

You haven't answered any questions yet!

id) }}">{{ question.title }} - - Browse Questionsent|length > 150 %}...{% endif %}

-
-
- {% endif %} Asked by {{ question.author.username }} -
on {{ question.created_at.strftime('%B %d, %Y') }} -
-
- Answer - -
- > -
-
-

t-center">No recent questions.

- Your Profile -

-
-
- Profile -

{{ current_user.username }}

-

abindex="-1" role="dialog"> - {{ current_user.company or 'Add Company' }} -

l-content"> - - dal-title">Create New Event -
-
    te_event') }}"> -
  • - {{ current_user.email }} -
  • label for="event_title">Event Title -
  • ="form-control" id="event_title" name="title" required> - {{ current_user.contact }} -
  • class="form-group"> -
-
-
- orm-group"> -
date">Date and Time -
m-control" id="event_date" name="date" required> -

- Your Impact -

s="modal-footer"> -
utton type="button" class="btn btn-default" data-dismiss="modal">Cancel -
t" class="btn btn-primary">Create Event -
-
-

{{ answers|length }}

- Questions Answered -
-
-

5

- Students Mentored -
role="document"> -
-

3

- Events Hostedimes; -
al-title">Post New Job -
-

2

}}"> - Jobs Posted -
="form-group"> -
abel for="job_title">Job Title -
-
-
- or="company">Company -
text" class="form-control" id="company" name="company" required> -
-

group"> - Quick Linksn -

textarea class="form-control" id="job_description" name="description" rows="4" required> -
div> -
- - My Menteesents" name="requirements" rows="4" required> - v> - - Posted Jobs - ton type="button" class="btn btn-default" data-dismiss="modal">Cancel - ton> - My Events - - - Discussion Forum - -
-
-
- 150px; -ight: 150px; - border-radius: 50%; -; - -.fas { - - - -ipt> -{% endblock %}{% block extra_js %} -{% endblock %} -{% endblock %} diff --git a/templates/index.html b/templates/index.html index 61952b3..b45a0d4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,140 +3,185 @@ {% block title %}Welcome to Campus2Career{% endblock %} {% block content %} -
-

Welcome to Campus2Career

-

Connect, Learn, and Grow with your Campus Community

- {% if not current_user.is_authenticated %} -

- Login - Sign Up -

- {% endif %} -
+ +
+
+

Welcome to Campus2Career

+

Connect, Learn, and Grow with your Campus Community

+ {% if not current_user.is_authenticated %} + + {% endif %} +
+
-
+ +
-
-
-
-

Recent Questions

+
+
+
+
+

+ Recent Questions +

+ + View All + +
-
+
{% if questions %} {% for question in questions %} -
-

{{ question.title }}

-

+

+
+

+ + {{ question.title }} + +

+ + {{ question.answers|length }} answers + +
+

Posted by {{ question.author.username }} on {{ question.created_at.strftime('%B %d, %Y') }}

-

{{ question.content[:200] }}{% if question.content|length > 200 %}...{% endif %}

-
- {{ question.answers|length }} answers -
+

+ {{ question.content[:200] }}{% if question.content|length > 200 %}...{% endif %} +

{% endfor %} - {% else %} -

No questions yet. +

+ +

No questions yet.

{% if current_user.is_authenticated %} - Be the first to ask! + + Be the first to ask! + {% else %} - Login to ask a question! + + Login to ask a question! + {% endif %} -

+
{% endif %}
- -
-
-
-

Upcoming Events

+ +
+ +
+
+
+

+ Upcoming Events +

+ + View All + +
-
+
{% if events %} {% for event in events %} -
-

{{ event.title }}

-

- {{ event.date.strftime('%B %d, %Y') }} +

+

{{ event.title }}

+

+ {{ event.date.strftime('%B %d, %Y') }} +

+

+ {{ event.description[:100] }}{% if event.description|length > 100 %}...{% endif %}

-

{{ event.description[:100] }}{% if event.description|length > 100 %}...{% endif %}

{% endfor %} - {% else %} -

No upcoming events.

+
+ +

No upcoming events.

+
{% endif %}
-
-
-

Quick Links

+
+
+

+ Quick Links +

-
- +
{% endblock %} diff --git a/templates/jobs.html b/templates/jobs.html new file mode 100644 index 0000000..6fb47c5 --- /dev/null +++ b/templates/jobs.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %}Job Listings - Campus2Career{% endblock %} + +{% block content %} +
+

Job Listings

+
+ {% for job in jobs %} +
+
+
+
{{ job.title }}
+

Company: {{ job.company }}

+

Contact: {{ job.company_contact }}

+

{{ job.description }}

+

Posted by: {{ job.posted_by }}

+
+ +
+ + +
+
+
+
+
+ {% endfor %} +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/profile.html b/templates/profile.html new file mode 100644 index 0000000..8f010f6 --- /dev/null +++ b/templates/profile.html @@ -0,0 +1,69 @@ +{% extends "base.html" %} + +{% block title %}Profile - Campus2Career{% endblock %} + +{% block content %} +
+

User Profile

+
+
+ Profile +

{{ user.username }}

+

Email: {{ user.email }}

+

Role: {{ user.role }}

+

Contact: {{ user.contact }}

+

Course: {{ user.course }}

+ +
+
+
+ + + + + + +{% endblock %} \ No newline at end of file diff --git a/templates/quest.html b/templates/quest.html deleted file mode 100644 index 6f34520..0000000 --- a/templates/quest.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Campus2Career - - - - - - - - - - - - - - - - - - - -
- -
-
-

- Welcome to Campus2Career -

-
- - - \ No newline at end of file diff --git a/templates/questions/detail.html b/templates/questions/detail.html index 2eb407c..d5df13b 100644 --- a/templates/questions/detail.html +++ b/templates/questions/detail.html @@ -18,8 +18,7 @@

{{ question.title }}

- Profile + Profile
{{ question.author.username }}
@@ -66,7 +65,7 @@
- Profile
{{ answer.author.username }}
@@ -157,7 +156,7 @@
- Profile
{{ question.author.username }}

diff --git a/templates/questions/list.html b/templates/questions/list.html index cce2eda..9dd3aab 100644 --- a/templates/questions/list.html +++ b/templates/questions/list.html @@ -29,7 +29,7 @@

- Profile
{{ question.author.username }}
@@ -176,4 +176,4 @@