From 09c03a2c1eb67daf80bf13636af4bda8647f4bb3 Mon Sep 17 00:00:00 2001 From: ari201604d7 <2016047@iiitdmj.ac.in> Date: Sun, 27 Jan 2019 17:56:44 +0530 Subject: [PATCH 1/8] It solved the bug to show previous winners which were not shown before --- FusionIIIT/Fusion/fusion.db | Bin 7630848 -> 7630848 bytes .../templates/scholarshipsModule/winners.html | 8 ++------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/FusionIIIT/Fusion/fusion.db b/FusionIIIT/Fusion/fusion.db index 7ddff21c4fc73a336dcac33a234b7957e8eacd26..b89b0dfb58bbdfae5f67bdda5419a92da0c0ec6c 100644 GIT binary patch delta 1513 zcmajfU2IcT902fhzk2&|KgNKrvQ662c0*a$9@cdo2n;*Q%5Jw|*V*#5%606U&RxS8 zJamM9K%%P>IS@?deAt_j8RVkk5@Vt!K8T4kfDvcp!50%2;uB{2FGOE_AUD60lYjpA zf6n=z+?!ecp2>h>rRYS64=LRa=59gJyQ0D#s*GAFBq8HYVH=FM z3-0`Ur=ZVwiihn?1@$T6)8gwa6xcx=9?7B4rNyJNc|AQ($tk9fo+svv=#;1o`U!1^ z2g!ZRmrpWN8L^EvO*a)bi)gyGl`L4xsz`Q53~s<)U$EZmtH%MmFVNB$Y{7m{bHL}_ z>L-gc;%;`jvQYQ927%R1T|X=KSvUm2+9$zX{zn#u9%(DfB%&iEH z{N+m`kbn%zz#32v)`E3ly?*(Ub*y*IRp`qnUUgoWKR#pcd4D&EPrkJlF#2buQ!i>u*{905Ng` zI?cQ<|0pN)vP{E1nPxVTQ5SX_Aw20~6q;-_wb%`mAM!Sng_#Bqxn;$UT(Kcn^j+MQviDdzDX*c zzu>}PD`*6M(4=2*1;!(`1iH^z{;+&)nX{a-^jI1!Ci8vsqWLm0rUSG3XX(Hlo~C(y zjh$xbQd?XkUW47_yc2i5v$|~~O-0F)6Hk(5J9a+a6pfbhYflG2GYEnfunlYnFMu6j zC)fpA!EW#(2!S@R2ZX_1&<-MCALsxIh=NYg1-ik0@DhlD9uNn;;AM~iNpJuh1c$(3 za715wx^LwnlVX)t!_mRckb;$1_hcg0>L)2{ zu$m4f$jUX}L{nrq8BzzLQ?1@;NSR7Z?H`EZZf|FAWGE3E7)^$IP9($eK_%AXS4P`$ rGS=-&3`IxDuUCfM>u~-5Po7^T!(arAf-!I$q`^3NOR!^iJ?+{tW?kh`EDV%4b(6WR6J#<4I`=3lGCDU6 zVa;;pd`=rLqzK7@cp-Yh9WNu114a|y;*A&17!A}!A@Ra^wPlhRO%}i7Kk(x7yEwm> zlXFfEz4e1ap&GLigy=nlNJT=(m6IJgEkU~CmuEfSlYCG1J;nD_-_v|A;Cs671${5% zdxr1Ted3wtwg!9cJQ}4&ZZ7B<(Y?)#+9&ftv3tPWDMd)FGJ@>Q%67yXm5%cHK~tO` zv<^5*GbwSsXuZh`bJjT#pRoS01I=U$2^Y9ct(2`Cl)sjf5+%Q2k%;-z);G%4cdSC4 zIvcO706=%;hj1Sk(`8nqoA~Xgi~8 z8SP+n9iyF$-p^=;(FYjqipaPGB|NtpKMwyKz91qr+ZSG)+Zj-frImh}w}!f%fV2S> zZG8Sjwu@g}+}J9UJFJ>z)d#Ou*Gp8@$HIhO+_bpa z|D!5vS6*iCyX- z`Ca4jV(!D}7sdz1TlznN8DmJkV`QXK&=H>&b2VL3M54NRMkz;2IoJrBpc^*B7I+jM zgRQU)w!;qC36H}Q@Fes=FFXaipbwsgei(p3$iomk1G`}lJPUha7@mWDFapoR3$Py! zz(El$6_%Ejf=ci+M!)233*)y1UT;|Dw6 - +
@@ -117,7 +117,6 @@ {% endblock javascript %} - - - - From 44035766090a2c84a87c03e0d07b0860b510c4be Mon Sep 17 00:00:00 2001 From: ari201604d7 <2016047@iiitdmj.ac.in> Date: Sun, 27 Jan 2019 18:18:13 +0530 Subject: [PATCH 2/8] It fixed the UI problem in Covocation Medal --- .../scholarshipsModule/applyNew.html | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/FusionIIIT/templates/scholarshipsModule/applyNew.html b/FusionIIIT/templates/scholarshipsModule/applyNew.html index f8fb2edda..d2fd527e8 100644 --- a/FusionIIIT/templates/scholarshipsModule/applyNew.html +++ b/FusionIIIT/templates/scholarshipsModule/applyNew.html @@ -17,8 +17,8 @@ - +
- + - +
@@ -291,7 +291,7 @@


- +
@@ -302,7 +302,7 @@
Please read below instructions before applying for any of the Convocation Medals:
- +
@@ -318,34 +318,34 @@



- +


- + - +
- +
- + @@ -948,19 +948,19 @@ if (aval == "gold") { silver.style.display='none'; dandm.style.display='none'; - gold.style.display='inline-block'; + gold.style.display='inline'; Form.fileURL.focus(); - } + } if (aval == "silver") { dandm.style.display='none'; gold.style.display='none'; - silver.style.display='inline-block'; + silver.style.display='inline'; Form.fileURL.focus(); - } + } if (aval == "dandm") { silver.style.display='none'; gold.style.display='none'; - dandm.style.display='inline-block'; + dandm.style.display='inline'; Form.fileURL.focus(); } } @@ -970,16 +970,16 @@ if(aval == 1) { form_part1.style.display='none'; - form_part2.style.display='inline-block'; + form_part2.style.display='inline'; form_part3.style.display='none'; } else if(aval == 2) { form_part1.style.display='none'; form_part2.style.display='none'; - form_part3.style.display='inline-block'; + form_part3.style.display='inline'; } } -{% endblock %} \ No newline at end of file +{% endblock %} From 3c6cc15b75253639d78b95956d2bd87ea4cd0d29 Mon Sep 17 00:00:00 2001 From: ari201604d7 <2016047@iiitdmj.ac.in> Date: Sun, 27 Jan 2019 18:38:13 +0530 Subject: [PATCH 3/8] 1. It removed the browse catalog bug data which appeared at the bottom of every tab even after closing it. 2.It made the select award dropdown more fluid which was sticky and static before 3.It solved the UI problem in MCM form --- .../scholarshipsModule/applyNew.html | 11 ++++--- .../scholarshipsModule/browsecatalogue.html | 11 +++---- .../scholarships_student.html | 32 +++++++++---------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/FusionIIIT/templates/scholarshipsModule/applyNew.html b/FusionIIIT/templates/scholarshipsModule/applyNew.html index d2fd527e8..d8a55413b 100644 --- a/FusionIIIT/templates/scholarshipsModule/applyNew.html +++ b/FusionIIIT/templates/scholarshipsModule/applyNew.html @@ -18,26 +18,27 @@
Application Form for Merit Cum Means (MCM) Scholarship: - +

- + - +
+
@@ -328,8 +329,8 @@
- - diff --git a/FusionIIIT/templates/scholarshipsModule/browsecatalogue.html b/FusionIIIT/templates/scholarshipsModule/browsecatalogue.html index 15958c397..3e84a9e37 100644 --- a/FusionIIIT/templates/scholarshipsModule/browsecatalogue.html +++ b/FusionIIIT/templates/scholarshipsModule/browsecatalogue.html @@ -23,8 +23,7 @@ -
-
+
@@ -37,7 +36,7 @@
- +
{% endblock %} @@ -47,7 +46,7 @@ -{% endblock %} \ No newline at end of file +{% endblock %} From c222b27096a2275f14d555c6d9d46e171d472d2d Mon Sep 17 00:00:00 2001 From: Amish Naidu Date: Fri, 1 Feb 2019 15:38:05 +0530 Subject: [PATCH 4/8] Add new dashboard template, restructure profile urls Also remove redundant module and folders --- FusionIIIT/Fusion/routing.py | 18 +- FusionIIIT/Fusion/settings.py | 1 - FusionIIIT/applications/globals/urls.py | 1 + FusionIIIT/applications/globals/views.py | 10 +- .../applications/health_center/views.py | 20 +- FusionIIIT/notification_channels/__init__.py | 0 FusionIIIT/notification_channels/admin.py | 9 - FusionIIIT/notification_channels/apps.py | 5 - FusionIIIT/notification_channels/consumers.py | 22 - FusionIIIT/notification_channels/helpers.py | 24 - FusionIIIT/notification_channels/models.py | 278 --- FusionIIIT/notification_channels/notify.py | 0 .../notification_channels/css/lobibox.css | 1057 ------------ .../static/notification_channels/lobibox.js | 1530 ----------------- .../static/notification_channels/main.js | 18 - .../notification_channels/manifest.json | 4 - .../notification_channels/notifications.js | 169 -- .../notification_channels/serviceworker.js | 20 - FusionIIIT/notification_channels/tasks.py | 23 - .../notification_channels/activity.html | 5 - .../notification_channels/notification.html | 11 - .../notification_channels/notifs_full.html | 144 -- .../notification_channels/notify.html | 4 - .../type_sorted_notifs.html | 37 - .../templatetags/__init__.py | 0 .../templatetags/activity_tags.py | 46 - .../templatetags/notif_tags.py | 96 -- FusionIIIT/notification_channels/tests.py | 0 FusionIIIT/notification_channels/urls.py | 13 - FusionIIIT/notification_channels/views.py | 49 - FusionIIIT/templates/dashboard/alerts.html | 182 +- FusionIIIT/templates/dashboard/dashboard.html | 405 ++--- .../templates/eisModule/eventorganized.html | 470 ----- .../templates/eisModule/generatereport.html | 19 - .../templates/eisModule/personaldetails.html | 188 -- FusionIIIT/templates/eisModule/profile.html | 215 --- FusionIIIT/templates/eisModule/projects.html | 473 ----- .../templates/eisModule/publications.html | 446 ----- FusionIIIT/templates/eisModule/thesis.html | 307 ---- FusionIIIT/templates/eisModule/visits.html | 504 ------ .../templates/globals/student_profile.html | 283 +++ 41 files changed, 549 insertions(+), 6557 deletions(-) delete mode 100644 FusionIIIT/notification_channels/__init__.py delete mode 100644 FusionIIIT/notification_channels/admin.py delete mode 100644 FusionIIIT/notification_channels/apps.py delete mode 100644 FusionIIIT/notification_channels/consumers.py delete mode 100644 FusionIIIT/notification_channels/helpers.py delete mode 100644 FusionIIIT/notification_channels/models.py delete mode 100644 FusionIIIT/notification_channels/notify.py delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/css/lobibox.css delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/lobibox.js delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/main.js delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/manifest.json delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/notifications.js delete mode 100644 FusionIIIT/notification_channels/static/notification_channels/serviceworker.js delete mode 100644 FusionIIIT/notification_channels/tasks.py delete mode 100644 FusionIIIT/notification_channels/templates/notification_channels/activity.html delete mode 100644 FusionIIIT/notification_channels/templates/notification_channels/notification.html delete mode 100644 FusionIIIT/notification_channels/templates/notification_channels/notifs_full.html delete mode 100644 FusionIIIT/notification_channels/templates/notification_channels/notify.html delete mode 100644 FusionIIIT/notification_channels/templates/notification_channels/type_sorted_notifs.html delete mode 100644 FusionIIIT/notification_channels/templatetags/__init__.py delete mode 100644 FusionIIIT/notification_channels/templatetags/activity_tags.py delete mode 100644 FusionIIIT/notification_channels/templatetags/notif_tags.py delete mode 100644 FusionIIIT/notification_channels/tests.py delete mode 100644 FusionIIIT/notification_channels/urls.py delete mode 100644 FusionIIIT/notification_channels/views.py delete mode 100644 FusionIIIT/templates/eisModule/eventorganized.html delete mode 100644 FusionIIIT/templates/eisModule/generatereport.html delete mode 100644 FusionIIIT/templates/eisModule/personaldetails.html delete mode 100644 FusionIIIT/templates/eisModule/profile.html delete mode 100644 FusionIIIT/templates/eisModule/projects.html delete mode 100644 FusionIIIT/templates/eisModule/publications.html delete mode 100644 FusionIIIT/templates/eisModule/thesis.html delete mode 100644 FusionIIIT/templates/eisModule/visits.html create mode 100644 FusionIIIT/templates/globals/student_profile.html diff --git a/FusionIIIT/Fusion/routing.py b/FusionIIIT/Fusion/routing.py index cdaae2adc..6137de5fb 100644 --- a/FusionIIIT/Fusion/routing.py +++ b/FusionIIIT/Fusion/routing.py @@ -1,9 +1,9 @@ -from channels.routing import route -from notification_channels.consumers import add, disconnect, message - -channel_routing = [ - route("websocket.connect", add, path=r"/notifications/"), - # path="r^/(?P[a-zA-Z0-9_]+)/$"), - route("websocket.disconnect", disconnect, path=r"/notifications/"), - route("websocket.receive", message, path=r"/notifications/"), -] +from channels.routing import route +#from notification_channels.consumers import add, disconnect, message + +channel_routing = [ + #route("websocket.connect", add, path=r"/notifications/"), + # path="r^/(?P[a-zA-Z0-9_]+)/$"), + #route("websocket.disconnect", disconnect, path=r"/notifications/"), + #route("websocket.receive", message, path=r"/notifications/"), +] diff --git a/FusionIIIT/Fusion/settings.py b/FusionIIIT/Fusion/settings.py index a59d1e84c..ef069e101 100644 --- a/FusionIIIT/Fusion/settings.py +++ b/FusionIIIT/Fusion/settings.py @@ -121,7 +121,6 @@ 'applications.filetracking', 'applications.finance_accounts', 'applications.health_center', - 'notification_channels', 'applications.online_cms', 'applications.placement_cell', 'applications.scholarships', diff --git a/FusionIIIT/applications/globals/urls.py b/FusionIIIT/applications/globals/urls.py index 2ccea2df9..722d6cd78 100644 --- a/FusionIIIT/applications/globals/urls.py +++ b/FusionIIIT/applications/globals/urls.py @@ -9,6 +9,7 @@ url(r'^$', views.index, name='index'), url(r'^dashboard/$', views.dashboard, name='dashboard'), url(r'^about/', views.about, name='about'), + url(r'^profile/', views.profile, name='profile'), # Feedback and issues url url(r'^feedback/$', views.feedback, name="feedback"), url(r'^issue/$', views.issue, name="issue"), diff --git a/FusionIIIT/applications/globals/views.py b/FusionIIIT/applications/globals/views.py index 73ac62d52..080c85652 100644 --- a/FusionIIIT/applications/globals/views.py +++ b/FusionIIIT/applications/globals/views.py @@ -675,6 +675,11 @@ def about(request): @login_required(login_url=LOGIN_URL) def dashboard(request): + return render(request, "dashboard/dashboard.html", {}) + + +@login_required(login_url=LOGIN_URL) +def profile(request): user = request.user profile = get_object_or_404(ExtraInfo, Q(user=user)) if(str(request.user.extrainfo.user_type)=='faculty'): @@ -870,14 +875,11 @@ def dashboard(request): 'patent': patent, 'form': form, 'form1': form1, 'form14': form14, 'form5': form5, 'form6': form6, 'form7': form7, 'form8': form8, 'form10':form10, 'form11':form11, 'form12':form12, 'current':current} - return render(request, "dashboard/dashboard.html", context) + return render(request, "globals/student_profile.html", context) else: context = {} return render(request, "dashboard/dashboard.html", context) - - - @login_required(login_url=LOGIN_URL) def logout_view(request): logout(request) diff --git a/FusionIIIT/applications/health_center/views.py b/FusionIIIT/applications/health_center/views.py index 25ce95aad..7d0469310 100644 --- a/FusionIIIT/applications/health_center/views.py +++ b/FusionIIIT/applications/health_center/views.py @@ -8,7 +8,7 @@ from django.shortcuts import render from applications.globals.models import ExtraInfo -from notification_channels.models import Notification +#from notification_channels.models import Notification from .models import (Ambulance_request, Appointment, Complaint, Constants, Counter, Doctor, Expiry, Hospital, Hospital_admit, @@ -73,8 +73,8 @@ def compounder_view(request): active=True ) a=User.objects.all() - for user in a: - Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='appoiinted',display_text='New Doctor has been appointed : Dr.'+doctor) +# for user in a: +# Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='appoiinted',display_text='New Doctor has been appointed : Dr.'+doctor) data={'status':1} return JsonResponse(data) elif 'remove_doctor' in request.POST: @@ -82,8 +82,8 @@ def compounder_view(request): Doctor.objects.filter(id=doctor).update(active=False) doc=Doctor.objects.get(id=doctor).doctor_name a=User.objects.all() - for user in a: - Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='removed',display_text='Dr.'+doc+'will not be available from now') +# for user in a: +# Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='removed',display_text='Dr.'+doc+'will not be available from now') data={'status':1} return JsonResponse(data) elif 'discharge' in request.POST: @@ -128,8 +128,8 @@ def compounder_view(request): Schedule.objects.filter(doctor_id=doctor_id, day=day).update(from_time=time_in) Schedule.objects.filter(doctor_id=doctor_id, day=day).update(to_time=time_out) a=User.objects.all() - for user in a: - Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='changed',display_text='Doctor Schedule has been changed') +# for user in a: +# Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='changed',display_text='Doctor Schedule has been changed') data={'status':1} return JsonResponse(data) elif 'add_medicine' in request.POST: @@ -176,7 +176,7 @@ def compounder_view(request): ) user=user_id.user hname=hospital_name.hospital_name - Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='admitted',display_text='You have been admitted in '+hname) +# Notification.objects.create(notif_type='healthcenter',recipient=user,action_verb='admitted',display_text='You have been admitted in '+hname) data={'status':1} return JsonResponse(data) elif 'medicine_name' in request.POST: @@ -320,7 +320,7 @@ def compounder_view(request): 'status': status, 'stock':stock } - Notification.objects.create(notif_type='healthcenter',recipient=user.user,action_verb='prescribed',display_text='You have been prescribed for '+details) +# Notification.objects.create(notif_type='healthcenter',recipient=user.user,action_verb='prescribed',display_text='You have been prescribed for '+details) return JsonResponse(data) elif 'prescribe_b' in request.POST: @@ -386,7 +386,7 @@ def compounder_view(request): status=0 Medicine.objects.all().delete() - Notification.objects.create(notif_type='healthcenter',recipient=user.user,action_verb='prescribed',display_text='You have been prescribed for '+details) +# Notification.objects.create(notif_type='healthcenter',recipient=user.user,action_verb='prescribed',display_text='You have been prescribed for '+details) data = { 'status': status diff --git a/FusionIIIT/notification_channels/__init__.py b/FusionIIIT/notification_channels/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/notification_channels/admin.py b/FusionIIIT/notification_channels/admin.py deleted file mode 100644 index da258af35..000000000 --- a/FusionIIIT/notification_channels/admin.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.contrib import admin - -from .models import Activity, Notification - -# Register your models here. - - -admin.site.register(Notification) -admin.site.register(Activity) diff --git a/FusionIIIT/notification_channels/apps.py b/FusionIIIT/notification_channels/apps.py deleted file mode 100644 index c5d62f981..000000000 --- a/FusionIIIT/notification_channels/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class NotificationChannelsConfig(AppConfig): - name = 'notification_channels' diff --git a/FusionIIIT/notification_channels/consumers.py b/FusionIIIT/notification_channels/consumers.py deleted file mode 100644 index 1ab5eda77..000000000 --- a/FusionIIIT/notification_channels/consumers.py +++ /dev/null @@ -1,22 +0,0 @@ -from channels import Group -from channels.auth import channel_session_user, channel_session_user_from_http - - -@channel_session_user -def message(message): - pass - # mes = parse_qs(message.content['text']) - - -@channel_session_user_from_http -def add(message): - if(message.user.is_authenticated()): - Group(message.user.username).add(message.reply_channel) - message.reply_channel.send({"accept": True}) - else: - message.reply_channel.send({"accept": False}) - - -@channel_session_user -def disconnect(message): - Group(message.user.username).discard(message.reply_channel) diff --git a/FusionIIIT/notification_channels/helpers.py b/FusionIIIT/notification_channels/helpers.py deleted file mode 100644 index b180fb797..000000000 --- a/FusionIIIT/notification_channels/helpers.py +++ /dev/null @@ -1,24 +0,0 @@ -def seen_or_x(notifications, x=10): - notifs = notifications.filter(seen=False) - flag = notifs.count() < x - if flag: - notifs = notifications.order_by("-timestamp")[0:x] - return notifs - - -def type_sort_notifs(notifications, seenify=True): - all_notif_types = list() - for dic in notifications.values("notif_type").distinct(): - for key, value in dic.items(): - all_notif_types.append(value) - type_sorted_notifs = dict() - for notif_type in all_notif_types: - notifs = notifications.filter(notif_type=notif_type) - if seenify: - notifs = seen_or_x(notifs) - type_sorted_notifs[notif_type] = notifs - context = { - "type_sorted_notifs": type_sorted_notifs, - "all_notif_types": all_notif_types, - } - return context diff --git a/FusionIIIT/notification_channels/models.py b/FusionIIIT/notification_channels/models.py deleted file mode 100644 index 4e8c25133..000000000 --- a/FusionIIIT/notification_channels/models.py +++ /dev/null @@ -1,278 +0,0 @@ -from django.conf import settings -from django.contrib.auth.models import User -from django.contrib.contenttypes.fields import GenericForeignKey -from django.contrib.contenttypes.models import ContentType -from django.db import models -from django.db.models.signals import m2m_changed, post_delete -from django.dispatch import receiver -from django.utils import timezone -from django.utils.timesince import timesince - - -class NotificationManager(models.Manager): - - """ Create takes arguments of notification values and returns the notification object """ - - def create(self, **kwargs): - generator = kwargs.pop("generator", None) - target = kwargs.get("target", None) - action_obj = kwargs.get("action_obj", None) - - """ Merge allows users to specify if a particular notification needs to be merged or not - """ - mergeable = generator and kwargs.pop("merge", True) - """ Notifications to a recipient will get merged when the target and - action_verball are same for both notifications. In the case of merge url and - description for the more recent notification will be ignored. """ - if getattr(settings, "ALLOW_NOTIFICATION_MERGE", True) and mergeable: - try: - com_kwargs = kwargs - com_kwargs["action_obj_id"] = action_obj.id - - if action_obj: - com_kwargs.pop("action_obj", None) - com_kwargs["action_obj_ctype"] = ContentType.objects.get_for_model(action_obj) - if target: - com_kwargs.pop("target", None) - com_kwargs["target_id"] = target.id - com_kwargs["target_ctype"] = ContentType.objects.get_for_model(target) - - notif = super(NotificationManager, self).get(**com_kwargs) - - if generator and generator not in notif.generator.all(): - notif.seen = False - notif.read = False - - except Exception as e: - notif = super(NotificationManager, self).create(**kwargs) - - else: - notif = super(NotificationManager, self).create(**kwargs) - - if generator: - notif.generator.add(generator) - notif.save() - return notif - - """ Discard notification deletes the notification or removes the generator for the """ - def discard(self, **kwargs): - generator = kwargs.pop("generator", None) - target = kwargs.pop("target", None) - action_obj = kwargs.pop("action_obj", None) - - if action_obj: - kwargs["action_obj_id"] = action_obj.id - kwargs["action_obj_ctype"] = ContentType.objects.get_for_model(action_obj) - if target: - kwargs["target_id"] = action_obj.id - kwargs["target_ctype"] = ContentType.objects.get_for_model(target) - - notif = super(NotificationManager, self).get(**kwargs) - - if getattr(settings, "ALLOW_NOTIFICATION_MERGE", True) and \ - notif.generator.all().count() > 1: - notif.generator.remove(generator) - notif.save() - read_list = map(lambda x: x.read, notif.activities.all()) - flag = True - for i in read_list: - if not i: - flag = False - notif.read = flag - - seen_list = map(lambda x: x.seen, notif.activities.all()) - flag = True - for i in seen_list: - if not i: - flag = False - notif.seen = flag - - notif.save() - elif not generator and not notif.generator.all().count(): - notif.delete() - elif generator and generator in notif.generator.all(): - notif.delete() - - def seen(self, seen=True): - queryset = super(NotificationManager, self).get_queryset() - queryset.update(seen=seen) - for qry in queryset: - qry.activities.all().update(seen=seen) - - def read(self, read=True): - queryset = super(NotificationManager, self).get_queryset() - queryset.update(read=read) - for qry in queryset: - qry.activities.all().update(read=read) - - -class Notification(models.Model): - - """ Type can be used to group different types of notifications together """ - notif_type = models.CharField(max_length=255, blank=True, null=True) - - recipient = models.ForeignKey(User, null=False, blank=False, - related_name="notifications", on_delete=models.CASCADE) - - """ Generator can be a single person in order to maintain activity stream for a user. """ - generator = models.ManyToManyField(User, related_name='activity_notifications', blank=True) - - """ target of any type can create a notification """ - target_ctype = models.ForeignKey(ContentType, related_name='related_notifications', - blank=True, null=True, on_delete=models.CASCADE) - target_id = models.CharField(max_length=255, blank=True, null=True,) - target = GenericForeignKey('target_ctype', 'target_id') - - """ Action object can be of any type that's related to any certain notification - for eg. a notification like ' liked your post' has post as action object """ - action_obj_ctype = models.ForeignKey(ContentType, related_name='action_notifications', - blank=True, null=True, on_delete=models.CASCADE) - action_obj_id = models.CharField(max_length=255, blank=True, null=True,) - action_obj = GenericForeignKey('action_obj_ctype', 'action_obj_id') - - """ Action verb is the activity that produced the notification - eg. commented on - - where 'commented on' is an action verb """ - - """" Notification read or not """ - read = models.BooleanField(default=False, blank=False) - - """ Notification seen or not """ - seen = models.BooleanField(default=False, blank=False) - - """ action verb is the bridging verb defining the generation reason """ - action_verb = models.CharField(max_length=255, null=False, blank=False) - description = models.TextField(null=True, blank=True) - - """ A text to display instead of autogenerated one """ - display_text = models.CharField(max_length=255, null=True, blank=True) - - """ Reference URL points to the web address the notification needs - to redirect the recipient to on click """ - reference_url = models.CharField(max_length=1023, blank=True, null=True, default="#") - - timestamp = models.DateTimeField(auto_now=True) - - """ Managing creation and manipulation of model """ - objects = NotificationManager() - - def __str__(self): - if self.display_text: - return self.display_text - timedlta = timesince(self.timestamp, timezone.now()) - count = self.generator.all().count() - if count == 1: - gen = self.generator.all()[0].username - elif count == 2: - gen = self.generator.all()[0].username + " and " + self.generator.all()[1].username - elif count == 0: - gen = "" - else: - gen = self.generator.all()[0].username + " , " + self.generator.all()[1].username + \ - " and " + str(count-2) + " others" - fields = { - 'recipient': self.recipient, - 'generator': gen, - 'action_obj': self.action_obj, - 'target': self.target, - 'action_verb': self.action_verb, - 'timesince': timedlta, - } - - if self.generator: - if self.action_obj: - if self.target: - return u'%(generator)s %(action_verb)s %(target)s on %(action_obj)s' % fields - return u'%(generator)s %(action_verb)s %(action_obj)s' % fields - return u'%(generator)s %(action_verb)s' % fields - - if self.action_obj: - if self.target: - return u'%(action_verb)s %(target)s on %(action_obj)s' % fields - return u'%(action_verb)s %(action_obj)s' % fields - return u'%(action_verb)s' % fields - - def __unicode__(self): - return self.__str__(self) - - def mark_seen(self, seen=True): - self.seen = seen - super(Notification, self).save() - - def mark_read(self, read=True): - self.read = read - super(Notification, self).save() - - -""" Activities are to keep track of user's activity for mergeable and - non-mergeable notifications for notification generators """ - - -class Activity(models.Model): - user = models.ForeignKey(User, null=False, blank=False, related_name="activities", - on_delete=models.CASCADE) - notification = models.ForeignKey(Notification, null=False, blank=False, - related_name="activities", on_delete=models.CASCADE) - timestamp = models.DateTimeField(auto_now_add=True) - - """ Notification seen or not """ - seen = models.BooleanField(default=False, blank=False) - - """" Notification read or not """ - read = models.BooleanField(default=False, blank=False) - - def __str__(self): - return self.user.username+" - "+self.notification.__str__() - - def __unicode__(self): - return self.__str__() - - -class PushSubscriptionInfo(models.Model): - browser_id = models.CharField(max_length=255, unique=True) - user = models.ForeignKey(User, related_name="push_abscription") - end_point = models.CharField(max_length=255) - auth = models.CharField(max_length=255) - p256dh = models.CharField(max_length=255) - - def __str__(self): - return self.user.username + "- " + self.browser_id - - def __unicode__(self): - return self.__str__(self) - - -def sync_notif_add(notification, generators): - for user in generators: - try: - activity = Activity.objects.get(user=user, notification=notification) - except: - activity = Activity.objects.create(user=user, notification=notification) - activity.save() - if not activity: - activity = Activity.objects.create(user=user, notification=notification) - activity.save() - - -def sync_notif_delete(notification, generators): - for activ in notification.activities.all(): - if activ.user not in generators: - activ.delete() - - -@receiver(m2m_changed, sender=Notification.generator.through) -def create_activity(sender, instance, **kwargs): - generators = instance.generator.all() - sync_notif_delete(instance, generators) - sync_notif_add(instance, generators) - - -@receiver(post_delete, sender=Notification) -def delete_activity(sender, instance, *args, **kwargs): - instance.activities.all().delete() - - -@receiver(post_delete, sender=Activity) -def remove_activity_trace(sender, instance, *args, **kwargs): - instance.notification.generator.remove(instance.user) diff --git a/FusionIIIT/notification_channels/notify.py b/FusionIIIT/notification_channels/notify.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/notification_channels/static/notification_channels/css/lobibox.css b/FusionIIIT/notification_channels/static/notification_channels/css/lobibox.css deleted file mode 100644 index 09ae045e0..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/css/lobibox.css +++ /dev/null @@ -1,1057 +0,0 @@ -/* - Created on : Mar 19, 2014, 9:48:25 AM - Author : @arboshiki -*/ -/* - Created on : Sep 19, 2014, 1:47:13 PM - Author : @arboshiki -*/ -/* - Author : @arboshiki -*/ -@import url(https://fonts.googleapis.com/css?family=Open+Sans:600,700,400,300); -/* - Created on : Aug 11, 2014, 5:14:12 PM - Author : @arboshiki -*/ -.animated-super-fast { - -webkit-animation-duration: 0.3s; - animation-duration: 0.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} -.animated-fast { - -webkit-animation-duration: 0.5s; - animation-duration: 0.5s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} -.animated { - -webkit-animation-duration: 1s; - animation-duration: 1s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} -.animated-slow { - -webkit-animation-duration: 1.3s; - animation-duration: 1.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} -@-webkit-keyframes bounce { - 0%, - 20%, - 50%, - 80%, - 100% { - -webkit-transform: translateY(0); - transform: translateY(0); - } - 40% { - -webkit-transform: translateY(-30px); - transform: translateY(-30px); - } - 60% { - -webkit-transform: translateY(-15px); - transform: translateY(-15px); - } -} -@keyframes bounce { - 0%, - 20%, - 50%, - 80%, - 100% { - transform: translateY(0); - } - 40% { - transform: translateY(-30px); - } - 60% { - transform: translateY(-15px); - } -} -@-webkit-keyframes jumpUp { - 0% { - -webkit-transform: translate3d(0, calc(230%), 0) scale3d(0, 1, 1); - -webkit-animation-timing-function: ease-in; - } - 40% { - -webkit-transform: translate3d(0, 0, 0) scale3d(0.02, 1.1, 1); - -webkit-animation-timing-function: ease-out; - } - 70% { - -webkit-transform: translate3d(0, -40px, 0) scale3d(0.8, 1.1, 1); - } - 100% { - -webkit-transform: translate3d(0, 0, 0) scale3d(1, 1, 1); - } -} -@keyframes jumpUp { - 0% { - transform: translate3d(0, calc(230%), 0) scale3d(0, 1, 1); - animation-timing-function: ease-in; - } - 40% { - transform: translate3d(0, 0, 0) scale3d(0.02, 1.1, 1); - animation-timing-function: ease-out; - } - 70% { - transform: translate3d(0, -40px, 0) scale3d(0.8, 1.1, 1); - } - 100% { - transform: translate3d(0, 0, 0) scale3d(1, 1, 1); - } -} -@-webkit-keyframes expandOpen { - 0% { - -webkit-transform: scale(1.8); - } - 50% { - -webkit-transform: scale(0.95); - } - 80% { - -webkit-transform: scale(1.05); - } - 90% { - -webkit-transform: scale(0.98); - } - 100% { - -webkit-transform: scale(1); - } -} -@keyframes expandOpen { - 0% { - transform: scale(1.8); - } - 50% { - transform: scale(0.95); - } - 80% { - transform: scale(1.05); - } - 90% { - transform: scale(0.98); - } - 100% { - transform: scale(1); - } -} -@keyframes fadeInScale { - 0% { - transform: scale(0); - opacity: 0.0; - } - 100% { - transform: scale(1); - opacity: 1; - } -} -@-webkit-keyframes fadeInScale { - 0% { - -webkit-transform: scale(0); - opacity: 0.0; - } - 100% { - -webkit-transform: scale(1); - opacity: 1; - } -} -@-webkit-keyframes zoomIn { - 0% { - opacity: 0; - -webkit-transform: scale(0.3); - transform: scale(0.3); - } - 50% { - opacity: 1; - } -} -@keyframes zoomIn { - 0% { - opacity: 0; - -webkit-transform: scale(0.3); - -ms-transform: scale(0.3); - transform: scale(0.3); - } - 50% { - opacity: 1; - } -} -@-webkit-keyframes zoomOut { - 0% { - opacity: 1; - -webkit-transform: scale(1); - transform: scale(1); - } - 50% { - opacity: 0; - -webkit-transform: scale(0.3); - transform: scale(0.3); - } - 100% { - opacity: 0; - } -} -@keyframes zoomOut { - 0% { - opacity: 1; - -webkit-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 50% { - opacity: 0; - -webkit-transform: scale(0.3); - -ms-transform: scale(0.3); - transform: scale(0.3); - } - 100% { - opacity: 0; - } -} -@-webkit-keyframes fadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - } - to { - opacity: 1; - -webkit-transform: none; - transform: none; - } -} -@keyframes fadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - } - to { - opacity: 1; - -webkit-transform: none; - transform: none; - } -} -.fadeInDown { - -webkit-animation-name: fadeInDown; - animation-name: fadeInDown; -} -.zoomIn { - -webkit-animation-name: zoomIn; - animation-name: zoomIn; -} -.zoomOut { - -webkit-animation-name: zoomOut; - animation-name: zoomOut; -} -.bounce { - -webkit-animation-name: bounce; - animation-name: bounce; -} -.jumpUp { - -webkit-animation-name: jumpUp; - animation-name: jumpUp; -} -.expandOpen { - animation-name: expandOpen; - -webkit-animation-name: expandOpen; -} -.fadeInScale { - animation-name: fadeInScale; - -webkit-animation-name: fadeInScale; -} -/* - Created on : Sep 19, 2014, 1:47:04 PM - Author : @arboshiki -*/ -body.lobibox-open { - overflow: hidden; -} -.lobibox { - position: fixed; - z-index: 4001; - font-family: 'Open Sans', Arial, Helvetica, sans-serif; - -webkit-box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.5); - box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.5); -} -.lobibox * { - box-sizing: border-box; - -webkit-box-sizing: border-box; -} -.lobibox .lobibox-header { - font-size: 20px; - padding: 5px 10px; - color: #eeeeee; -} -.lobibox .lobibox-header .btn-close { - float: right; - background-color: transparent; - cursor: pointer; - border: none; - outline: 0; - -webkit-transition: all 0.3s; - -o-transition: all 0.3s; - transition: all 0.3s; -} -.lobibox .lobibox-header .btn-close:hover { - text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7); -} -.lobibox .lobibox-body { - overflow: hidden; - display: table; - position: relative; - width: 100%; - padding: 15px 20px; - background-color: rgba(255, 255, 255, 0.98); - font-size: 16px; -} -.lobibox .lobibox-body .lobibox-icon-wrapper { - position: relative; - height: 100%; - display: table; - font-size: 60px; -} -.lobibox .lobibox-body .lobibox-icon-wrapper .lobibox-icon { - display: table-cell; - vertical-align: middle; -} -.lobibox .lobibox-body .lobibox-body-text-wrapper { - display: table-cell; - vertical-align: middle; - width: 100%; - padding-left: 10px; -} -.lobibox .lobibox-footer { - text-align: center; - padding: 6px; -} -.lobibox .lobibox-footer > * { - margin: 0 10px 0 0; -} -.lobibox .lobibox-footer.text-center { - text-align: center; -} -.lobibox .lobibox-footer.text-left { - text-align: left; -} -.lobibox .lobibox-footer.text-right { - text-align: right; -} -.lobibox.lobibox-confirm { - border: none; -} -.lobibox.lobibox-confirm .lobibox-header { - color: #eeeeee; - background-color: #3C2D2D; -} -.lobibox.lobibox-confirm .lobibox-body .lobibox-icon { - color: #3C2D2D; -} -.lobibox.lobibox-confirm .lobibox-footer { - background-color: #594343; -} -.lobibox.lobibox-success { - border: 1px solid #29B87E; -} -.lobibox.lobibox-success .lobibox-header { - color: #eeeeee; - background-color: #29B87E; -} -.lobibox.lobibox-success .lobibox-body .lobibox-icon { - color: #29B87E; -} -.lobibox.lobibox-success .lobibox-footer { - background-color: #40d498; -} -.lobibox.lobibox-error { - border: 1px solid #CA2121; -} -.lobibox.lobibox-error .lobibox-header { - color: #eeeeee; - background-color: #CA2121; -} -.lobibox.lobibox-error .lobibox-body .lobibox-icon { - color: #CA2121; -} -.lobibox.lobibox-error .lobibox-footer { - background-color: #e03e3e; -} -.lobibox.lobibox-info { - border: 1px solid #2E79B4; -} -.lobibox.lobibox-info .lobibox-header { - color: #eeeeee; - background-color: #2E79B4; -} -.lobibox.lobibox-info .lobibox-body .lobibox-icon { - color: #2E79B4; -} -.lobibox.lobibox-info .lobibox-footer { - background-color: #4593d0; -} -.lobibox.lobibox-warning { - border: 1px solid #CE812E; -} -.lobibox.lobibox-warning .lobibox-header { - color: #eeeeee; - background-color: #CE812E; -} -.lobibox.lobibox-warning .lobibox-body .lobibox-icon { - color: #CE812E; -} -.lobibox.lobibox-warning .lobibox-footer { - background-color: #d99a56; -} -.lobibox.lobibox-prompt { - border: none; -} -.lobibox.lobibox-prompt .lobibox-header { - color: #eeeeee; - background-color: #3c2d2d; -} -.lobibox.lobibox-prompt .lobibox-body { - padding: 20px; -} -.lobibox.lobibox-prompt .lobibox-body .lobibox-input { - min-height: 38px; - border: 1px solid #21cb91; - width: 100%; - padding: 5px; - font-size: 18px; - outline: 0; -} -.lobibox.lobibox-prompt .lobibox-body .lobibox-input:focus { - background-color: #EEE; -} -.lobibox.lobibox-prompt .lobibox-body .lobibox-input.invalid { - border-color: #DC2B2A; -} -.lobibox.lobibox-prompt .lobibox-body .lobibox-input-error-message { - margin-top: 5px; - margin-bottom: 0; - font-size: 13px; - color: #DC2B2A; -} -.lobibox.lobibox-prompt .lobibox-footer { - background-color: #594343; -} -.lobibox.lobibox-progress .lobibox-header { - background-color: #2F5D6D; -} -.lobibox.lobibox-progress .lobibox-body { - padding: 15px; - font-size: 16px; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-bar-wrapper { - position: relative; - height: 20px; - border: 1px solid #c3c3c3; - border-radius: 10px; - background-color: #d5d5d5; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-bar-wrapper .lobibox-progress-bar { - width: 0; - border-radius: 10px; - background-color: #468ba2; - height: 100%; - text-align: center; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-bar-wrapper .lobibox-progress-text { - position: absolute; - text-align: center; - top: 0; - width: 100%; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-outer { - margin-bottom: 0; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-outer .progress-bar { - transition: none; -} -.lobibox.lobibox-progress .lobibox-body .lobibox-progress-outer [data-role="progress-text"] { - font-weight: bold; - color: rgba(0, 0, 0, 0.7); -} -.lobibox.lobibox-window { - border: 3px solid #225EB8; - border-radius: 6px; -} -.lobibox.lobibox-window .lobibox-header { - background-color: #225EB8; - color: #eeeeee; - font-size: 18px; -} -.lobibox.lobibox-window .lobibox-body { - overflow: auto; - display: block; - font-size: 14px; - padding: 15px; - background-color: #f5f8fd; -} -.lobibox.lobibox-window .lobibox-footer { - background-color: #8ab0e9; -} -.lobibox.lobibox-window :last-child { - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.lobibox.draggable .lobibox-header { - cursor: move; -} -.lobibox .lobibox-btn { - display: inline-block; - padding: 8px 14px; - font-size: 14px; - cursor: pointer; - border: 1px solid transparent; - border-radius: 2px; - line-height: initial; -} -.lobibox .lobibox-btn.lobibox-btn-cancel { - color: #FFF; - background-color: #CA2121; - border-color: #CA2121; -} -.lobibox .lobibox-btn.lobibox-btn-cancel:hover, -.lobibox .lobibox-btn.lobibox-btn-cancel:focus, -.lobibox .lobibox-btn.lobibox-btn-cancel.focus, -.lobibox .lobibox-btn.lobibox-btn-cancel:active, -.lobibox .lobibox-btn.lobibox-btn-cancel.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-cancel { - color: #FFF; - background-color: #9e1a1a; - border-color: #951818; -} -.lobibox .lobibox-btn.lobibox-btn-cancel:active, -.lobibox .lobibox-btn.lobibox-btn-cancel.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-cancel { - background-image: none; -} -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled], -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel, -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled:hover, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled]:hover, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel:hover, -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled:focus, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled]:focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel:focus, -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled.focus, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled].focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel.focus, -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled:active, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled]:active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel:active, -.lobibox .lobibox-btn.lobibox-btn-cancel.disabled.active, -.lobibox .lobibox-btn.lobibox-btn-cancel[disabled].active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-cancel.active { - background-color: #CA2121; - border-color: #CA2121; -} -.lobibox .lobibox-btn.lobibox-btn-cancel .badge { - color: #CA2121; - background-color: #FFF; -} -.lobibox .lobibox-btn.lobibox-btn-yes { - color: #FFF; - background-color: #29B87E; - border-color: #29B87E; -} -.lobibox .lobibox-btn.lobibox-btn-yes:hover, -.lobibox .lobibox-btn.lobibox-btn-yes:focus, -.lobibox .lobibox-btn.lobibox-btn-yes.focus, -.lobibox .lobibox-btn.lobibox-btn-yes:active, -.lobibox .lobibox-btn.lobibox-btn-yes.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-yes { - color: #FFF; - background-color: #208e61; - border-color: #1e865c; -} -.lobibox .lobibox-btn.lobibox-btn-yes:active, -.lobibox .lobibox-btn.lobibox-btn-yes.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-yes { - background-image: none; -} -.lobibox .lobibox-btn.lobibox-btn-yes.disabled, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled], -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes, -.lobibox .lobibox-btn.lobibox-btn-yes.disabled:hover, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled]:hover, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes:hover, -.lobibox .lobibox-btn.lobibox-btn-yes.disabled:focus, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled]:focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes:focus, -.lobibox .lobibox-btn.lobibox-btn-yes.disabled.focus, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled].focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes.focus, -.lobibox .lobibox-btn.lobibox-btn-yes.disabled:active, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled]:active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes:active, -.lobibox .lobibox-btn.lobibox-btn-yes.disabled.active, -.lobibox .lobibox-btn.lobibox-btn-yes[disabled].active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-yes.active { - background-color: #29B87E; - border-color: #29B87E; -} -.lobibox .lobibox-btn.lobibox-btn-yes .badge { - color: #29B87E; - background-color: #FFF; -} -.lobibox .lobibox-btn.lobibox-btn-no { - color: #FFF; - background-color: #0760B3; - border-color: #0760B3; -} -.lobibox .lobibox-btn.lobibox-btn-no:hover, -.lobibox .lobibox-btn.lobibox-btn-no:focus, -.lobibox .lobibox-btn.lobibox-btn-no.focus, -.lobibox .lobibox-btn.lobibox-btn-no:active, -.lobibox .lobibox-btn.lobibox-btn-no.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-no { - color: #FFF; - background-color: #054682; - border-color: #054078; -} -.lobibox .lobibox-btn.lobibox-btn-no:active, -.lobibox .lobibox-btn.lobibox-btn-no.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-no { - background-image: none; -} -.lobibox .lobibox-btn.lobibox-btn-no.disabled, -.lobibox .lobibox-btn.lobibox-btn-no[disabled], -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no, -.lobibox .lobibox-btn.lobibox-btn-no.disabled:hover, -.lobibox .lobibox-btn.lobibox-btn-no[disabled]:hover, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no:hover, -.lobibox .lobibox-btn.lobibox-btn-no.disabled:focus, -.lobibox .lobibox-btn.lobibox-btn-no[disabled]:focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no:focus, -.lobibox .lobibox-btn.lobibox-btn-no.disabled.focus, -.lobibox .lobibox-btn.lobibox-btn-no[disabled].focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no.focus, -.lobibox .lobibox-btn.lobibox-btn-no.disabled:active, -.lobibox .lobibox-btn.lobibox-btn-no[disabled]:active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no:active, -.lobibox .lobibox-btn.lobibox-btn-no.disabled.active, -.lobibox .lobibox-btn.lobibox-btn-no[disabled].active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-no.active { - background-color: #0760B3; - border-color: #0760B3; -} -.lobibox .lobibox-btn.lobibox-btn-no .badge { - color: #0760B3; - background-color: #FFF; -} -.lobibox .lobibox-btn.lobibox-btn-ok { - color: #FFF; - background-color: #0760B3; - border-color: #0760B3; -} -.lobibox .lobibox-btn.lobibox-btn-ok:hover, -.lobibox .lobibox-btn.lobibox-btn-ok:focus, -.lobibox .lobibox-btn.lobibox-btn-ok.focus, -.lobibox .lobibox-btn.lobibox-btn-ok:active, -.lobibox .lobibox-btn.lobibox-btn-ok.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-ok { - color: #FFF; - background-color: #054682; - border-color: #054078; -} -.lobibox .lobibox-btn.lobibox-btn-ok:active, -.lobibox .lobibox-btn.lobibox-btn-ok.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-ok { - background-image: none; -} -.lobibox .lobibox-btn.lobibox-btn-ok.disabled, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled], -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok, -.lobibox .lobibox-btn.lobibox-btn-ok.disabled:hover, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled]:hover, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok:hover, -.lobibox .lobibox-btn.lobibox-btn-ok.disabled:focus, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled]:focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok:focus, -.lobibox .lobibox-btn.lobibox-btn-ok.disabled.focus, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled].focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok.focus, -.lobibox .lobibox-btn.lobibox-btn-ok.disabled:active, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled]:active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok:active, -.lobibox .lobibox-btn.lobibox-btn-ok.disabled.active, -.lobibox .lobibox-btn.lobibox-btn-ok[disabled].active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-ok.active { - background-color: #0760B3; - border-color: #0760B3; -} -.lobibox .lobibox-btn.lobibox-btn-ok .badge { - color: #0760B3; - background-color: #FFF; -} -.lobibox .lobibox-btn.lobibox-btn-default { - color: #000; - background-color: #e2e2e2; - border-color: #dadada; -} -.lobibox .lobibox-btn.lobibox-btn-default:hover, -.lobibox .lobibox-btn.lobibox-btn-default:focus, -.lobibox .lobibox-btn.lobibox-btn-default.focus, -.lobibox .lobibox-btn.lobibox-btn-default:active, -.lobibox .lobibox-btn.lobibox-btn-default.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-default { - color: #000; - background-color: #c9c9c9; - border-color: #bcbcbc; -} -.lobibox .lobibox-btn.lobibox-btn-default:active, -.lobibox .lobibox-btn.lobibox-btn-default.active, -.open > .dropdown-toggle.lobibox .lobibox-btn.lobibox-btn-default { - background-image: none; -} -.lobibox .lobibox-btn.lobibox-btn-default.disabled, -.lobibox .lobibox-btn.lobibox-btn-default[disabled], -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default, -.lobibox .lobibox-btn.lobibox-btn-default.disabled:hover, -.lobibox .lobibox-btn.lobibox-btn-default[disabled]:hover, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default:hover, -.lobibox .lobibox-btn.lobibox-btn-default.disabled:focus, -.lobibox .lobibox-btn.lobibox-btn-default[disabled]:focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default:focus, -.lobibox .lobibox-btn.lobibox-btn-default.disabled.focus, -.lobibox .lobibox-btn.lobibox-btn-default[disabled].focus, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default.focus, -.lobibox .lobibox-btn.lobibox-btn-default.disabled:active, -.lobibox .lobibox-btn.lobibox-btn-default[disabled]:active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default:active, -.lobibox .lobibox-btn.lobibox-btn-default.disabled.active, -.lobibox .lobibox-btn.lobibox-btn-default[disabled].active, -fieldset[disabled] .lobibox .lobibox-btn.lobibox-btn-default.active { - background-color: #e2e2e2; - border-color: #dadada; -} -.lobibox .lobibox-btn.lobibox-btn-default .badge { - color: #e2e2e2; - background-color: #000; -} -.lobibox.lobibox-hidden { - display: none; -} -.lobibox-backdrop { - position: fixed; - z-index: 4000; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); -} -/* - Created on : Sep 19, 2014, 2:01:43 PM - Author : @arboshiki -*/ -.lobibox-notify-wrapper { - z-index: 5000; - position: fixed; -} -.lobibox-notify-wrapper.top { - top: 0px; -} -.lobibox-notify-wrapper.bottom { - bottom: 0px; -} -.lobibox-notify-wrapper.left { - left: 0px; - margin-right: 0px; -} -.lobibox-notify-wrapper.right { - right: 0px; - margin-left: 0px; -} -.lobibox-notify-wrapper.right .lobibox-notify { - margin-left: auto; -} -.lobibox-notify-wrapper.center { - left: 50%; -} -.lobibox-notify-wrapper-large { - z-index: 5000; - position: fixed; -} -.lobibox-notify-wrapper-large.top { - top: 0px; -} -.lobibox-notify-wrapper-large.bottom { - bottom: 0px; -} -.lobibox-notify-wrapper-large.left { - left: 0px; -} -.lobibox-notify-wrapper-large.left .lb-notify-tabs > li { - float: left; - margin-left: 0; - margin-right: 2px; -} -.lobibox-notify-wrapper-large.right { - right: 0px; -} -.lobibox-notify-wrapper-large .lb-notify-tabs { - list-style: none; - padding: 0; - margin: 0 0 -5px 0; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li { - float: right; - margin-left: 2px; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a { - text-align: center; - display: table; - text-decoration: none; - font-size: 18px; - height: 32px; - color: #FFF; - width: 28px; - opacity: 0.6; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a:hover, -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a:active, -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a:focus, -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a:hover:active { - color: #FFF; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li > a .tab-control-icon { - display: table-cell; - vertical-align: middle; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-default > a { - background-color: rgba(28, 28, 28, 0.9); - border-color: #141414; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-default > a:hover { - background-color: #1c1c1c; - border-color: #0f0f0f; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-error > a { - background-color: rgba(202, 33, 33, 0.9); - border-color: #bd1f1f; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-error > a:hover { - background-color: #CA2121; - border-color: #b41d1d; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-success > a { - background-color: rgba(41, 184, 126, 0.9); - border-color: #26ab75; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-success > a:hover { - background-color: #29B87E; - border-color: #24a370; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-warning > a { - background-color: rgba(206, 129, 46, 0.9); - border-color: #c1792b; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-warning > a:hover { - background-color: #CE812E; - border-color: #b97429; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-info > a { - background-color: rgba(46, 121, 180, 0.9); - border-color: #2b71a8; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.lobibox-notify-info > a:hover { - background-color: #2E79B4; - border-color: #296ba0; -} -.lobibox-notify-wrapper-large .lb-notify-tabs > li.active > a { - opacity: 1; -} -.lobibox-notify-wrapper-large .lb-notify-tabs:after { - content: ""; - display: block; - clear: both; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper { - background-color: transparent; - padding: 0; - border: none; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lb-tab-pane { - display: none; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lb-tab-pane.active { - display: block; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lobibox-notify { - min-height: 150px; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lobibox-notify .lobibox-notify-icon-wrapper { - width: 100px; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lobibox-notify .lobibox-notify-icon > div .icon-el { - font-size: 78px; -} -.lobibox-notify-wrapper-large .lb-notify-wrapper .lobibox-notify .lobibox-notify-body { - margin: 13px 20px; - margin-left: 130px; -} -.lobibox-notify { - position: relative; - min-height: 85px; - font-family: 'Open Sans', Arial, Helvetica, sans-serif; - font-size: 14px; - margin: 7px 0; - border-radius: 0; - border: 1px solid transparent; - - -webkit-transition: all 0.2s; - -o-transition: all 0.2s; - transition: all 0.2s; -} -.lobibox-notify .lobibox-notify-icon-wrapper { - position: absolute; - left: 15px; - width: 60px; - height: 100%; -} -.lobibox-notify .lobibox-notify-icon { - display: table; - width: 100%; - height: 100%; -} -.lobibox-notify .lobibox-notify-icon > div { - display: table-cell; - vertical-align: middle; -} -.lobibox-notify .lobibox-notify-icon > div > img { - width: 100%; - max-width: 100%; - margin-top: 3px; - border-radius: 4px; -} -.lobibox-notify .lobibox-notify-icon > div .icon-el { - text-align: center; - font-size: 3em; - padding-top:10px; -} -.lobibox-notify .lobibox-notify-body { - margin: 10px 20px; - margin-left: 90px; -} -.lobibox-notify .lobibox-notify-title { - font-size: 20px; -} -.lobibox-notify .lobibox-notify-msg { - overflow: hidden; -} -.lobibox-notify .lobibox-close { - position: absolute; - text-align: center; - border-radius: 50%; - right: 10px; - top: 10px; - font-size: 20px; - line-height: 19px; - width: 19px; - height: 19px; - -webkit-transition: all 0.2s; - -o-transition: all 0.2s; - transition: all 0.2s; -} -.lobibox-notify .lobibox-close:hover { - background-color: rgba(0, 0, 0, 0.5); - font-weight: bold; -} -.lobibox-notify .lobibox-delay-indicator { - position: absolute; - left: 0; - right: 0; - bottom: 0; - height: 3px; -} -.lobibox-notify .lobibox-delay-indicator > div { - position: relative; - height: 100%; - width: 0; - background-color: #e8e8e8; -} -.lobibox-notify.lobibox-notify-default { - border-color: #0f0f0f; - background-color: #1c1c1c; - color: #FFF; -} -.lobibox-notify.lobibox-notify-default:hover { - background-color: #1c1c1c; - border-color: #FFF; -} -.lobibox-notify.lobibox-notify-default .lobibox-close:hover { - background-color: #4f4f4f; -} -.lobibox-notify.lobibox-notify-error { - border-color: #b41d1d; - background-color: #CA2121; - color: #FFF; -} -.lobibox-notify.lobibox-notify-error:hover { - background-color: #CA2121; - border-color: #FFF; -} -.lobibox-notify.lobibox-notify-success { - border-color: #24a370; - background-color: #29B87E; - color: #FFF; -} -.lobibox-notify.lobibox-notify-success:hover { - background-color: #29B87E; - border-color: #FFF; -} -.lobibox-notify.lobibox-notify-warning { - border-color: #b97429; - background-color: #CE812E; - color: #FFF; -} -.lobibox-notify.lobibox-notify-warning:hover { - background-color: #CE812E; - border-color: #FFF; -} -.lobibox-notify.lobibox-notify-info { - border-color: #296ba0; - background-color: #2E79B4; - color: #FFF; -} -.lobibox-notify.lobibox-notify-info:hover { - background-color: #2E79B4; - border-color: #FFF; -} -.lobibox-notify.rounded { - border-radius: 30px; -} -.lobibox-notify:hover { - cursor: pointer; - -} -.lobibox-notify.notify-mini { - min-height: 36px; -} -.lobibox-notify.notify-mini .lobibox-notify-title { - margin-top: -5px; - font-size: 20px; - line-height: 22px; -} -.lobibox-notify.notify-mini .lobibox-notify-msg { - line-height: 16px; -} -.lobibox-notify.notify-mini .lobibox-notify-icon-wrapper { - left: 12px; - width: 32px; -} -.lobibox-notify.notify-mini .lobibox-notify-icon > div .icon-el { - font-size: 32px; -} -.lobibox-notify.notify-mini .lobibox-notify-body { - margin: 15px 30px 15px 56px; -} -.lobibox-notify.without-icon .lobibox-notify-body { - margin-left: 20px; -} diff --git a/FusionIIIT/notification_channels/static/notification_channels/lobibox.js b/FusionIIIT/notification_channels/static/notification_channels/lobibox.js deleted file mode 100644 index b4dd9644e..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/lobibox.js +++ /dev/null @@ -1,1530 +0,0 @@ -//Author : @arboshiki -//create lobibox object -var Lobibox = Lobibox || {}; -(function () { - - Lobibox.counter = 0; -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ - - //User can set default properties for prompt in the following way - //Lobibox.prompt.DEFAULT_OPTIONS = object; - Lobibox.prompt = function (type, options) { - return new LobiboxPrompt(type, options); - }; - //User can set default properties for confirm in the following way - //Lobibox.confirm.DEFAULT_OPTIONS = object; - Lobibox.confirm = function (options) { - return new LobiboxConfirm(options); - }; - //User can set default properties for progress in the following way - //Lobibox.progress.DEFAULT_OPTIONS = object; - Lobibox.progress = function (options) { - return new LobiboxProgress(options); - }; - //Create empty objects in order user to be able to set default options in the following way - //Lobibox.error.DEFAULT_OPTIONS = object; - //Lobibox.success.DEFAULT_OPTIONS = object; - //Lobibox.warning.DEFAULT_OPTIONS = object; - //Lobibox.info.DEFAULT_OPTIONS = object; - - Lobibox.error = {}; - Lobibox.success = {}; - Lobibox.warning = {}; - Lobibox.info = {}; - - //User can set default properties for alert in the following way - //Lobibox.alert.DEFAULT_OPTIONS = object; - Lobibox.alert = function (type, options) { - if (["success", "error", "warning", "info"].indexOf(type) > -1) { - return new LobiboxAlert(type, options); - } - }; - //User can set default properties for window in the following way - //Lobibox.window.DEFAULT_OPTIONS = object; - Lobibox.window = function (options) { - return new LobiboxWindow('window', options); - }; - - - /** - * Base prototype for all messageboxes and window - */ - var LobiboxBase = { - $type: null, - $el: null, - $options: null, - debug: function () { - if (this.$options.debug) { - window.console.debug.apply(window.console, arguments); - } - }, - _processInput: function (options) { - if ($.isArray(options.buttons)) { - var btns = {}; - for (var i = 0; i < options.buttons.length; i++) { - btns[options.buttons[i]] = Lobibox.base.OPTIONS.buttons[options.buttons[i]]; - } - options.buttons = btns; - } - options.customBtnClass = options.customBtnClass ? options.customBtnClass : Lobibox.base.DEFAULTS.customBtnClass; - for (var i in options.buttons) { - if (options.buttons.hasOwnProperty(i)) { - var btn = options.buttons[i]; - btn = $.extend({}, Lobibox.base.OPTIONS.buttons[i], btn); - if (!btn['class']) { - btn['class'] = options.customBtnClass; - } - options.buttons[i] = btn; - } - } - options = $.extend({}, Lobibox.base.DEFAULTS, options); - if (options.showClass === undefined) { - options.showClass = Lobibox.base.OPTIONS.showClass; - } - if (options.hideClass === undefined) { - options.hideClass = Lobibox.base.OPTIONS.hideClass; - } - if (options.baseClass === undefined) { - options.baseClass = Lobibox.base.OPTIONS.baseClass; - } - if (options.delayToRemove === undefined) { - options.delayToRemove = Lobibox.base.OPTIONS.delayToRemove; - } - if (!options.iconClass) { - options.iconClass = Lobibox.base.OPTIONS.icons[options.iconSource][this.$type]; - } - return options; - }, - _init: function () { - var me = this; - - me._createMarkup(); - me.setTitle(me.$options.title); - if (me.$options.draggable && !me._isMobileScreen()) { - me.$el.addClass('draggable'); - me._enableDrag(); - } - if (me.$options.closeButton) { - me._addCloseButton(); - } - if (me.$options.closeOnEsc) { - $(document).on('keyup.lobibox', function (ev) { - if (ev.which === 27) { - me.destroy(); - } - }); - } - if (me.$options.baseClass) { - me.$el.addClass(me.$options.baseClass); - } - if (me.$options.showClass) { - me.$el.removeClass(me.$options.hideClass); - me.$el.addClass(me.$options.showClass); - } - me.$el.data('lobibox', me); - }, - - /** - * Calculate top, left position based on string keyword - * - * @param {string} position "'top', 'center', 'bottom'" - * @returns {{left: number, top: number}} - * @private - */ - _calculatePosition: function (position) { - var me = this; - var top; - if (position === 'top') { - top = 30; - } else if (position === 'bottom') { - top = $(window).outerHeight() - me.$el.outerHeight() - 30; - } else { - top = ($(window).outerHeight() - me.$el.outerHeight()) / 2; - } - var left = ($(window).outerWidth() - me.$el.outerWidth()) / 2; - return { - left: left, - top: top - }; - }, - - _createButton: function (type, op) { - var me = this; - var btn = $('') - .addClass(op['class']) - .attr('data-type', type) - .html(op.text); - if (me.$options.callback && typeof me.$options.callback === 'function') { - btn.on('click.lobibox', function (ev) { - var bt = $(this); - me._onButtonClick(me.$options.buttons[type], type); - me.$options.callback(me, bt.data('type'), ev); - }); - } - btn.click(function () { - me._onButtonClick(me.$options.buttons[type], type); - }); - return btn; - }, - - _onButtonClick: function (buttonOptions, type) { - var me = this; - - if ((type === 'ok' && me.$type === 'prompt' && me.isValid() || me.$type !== 'prompt' || type !== 'ok') - && buttonOptions && buttonOptions.closeOnClick) { - me.destroy(); - } - }, - - _generateButtons: function () { - var me = this; - var btns = []; - for (var i in me.$options.buttons) { - if (me.$options.buttons.hasOwnProperty(i)) { - var op = me.$options.buttons[i]; - var btn = me._createButton(i, op); - btns.push(btn); - } - } - return btns; - }, - _createMarkup: function () { - var me = this; - var lobibox = $('
'); - lobibox.attr('data-is-modal', me.$options.modal); - var header = $('
') - .append('') - ; - var body = $('
'); - lobibox.append(header); - lobibox.append(body); - if (me.$options.buttons && !$.isEmptyObject(me.$options.buttons)) { - var footer = $(''); - footer.append(me._generateButtons()); - lobibox.append(footer); - if (Lobibox.base.OPTIONS.buttonsAlign.indexOf(me.$options.buttonsAlign) > -1) { - footer.addClass('text-' + me.$options.buttonsAlign); - } - } - me.$el = lobibox - .addClass(Lobibox.base.OPTIONS.modalClasses[me.$type]) - ; - }, - _setSize: function () { - var me = this; - me.setWidth(me.$options.width); - if (me.$options.height === 'auto') { - me.setHeight(me.$el.outerHeight()); - } else { - me.setHeight(me.$options.height); - } - }, - _calculateBodyHeight: function (height) { - var me = this; - var headerHeight = me.$el.find('.lobibox-header').outerHeight(); - var footerHeight = me.$el.find('.lobibox-footer').outerHeight(); - return height - (headerHeight ? headerHeight : 0) - (footerHeight ? footerHeight : 0); - - }, - - /** - * Add backdrop in case if backdrop does not exist - * - * @private - */ - _addBackdrop: function () { - if ($('.lobibox-backdrop').length === 0) { - $('body').append('
'); - } - }, - - _triggerEvent: function (type) { - var me = this; - if (me.$options[type] && typeof me.$options[type] === 'function') { - me.$options[type](me); - } - }, - - _calculateWidth: function (width) { - var me = this; - width = Math.min(Math.max(width, me.$options.width), $(window).outerWidth()); - if (width === $(window).outerWidth()) { - width -= 2 * me.$options.horizontalOffset; - } - return width; - }, - - _calculateHeight: function (height) { - var me = this; - console.log(me.$options.height); - height = Math.min(Math.max(height, me.$options.height), $(window).outerHeight()); - if (height === $(window).outerHeight()) { - height -= 2 * me.$options.verticalOffset; - } - return height; - }, - - _addCloseButton: function () { - var me = this; - var closeBtn = $('×'); - me.$el.find('.lobibox-header').append(closeBtn); - closeBtn.on('mousedown', function (ev) { - ev.stopPropagation(); - }); - closeBtn.on('click.lobibox', function () { - me.destroy(); - }); - }, - _position: function () { - var me = this; - - me._setSize(); - var pos = me._calculatePosition(); - me.setPosition(pos.left, pos.top); - }, - _isMobileScreen: function () { - return $(window).outerWidth() < 768; - }, - _enableDrag: function () { - var el = this.$el, - heading = el.find('.lobibox-header'); - - heading.on('mousedown.lobibox', function (ev) { - el.attr('offset-left', ev.offsetX); - el.attr('offset-top', ev.offsetY); - el.attr('allow-drag', 'true'); - }); - $(document).on('mouseup.lobibox', function () { - el.attr('allow-drag', 'false'); - }); - $(document).on('mousemove.lobibox', function (ev) { - if (el.attr('allow-drag') === 'true') { - var left = ev.clientX - parseInt(el.attr('offset-left'), 10) - parseInt(el.css('border-left-width'), 10); - var top = ev.clientY - parseInt(el.attr('offset-top'), 10) - parseInt(el.css('border-top-width'), 10); - el.css({ - left: left, - top: top - }); - } - }); - }, - - /** - * Set the message of messagebox - * - * @param {string} msg "new message of messagebox" - * @returns {LobiboxBase} - * @private - */ - _setContent: function (msg) { - var me = this; - me.$el.find('.lobibox-body').html(msg); - return me; - }, - - _beforeShow: function () { - var me = this; - me._triggerEvent('onShow'); - }, - - _afterShow: function () { - var me = this; - Lobibox.counter++; - me.$el.attr('data-nth', Lobibox.counter); - if (!me.$options.draggable){ - $(window).on('resize.lobibox-'+me.$el.attr('data-nth'), function(){ - me.refreshWidth(); - me.refreshHeight(); - me.$el.css('left', '50%').css('margin-left', '-'+(me.$el.width()/2)+'px'); - me.$el.css('top', '50%').css('margin-top', '-'+(me.$el.height()/2)+'px'); - }); - } - - me._triggerEvent('shown'); - }, - - _beforeClose: function () { - var me = this; - me._triggerEvent('beforeClose'); - }, - - _afterClose: function () { - var me = this; - if (!me.$options.draggable){ - $(window).off('resize.lobibox-'+me.$el.attr('data-nth')); - } - me._triggerEvent('closed'); - }, -//------------------------------------------------------------------------------ -//--------------------------PUBLIC METHODS-------------------------------------- -//------------------------------------------------------------------------------ - - /** - * Hide the messagebox - * - * @returns {LobiboxBase} - */ - hide: function () { - var me = this; - if (me.$options.hideClass) { - me.$el.removeClass(me.$options.showClass); - me.$el.addClass(me.$options.hideClass); - setTimeout(function () { - callback(); - }, me.$options.delayToRemove); - } else { - callback(); - } - function callback() { - me.$el.addClass('lobibox-hidden'); - if ($('.lobibox[data-is-modal=true]:not(.lobibox-hidden)').length === 0) { - $('.lobibox-backdrop').remove(); - $('body').removeClass(Lobibox.base.OPTIONS.bodyClass); - } - } - - return this; - }, - - /** - * Removes the messagebox from document - * - * @returns {LobiboxBase} - */ - destroy: function () { - var me = this; - me._beforeClose(); - if (me.$options.hideClass) { - me.$el.removeClass(me.$options.showClass).addClass(me.$options.hideClass); - setTimeout(function () { - callback(); - }, me.$options.delayToRemove); - } else { - callback(); - } - function callback() { - me.$el.remove(); - if ($('.lobibox[data-is-modal=true]').length === 0) { - $('.lobibox-backdrop').remove(); - $('body').removeClass(Lobibox.base.OPTIONS.bodyClass); - } - me._afterClose(); - } - - return this; - }, - - /** - * Set the width of messagebox - * - * @param {number} width "new width of messagebox" - * @returns {LobiboxBase} - */ - setWidth: function (width) { - var me = this; - me.$el.css('width', me._calculateWidth(width)); - return me; - }, - - refreshWidth: function(){ - this.setWidth(this.$el.width()); - }, - - refreshHeight: function(){ - this.setHeight(this.$el.height()); - }, - - /** - * Set the height of messagebox - * - * @param {number} height "new height of messagebox" - * @returns {LobiboxBase} - */ - setHeight: function (height) { - var me = this; - me.$el.css('height', me._calculateHeight(height)) - .find('.lobibox-body') - .css('height', me._calculateBodyHeight(me.$el.innerHeight())); - return me; - }, - - /** - * Set the width and height of messagebox - * - * @param {number} width "new width of messagebox" - * @param {number} height "new height of messagebox" - * @returns {LobiboxBase} - */ - setSize: function (width, height) { - var me = this; - me.setWidth(width); - me.setHeight(height); - return me; - }, - - /** - * Set position of messagebox - * - * @param {number|String} left "left coordinate of messsagebox or string representaing position. Available: ('top', 'center', 'bottom')" - * @param {number} top - * @returns {LobiboxBase} - */ - setPosition: function (left, top) { - var pos; - if (typeof left === 'number' && typeof top === 'number') { - pos = { - left: left, - top: top - }; - } else if (typeof left === 'string') { - pos = this._calculatePosition(left); - } - this.$el.css(pos); - return this; - }, - /** - * Set the title of messagebox - * - * @param {string} title "new title of messagebox" - * @returns {LobiboxBase} - */ - setTitle: function (title) { - return this.$el.find('.lobibox-title').html(title); - }, - - /** - * Get the title of messagebox - * - * @returns {string} - */ - getTitle: function () { - return this.$el.find('.lobibox-title').html(); - }, - - /** - * Show messagebox - * - * @returns {LobiboxBase} - */ - show: function () { - var me = this, - $body = $('body'); - - me._beforeShow(); - - me.$el.removeClass('lobibox-hidden'); - $body.append(me.$el); - if (me.$options.buttons) { - var buttons = me.$el.find('.lobibox-footer').children(); - buttons[0].focus(); - } - if (me.$options.modal) { - $body.addClass(Lobibox.base.OPTIONS.bodyClass); - me._addBackdrop(); - } - if (me.$options.delay !== false) { - setTimeout(function () { - me.destroy(); - }, me.$options.delay); - } - me._afterShow(); - return me; - } - }; - //User can set default options by this variable - Lobibox.base = {}; - Lobibox.base.OPTIONS = { - bodyClass: 'lobibox-open', - - modalClasses: { - 'error': 'lobibox-error', - 'success': 'lobibox-success', - 'info': 'lobibox-info', - 'warning': 'lobibox-warning', - 'confirm': 'lobibox-confirm', - 'progress': 'lobibox-progress', - 'prompt': 'lobibox-prompt', - 'default': 'lobibox-default', - 'window': 'lobibox-window' - }, - buttonsAlign: ['left', 'center', 'right'], - buttons: { - ok: { - 'class': 'lobibox-btn lobibox-btn-default', - text: 'OK', - closeOnClick: true - }, - cancel: { - 'class': 'lobibox-btn lobibox-btn-cancel', - text: 'Cancel', - closeOnClick: true - }, - yes: { - 'class': 'lobibox-btn lobibox-btn-yes', - text: 'Yes', - closeOnClick: true - }, - no: { - 'class': 'lobibox-btn lobibox-btn-no', - text: 'No', - closeOnClick: true - } - }, - icons: { - bootstrap: { - confirm: 'glyphicon glyphicon-question-sign', - success: 'glyphicon glyphicon-ok-sign', - error: 'glyphicon glyphicon-remove-sign', - warning: 'glyphicon glyphicon-exclamation-sign', - info: 'glyphicon glyphicon-info-sign' - }, - fontAwesome: { - confirm: 'fa fa-question-circle', - success: 'fa fa-check-circle', - error: 'fa fa-times-circle', - warning: 'fa fa-exclamation-circle', - info: 'fa fa-info-circle' - } - } - }; - Lobibox.base.DEFAULTS = { - horizontalOffset: 5, //If the messagebox is larger (in width) than window's width. The messagebox's width is reduced to window width - 2 * horizontalOffset - verticalOffset: 5, //If the messagebox is larger (in height) than window's height. The messagebox's height is reduced to window height - 2 * verticalOffset - width: 600, - height: 'auto', // Height is automatically calculated by width - closeButton: true, // Show close button or not - draggable: false, // Make messagebox draggable - customBtnClass: 'lobibox-btn lobibox-btn-default', // Class for custom buttons - modal: true, - debug: false, - buttonsAlign: 'center', // Position where buttons should be aligned - closeOnEsc: true, // Close messagebox on Esc press - delayToRemove: 200, // Time after which lobibox will be removed after remove call. (This option is for hide animation to finish) - delay: false, // Time to remove lobibox after shown - baseClass: 'animated-super-fast', // Base class to add all messageboxes - showClass: 'zoomIn', // Show animation class - hideClass: 'zoomOut', // Hide animation class - iconSource: 'bootstrap', // "bootstrap" or "fontAwesome" the library which will be used for icons - - //events - //When messagebox show is called but before it is actually shown - onShow: null, - //After messagebox is shown - shown: null, - //When messagebox remove method is called but before it is actually hidden - beforeClose: null, - //After messagebox is hidden - closed: null - }; -//------------------------------------------------------------------------------ -//-------------------------LobiboxPrompt---------------------------------------- -//------------------------------------------------------------------------------ - function LobiboxPrompt(type, options) { - this.$input = null; - this.$type = 'prompt'; - this.$promptType = type; - - options = $.extend({}, Lobibox.prompt.DEFAULT_OPTIONS, options); - - this.$options = this._processInput(options); - - this._init(); - this.debug(this); - } - - LobiboxPrompt.prototype = $.extend({}, LobiboxBase, { - constructor: LobiboxPrompt, - - _processInput: function (options) { - var me = this; - - var mergedOptions = LobiboxBase._processInput.call(me, options); - mergedOptions.buttons = { - ok: Lobibox.base.OPTIONS.buttons.ok, - cancel: Lobibox.base.OPTIONS.buttons.cancel - }; - options = $.extend({}, mergedOptions, LobiboxPrompt.DEFAULT_OPTIONS, options); - return options; - }, - - _init: function () { - var me = this; - LobiboxBase._init.call(me); - me.show(); - }, - - _afterShow: function () { - var me = this; - me._setContent(me._createInput())._position(); - me.$input.focus(); - LobiboxBase._afterShow.call(me); - }, - - _createInput: function () { - var me = this, - label; - if (me.$options.multiline) { - me.$input = $('').attr('rows', me.$options.lines); - } else { - me.$input = $(''); - } - me.$input.addClass('lobibox-input').attr(me.$options.attrs); - if (me.$options.value) { - me.setValue(me.$options.value); - } - if (me.$options.label) { - label = $(''); - } - return $('
').append(label, me.$input); - }, - - /** - * Set value of input - * - * @param {string} val "value of input" - * @returns {LobiboxPrompt} - */ - setValue: function (val) { - this.$input.val(val); - return this; - }, - - /** - * Get value of input - * - * @returns {String} - */ - getValue: function () { - return this.$input.val(); - }, - - isValid: function () { - var me = this, - $error = me.$el.find('.lobibox-input-error-message'); - - if (me.$options.required && !me.getValue()){ - me.$input.addClass('invalid'); - if ($error.length === 0){ - me.$el.find('.lobibox-body').append('

'+me.$options.errorMessage+'

'); - me._position(); - me.$input.focus(); - } - return false; - } - me.$input.removeClass('invalid'); - $error.remove(); - me._position(); - me.$input.focus(); - - return true; - } - }); - - LobiboxPrompt.DEFAULT_OPTIONS = { - width: 400, - attrs: {}, // Object of any valid attribute of input field - value: '', // Value which is given to textfield when messagebox is created - multiline: false, // Set this true for multiline prompt - lines: 3, // This works only for multiline prompt. Number of lines - type: 'text', // Prompt type. Available types (text|number|color) - label: '', // Set some text which will be shown exactly on top of textfield - required: true, - errorMessage: 'The field is required' - }; -//------------------------------------------------------------------------------ -//-------------------------LobiboxConfirm--------------------------------------- -//------------------------------------------------------------------------------ - function LobiboxConfirm(options) { - this.$type = 'confirm'; - -// options = $.extend({}, Lobibox.confirm.DEFAULT_OPTIONS, options); - - this.$options = this._processInput(options); - this._init(); - this.debug(this); - } - - LobiboxConfirm.prototype = $.extend({}, LobiboxBase, { - constructor: LobiboxConfirm, - - _processInput: function (options) { - var me = this; - - var mergedOptions = LobiboxBase._processInput.call(me, options); - mergedOptions.buttons = { - yes: Lobibox.base.OPTIONS.buttons.yes, - no: Lobibox.base.OPTIONS.buttons.no - }; - options = $.extend({}, mergedOptions, Lobibox.confirm.DEFAULTS, options); - return options; - }, - - _init: function () { - var me = this; - - LobiboxBase._init.call(me); - me.show(); - }, - - _afterShow: function () { - var me = this; - - var d = $('
'); - if (me.$options.iconClass) { - d.append($('
') - .append('')) - ; - } - d.append('
' + me.$options.msg + '
'); - me._setContent(d.html()); - - me._position(); - - LobiboxBase._afterShow.call(me); - } - }); - - Lobibox.confirm.DEFAULTS = { - title: 'Question', - width: 500 - }; -//------------------------------------------------------------------------------ -//-------------------------LobiboxAlert------------------------------------------ -//------------------------------------------------------------------------------ - function LobiboxAlert(type, options) { - this.$type = type; - -// options = $.extend({}, Lobibox.alert.DEFAULT_OPTIONS, Lobibox[type].DEFAULT_OPTIONS, options); - - this.$options = this._processInput(options); - - this._init(); - this.debug(this); - } - - LobiboxAlert.prototype = $.extend({}, LobiboxBase, { - constructor: LobiboxAlert, - - _processInput: function (options) { - -// ALERT_OPTIONS = $.extend({}, LobiboxAlert.OPTIONS, Lobibox.alert.DEFAULTS); - var me = this; - var mergedOptions = LobiboxBase._processInput.call(me, options); - mergedOptions.buttons = { - ok: Lobibox.base.OPTIONS.buttons.ok - }; - - options = $.extend({}, mergedOptions, Lobibox.alert.OPTIONS[me.$type], Lobibox.alert.DEFAULTS, options); - - return options; - }, - - _init: function () { - var me = this; - LobiboxBase._init.call(me); - me.show(); - }, - - _afterShow: function () { - var me = this; - - var d = $('
'); - if (me.$options.iconClass) { - d.append($('
') - .append('')) - ; - } - d.append('
' + me.$options.msg + '
'); - me._setContent(d.html()); - me._position(); - - LobiboxBase._afterShow.call(me); - } - }); - Lobibox.alert.OPTIONS = { - warning: { - title: 'Warning' - }, - info: { - title: 'Information' - }, - success: { - title: 'Success' - }, - error: { - title: 'Error' - } - }; - //User can set default options by this variable - Lobibox.alert.DEFAULTS = {}; -//------------------------------------------------------------------------------ -//-------------------------LobiboxProgress-------------------------------------- -//------------------------------------------------------------------------------ - function LobiboxProgress(options) { - this.$type = 'progress'; - this.$progressBarElement = null; - this.$options = this._processInput(options); - this.$progress = 0; - - this._init(); - this.debug(this); - } - - LobiboxProgress.prototype = $.extend({}, LobiboxBase, { - constructor: LobiboxProgress, - - _processInput: function (options) { - var me = this; - var mergedOptions = LobiboxBase._processInput.call(me, options); - - options = $.extend({}, mergedOptions, Lobibox.progress.DEFAULTS, options); - return options; - }, - - _init: function () { - var me = this; - - LobiboxBase._init.call(me); - me.show(); - }, - - _afterShow: function () { - var me = this; - - if (me.$options.progressTpl) { - me.$progressBarElement = $(me.$options.progressTpl); - } else { - me.$progressBarElement = me._createProgressbar(); - } - var label; - if (me.$options.label) { - label = $(''); - } - var innerHTML = $('
').append(label, me.$progressBarElement); - me._setContent(innerHTML); - me._position(); - - LobiboxBase._afterShow.call(me); - }, - - _createProgressbar: function () { - var me = this; - var outer = $('
') - .append('
') - ; - if (me.$options.showProgressLabel) { - outer.append(''); - } - - return outer; - }, - - /** - * Set progress value - * - * @param {number} progress "progress value" - * @returns {LobiboxProgress} - */ - setProgress: function (progress) { - var me = this; - if (me.$progress === 100) { - return; - } - progress = Math.min(100, Math.max(0, progress)); - me.$progress = progress; - me._triggerEvent('progressUpdated'); - if (me.$progress === 100) { - me._triggerEvent('progressCompleted'); - } - me.$el.find('.lobibox-progress-element').css('width', progress.toFixed(1) + "%"); - me.$el.find('[data-role="progress-text"]').html(progress.toFixed(1) + "%"); - return me; - }, - - /** - * Get progress value - * - * @returns {number} - */ - getProgress: function () { - return this.$progress; - } - }); - - Lobibox.progress.DEFAULTS = { - width: 500, - showProgressLabel: true, // Show percentage of progress - label: '', // Show progress label - progressTpl: false, //Template of progress bar - - //Events - progressUpdated: null, - progressCompleted: null - }; -//------------------------------------------------------------------------------ -//-------------------------LobiboxWindow---------------------------------------- -//------------------------------------------------------------------------------ - function LobiboxWindow(type, options) { - this.$type = type; - - this.$options = this._processInput(options); - - this._init(); - this.debug(this); - } - - LobiboxWindow.prototype = $.extend({}, LobiboxBase, { - constructor: LobiboxWindow, - _processInput: function (options) { - var me = this; - var mergedOptions = LobiboxBase._processInput.call(me, options); - - if (options.content && typeof options.content === 'function') { - options.content = options.content(); - } - if (options.content instanceof jQuery) { - options.content = options.content.clone(); - } - options = $.extend({}, mergedOptions, Lobibox.window.DEFAULTS, options); - return options; - }, - - _init: function () { - var me = this; - - LobiboxBase._init.call(me); - me.setContent(me.$options.content); - if (me.$options.url && me.$options.autoload) { - if (!me.$options.showAfterLoad) { - me.show(); - } - me.load(function () { - if (me.$options.showAfterLoad) { - me.show(); - } - }); - } else { - me.show(); - } - }, - - _afterShow: function () { - var me = this; - - me._position(); - - LobiboxBase._afterShow.call(me); - }, - - /** - * Setter method for params option - * - * @param {object} params "new params" - * @returns {LobiboxWindow} - */ - setParams: function (params) { - var me = this; - me.$options.params = params; - return me; - }, - /** - * Getter method for params - * - * @returns {object} - */ - getParams: function () { - var me = this; - return me.$options.params; - }, - /** - * Setter method of loadMethod option - * - * @param {string} method "new method" - * @returns {LobiboxWindow} - */ - setLoadMethod: function (method) { - var me = this; - me.$options.loadMethod = method; - return me; - }, - /** - * Getter method for loadMethod option - * - * @returns {string} - */ - getLoadMethod: function () { - var me = this; - return me.$options.loadMethod; - }, - /** - * Setter method of content option. - * Change the content of window - * - * @param {string} content "new content" - * @returns {LobiboxWindow} - */ - setContent: function (content) { - var me = this; - me.$options.content = content; - me.$el.find('.lobibox-body').html('').append(content); - return me; - }, - /** - * Getter method of content option - * - * @returns {string} - */ - getContent: function () { - var me = this; - return me.$options.content; - }, - /** - * Setter method of url option - * - * @param {string} url "new url" - * @returns {LobiboxWindow} - */ - setUrl: function (url) { - this.$options.url = url; - return this; - }, - /** - * Getter method of url option - * - * @returns {String} - */ - getUrl: function () { - return this.$options.url; - }, - /** - * Loads content to window by ajax from specific url - * - * @param {Function} callback "callback function" - * @returns {LobiboxWindow} - */ - load: function (callback) { - var me = this; - if (!me.$options.url) { - return me; - } - $.ajax(me.$options.url, { - method: me.$options.loadMethod, - data: me.$options.params - }).done(function (res) { - me.setContent(res); - if (callback && typeof callback === 'function') { - callback(res); - } - }); - return me; - } - }); - - Lobibox.window.DEFAULTS = { - width: 480, - height: 600, - content: '', // HTML Content of window - url: '', // URL which will be used to load content - draggable: true, // Override default option - autoload: true, // Auto load from given url when window is created - loadMethod: 'GET', // Ajax method to load content - showAfterLoad: true, // Show window after content is loaded or show and then load content - params: {} // Parameters which will be send by ajax for loading content - }; - -})(); - -//Author : @arboshiki -/** - * Generates random string of n length. - * String contains only letters and numbers - * - * @param {int} n - * @returns {String} - */ -Math.randomString = function (n) { - var text = ""; - var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - - for (var i = 0; i < n; i++) - text += possible.charAt(Math.floor(Math.random() * possible.length)); - - return text; -}; -var Lobibox = Lobibox || {}; -(function () { - - var LobiboxNotify = function (type, options) { -//------------------------------------------------------------------------------ -//----------------PROTOTYPE VARIABLES------------------------------------------- -//------------------------------------------------------------------------------ - this.$type = null; - this.$options = null; - this.$el = null; -//------------------------------------------------------------------------------ -//-----------------PRIVATE VARIABLES-------------------------------------------- -//------------------------------------------------------------------------------ - var me = this; -//------------------------------------------------------------------------------ -//-----------------PRIVATE FUNCTIONS-------------------------------------------- -//------------------------------------------------------------------------------ - var _processInput = function (options) { - - if (options.size === 'mini' || options.size === 'large') { - options = $.extend({}, Lobibox.notify.OPTIONS[options.size], options); - } - options = $.extend({}, Lobibox.notify.OPTIONS[me.$type], Lobibox.notify.DEFAULTS, options); - - if (options.size !== 'mini' && options.title === true) { - options.title = Lobibox.notify.OPTIONS[me.$type].title; - } else if (options.size === 'mini' && options.title === true) { - options.title = false; - } - if (options.icon === true) { - options.icon = Lobibox.notify.OPTIONS.icons[options.iconSource][me.$type]; - } - if (options.sound === true) { - options.sound = Lobibox.notify.OPTIONS[me.$type].sound; - } - if (options.sound) { - options.sound = options.soundPath + options.sound + options.soundExt; - } - return options; - }; - var _init = function () { - // Create notification - var $notify = _createNotify(); - if (me.$options.size === 'mini'){ - $notify.addClass('notify-mini'); - } - - if (typeof me.$options.position === 'string'){ - var $wrapper = _createNotifyWrapper(); - _appendInWrapper($notify, $wrapper); - if ($wrapper.hasClass('center')){ - $wrapper.css('margin-left', '-'+($wrapper.width()/2)+"px"); - } - } else { - $('body').append($notify); - $notify.css({ - 'position': 'fixed', - left: me.$options.position.left, - top: me.$options.position.top, - }) - } - - me.$el = $notify; - if (me.$options.sound) { - var snd = new Audio(me.$options.sound); // buffers automatically when created - snd.play(); - } - if (me.$options.rounded){ - me.$el.addClass('rounded'); - } - }; - var _appendInWrapper = function ($el, $wrapper) { - if (me.$options.size === 'normal') { - if ($wrapper.hasClass('bottom')){ - $wrapper.prepend($el); - } else { - $wrapper.append($el); - } - - } else if (me.$options.size === 'mini') { - if ($wrapper.hasClass('bottom')){ - $wrapper.prepend($el); - } else { - $wrapper.append($el); - } - } else if (me.$options.size === 'large') { - var tabPane = _createTabPane().append($el); - var $li = _createTabControl(tabPane.attr('id')); - $wrapper.find('.lb-notify-wrapper').append(tabPane); - $wrapper.find('.lb-notify-tabs').append($li); - _activateTab($li); - $li.find('>a').click(function () { - _activateTab($li); - }); - } - }; - var _activateTab = function ($li) { - $li.closest('.lb-notify-tabs').find('>li').removeClass('active'); - $li.addClass('active'); - var $current = $($li.find('>a').attr('href')); - $current.closest('.lb-notify-wrapper').find('>.lb-tab-pane').removeClass('active'); - $current.addClass('active') - }; - var _createTabControl = function (tabPaneId) { - var $li = $('
  • ', { - 'class': Lobibox.notify.OPTIONS[me.$type]['class'] - }); - $('', { - 'href': '#' + tabPaneId - }).append('') - .appendTo($li); - return $li; - }; - var _createTabPane = function () { - return $('
    ', { - 'class': 'lb-tab-pane', - 'id': Math.randomString(10) - }) - }; - var _createNotifyWrapper = function () { - var selector = (me.$options.size === 'large' ? '.lobibox-notify-wrapper-large' : '.lobibox-notify-wrapper') - + "." + me.$options.position.replace(/\s/gi, '.'), - $wrapper; - - //var classes = me.$options.position.split(" "); - $wrapper = $(selector); - if ($wrapper.length === 0) { - $wrapper = $('
    ') - .addClass(selector.replace(/\./g, ' ').trim()) - .appendTo($('body')); - if (me.$options.size === 'large') { - $wrapper.append($('
      ')) - .append($('
      ')); - } - } - return $wrapper; - }; - var _createNotify = function () { - var OPTS = Lobibox.notify.OPTIONS, - $iconEl, - $innerIconEl, - $iconWrapper, - $body, - $msg, - $notify = $('
      ', { - 'class': 'lobibox-notify ' + OPTS[me.$type]['class'] + ' ' + OPTS['class'] + ' ' + me.$options.showClass - }); - - $iconWrapper = $('
      ').appendTo($notify); - $iconEl = $('
      ').appendTo($iconWrapper); - $innerIconEl = $('
      ').appendTo($iconEl); - - // Add image or icon depending on given parameters - if (me.$options.img) { - $innerIconEl.append(''); - } else if (me.$options.icon) { - $innerIconEl.append('
      '); - } else { - $notify.addClass('without-icon'); - } - // Create body, append title and message in body and append body in notification - $msg = $('
      ' + me.$options.msg + '
      '); - - if (me.$options.messageHeight !== false){ - $msg.css('max-height', me.$options.messageHeight); - } - - $body = $('
      ', { - 'class': 'lobibox-notify-body' - }).append($msg).appendTo($notify); - - if (me.$options.title) { - $body.prepend('
      ' + me.$options.title + '
      '); - } - _addCloseButton($notify); - if (me.$options.size === 'normal' || me.$options.size === 'mini') { - _addCloseOnClick($notify); - _addDelay($notify); - } - - // Give width to notification - if (me.$options.width) { - $notify.css('width', _calculateWidth(me.$options.width)); - } - - return $notify; - }; - var _addCloseButton = function ($el) { - if (!me.$options.closable) { - return; - } - $('×').click(function () { - me.remove(); - }).appendTo($el); - }; - var _addCloseOnClick = function ($el) { - if (!me.$options.closeOnClick) { - return; - } - $el.click(function () { - me.remove(); - }); - }; - var _addDelay = function ($el) { - if (!me.$options.delay) { - return; - } - if (me.$options.delayIndicator) { - var delay = $('
      '); - $el.append(delay); - } - var time = 0; - var interval = 1000 / 30; - var timer = setInterval(function () { - time += interval; - var width = 100 * time / me.$options.delay; - if (width >= 100) { - width = 100; - me.remove(); - timer = clearInterval(timer); - } - if (me.$options.delayIndicator) { - delay.find('div').css('width', width + "%"); - } - - }, interval); - }; - var _findTabToActivate = function ($li) { - var $itemToActivate = $li.prev(); - if ($itemToActivate.length === 0) { - $itemToActivate = $li.next(); - } - if ($itemToActivate.length === 0) { - return null; - } - return $itemToActivate; - }; - var _calculateWidth = function (width) { - width = Math.min($(window).outerWidth(), width); - return width; - }; -//------------------------------------------------------------------------------ -//----------------PROTOTYPE FUNCTIONS------------------------------------------- -//------------------------------------------------------------------------------ - /** - * Delete the notification - * - * @returns {LobiboxNotify} - */ - this.remove = function () { - me.$el.removeClass(me.$options.showClass) - .addClass(me.$options.hideClass); - var parent = me.$el.parent(); - var wrapper = parent.closest('.lobibox-notify-wrapper-large'); - - var href = '#' + parent.attr('id'); - - var $li = wrapper.find('>.lb-notify-tabs>li:has(a[href="' + href + '"])'); - $li.addClass(Lobibox.notify.OPTIONS['class']) - .addClass(me.$options.hideClass); - setTimeout(function () { - if (me.$options.size === 'normal' || me.$options.size === 'mini') { - me.$el.remove(); - } else if (me.$options.size === 'large') { - - var $newLi = _findTabToActivate($li); - if ($newLi) { - _activateTab($newLi); - } - $li.remove(); - parent.remove(); - } - }, 500); - return me; - }; -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ - this.$type = type; - this.$options = _processInput(options); - _init(); - }; - - Lobibox.notify = function (type, options) { - if (["default", "info", "warning", "error", "success"].indexOf(type) > -1) { - var lobibox = new LobiboxNotify(type, options); - lobibox.$el.data('lobibox', lobibox); - return lobibox; - } - }; - Lobibox.notify.closeAll = function(){ - var ll = $('.lobibox-notify'); - ll.each(function(ind, el){ - var notify =$(el).data('lobibox') .remove(); - }); - }; - //User can set default options to this variable - Lobibox.notify.DEFAULTS = { - title: true, // Title of notification. If you do not include the title in options it will automatically takes its value - //from Lobibox.notify.OPTIONS object depending of the type of the notifications or set custom string. Set this false to disable title - size: 'normal', // normal, mini, large - soundPath: 'sounds/', // The folder path where sounds are located - soundExt: '.ogg', // Default extension for all sounds - showClass: 'fadeInDown', // Show animation class. - hideClass: 'zoomOut', // Hide animation class. - icon: true, // Icon of notification. Leave as is for default icon or set custom string - msg: '', // Message of notification - img: null, // Image source string - closable: true, // Make notifications closable - hideCloseButton: false, // Notification may be closable but you can hide close button and it will be closed by clicking on notification itsef - delay: 5000, // Hide notification after this time (in miliseconds) - delayIndicator: true, // Show timer indicator - closeOnClick: true, // Close notifications by clicking on them - width: 400, // Width of notification box - sound: true, // Sound of notification. Set this false to disable sound. Leave as is for default sound or set custom soud path - // Place to show notification. Available options: "top left", "top right", "bottom left", "bottom right", "center top", "center bottom" - // It can also be object {left: number, top: number} to position notification at any place - position: "bottom right", - iconSource: 'bootstrap', // "bootstrap" or "fontAwesome" the library which will be used for icons - rounded: false, // Whether to make notification corners rounded - messageHeight: 60 // Notification message maximum height - }; - //This variable is necessary. - Lobibox.notify.OPTIONS = { - 'class': 'animated-fast', - large: { - width: 500, - messageHeight: 96 - }, - mini: { - 'class': 'notify-mini', - messageHeight: 32 - }, - default: { - 'class': 'lobibox-notify-default', - 'title': 'Default', - sound: false - }, - success: { - 'class': 'lobibox-notify-success', - 'title': 'Success', - sound: 'sound2' - }, - error: { - 'class': 'lobibox-notify-error', - 'title': 'Error', - sound: 'sound4' - }, - warning: { - 'class': 'lobibox-notify-warning', - 'title': 'Warning', - sound: 'sound5' - }, - info: { - 'class': 'lobibox-notify-info', - 'title': 'Information', - sound: 'sound6' - }, - icons: { - bootstrap: { - success: 'glyphicon glyphicon-ok-sign', - error: 'glyphicon glyphicon-remove-sign', - warning: 'glyphicon glyphicon-exclamation-sign', - info: 'glyphicon glyphicon-info-sign' - }, - fontAwesome: { - success: 'fa fa-check-circle', - error: 'fa fa-times-circle', - warning: 'fa fa-exclamation-circle', - info: 'fa fa-info-circle' - } - } - }; -})(); - - diff --git a/FusionIIIT/notification_channels/static/notification_channels/main.js b/FusionIIIT/notification_channels/static/notification_channels/main.js deleted file mode 100644 index a8b4759b2..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/main.js +++ /dev/null @@ -1,18 +0,0 @@ -function subscribeUser() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then(function(reg) { - - reg.pushManager.subscribe({ - userVisibleOnly: true - }).then(function(sub) { - console.log('Endpoint URL: ', sub.endpoint); - }).catch(function(e) { - if (Notification.permission === 'denied') { - console.warn('Permission for notifications was denied'); - } else { - console.error('Unable to subscribe to push', e); - } - }); - }) - } -} \ No newline at end of file diff --git a/FusionIIIT/notification_channels/static/notification_channels/manifest.json b/FusionIIIT/notification_channels/static/notification_channels/manifest.json deleted file mode 100644 index b9266b020..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name" : "Asq", - "gcm_sender_id" : "989124553452" -} \ No newline at end of file diff --git a/FusionIIIT/notification_channels/static/notification_channels/notifications.js b/FusionIIIT/notification_channels/static/notification_channels/notifications.js deleted file mode 100644 index 42dda910b..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/notifications.js +++ /dev/null @@ -1,169 +0,0 @@ -function wsstart(){ - notif_socket = new WebSocket("ws://"+window.location.host+"/notifications/"); - - notif_socket.onopen = function(event){ - console.log("connected to notification_channels."); - } - notif_socket.onclose = warning; -} - -function warning(){ - console.log("Connection error while connecting to notification_channels."); - setTimeout(wsstart, 10000); -} - -wsstart(); - - -$(document).ready(function(){ - const notif_button = $(".notification-button"); - const notif_div = $(".notification-div"); - const notif_label = $(".notification-label"); - - function attachMenu(event){ - const notif_menu = $(".notification-menu"); - const notif_tabs = $(".notification-tabs"); - notif_menu.on('click', '.item', function() { - if(!$(this).hasClass('dropdown')) { - $(this) - .addClass('active') - .siblings('.item') - .removeClass('active'); - } - const tab_segment = $(this).attr('data-tab'); - const tab = notif_tabs.find("[data-tab="+tab_segment+"]").each(function(event){ - $(this) - .addClass('active') - .siblings('.tab') - .removeClass('active'); - }); - - }); - } - - function updateNotificationLabel(event){ - $.ajax({ - type: "GET", - url: "/notifications/get-unseen-count/", - success:function(data){ - notif_label.text(data.count); - if(parseInt(data.count)>0){ - notif_label.show(); - } - else{ - notif_label.hide(); - } - }, - error:function(data){ - console.log(data); - }, - }); - } - - notif_socket.onmessage = function(event){ - var data = JSON.parse(event.data); - updateNotificationLabel(); - Lobibox.notify('info',{ - title: data.title, - msg: data.message, - onClickUrl: data.url, - }); - } - - updateNotificationLabel() - - function reloadNotifications(event){ - $.ajax({ - type: "GET", - url: "/notifications/type-sorted-notifs/", - success:function(data){ - notif_div.html(data); - attachMenu(); - typeLabelUpdate(); - }, - error:function(data){ - console.log(data); - }, - }); - } - - function typeLabelUpdate(event){ - $(".type-label").each(function(event){ - const notif_label = $(this); - const data = parseInt(notif_label.text()); - if(data>0){ - notif_label.show(); - } - else{ - notif_label.hide(); - } - }); - } - - notif_button.click(reloadNotifications); - - $(document).on("click", "a.type-sorted-div", function(event){ - const url = "/notifications/seen-all/"; - const notif_type = $(this).attr("data-tab"); - $.ajax({ - type: "GET", - url: url, - data: { "type": notif_type }, - success:function(data){ - // console.log("success",data); - updateNotificationLabel(); - $("."+notif_type+"-notification-label").hide(); - }, - error:function(data){ - console.log("error",data) - }, - }); - }); - - - $(document).on("click", "a.read-all", function(event){ - const url = "/notifications/read-all/"; - const item = $(this); - $.ajax({ - type: "GET", - url: url, - data: { "type": item.attr("data") }, - success:function(data){ - // console.log("success",data); - reloadNotifications(); - updateNotificationLabel(); - }, - error:function(data){ - console.log("error",data) - }, - }); - }); - - - function mark_read(url){ - $.ajax({ - type: "GET", - url: url, - success:function(data){ - console.log("success",data); - }, - error:function(data){ - console.log("error",data) - }, - }); - } - - - $(document).on("click", "a.notification-anchor", function(event){ - const url = "/notifications/read/"+$(this).attr("data")+"/"; - const item = $(this); - mark_read(url); - const redirect_url = item.attr("href"); - if(redirect_url!="#"){ - window.location = window.location.hostname + redirect_url; - } - - }); - - -}); \ No newline at end of file diff --git a/FusionIIIT/notification_channels/static/notification_channels/serviceworker.js b/FusionIIIT/notification_channels/static/notification_channels/serviceworker.js deleted file mode 100644 index 163ddcdc1..000000000 --- a/FusionIIIT/notification_channels/static/notification_channels/serviceworker.js +++ /dev/null @@ -1,20 +0,0 @@ -self.addEventListener('push', function(e) { - var options = { - body: 'This notification was generated from a push!', - icon: 'images/example.png', - vibrate: [100, 50, 100], - data: { - dateOfArrival: Date.now(), - primaryKey: '2' - }, - actions: [ - {action: 'explore', title: 'Explore this new world', - icon: 'images/checkmark.png'}, - {action: 'close', title: 'Close', - icon: 'images/xmark.png'}, - ] - }; - e.waitUntil( - self.registration.showNotification('Hello world!', options) - ); -}); diff --git a/FusionIIIT/notification_channels/tasks.py b/FusionIIIT/notification_channels/tasks.py deleted file mode 100644 index 130880c38..000000000 --- a/FusionIIIT/notification_channels/tasks.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -import json - -import celery - -from channels import Group - - -@celery.task() -def notify(notif): - notif_type = "New Notification" - notif_str = notif.__str__() - if notif.notif_type: - notif_type = notif.notif_type - data = { - "title": notif_type, - "message": notif_str, - "url": notif.reference_url, - } - Group(notif.recipient.username).send({ - "text": json.dumps(data), - }) diff --git a/FusionIIIT/notification_channels/templates/notification_channels/activity.html b/FusionIIIT/notification_channels/templates/notification_channels/activity.html deleted file mode 100644 index 93d823b91..000000000 --- a/FusionIIIT/notification_channels/templates/notification_channels/activity.html +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/FusionIIIT/notification_channels/templates/notification_channels/notification.html b/FusionIIIT/notification_channels/templates/notification_channels/notification.html deleted file mode 100644 index d8ead3b02..000000000 --- a/FusionIIIT/notification_channels/templates/notification_channels/notification.html +++ /dev/null @@ -1,11 +0,0 @@ -
      -
      - -

      {{ notification }}

      -
      -
      - {{ notification.timestamp }} ago. -
      -
      -
      -
      \ No newline at end of file diff --git a/FusionIIIT/notification_channels/templates/notification_channels/notifs_full.html b/FusionIIIT/notification_channels/templates/notification_channels/notifs_full.html deleted file mode 100644 index 1d6d1f677..000000000 --- a/FusionIIIT/notification_channels/templates/notification_channels/notifs_full.html +++ /dev/null @@ -1,144 +0,0 @@ -{% extends 'globals/base.html' %} -{% load static %} -{% load notif_tags %} -{% load semanticui %} -{% block title %} -Fusion - Feedback -{% endblock %} - -{% block css %} - -{% endblock %} - -{% block body %} - {% block navBar %} - {% include 'dashboard/navbar.html' %} - {% endblock %} - -
      - - {% comment %}The left-margin segment!{% endcomment %} -
      - - {% comment %} - The left-rail segment starts here! - {% endcomment %} -
      - - {% comment %}The user image card starts here!{% endcomment %} - {% block usercard %} - {% include 'globals/usercard.html' %} - {% endblock %} - {% comment %}The user image card ends here!{% endcomment %} - -
      - - - -
      - {% comment %} - The left-rail segment ends here! - {% endcomment %} - - - - {% comment %} - The central-rail segment starts here! - {% endcomment %} -
      - -
      - {% if type_sorted %} -
      -

      Notifications

      -
      - Mark all as read -
      -
      - - -
      - -
      - {% for notif_type, notifications in type_sorted_notifs.items %} -
      - -
      - {% for notif in notifications %} - {% get_notification notif %} - {% endfor %} -
      -
      - {% endfor %} -
      -
      - - {% else %} - -
      -

      Notifications

      -
      - -
      -
      -
      - {% for notif in notifications %} - {% get_notification notif %} - {% endfor %} -
      -
      -
      - - {% endif %} -
      -
      - {% comment %}The central-rail segment ends here!{% endcomment %} - - {% comment %}The right-rail segment starts here!{% endcomment %} -
      - -
      - {% comment %}The right-rail segment ends here!{% endcomment %} - - {% comment %}The right-margin segment!{% endcomment %} -
      - -
      - -{% endblock %} diff --git a/FusionIIIT/notification_channels/templates/notification_channels/notify.html b/FusionIIIT/notification_channels/templates/notification_channels/notify.html deleted file mode 100644 index 31180f87d..000000000 --- a/FusionIIIT/notification_channels/templates/notification_channels/notify.html +++ /dev/null @@ -1,4 +0,0 @@ -{% load notif_tags %} -{% for notif in notifications %} - {% get_notification notif %} -{% endfor %} \ No newline at end of file diff --git a/FusionIIIT/notification_channels/templates/notification_channels/type_sorted_notifs.html b/FusionIIIT/notification_channels/templates/notification_channels/type_sorted_notifs.html deleted file mode 100644 index cfcbc0f13..000000000 --- a/FusionIIIT/notification_channels/templates/notification_channels/type_sorted_notifs.html +++ /dev/null @@ -1,37 +0,0 @@ -{% load notif_tags %} -
      -

      Notifications

      -
      -Mark all as read -
      -
      - - -
      - -
      - {% for notif_type, notifications in type_sorted_notifs.items %} -
      - -
      - {% for notif in notifications %} - {% get_notification notif %} - {% endfor %} -
      -
      - {% endfor %} -
      -
      -All notifications \ No newline at end of file diff --git a/FusionIIIT/notification_channels/templatetags/__init__.py b/FusionIIIT/notification_channels/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/notification_channels/templatetags/activity_tags.py b/FusionIIIT/notification_channels/templatetags/activity_tags.py deleted file mode 100644 index bf1928695..000000000 --- a/FusionIIIT/notification_channels/templatetags/activity_tags.py +++ /dev/null @@ -1,46 +0,0 @@ -from django import template - -register = template.Library() - - -""" Activity tags """ - - -@register.simple_tag(name='get_all_activities') -def get_all_activities(user): - return user.activities.all().order_by("-timestamp") - - -@register.simple_tag(name='get_activities_count') -def get_activities_count(user): - return user.activities.all().count() - - -def unread_activities(user): - unread = user.activities.filter(read=False).order_by("-timestamp") - return { - "activities": unread, - } - - -register.inclusion_tag("notification_channels/activity.html")(unread_activities) - - -def unseen_activities(user): - unseen = user.activities.filter(seen=False).order_by("-timestamp") - return { - "activities": unseen, - } - - -register.inclusion_tag("notification_channels/activity.html")(unseen_activities) - - -def all_activities(user): - activities = user.activities.all().order_by("-timestamp") - return { - "activities": activities, - } - - -register.inclusion_tag("notification_channels/activity.html")(all_activities) diff --git a/FusionIIIT/notification_channels/templatetags/notif_tags.py b/FusionIIIT/notification_channels/templatetags/notif_tags.py deleted file mode 100644 index 5b4319c4e..000000000 --- a/FusionIIIT/notification_channels/templatetags/notif_tags.py +++ /dev/null @@ -1,96 +0,0 @@ -from django import template -from django.contrib.contenttypes.models import ContentType - -from notification_channels.models import Notification - -register = template.Library() - - -""" Notification tags """ - - -@register.simple_tag(name='get_all_notifs') -def get_all_notifs(user): - return user.notifications.all().order_by("-timestamp") - - -@register.simple_tag(name='get_notif_count') -def get_notif_count(user): - return user.notifications.all().count() - - -@register.simple_tag(name='get_related_notifs') -def get_related_notifs(obj): - obj_ctype = ContentType.objects.get_for_model(obj) - return Notification.objects.filter(target_ctype=obj_ctype, - target_id=obj.id).order_by("-timestamp") - - -@register.simple_tag(name='get_action_notifs') -def get_action_notifs(obj): - obj_ctype = ContentType.objects.get_for_model(obj) - return Notification.objects.filter(action_obj_ctype=obj_ctype, - action_obj_id=obj.id).order_by("-timestamp") - - -@register.simple_tag(name='get_user_action_notifs') -def get_user_action_notifs(user, obj): - obj_ctype = ContentType.objects.get_for_model(obj) - return Notification.objects.filter(recipient=user, action_obj_ctype=obj_ctype, - action_obj_id=obj.id).order_by("-timestamp") - - -@register.simple_tag(name='get_user_related_notifs') -def get_user_related_notifs(user, obj): - obj_ctype = ContentType.objects.get_for_model(obj) - return Notification.objects.filter(recipient=user, target_ctype=obj_ctype, - target_id=obj.id).order_by("-timestamp") - - -def unread_notifs(user): - unread = user.notifications.filter(read=False).order_by("-timestamp") - return { - "notifications": unread, - } - - -register.inclusion_tag("notification_channels/notify.html")(unread_notifs) - - -def unseen_notifs(user): - unseen = user.notifications.filter(seen=False).order_by("-timestamp") - return { - "notifications": unseen, - } - - -register.inclusion_tag("notification_channels/notify.html")(unseen_notifs) - - -def all_notifs(user): - notifs = user.notifications.all().order_by("-timestamp") - return { - "notifications": notifs, - } - - -register.inclusion_tag("notification_channels/notify.html")(all_notifs) - - -def type_notifs(typ, user): - notifs = user.notifications.filter(notif_type=typ).order_by("-timestamp") - return { - "notifications": notifs, - } - - -register.inclusion_tag("notification_channels/notify.html")(type_notifs) - - -def get_notification(notification): - return { - "notification": notification, - } - - -register.inclusion_tag("notification_channels/notification.html")(get_notification) diff --git a/FusionIIIT/notification_channels/tests.py b/FusionIIIT/notification_channels/tests.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/FusionIIIT/notification_channels/urls.py b/FusionIIIT/notification_channels/urls.py deleted file mode 100644 index 486289361..000000000 --- a/FusionIIIT/notification_channels/urls.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.conf.urls import url - -from notification_channels.views import notifications, read_all - -app_name = 'notifications' - - -urlpatterns = [ - - url(r'^$', notifications, name='notifications'), - url(r'^/read-all/$', read_all, name='read_all'), - -] diff --git a/FusionIIIT/notification_channels/views.py b/FusionIIIT/notification_channels/views.py deleted file mode 100644 index 4ffded88c..000000000 --- a/FusionIIIT/notification_channels/views.py +++ /dev/null @@ -1,49 +0,0 @@ -import json - -from django.conf import settings -from django.contrib.auth.decorators import login_required -from django.shortcuts import HttpResponse, get_object_or_404, render - -from .models import Notification - -login_url = getattr(settings, "LOGIN_URL", "/") - - -@login_required(login_url=login_url) -def notifications(request): - context = {"notifications": request.user.notifications.all()} - return render(request, "notification_channels/notify.html", context) - - -@login_required(login_url=login_url) -def read_all(request): - request.user.notifications.all().seen() - request.user.notifications.all().read() - context = {"success": True} - return HttpResponse(json.dumps(context), content_type='application/json') - - -@login_required(login_url=login_url) -def seen_all(request): - request.user.notifications.all().seen() - context = {"success": True} - return HttpResponse(json.dumps(context), content_type='application/json') - - -@login_required(login_url=login_url) -def mark_seen(request, id): - notif = get_object_or_404(Notification, id=id) - context = {} - if request.user == notif.recipient: - notif.mark_seen() - context['success'] = True - context['text'] = "Successfully marked as read" - return HttpResponse(json.dumps(context), content_type='application/json') - context['success'] = False - context['text'] = "Unauthorised to make these changes" - return HttpResponse(json.dumps(context), content_type='application/json') - - -@login_required(login_url=login_url) -def get_notifications(request): - pass diff --git a/FusionIIIT/templates/dashboard/alerts.html b/FusionIIIT/templates/dashboard/alerts.html index 1da8688cd..ad45de191 100644 --- a/FusionIIIT/templates/dashboard/alerts.html +++ b/FusionIIIT/templates/dashboard/alerts.html @@ -1,65 +1,119 @@ -{% load static %} - -{% block alerts %} - {% comment %}The Alerts start here!{% endcomment %} -
      - - - Alerts - - - - - -
      -
      -
      -
      -
      12.04.2014
      -
      - - 4 system errors -
      -
      -
      -
      -
      -
      12.04.2014
      -
      - - 4 system errors -
      -
      -
      -
      -
      -
      12.04.2014
      -
      - - 4 system errors -
      -
      -
      -
      -
      -
      12.04.2014
      -
      - - 4 system errors -
      -
      -
      -
      -
      -
      12.04.2014
      -
      - - 4 system errors -
      -
      -
      -
      -
      -
      - {% comment %}The Alerts ends here!{% endcomment %} +{% load static %} + +{% block alerts %} +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + + {% comment %}A single card starts here!{% endcomment %} +
      +
      +
      + Title of the notification +
      +
      + Dec 21, 2018, to all students +
      + +
      + Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. Summary notification and/or alerts. +
      +
      +
      + +
      {% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/dashboard/dashboard.html b/FusionIIIT/templates/dashboard/dashboard.html index 5ad07ba0a..cf7138706 100644 --- a/FusionIIIT/templates/dashboard/dashboard.html +++ b/FusionIIIT/templates/dashboard/dashboard.html @@ -1,283 +1,122 @@ -{% extends 'globals/base.html' %} -{% load static %} - - -{% block title %} - Dashboard -{% endblock %} - - -{% block body %} - {% block navBar %} - {% include 'dashboard/navbar.html' %} - {% endblock %} - - - {% comment %} - -
      -
      - -
      - {% block modules %} - {% include 'dashboard/modules.html' %} - {% endblock %} -
      - - -
      - -
      - The Modules: - {% block calendar %} - {% include 'dashboard/calendar.html' %} - {% endblock %} -
      - -
      -
      -
      - The Alerts: - {% block alerts %} - {% include 'dashboard/alerts.html' %} - {% endblock %} -
      - -
      - -
      - The Modules: - {% block contacts %} - {% include 'dashboard/contacts.html' %} - {% endblock %} -
      -
      -
      -
      -
      -
      - {% endcomment %} - {% comment %}The grid starts here!{% endcomment %} -
      - - {% comment %}The left-margin segment!{% endcomment %} -
      - - {% comment %} - The left-rail segment starts here! - {% endcomment %} -
      - - {% comment %}The user image card starts here!{% endcomment %} - {% block usercard %} - {% include 'globals/usercard.html' %} - {% endblock %} - {% comment %}The user image card ends here!{% endcomment %} -
      - - {% comment %}The Tab-Menu starts here!{% endcomment %} - - {% comment %}The Tab-Menu ends here!{% endcomment %} - -
      -
      - {% for c in current %} - {% if c.designation.name == 'student' %} - {% comment %}The Details start here!{% endcomment %} -
      - {% block profile %} - {% include 'placementModule/profile.html' %} - {% endblock %} -
      - {% comment %}The Personal Details end here!{% endcomment %} - - - {% comment %}The Skills & Technologies start here!{% endcomment %} -
      - {% block skills %} - {% include 'placementModule/skills.html' %} - {% endblock %} -
      - {% comment %}The Skills & Technologies end here!{% endcomment %} - - {% comment %}The Education tab starts here!{% endcomment %} -
      - {% block education %} - {% include 'placementModule/education.html' %} - {% endblock %} -
      - {% comment %}The Education tab ends here!{% endcomment %} - - {% comment %}The Education tab starts here!{% endcomment %} -
      - {% block workexperience %} - {% include 'placementModule/workexperience.html' %} - {% endblock %} -
      - {% comment %}The Education tab ends here!{% endcomment %} - - {% comment %}The Achievements tab starts here!{% endcomment %} -
      - {% block achievements %} - {% include 'placementModule/achievements.html' %} - {% endblock %} -
      - {% comment %}The Achievements tab ends here!{% endcomment %} - - {% comment %}The Achievements tab starts here!{% endcomment %} -
      - {% block publications %} - {% include 'placementModule/publications.html' %} - {% endblock %} -
      - {% comment %}The Achievements tab ends here!{% endcomment %} - {% endif %} - {% endfor %} -
      - - - -
      - {% comment %}The Modules:{% endcomment %} - {% block modules %} - {% include 'dashboard/modules.html' %} - {% endblock %} -
      - - -{% endblock %} - -{% block javascript %} - - - - - - - - - - -{% endblock %} +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} + Profile +{% endblock %} + +{% block css %} + + + +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + + {% comment %}The grid starts here!{% endcomment %} +
      + + {% comment %}The left-margin segment!{% endcomment %} +
      + + {% comment %} + The left-rail segment starts here! + {% endcomment %} +
      + + {% comment %}The user image card starts here!{% endcomment %} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {% comment %}The user image card ends here!{% endcomment %} + +
      + + {% comment %}The Tab-Menu starts here!{% endcomment %} + + {% comment %}The Tab-Menu ends here!{% endcomment %} + +
      + {% comment %} + The left-rail segment ends here! + {% endcomment %} + + + + {% comment %} + The central-rail segment starts here! + {% endcomment %} + {% comment %} + The central-rail segment starts here! + {% endcomment %} +
      + +
      + +
      +
      +
      +
      + Loading ... +
      + +
      + {% block alerts %} + {% include 'dashboard/alerts.html' %} + {% endblock %} +
      + +
      +
      +
      + +
      + {% comment %}The central-rail segment ends here!{% endcomment %} + + + {% comment %}The central-rail segment ends here!{% endcomment %} + + {% comment %}The right-rail segment starts here!{% endcomment %} +
      +
      + {% comment %}The Modules:{% endcomment %} + {% block generatereport %} + {% include 'eisModulenew/generatereport.html' %} + {% endblock %} +
      + +
      + {% comment %}The Modules:{% endcomment %} + {% block modules %} + {% include 'dashboard/modules.html' %} + {% endblock %} +
      + +
      + {% comment %}The right-rail segment ends here!{% endcomment %} + + {% comment %}The right-margin segment!{% endcomment %} +
      + +
      + {% comment %}The grid ends here!{% endcomment %} + + + +{% endblock %} + + diff --git a/FusionIIIT/templates/eisModule/eventorganized.html b/FusionIIIT/templates/eisModule/eventorganized.html deleted file mode 100644 index 7fe183df3..000000000 --- a/FusionIIIT/templates/eisModule/eventorganized.html +++ /dev/null @@ -1,470 +0,0 @@ -{% load static %} - -{% block eventorganised %} - {% comment %}The tab menu starts here!{% endcomment %} - - - - {% comment %}The Journal segment starts here!{% endcomment %} -
      -

      Add a Conference/Symposium

      - -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - - -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - - - -
      -
      - -
      - - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - - -
      - -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.RoleConference NameVenueStart Date && End-DateYearAction
      - -
      -
      - - {% comment %}The Journal segment ends here!{% endcomment %} - - - - {% comment %}The Conference segment starts here!{% endcomment %} -
      -

      Add a Workshop

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      - - -
      - - -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.RoleSponsoring AgencyVenueStart Date && End-DateTypeAction
      - -
      -
      - {% comment %}The Conference segment ends here!{% endcomment %} - - - {% comment %}The Books segment starts here!{% endcomment %} -
      -

      Add a Seminar

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PatentTitleStatusYearEarning(in Rs.)Action
      - -
      -
      - - {% comment %}The Books segment ends here!{% endcomment %} - - - {% comment %}The Technology segment starts here!{% endcomment %} - - {% comment %}The Technology segment ends here!{% endcomment %} -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/generatereport.html b/FusionIIIT/templates/eisModule/generatereport.html deleted file mode 100644 index 3a2d13e14..000000000 --- a/FusionIIIT/templates/eisModule/generatereport.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load static %} - -{% block generatereport %} -
      -
      -
      - - Report - - -
      -
      - Generate! -
      -
      -
      -
      -
      -{% endblock%} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/personaldetails.html b/FusionIIIT/templates/eisModule/personaldetails.html deleted file mode 100644 index 465882197..000000000 --- a/FusionIIIT/templates/eisModule/personaldetails.html +++ /dev/null @@ -1,188 +0,0 @@ -{% load static %} - -{% block personaldetails %} - - -
      -
      -
      - About Me - - -
      - -
      - - - I am interested in investigating and developing intelligent methods and tools in the area of software engineering, computer vision, information extraction, and other domains. Currently, some of the work I am engaged in include Identifying patterns in requirements, design and coding using NLP as well as through model transformation approaches. Some other work include the study the dataset characteristics and suitability of a given dataset to provide an acceptable solution of a Machine Learning problem. - - -
      - -
      -
      -
      - - - - -
      -
      -
      Details
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Date Of Joining - - - January 10, 2012 - -
      - Pension Fund # - - - PF# XXXXXXXXX - -
      - Education - - - PhD, IIT Kanpur - - -
      - -
      -
      - Interest Areas - - - Software Engineering, Machine Learning, Data Science, and NLP. - - -
      - -
      -
      -
      -
      -
      - - - -
      -
      -
      Contact Details
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Contact - - - - - +91 - 7612632139 - - - -
      - -
      -
      - Mail - - - - - - {{ userEmail }} - - - -
      - LinkedIn - - - - {{ userFirstName }} {{ userLastName }} - -
      - Github - - - - {{ userFirstName }} {{ userLastName }} - -
      -
      -
      -
      -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/profile.html b/FusionIIIT/templates/eisModule/profile.html deleted file mode 100644 index 698713f76..000000000 --- a/FusionIIIT/templates/eisModule/profile.html +++ /dev/null @@ -1,215 +0,0 @@ -{% extends 'globals/base.html' %} -{% load static %} - - -{% block title %} - Profile -{% endblock %} - - -{% block body %} - {% block navBar %} - {% include 'dashboard/navbar.html' %} - {% endblock %} - - - {% comment %}The grid starts here!{% endcomment %} -
      - - {% comment %}The left-margin segment!{% endcomment %} -
      - - {% comment %} - The left-rail segment starts here! - {% endcomment %} -
      - - {% comment %}The user image card starts here!{% endcomment %} - {% block usercard %} - {% include 'globals/usercard.html' %} - {% endblock %} - {% comment %}The user image card ends here!{% endcomment %} - -
      - - {% comment %}The Tab-Menu starts here!{% endcomment %} - - {% comment %}The Tab-Menu ends here!{% endcomment %} - -
      - {% comment %} - The left-rail segment ends here! - {% endcomment %} - - - - {% comment %} - The central-rail segment starts here! - {% endcomment %} -
      - {% comment %}The Details start here!{% endcomment %} -
      - {% block personaldetails %} - {% include 'eisModule/personaldetails.html' %} - {% endblock %} -
      - {% comment %}The Personal Details end here!{% endcomment %} - - - {% comment %}The Publications starts here!{% endcomment %} -
      - {% block publications %} - {% include 'eisModule/publications.html' %} - {% endblock %} -
      - {% comment %}The Publications ends here!{% endcomment %} - - - {% comment %}The Projects starts here!{% endcomment %} -
      - {% block projects %} - {% include 'eisModule/projects.html' %} - {% endblock %} -
      - {% comment %}The Projects ends here!{% endcomment %} - - - {% comment %}The Thesis Supervision starts here!{% endcomment %} -
      - {% block thesis %} - {% include 'eisModule/thesis.html' %} - {% endblock %} -
      - {% comment %}The Publications ends here!{% endcomment %} - - {% comment %}The Thesis Supervision starts here!{% endcomment %} -
      - {% block eventorganised %} - {% include 'eisModule/eventorganized.html' %} - {% endblock %} -
      - {% comment %}The Publications ends here!{% endcomment %} - - {% comment %}The Thesis Supervision starts here!{% endcomment %} -
      - {% block visits %} - {% include 'eisModule/visits.html' %} - {% endblock %} -
      - {% comment %}The Publications ends here!{% endcomment %} - - {% comment %}The Thesis Supervision starts here!{% endcomment %} -
      - Hi! -
      - {% comment %}The Publications ends here!{% endcomment %} - - {% comment %}The Thesis Supervision starts here!{% endcomment %} -
      - Hi! -
      - {% comment %}The Publications ends here!{% endcomment %} - -
      - {% comment %}The central-rail segment ends here!{% endcomment %} - - {% comment %}The right-rail segment starts here!{% endcomment %} -
      -
      - {% comment %}The Modules:{% endcomment %} - {% block generatereport %} - {% include 'eisModule/generatereport.html' %} - {% endblock %} -
      - -
      - {% comment %}The Modules:{% endcomment %} - {% block modules %} - {% include 'dashboard/modules.html' %} - {% endblock %} -
      - -
      - {% comment %}The right-rail segment ends here!{% endcomment %} - - {% comment %}The right-margin segment!{% endcomment %} -
      - -
      - {% comment %}The grid ends here!{% endcomment %} - - - -{% endblock %} - -{% block javascript %} - - - -{% comment %} - -{% endcomment %} - - - -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/projects.html b/FusionIIIT/templates/eisModule/projects.html deleted file mode 100644 index 7fe7d0f7d..000000000 --- a/FusionIIIT/templates/eisModule/projects.html +++ /dev/null @@ -1,473 +0,0 @@ -{% load static %} - -{% block projects %} - {% comment %}The tab menu starts here!{% endcomment %} - - - - {% comment %}The Journal segment starts here!{% endcomment %} -
      -

      Add a Research Project

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      - -
      - - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PI/CO-PITitleFunding AgencyOther DetailsStatusAction
      1.Projects's NameProjects's TitleProjects's PublisherOngoingProjects's Co-authorEdit
      2.Projects's NameProjects's TitleProjects's PublisherOngoingProjects's Co-authorEdit
      3.Journal's NameJournal's TitleJournal's Publisher2015Journal's Co-authorEdit
      - -
      -
      - - {% comment %}The Journal segment ends here!{% endcomment %} - - - - {% comment %}The Conference segment starts here!{% endcomment %} -
      -

      Add a Consultancy Project

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.Consultant(s)TitleClientFinancial OutlayPeriod of ConsultancyAction
      - -
      -
      - {% comment %}The Conference segment ends here!{% endcomment %} - - - {% comment %}The Books segment starts here!{% endcomment %} -
      -

      Add a Patent

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PatentTitleStatusYearEarning(in Rs.)Action
      - -
      -
      - - {% comment %}The Books segment ends here!{% endcomment %} - - - {% comment %}The Technology segment starts here!{% endcomment %} - -
      -

      Add a Technology Transfer

      -
      -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      -
      -
      - {% comment %}The Technology segment ends here!{% endcomment %} -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/publications.html b/FusionIIIT/templates/eisModule/publications.html deleted file mode 100644 index f3755fd92..000000000 --- a/FusionIIIT/templates/eisModule/publications.html +++ /dev/null @@ -1,446 +0,0 @@ -{% load static %} - -{% block publications %} - {% comment %}The tab menu starts here!{% endcomment %} - - - - {% comment %}The Journal segment starts here!{% endcomment %} -
      -

      Add a Journal

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      - - Optional Details -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.AuthorsTitleConferenceYearAction
      1.Journal's AuthorsJournal's TitleConference and Details2017Edit
      2.Journal's AuthorsJournal's TitleConference and Details2016Edit
      3.Journal's AuthorsJournal's TitleConference and Details2015Edit
      - -
      -
      - {% comment %}The Journal segment ends here!{% endcomment %} - - - - {% comment %}The Conference segment starts here!{% endcomment %} -
      -

      Add a Conference

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PublishedTitlePublisherYearCo-authorsAction
      1.Journal's NameJournal's TitleJournal's Publisher2017Journal's Co-authorEdit
      2.Journal's NameJournal's TitleJournal's Publisher2016Journal's Co-authorEdit
      3.Journal's NameJournal's TitleJournal's Publisher2015Journal's Co-authorEdit
      - -
      -
      - {% comment %}The Conference segment ends here!{% endcomment %} - - - {% comment %}The Books segment starts here!{% endcomment %} -
      -

      Add a Book/Book Chapter

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PublishedTitlePublisherYearCo-authorsAction
      1.Journal's NameJournal's TitleJournal's Publisher2017Journal's Co-authorEdit
      2.Journal's NameJournal's TitleJournal's Publisher2016Journal's Co-authorEdit
      3.Journal's NameJournal's TitleJournal's Publisher2015Journal's Co-authorEdit
      - -
      -
      - {% comment %}The Books segment ends here!{% endcomment %} -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/thesis.html b/FusionIIIT/templates/eisModule/thesis.html deleted file mode 100644 index d0baf89aa..000000000 --- a/FusionIIIT/templates/eisModule/thesis.html +++ /dev/null @@ -1,307 +0,0 @@ -{% load static %} - -{% block thesis %} - {% comment %}The tab menu starts here!{% endcomment %} - - - - {% comment %}The PG Thesis supervision segment starts here!{% endcomment %} -
      -

      Add a Thesis

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      -
      -
      - - -
      - -
      - - -
      - -
      - - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.StudentTitleYearSupervisorAction
      1.Student's NameStudent's Thesis's Title2017Student's SupervisorEdit
      2.Student's NameStudent's Thesis's Title2016Student's SupervisorEdit
      3.Student's NameStudent's Thesis's Title2015Student's SupervisorEdit
      - -
      -
      - {% comment %}The PG Thesis supervision segment ends here!{% endcomment %} - - - - {% comment %}The PhD Thesis supervision segment starts here!{% endcomment %} -
      -

      Add a Thesis

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      -
      -
      - - -
      - -
      - - -
      - -
      - - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.StudentTitleYearSupervisorAction
      1.Student's NameStudent's Thesis's Title2017Student's SupervisorEdit
      2.Student's NameStudent's Thesis's Title2016Student's SupervisorEdit
      3.Student's NameStudent's Thesis's Title2015Student's SupervisorEdit
      - -
      -
      - {% comment %}The PhD Thesis supervision segment ends here!{% endcomment %} -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/eisModule/visits.html b/FusionIIIT/templates/eisModule/visits.html deleted file mode 100644 index 3ed921eb6..000000000 --- a/FusionIIIT/templates/eisModule/visits.html +++ /dev/null @@ -1,504 +0,0 @@ -{% load static %} - -{% block visits %} - - - {% comment %}The tab menu starts here!{% endcomment %} - - - - {% comment %}The Foreign Visit segment starts here!{% endcomment %} -
      -

      Add a Foreign Visit

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      -
      -
      - - -
      - -
      - - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.CountryPlaceFrom - ToPurposeAction
      1. - - Germany - Munich10.01.2017 - 15.01.2017Attend Bayern Munich's MatchesEdit
      2. - - Japan - Tokyo05.12.2016 - 09.12.2016Attend Bayern Munich's MatchesEdit
      3. - - Australia - Sydney10.08.2015 - 15.08.2015Attend Bayern Munich's MatchesEdit
      - -
      -
      - {% comment %}The Foreign Visit segment ends here!{% endcomment %} - - - - {% comment %}The Indian University Visit segment starts here!{% endcomment %} -
      -

      Add an Indian University Visit

      -
      -
      -
      -
      - - -
      - -
      - - -
      -
      -
      - -
      -
      -
      - - -
      - -
      - - -
      -
      - -
      -
      -
      - - -
      -
      - -
      - -
      - Save - -
      -
      -
      - -
      -
      -
      -

      Report:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Sr.PlaceFrom - ToPurposeAction
      1.Delhi10.01.2017 - 15.01.2017Attend Bayern Munich's MatchesEdit
      2.Kanpur05.12.2016 - 09.12.2016Attend Bayern Munich's MatchesEdit
      3.Bangalore10.08.2015 - 15.08.2015Attend Bayern Munich's MatchesEdit
      - -
      -
      - {% comment %}The Indian University visit segment ends here!{% endcomment %} -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/globals/student_profile.html b/FusionIIIT/templates/globals/student_profile.html new file mode 100644 index 000000000..5ad07ba0a --- /dev/null +++ b/FusionIIIT/templates/globals/student_profile.html @@ -0,0 +1,283 @@ +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} + Dashboard +{% endblock %} + + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + + {% comment %} + +
      +
      + +
      + {% block modules %} + {% include 'dashboard/modules.html' %} + {% endblock %} +
      + + +
      + +
      + The Modules: + {% block calendar %} + {% include 'dashboard/calendar.html' %} + {% endblock %} +
      + +
      +
      +
      + The Alerts: + {% block alerts %} + {% include 'dashboard/alerts.html' %} + {% endblock %} +
      + +
      + +
      + The Modules: + {% block contacts %} + {% include 'dashboard/contacts.html' %} + {% endblock %} +
      +
      +
      +
      +
      +
      + {% endcomment %} + {% comment %}The grid starts here!{% endcomment %} +
      + + {% comment %}The left-margin segment!{% endcomment %} +
      + + {% comment %} + The left-rail segment starts here! + {% endcomment %} +
      + + {% comment %}The user image card starts here!{% endcomment %} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {% comment %}The user image card ends here!{% endcomment %} +
      + + {% comment %}The Tab-Menu starts here!{% endcomment %} + + {% comment %}The Tab-Menu ends here!{% endcomment %} + +
      +
      + {% for c in current %} + {% if c.designation.name == 'student' %} + {% comment %}The Details start here!{% endcomment %} +
      + {% block profile %} + {% include 'placementModule/profile.html' %} + {% endblock %} +
      + {% comment %}The Personal Details end here!{% endcomment %} + + + {% comment %}The Skills & Technologies start here!{% endcomment %} +
      + {% block skills %} + {% include 'placementModule/skills.html' %} + {% endblock %} +
      + {% comment %}The Skills & Technologies end here!{% endcomment %} + + {% comment %}The Education tab starts here!{% endcomment %} +
      + {% block education %} + {% include 'placementModule/education.html' %} + {% endblock %} +
      + {% comment %}The Education tab ends here!{% endcomment %} + + {% comment %}The Education tab starts here!{% endcomment %} +
      + {% block workexperience %} + {% include 'placementModule/workexperience.html' %} + {% endblock %} +
      + {% comment %}The Education tab ends here!{% endcomment %} + + {% comment %}The Achievements tab starts here!{% endcomment %} +
      + {% block achievements %} + {% include 'placementModule/achievements.html' %} + {% endblock %} +
      + {% comment %}The Achievements tab ends here!{% endcomment %} + + {% comment %}The Achievements tab starts here!{% endcomment %} +
      + {% block publications %} + {% include 'placementModule/publications.html' %} + {% endblock %} +
      + {% comment %}The Achievements tab ends here!{% endcomment %} + {% endif %} + {% endfor %} +
      + + + +
      + {% comment %}The Modules:{% endcomment %} + {% block modules %} + {% include 'dashboard/modules.html' %} + {% endblock %} +
      + + +{% endblock %} + +{% block javascript %} + + + + + + + + + + +{% endblock %} From 44aa8baac9015fdef686a25ea6cce22a6a98e7d3 Mon Sep 17 00:00:00 2001 From: Ayaskant Panigrahi Date: Fri, 1 Feb 2019 16:02:33 +0530 Subject: [PATCH 5/8] Comment out loader overlay --- FusionIIIT/templates/dashboard/dashboard.html | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/FusionIIIT/templates/dashboard/dashboard.html b/FusionIIIT/templates/dashboard/dashboard.html index cf7138706..0a8967d47 100644 --- a/FusionIIIT/templates/dashboard/dashboard.html +++ b/FusionIIIT/templates/dashboard/dashboard.html @@ -41,7 +41,7 @@