diff --git a/assets/css/styles.css b/assets/css/styles.css index 95e9113..0922b3f 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -518,11 +518,14 @@ input[type=text] { top: -11px; max-height: 145px; } -.submit-message { - margin-top: 18px; } - .selected-status { background-color: #e4e4eb; border: solid 1px #dedee2; } +.montserrat { + font-family: "Montserrat-Regular"; } + +.error-text { + color: red; } + /*# sourceMappingURL=styles.css.map */ diff --git a/assets/css/styles.css.map b/assets/css/styles.css.map index 15e381a..a895616 100644 --- a/assets/css/styles.css.map +++ b/assets/css/styles.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAQ,oFAA4E;AAGpF,UAOC;EANG,WAAW,EAAE,iBAAiB;EAC9B,GAAG,EAAE,8CAA8C;EACnD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;EAClB,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,SAAS;AAGtC,UAOC;EANG,WAAW,EAAE,kBAAkB;EAC/B,GAAG,EAAE,+CAA+C;EACpD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;EAClB,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,SAAS;AAGtC,UAOC;EANG,WAAW,EAAE,wBAAwB;EACrC,GAAG,EAAE,qDAAqD;EAC1D,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;EAClB,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,SAAS;AAGtC,UAOC;EANG,WAAW,EAAE,mBAAmB;EAChC,GAAG,EAAE,gDAAgD;EACrD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;EAClB,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,SAAS;AAGtC,UAOC;EANG,WAAW,EAAE,oBAAoB;EACjC,GAAG,EAAE,iDAAiD;EACtD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;EAClB,sBAAsB,EAAE,WAAW;EACnC,uBAAuB,EAAE,S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B;EACjB,WAAW,ECncO,oBAAoB;EDoctC,SAAS,EAAE,IAAI;EACf,cAAc,EAAE,IAAI;EACpB,YAAY;EACZ,gBAAgB,ECvdJ,OAAO;EDwdnB,OAAO,EAAE,SAAS;EAClB,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,WAAW;;AAGvB,cAAe;EACX,gBAAgB,ECzdH,OAAO;ED0dpB,MAAM,EAAE,iBAAqB;;AAGjC,gBAAiB;EACb,MAAM,EAAE,MAAM;;AAGlB,eAAgB;EACZ,YAAY,EAAC,IAAI;;AAGrB,oBAAqB;EACjB,SAAS,EAAE,KAAK;;AAGpB,WAAY;EACT,UAAU,EAAE,IAAI;;AAGnB,kBAAmB;EACf,OAAO,EAAE,IAAI;EAET,2BAAI;IACA,UAAU,EAAE,IAAI;;AAM5B,mBAAoB;EAChB,WAAW,EC7eO,oBAAoB;ED8etC,KAAK,EC/fK,OAAO;;ADkgBrB,UAAW;EACP,gBAAgB,ECngBN,OAAO;EDogBjB,KAAK,EC1gBD,IAAI;;AD6gBZ,kBAAmB;EACf,gBAAgB,EC9gBZ,IAAI;ED+gBR,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,IAAI;;AAGpB,aAAc;EACV,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,IAAI,EAAE,KAAK;EACX,GAAG,EAAE,KAAK;EACV,UAAU,EAAE,KAAK;;AAGrB,gBAAiB;EACb,gBAAgB,EC/gBJ,OAAO;EDghBnB,MAAM,EAAE,iBAAsB;;AAGlC,WAAY;EACV,WAAW,EC3gBS,oBAAoB;;AD8gB1C,WAAY;EACV,KAAK,EAAE,GAAG", "sources": ["../scss/_typography.scss","../scss/_customdesign.scss","../scss/_variables.scss"], "names": [], "file": "styles.css" diff --git a/assets/js/js-cookie.js b/assets/js/js-cookie.js deleted file mode 100644 index 98aad3b..0000000 --- a/assets/js/js-cookie.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){if("function"==typeof define&&define.amd)define(a);else if("object"==typeof exports)module.exports=a();else{var b=window.Cookies,c=window.Cookies=a(window.jQuery);c.noConflict=function(){return window.Cookies=b,c}}}(function(){function a(){for(var a=0,b={};a1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(i){}return e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape),document.cookie=[b,"=",e,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}b||(g={});for(var j=document.cookie?document.cookie.split("; "):[],k=/(%[0-9A-Z]{2})+/g,l=0;l[0-9]+)/$', BotDetailView.as_view(), name='botdetails'), url(r'^bots/(?P[0-9]+)/chat/$', ChatBotAppView.as_view(), name='chat'), diff --git a/bots/views.py b/bots/views.py index b7122e6..a29198b 100644 --- a/bots/views.py +++ b/bots/views.py @@ -2,16 +2,13 @@ from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.shortcuts import get_object_or_404 +from django.contrib.auth.mixins import LoginRequiredMixin from django.core.paginator import ( Paginator, EmptyPage, PageNotAnInteger ) -from rest_framework.generics import ( - ListAPIView, - ListCreateAPIView, - RetrieveUpdateDestroyAPIView - ) + from rest_framework.views import APIView from rest_framework.viewsets import ModelViewSet from rest_framework.response import Response @@ -21,9 +18,12 @@ HTTP_400_BAD_REQUEST, HTTP_500_INTERNAL_SERVER_ERROR ) + +from datetime import datetime, timedelta import json from .models import Bot, Knowledge +from .mixins import UserIsOwnerMixin from .serializers import ( BotDetailsSerializer, ArchivedBotSerializer, @@ -76,7 +76,7 @@ def perform_create(self, serializer): if self.request.user == bot.creator: serializer.save(bot=bot, is_accepted=True) serializer.save(bot=bot) - + class ChatBot(APIView): def post(self, request, *args, **kwargs): @@ -118,8 +118,13 @@ def post(self, request, *args, **kwargs): # contextual and non-contextual similarity scores, # then join both as a set for each statement - vector_scores = [round(message.similarity(st_vector).item(), 4) - for st_vector in statement_vectors] + + # Note: spaCy will return a vector filled with 0s if the string to be + # parsed is not a word, or not in the corpus' vocabulary, causing + # .similarity() to return a Python float instead of a NumPy float + vector_scores = [0 if isinstance(message.similarity(st_vector), float) + else round(message.similarity(st_vector).item(), 4) + for st_vector in statement_vectors] edist_scores = [str_similarity(lemmatized_input, lm_vector) for lm_vector in lemmatized_vectors] vector_and_edist = [x for x in zip(vector_scores, edist_scores)] @@ -127,23 +132,20 @@ def post(self, request, *args, **kwargs): # look for statement in knowledge with highest similarity score, # considering both contextual and non-contextual scores # first store answer's index, later be converted to actual answer - bot_response = {'response': 0, 'confidence': 0.0, 'a': 0.0, 'b': 0.0} + bot_response = {'response': 0, 'confidence': 0.0} for index, score in enumerate(vector_and_edist): - avg_score = ((score[0]*.7)+(score[1]*.3)) - print(score[0], score[1], avg_score) - - # if abs(avg_score - bot_response['confidence']) <= 0.03: - # if bot_response['a'] < score[0]: - # bot_response = {'response': index, 'confidence': avg_score, 'a': score[0], 'b': score[1]} + if score[0] > 0: + final_score = (score[0] * 0.7) + (score[1] * 0.3) + else: + final_score = score[1] - if avg_score > bot_response['confidence']: - bot_response = {'response': index, 'confidence': avg_score, 'a': score[0], 'b': score[1]} + if final_score > bot_response['confidence']: + bot_response = {'response': index, 'confidence': final_score} - if avg_score == 1: + if final_score == 1: break if bot_response['confidence'] < 0.65: - print(suggested_statements) if self.request.data.get('message') in suggested_statements: return Response(json.dumps({'response': 'I have a pending query with the same \ question you asked that needs to be accepted by my creator.'}) @@ -169,38 +171,40 @@ def get_context_data(self,**kwargs): return context -class IndexView(TemplateView): +class IndexView(ListView): + model = Bot + context_object_name = 'bots' template_name = 'bots/index.html' + paginate_by = 6 + + def get_queryset(self): + queryset = self.model.objects.filter(is_archived=False).order_by('-id') + status = self.request.GET.get('status') + if status and status != 'None': + if status.lower() in ('active', 'inactive'): + status = True if status.lower() == 'active' else False + queryset = queryset.filter(is_active=status) + else: + raise Http404('Invalid status ({0}): No results to show'.format(status)) + created = self.request.GET.get('created') + if created and created != 'None': + if created.lower() in ('week', 'month'): + date_today = datetime.today() + last_week = date_today - timedelta(days=7) + last_month = date_today - timedelta(days=31) + + created = last_week if created == 'week' else last_month + queryset = queryset.filter(created__gte=created) + else: + raise Http404('Invalid filter ({0}): No results to show'.format(status)) + return queryset def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - if self.request.user.is_authenticated: - queryset = Bot.objects.filter(creator=self.request.user, - is_archived=False).order_by('-id', '-created') - paginator = Paginator(queryset, 4) - page = self.request.GET.get('page') - - try: - bots = paginator.page(page) - except PageNotAnInteger: - if page == 'first': - bots = paginator.page(1) - page = 1 - elif page == 'last': - bots = paginator.page(paginator.num_pages) - page = paginator.num_pages - else: - bots = paginator.page(1) - except EmptyPage: - bots = paginator.page(paginator.num_pages) - - page_numbers = [x for x in range(1, bots.paginator.num_pages+1)] - - context['bots'] = bots - context['total_bots'] = queryset.count() - context['active_bots'] = queryset.filter(is_active=True).count() - context['page_numbers'] = page_numbers - context['page'] = page if page else 1 + context['status'] = self.request.GET.get('status') + context['created'] = self.request.GET.get('created') + context['total_bots'] = Bot.objects.filter(is_archived=False).count() + context['active_bots'] = Bot.objects.filter(is_archived=False, is_active=True).count() return context @@ -208,19 +212,97 @@ class AddChatBotView(TemplateView): template_name = "bots/addbot.html" -class BotDetailView(DetailView): - model = Bot +class BotDetailView(UserIsOwnerMixin, ListView): + model = Knowledge + context_object_name = 'bot_knowledge' template_name = 'bots/botdetails.html' + paginate_by = 5 + + def get_queryset(self): + queryset = self.model.objects.filter( + is_accepted=True, bot=self.kwargs['pk']).order_by('-id') + return queryset def get_context_data(self,**kwargs): - knowledge = Knowledge.objects.filter(bot=self.kwargs['pk'], is_accepted=True).order_by('id') context = super().get_context_data(**kwargs) - if knowledge.exists(): - context['bot_knowledge'] = knowledge - context['bot'] = get_object_or_404(Bot, pk=self.kwargs['pk']) - context['suggested_knowledge'] = Knowledge.objects.filter(bot=self.kwargs['pk'] - , is_accepted=False).order_by('id') - else: - pass - - return context \ No newline at end of file + context['bot'] = get_object_or_404(Bot, pk=self.kwargs['pk']) + suggested_knowledge = self.model.objects.filter( + is_accepted=False, bot=self.kwargs['pk']).order_by('id') + p = self.request.GET.get('p') + paginator_b = Paginator(suggested_knowledge, 5) + + try: + suggestions = paginator_b.page(p) if p else paginator_b.page(1) + except PageNotAnInteger: + raise Http404('Page can not be converted to an int.') + except EmptyPage: + raise Http404('Invalid page ({}): That page contains no results'.format(p)) + + context['page_a'] = context['page_obj'].number + context['page_b'] = suggestions.number + context['suggestions'] = suggestions + context['num_pages_b'] = paginator_b.num_pages + return context + + +class MyBots(LoginRequiredMixin, ListView): + model = Bot + context_object_name = 'bots' + template_name = 'bots/mybots.html' + paginate_by = 6 + + def get_queryset(self): + queryset = self.model.objects.filter( + creator=self.request.user, is_archived=False).order_by('-id') + status = self.request.GET.get('status') + if status and status != 'None': + if status.lower() in ('active', 'inactive'): + status = True if status.lower() == 'active' else False + queryset = queryset.filter(is_active=status) + else: + raise Http404('Invalid status ({0}): No results to show'.format(status)) + created = self.request.GET.get('created') + if created and created != 'None': + if created.lower() in ('week', 'month'): + date_today = datetime.today() + last_week = date_today - timedelta(days=7) + last_month = date_today - timedelta(days=31) + + created = last_week if created == 'week' else last_month + queryset = queryset.filter(created__gte=created) + else: + raise Http404('Invalid filter ({0}): No results to show'.format(status)) + return queryset + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + user = self.request.user + context['status'] = self.request.GET.get('status') + context['created'] = self.request.GET.get('created') + context['total_bots'] = Bot.objects.filter(creator=user, is_archived=False).count() + context['active_bots'] = Bot.objects.filter( + is_active=True, creator=user, is_archived=False).count() + return context + + +class ArchivedBots(LoginRequiredMixin, ListView): + model = Bot + context_object_name = 'bots' + template_name = 'bots/archive.html' + paginate_by = 6 + + def get_queryset(self): + queryset = self.model.objects.filter( + creator=self.request.user, is_archived=True).order_by('-id') + created = self.request.GET.get('created') + if created and created != 'None': + if created.lower() in ('week', 'month'): + date_today = datetime.today() + last_week = date_today - timedelta(days=7) + last_month = date_today - timedelta(days=31) + + created = last_week if created == 'week' else last_month + queryset = queryset.filter(created__gte=created) + else: + raise Http404('Invalid filter ({0}): No results to show'.format(status)) + return queryset diff --git a/templates/account/login.html b/templates/account/login.html index 5b6fa2c..1f08cb5 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -1,18 +1,9 @@ {% extends 'base.html' %} {% block title %}Sign In{% endblock %} -{% block header %} -
-
-
-
-

Sign In

-

Please sign in with one of your existing third party accounts. Or, sign up for a Bot Pro account.

-
-
-
-
-{% endblock %} +{% block main_text %}Sign In{% endblock %} + +{% block sub_text %}lease sign in with one of your existing third party accounts. Or, sign up for a Bot Pro account.{% endblock %} {% block content %}
diff --git a/templates/account/password_change.html b/templates/account/password_change.html index 24f21be..5674fa2 100644 --- a/templates/account/password_change.html +++ b/templates/account/password_change.html @@ -1,19 +1,10 @@ {% extends 'base.html' %} {% load account socialaccount %} -{% block title %}Change password{% endblock %} +{% block title %}Change Password{% endblock %} -{% block header %} -
-
-
-
-

Change password

-

Security matters. Changing your password every once in a while won't hurt.

-
-
-
-
-{% endblock %} +{% block main_text %}Change Password{% endblock %} + +{% block sub_text %}Security matters. Changing your password every once in a while won't hurt.{% endblock %} {% block content %}
@@ -28,9 +19,6 @@

Change password

    {{ form.non_field_errors }}
- {% for message in messages %} - - {% endfor %}
{% csrf_token %} diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html index 2500da8..3fa3df7 100644 --- a/templates/account/password_reset.html +++ b/templates/account/password_reset.html @@ -2,18 +2,9 @@ {% load socialaccount %} {% block title %}Password Reset{% endblock %} -{% block header %} -
-
-
-
-

Password Reset

-

Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.{% if user.is_authenticated %}{% include "account/snippets/already_logged_in.html" %}{% endif %}

-
-
-
-
-{% endblock %} +{% block main_text %}Password Reset{% endblock %} + +{% block sub_text %}Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.{% if user.is_authenticated %}{% include "account/snippets/already_logged_in.html" %}{% endif %}{% endblock %} {% block content %}
diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.html index 3cab95b..6d77461 100644 --- a/templates/account/password_reset_done.html +++ b/templates/account/password_reset_done.html @@ -2,15 +2,6 @@ {% load account socialaccount %} {% block title %}Password Reset{% endblock %} -{% block header %} -
-
-
-
-

Password Reset

-

{% if user.is_authenticated %}{% include "account/snippets/already_logged_in.html" %}{% endif %}
We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.

-
-
-
-
-{% endblock %} \ No newline at end of file +{% block main_text %}Password Reset{% endblock %} + +{% block sub_text %}{% if user.is_authenticated %}{% include "account/snippets/already_logged_in.html" %}{% endif %}
We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblock %} \ No newline at end of file diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html index b8e3344..4015980 100644 --- a/templates/account/password_reset_from_key.html +++ b/templates/account/password_reset_from_key.html @@ -1,19 +1,10 @@ {% extends 'base.html' %} {% load socialaccount %} -{% block title %}Password Reset{% endblock %} +{% block title %}Change Password{% endblock %} -{% block header %} -
-
-
-
-

{% if token_fail %}Bad Token{% else %}Change password{% endif %}

-

{% if token_fail %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% else %}You are about to change your password, please fill up the form below{% endif %}

-
-
-
-
-{% endblock %} +{% block main_text %}{% if token_fail %}Bad Token{% else %}Change Password{% endif %}{% endblock %} + +{% block sub_text %}{% if token_fail %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% else %}You are about to change your password, please fill up the form below{% endif %}{% endblock %} {% block content %}
diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.html index 16aadc9..7ba51d0 100644 --- a/templates/account/password_reset_from_key_done.html +++ b/templates/account/password_reset_from_key_done.html @@ -2,15 +2,6 @@ {% load account socialaccount %} {% block title %}Password Reset - Success{% endblock %} -{% block header %} -
-
-
-
-

Password Reset

-

Your password has been successfully changed

-
-
-
-
-{% endblock %} \ No newline at end of file +{% block main_text %}Password Reset - Success{% endblock %} + +{% block sub_text %}Your password has been successfully changed{% endblock %} \ No newline at end of file diff --git a/templates/account/password_set.html b/templates/account/password_set.html index 19704b4..2031f3e 100644 --- a/templates/account/password_set.html +++ b/templates/account/password_set.html @@ -1,36 +1,19 @@ {% extends 'base.html' %} {% load account socialaccount %} -{% block title %}Set password{% endblock %} +{% block title %}Set Password{% endblock %} -{% block header %} -
-
-
-
-

Set password

-

Looks like you have only been signing in through a social account and have not set a password yet

-
-
-
-
-{% endblock %} +{% block main_text %}Set Password{% endblock %} + +{% block sub_text %}Looks like you have only been signing in through a social account and have not set a password yet{% endblock %} {% block content %}
-
    - {% for message in message %} -
  • {{ message }}
  • - {% endfor %} -
    {{ form.non_field_errors }}
- {% for message in messages %} - - {% endfor %} {% csrf_token %} diff --git a/templates/account/profile.html b/templates/account/profile.html index a97543f..c1a2b11 100644 --- a/templates/account/profile.html +++ b/templates/account/profile.html @@ -2,18 +2,9 @@ {% load account socialaccount %} {% block title %}{% if user.get_full_name %}{{ user.get_full_name }}{% else %}{{ user.email }}{% endif %}{% endblock %} -{% block header %} -
-
-
-
-

{% if user.get_full_name %}{{ user.get_full_name }}{% else %}(No name set yet){% endif %}

-

It's been {{ user.date_joined|timesince }} since you joined us!

-
-
-
-
-{% endblock %} +{% block main_text %}{% if user.get_full_name %}{{ user.get_full_name }}{% else %}{{ user.email }}{% endif %}{% endblock %} + +{% block sub_text %}It's been {{ user.date_joined|timesince }} since you joined us!{% endblock %} {% block content %}
@@ -58,17 +49,18 @@

{% if user.get_full_name %}{{ user.get_full_name }}{% else %}( params_length--; } } - var csrftoken = Cookies.get('csrftoken'); + if (params_length > 0) { $.ajax({ - type: "PUT", + type: "PATCH", url: '/api/auth/user/', beforeSend: function(xhr, settings) { - xhr.setRequestHeader("X-CSRFToken", csrftoken); + xhr.setRequestHeader("X-CSRFToken", '{{ csrf_token }}'); }, data: params, success: function(data) { - alert('Sucessfully sent message'); + alert('Sucessfully updated profile'); + window.location = '/accounts/profile'; }, error: function(errorMessages) { errorMessages = JSON.parse(errorMessages.responseText); diff --git a/templates/account/signup.html b/templates/account/signup.html index 818a062..c8c901c 100644 --- a/templates/account/signup.html +++ b/templates/account/signup.html @@ -1,18 +1,9 @@ {% extends '../base.html' %} {% block title %}Sign Up{% endblock %} -{% block header %} -
-
-
-
-

Sign Up

-

Already have an account? Then please sign in

-
-
-
-
-{% endblock %} +{% block main_text %}Sign Up{% endblock %} + +{% block sub_text %}Already have an account? Then please sign in{% endblock %} {% block content %}
diff --git a/templates/base.html b/templates/base.html index 90a95c9..3ce29c2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -33,9 +33,12 @@ {% if user.is_authenticated %}

- + {% block header %} +
+
+
+
+ {% for message in messages %} + + {% endfor %} + +
+
+

{% block main_text %}{% endblock %}

+

{% block sub_text %}{% endblock %}

+
+
+
+
+
{% endblock %} {% block content %} @@ -58,7 +78,6 @@ - {% block js %}{% endblock %} diff --git a/templates/bots/addbot.html b/templates/bots/addbot.html index 37f04ce..c3db95b 100644 --- a/templates/bots/addbot.html +++ b/templates/bots/addbot.html @@ -38,7 +38,7 @@
What do you want to call your bot?
- +
@@ -102,7 +102,7 @@ xhr.setRequestHeader("X-CSRFToken", '{{ csrf_token }}'); }, success : function(json) { - alert('Bot was added Successfully!'); + alert('Bot was added successfully!'); window.location = '/bots/' + json.id; }, error : function(xhr,errmsg,err) { diff --git a/templates/bots/archive.html b/templates/bots/archive.html new file mode 100644 index 0000000..8bd1898 --- /dev/null +++ b/templates/bots/archive.html @@ -0,0 +1,132 @@ +{% extends '../base.html' %} +{% load staticfiles %} + +{% block title %}Archived Bots{% endblock %} + +{% block main_text %}Archived Bots{% endblock %} + +{% block sub_text %}You've archived {{ bots.count }} bot(s){% endblock %} + +{% block content %} +
+
+ +
+ +
+
+ {% for bot in bots %} + +
+
+
+ {{ bot.name }} +
+
+ + + + +
+
+
+
+

{{ bot.description|truncatechars:200 }}

+ Date Created +
{{ bot.created|date:"m/d/Y" }}
+
+
+
+ + {% endfor %} +
+
+{% endblock %} + +{% block js %} + +{% endblock %} diff --git a/templates/bots/botdetails.html b/templates/bots/botdetails.html index a82f7bc..bb0c2f3 100644 --- a/templates/bots/botdetails.html +++ b/templates/bots/botdetails.html @@ -7,6 +7,11 @@
+
+ {% for message in messages %} + + {% endfor %} +
@@ -68,7 +73,7 @@
@@ -118,13 +123,19 @@
@@ -141,8 +152,8 @@
- {% if suggested_knowledge %} - {% for knowledge in suggested_knowledge %} + {% if suggestions %} + {% for knowledge in suggestions %}
@@ -258,13 +269,19 @@

@@ -429,7 +446,7 @@

- This bot knows nothing. Please Initialize by adding queries. + This bot knows nothing. Please initialize by adding queries.

diff --git a/templates/bots/chat.html b/templates/bots/chat.html index 04e02e5..a53bbf7 100644 --- a/templates/bots/chat.html +++ b/templates/bots/chat.html @@ -6,6 +6,11 @@
+
+ {% for message in messages %} + + {% endfor %} +


@@ -47,15 +52,10 @@

{{ bot.name }}

var botknowledgeUrl = '/api/bots/{{ bot.id }}/knowledges/'; var botId = '{{ bot.id }}' var teachReply = "{% if user == bot.creator %}Ok I learned that, try asking me again.{% else %}Ok, I'll have to ask my creator's approval for this.{% endif %}"; - var csrftoken = Cookies.get('csrftoken'); - function csrfSafeMethod(method) { - return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); - } + $.ajaxSetup({ beforeSend: function(xhr, settings) { - if (!csrfSafeMethod(settings.type) && !this.crossDomain) { - xhr.setRequestHeader("X-CSRFToken", csrftoken); - } + xhr.setRequestHeader("X-CSRFToken", '{{ csrftoken }}'); } }); diff --git a/templates/bots/index.html b/templates/bots/index.html index b8bb0e2..2e7412d 100644 --- a/templates/bots/index.html +++ b/templates/bots/index.html @@ -7,6 +7,11 @@
+
+ {% for message in messages %} + + {% endfor %} +

Collections

@@ -69,27 +74,30 @@
Summary

@@ -99,21 +107,9 @@
Summary

- {{ bot.name }} + {{ bot.name }}
- -
- - - - -
+
Active{% else %}btn-danger">Inactive{% endif %}
diff --git a/templates/bots/mybots.html b/templates/bots/mybots.html new file mode 100644 index 0000000..6ea6034 --- /dev/null +++ b/templates/bots/mybots.html @@ -0,0 +1,225 @@ +{% extends '../base.html' %} +{% load staticfiles %} + +{% block title %}Your Bots{% endblock %} + +{% block header %} +
+
+
+
+ {% for message in messages %} + + {% endfor %} + +
+
+

Your Bots

+

You've created {{ total_bots }} bot(s) so far

+
+
+
+ New Bot +
+
+
+
+
+
Summary

+
+
+
+
+
+
+
+
+
+ +
+
+ {{ total_bots }} +
Total Bots
+
+
+
+
+ +
+
+ {{ active_bots }} +
Active Bots
+
+
+
+
+ +
+
+ 6 +
Languages
+
+
+
+
+
+
+
+
+{% endblock %} + +{% block content %} +
+
+ +
+ +
+
+ {% for bot in bots %} + +
+
+
+ {{ bot.name }} +
+ +
+ + + + +
+
+
+
+

{{ bot.description|truncatechars:200 }}

+ Date Created +
{{ bot.created|date:"m/d/Y" }}
+
+
+
+ + {% endfor %} +
+
+{% endblock %} + +{% block js %} + +{% endblock %} diff --git a/templates/socialaccount/connections.html b/templates/socialaccount/connections.html index 7776761..37925f4 100644 --- a/templates/socialaccount/connections.html +++ b/templates/socialaccount/connections.html @@ -2,18 +2,9 @@ {% block title %}Social Accounts{% endblock %} -{% block header %} -
-
-
-
-

Social accounts

-

Here you can remove or add third-party accounts that you can sign in with

-
-
-
-
-{% endblock %} +{% block main_text %}Social Accounts{% endblock %} + +{% block sub_text %}Here you can remove or add third-party accounts that you can sign in with{% endblock %} {% block content %}
diff --git a/templates/socialaccount/signup.html b/templates/socialaccount/signup.html index 097a3e9..d4163c0 100644 --- a/templates/socialaccount/signup.html +++ b/templates/socialaccount/signup.html @@ -1,18 +1,9 @@ {% extends 'base.html' %} {% block title %}Sign Up{% endblock %} -{% block header %} -
-
-
-
-

Sign Up

-

{% with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{ provider_name }} account to login to {{ site_name }}. As a final step, please complete the following form{% endwith %}

-
-
-
-
-{% endblock %} +{% block main_text %}Sign Up{% endblock %} + +{% block sub_text %}{% with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{ provider_name }} account to login. As a final step, please complete the following form{% endwith %}{% endblock %} {% block content %}
diff --git a/users/urls.py b/users/urls.py index 0b2bcc5..b67491b 100644 --- a/users/urls.py +++ b/users/urls.py @@ -1,13 +1,20 @@ from django.conf.urls import url, include -from .views import FacebookLogin, GoogleLogin, UserProfileViewSet, UserProfile +from django.contrib.auth.views import logout as logout_view +from .views import ( + FacebookLogin, + GoogleLogin, + UserProfileViewSet, + UserProfile + ) urlpatterns = [ + url(r'^accounts/logout/$', logout_view, {'next_page': '/'}), + url(r'^accounts/profile', UserProfile.as_view(), name='user_profile'), url(r'^accounts/', include('allauth.urls')), url(r'^api/auth/', include('rest_auth.urls')), url(r'^api/auth/registration/', include('rest_auth.registration.urls')), url(r'^api/auth/facebook', FacebookLogin.as_view(), name='fb_login'), url(r'^api/auth/google', GoogleLogin.as_view(), name='google_login'), url(r'^user_profile/', UserProfileViewSet.as_view({'get': 'get', 'put': 'update'})), - url(r'^accounts/profile', UserProfile.as_view(), name='user_profile'), ]