diff --git a/FusionIIIT/Fusion/fusion.db b/FusionIIIT/Fusion/fusion.db index a0dae8bd4..1fe84e47f 100644 Binary files a/FusionIIIT/Fusion/fusion.db and b/FusionIIIT/Fusion/fusion.db differ diff --git a/FusionIIIT/Fusion/settings.py b/FusionIIIT/Fusion/settings.py index fa6e02bdb..088a9a2d3 100644 --- a/FusionIIIT/Fusion/settings.py +++ b/FusionIIIT/Fusion/settings.py @@ -1,264 +1,264 @@ -''' -Django settings for Fusion project. - -Generated by 'django-admin startproject' using Django 1.11.4. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -''' -import os - -from celery.schedules import crontab - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '=&w9due426k@l^ju1=s1)fj1rnpf0ok8xvjwx+62_nc-f12-8(' -CLIENT_ID = '187004491411-frc3j36n04o9k0imgnbl02qg42vkq36f.apps.googleusercontent.com' -CLIENT_SECRET = 'enHu3RD0yBvCM_9C0HQmEp0z' -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - -# Google authentication -SOCIALACCOUNT_PROVIDERS = { - 'google': { - 'SCOPE': [ - 'profile', - 'email', - ], - 'AUTH_PARAMS': { - 'access_type': 'online', - 'hd': 'iiitdmj.ac.in', - } - } -} - -# allauth settings - -LOGIN_URL = '/accounts/login/' -LOGOUT_URL = '/accounts/logout/' -LOGIN_REDIRECT_URL = '/dashboard' - -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' -EMAIL_USE_TLS = True -EMAIL_HOST = 'smtp.gmail.com' - -# email of sender - -EMAIL_HOST_USER = 'erp@iiitdmj.ac.in' - -# password of sender -EMAIL_HOST_PASSWORD = '' - -EMAIL_PORT = 587 -ACCOUNT_EMAIL_REQUIRED = True - -ACCOUNT_AUTHENTICATION_METHOD = 'username_email' - -ACCOUNT_CONFIRM_EMAIL_ON_GET = False - -ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = '/accounts/login/' -ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = '/' -ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 1 -ACCOUNT_EMAIL_CONFIRMATION_HMAC = True - -ACCOUNT_EMAIL_VERIFICATION = 'optional' - -ACCOUNT_EMAIL_SUBJECT_PREFIX = 'Fusion: ' - -DEFAULT_FROM_EMAIL = 'erp@iiitdmj.ac.in' - -SERVER_EMAIL = 'erp@iiitdmj.ac.in' - -ACCOUNT_LOGOUT_REDIRECT_URL = '/accounts/login/' -ACCOUNT_USERNAME_MIN_LENGTH = 3 - -SOCIALACCOUNT_ADAPTER = 'applications.globals.adapters.MySocialAccountAdapter' - - -# CELERY STUFF -# CELERY_BROKER_URL = 'redis://localhost:6379' -# CELERY_RESULT_BACKEND = 'redis://localhost:6379' -CELERY_ACCEPT_CONTENT = ['application/json'] -CELERY_TASK_SERIALIZER = 'json' -CELERY_RESULT_SERIALIZER = 'json' -CELERY_TIMEZONE = 'Asia/Calcutta' -CELERY_BEAT_SCHEDULE = { - 'leave-migration-task': { - 'task': 'applications.leave.tasks.execute_leave_migrations', - 'schedule': crontab(minute='1', hour='0') - } -} - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'django.contrib.sites', - 'applications.globals', - 'applications.eis', - 'notifications', - 'applications.academic_procedures', - 'applications.academic_information', - 'applications.leave', - 'applications.library', - - 'applications.gymkhana', - 'applications.office_module', - 'applications.central_mess', - 'applications.complaint_system', - 'applications.filetracking', - 'applications.finance_accounts', - 'applications.health_center', - 'applications.online_cms', - 'applications.placement_cell', - 'applications.scholarships', - 'applications.visitor_hostel', - 'allauth.account', - 'allauth.socialaccount', - 'allauth', - 'allauth.socialaccount.providers.google', - 'semanticuiforms', - 'applications.feeds.apps.FeedsConfig', - 'pagedown', - 'markdown_deux', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'Fusion.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': ['/', os.path.join(BASE_DIR, 'templates')], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'Fusion.wsgi.application' - - -PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) - -# DATABASES = { -# 'default': -# { -# 'ENGINE': 'django.db.backends.mysql', -# 'NAME': 'test', -# 'USER': 'root', -# 'PASSWORD': 'sksingh55', -# 'HOST': 'localhost', -# 'PORT': '3306', -# }, -# } - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(PROJECT_DIR, 'fusion.db'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -AUTHENTICATION_BACKENDS = ( - # Default backend -- used to login by username in Django admin - "django.contrib.auth.backends.ModelBackend", - # `allauth` specific authentication methods, such as login by e-mail - "allauth.account.auth_backends.AuthenticationBackend", -) - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'Asia/Kolkata' - -USE_I18N = True - -USE_L10N = False - -USE_TZ = False - -SITE_ID = 1 -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - - -# os.path.join(BASE_DIR, 'static/') -STATIC_URL = '/static/' -STATIC_ROOT = '/static' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -MEDIA_URL = '/media/' - -ACCOUNT_USERNAME_REQUIRED = False -ACCOUNT_EMAIL_VERIFICATION = "none" -SOCIALACCOUNT_QUERY_EMAIL = True -LOGIN_REDIRECT_URL = "/" - -if DEBUG: - MIDDLEWARE += ( - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ) - INSTALLED_APPS += ( - 'debug_toolbar', - ) - INTERNAL_IPS = ('127.0.0.1',) - DEBUG_TOOLBAR_CONFIG = { - 'INTERCEPT_REDIRECTS': False, - } - -DJANGO_NOTIFICATIONS_CONFIG = { -'USE_JSONFIELD':True, -} \ No newline at end of file +''' +Django settings for Fusion project. + +Generated by 'django-admin startproject' using Django 1.11.4. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +''' +import os + +from celery.schedules import crontab + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '=&w9due426k@l^ju1=s1)fj1rnpf0ok8xvjwx+62_nc-f12-8(' +CLIENT_ID = '187004491411-frc3j36n04o9k0imgnbl02qg42vkq36f.apps.googleusercontent.com' +CLIENT_SECRET = 'enHu3RD0yBvCM_9C0HQmEp0z' +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + +# Google authentication +SOCIALACCOUNT_PROVIDERS = { + 'google': { + 'SCOPE': [ + 'profile', + 'email', + ], + 'AUTH_PARAMS': { + 'access_type': 'online', + 'hd': 'iiitdmj.ac.in', + } + } +} + +# allauth settings + +LOGIN_URL = '/accounts/login/' +LOGOUT_URL = '/accounts/logout/' +LOGIN_REDIRECT_URL = '/dashboard' + +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_USE_TLS = True +EMAIL_HOST = 'smtp.gmail.com' + +# email of sender + +EMAIL_HOST_USER = 'erp@iiitdmj.ac.in' + +# password of sender +EMAIL_HOST_PASSWORD = '' + +EMAIL_PORT = 587 +ACCOUNT_EMAIL_REQUIRED = True + +ACCOUNT_AUTHENTICATION_METHOD = 'username_email' + +ACCOUNT_CONFIRM_EMAIL_ON_GET = False + +ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = '/accounts/login/' +ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = '/' +ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 1 +ACCOUNT_EMAIL_CONFIRMATION_HMAC = True + +ACCOUNT_EMAIL_VERIFICATION = 'optional' + +ACCOUNT_EMAIL_SUBJECT_PREFIX = 'Fusion: ' + +DEFAULT_FROM_EMAIL = 'erp@iiitdmj.ac.in' + +SERVER_EMAIL = 'erp@iiitdmj.ac.in' + +ACCOUNT_LOGOUT_REDIRECT_URL = '/accounts/login/' +ACCOUNT_USERNAME_MIN_LENGTH = 3 + +SOCIALACCOUNT_ADAPTER = 'applications.globals.adapters.MySocialAccountAdapter' + + +# CELERY STUFF +# CELERY_BROKER_URL = 'redis://localhost:6379' +# CELERY_RESULT_BACKEND = 'redis://localhost:6379' +CELERY_ACCEPT_CONTENT = ['application/json'] +CELERY_TASK_SERIALIZER = 'json' +CELERY_RESULT_SERIALIZER = 'json' +CELERY_TIMEZONE = 'Asia/Calcutta' +CELERY_BEAT_SCHEDULE = { + 'leave-migration-task': { + 'task': 'applications.leave.tasks.execute_leave_migrations', + 'schedule': crontab(minute='1', hour='0') + } +} + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.sites', + 'applications.globals', + 'applications.eis', + 'notifications', + 'applications.academic_procedures', + 'applications.academic_information', + 'applications.leave', + 'applications.library', + + 'applications.gymkhana', + 'applications.office_module', + 'applications.central_mess', + 'applications.complaint_system', + 'applications.filetracking', + 'applications.finance_accounts', + 'applications.health_center', + 'applications.online_cms', + 'applications.placement_cell', + 'applications.scholarships', + 'applications.visitor_hostel', + 'allauth.account', + 'allauth.socialaccount', + 'allauth', + 'allauth.socialaccount.providers.google', + 'semanticuiforms', + 'applications.feeds.apps.FeedsConfig', + 'pagedown', + 'markdown_deux', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Fusion.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': ['/', os.path.join(BASE_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'Fusion.wsgi.application' + + +PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) + +# DATABASES = { +# 'default': +# { +# 'ENGINE': 'django.db.backends.mysql', +# 'NAME': 'test', +# 'USER': 'root', +# 'PASSWORD': 'sksingh55', +# 'HOST': 'localhost', +# 'PORT': '3306', +# }, +# } + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(PROJECT_DIR, 'fusion.db'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +AUTHENTICATION_BACKENDS = ( + # Default backend -- used to login by username in Django admin + "django.contrib.auth.backends.ModelBackend", + # `allauth` specific authentication methods, such as login by e-mail + "allauth.account.auth_backends.AuthenticationBackend", +) + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'Asia/Kolkata' + +USE_I18N = True + +USE_L10N = False + +USE_TZ = False + +SITE_ID = 1 +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + + +# os.path.join(BASE_DIR, 'static/') +STATIC_URL = '/static/' +STATIC_ROOT = '/static' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_URL = '/media/' + +ACCOUNT_USERNAME_REQUIRED = False +ACCOUNT_EMAIL_VERIFICATION = "none" +SOCIALACCOUNT_QUERY_EMAIL = True +LOGIN_REDIRECT_URL = "/" + +if DEBUG: + MIDDLEWARE += ( + 'debug_toolbar.middleware.DebugToolbarMiddleware', + ) + INSTALLED_APPS += ( + 'debug_toolbar', + ) + INTERNAL_IPS = ('127.0.0.1',) + DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + } + +DJANGO_NOTIFICATIONS_CONFIG = { +'USE_JSONFIELD':True, +} diff --git a/FusionIIIT/Fusion/urls.py b/FusionIIIT/Fusion/urls.py index 52554d62f..82d017ef3 100644 --- a/FusionIIIT/Fusion/urls.py +++ b/FusionIIIT/Fusion/urls.py @@ -1,58 +1,58 @@ -"""Fusion URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" - -from django.conf import settings -from django.conf.urls import include, url -from django.conf.urls.static import static -from django.contrib import admin -from django.contrib.auth import views as auth_views -import notifications.urls - -urlpatterns = [ - url(r'^', include('applications.globals.urls')), - url(r'^feeds/', include('applications.feeds.urls')), - url(r'^eis/', include('applications.eis.urls', namespace='eis')), - url(r'^mess/', include('applications.central_mess.urls')), - url(r'^complaint/', include('applications.complaint_system.urls')), - url(r'^healthcenter/', include('applications.health_center.urls')), - url(r'^leave/', include('applications.leave.urls')), - url(r'^placement/', include('applications.placement_cell.urls', namespace='placement')), - url(r'^filetracking/', include('applications.filetracking.urls')), - url(r'^spacs/', include('applications.scholarships.urls')), - url(r'^visitorhostel/', include('applications.visitor_hostel.urls')), - url(r'^office/', include('applications.office_module.urls')), - url(r'^admin/', include(admin.site.urls)), - url(r'^finance/', include('applications.finance_accounts.urls')), - url(r'^gymkhana/', include('applications.gymkhana.urls')), - url(r'^library/', include('applications.library.urls')), - url(r'^accounts/', include('allauth.urls')), - url(r'^ocms/', include('applications.online_cms.urls')), - url(r'^login/', auth_views.login, name='login'), - url(r'^logout/', auth_views.logout, name='logout'), - url(r'^academic-procedures/', include('applications.academic_procedures.urls', - namespace='procedures')), - url(r'^aims/', include('applications.academic_information.urls')), - url(r'^notifications/', include(notifications.urls, namespace='notifications')), - -] -if settings.DEBUG: - urlpatterns += static(settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT) - - import debug_toolbar - urlpatterns = [ - url(r'^__debug__/', include(debug_toolbar.urls)), - ] + urlpatterns +"""Fusion URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" + +import notifications.urls +from django.conf import settings +from django.conf.urls import include, url +from django.conf.urls.static import static +from django.contrib import admin +from django.contrib.auth import views as auth_views + +urlpatterns = [ + url(r'^', include('applications.globals.urls')), + url(r'^feeds/', include('applications.feeds.urls')), + url(r'^eis/', include('applications.eis.urls', namespace='eis')), + url(r'^mess/', include('applications.central_mess.urls')), + url(r'^complaint/', include('applications.complaint_system.urls')), + url(r'^healthcenter/', include('applications.health_center.urls')), + url(r'^leave/', include('applications.leave.urls')), + url(r'^placement/', include('applications.placement_cell.urls', namespace='placement')), + url(r'^filetracking/', include('applications.filetracking.urls')), + url(r'^spacs/', include('applications.scholarships.urls')), + url(r'^visitorhostel/', include('applications.visitor_hostel.urls')), + url(r'^office/', include('applications.office_module.urls')), + url(r'^admin/', include(admin.site.urls)), + url(r'^finance/', include('applications.finance_accounts.urls')), + url(r'^gymkhana/', include('applications.gymkhana.urls')), + url(r'^library/', include('applications.library.urls')), + url(r'^accounts/', include('allauth.urls')), + url(r'^ocms/', include('applications.online_cms.urls')), + url(r'^login/', auth_views.login, name='login'), + url(r'^logout/', auth_views.logout, name='logout'), + url(r'^academic-procedures/', include('applications.academic_procedures.urls', + namespace='procedures')), + url(r'^aims/', include('applications.academic_information.urls')), + url(r'^notifications/', include(notifications.urls, namespace='notifications')), + +] +if settings.DEBUG: + urlpatterns += static(settings.MEDIA_URL, + document_root=settings.MEDIA_ROOT) + + import debug_toolbar + urlpatterns = [ + url(r'^__debug__/', include(debug_toolbar.urls)), + ] + urlpatterns diff --git a/FusionIIIT/applications/eis/static/fusion/js/editProfile.js b/FusionIIIT/applications/eis/static/fusion/js/editProfile.js index b0bc7f368..11d32ab2d 100644 --- a/FusionIIIT/applications/eis/static/fusion/js/editProfile.js +++ b/FusionIIIT/applications/eis/static/fusion/js/editProfile.js @@ -56,8 +56,23 @@ function editFirst(){ } } +function showModal(){ + $("#editModal") + .modal({ + closable : false, + onDeny : function(){ + + return true; + }, + onApprove : function() { + editStudent(); + } + }).modal('show'); +} function editStudent() { + //$("#tinyModal").show(); + $("#editButton").hide(); $("#saveButton").show(); diff --git a/FusionIIIT/templates/placementModule/profile.html b/FusionIIIT/templates/placementModule/profile.html index 374e47449..b61ae0919 100644 --- a/FusionIIIT/templates/placementModule/profile.html +++ b/FusionIIIT/templates/placementModule/profile.html @@ -1,6 +1,25 @@ + {% load static %} {% block profile %} + +
@@ -23,10 +42,15 @@
{% csrf_token %} - + +
+ +