diff --git a/.gitignore b/.gitignore index 23d2dcc..e8f1c7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ venv *.sqlite3 -*.pyc \ No newline at end of file +*.pyc diff --git a/apps/chats/forms.py b/apps/chats/forms.py index 4d3e923..a6427c1 100644 --- a/apps/chats/forms.py +++ b/apps/chats/forms.py @@ -15,7 +15,8 @@ class Meta: helper = FormHelper() helper.form_method = 'POST' - helper.add_input(Submit('Create', 'Create', css_class='btn-lg btn-primary')) + helper.add_input(Submit( + 'Create', 'Create', css_class='btn-lg btn-primary pull-right')) class EnrollRoomForm(forms.Form): @@ -23,4 +24,5 @@ class EnrollRoomForm(forms.Form): validators=[MinLengthValidator(6), ]) helper = FormHelper() helper.form_method = 'POST' - helper.add_input(Submit('Enroll', 'Enroll', css_class='btn-lg btn-primary')) + helper.add_input(Submit( + 'Enroll', 'Enroll', css_class='btn-lg btn-primary pull-right')) diff --git a/apps/chats/views.py b/apps/chats/views.py index cad1cb8..22c8978 100644 --- a/apps/chats/views.py +++ b/apps/chats/views.py @@ -1,3 +1,5 @@ +import datetime + from django.views.generic import ListView, CreateView, DetailView from django.shortcuts import redirect, get_object_or_404 from django.views.generic.edit import FormMixin @@ -6,7 +8,7 @@ from ..messages.forms import CreateMessageForm from ..messages.models import Message - +from ..users.models import User from .models import ChatRoom from .forms import CreateRoomForm, EnrollRoomForm @@ -49,6 +51,10 @@ def get_context_data(self, **kwargs): context['form'] = self.get_form(self.get_form_class()) context['room'] = get_object_or_404(ChatRoom, slug=self.kwargs['slug']) context['room_messages'] = Message.objects.filter(room=context['room']) + users = User.objects.filter( + last_login__gt=self.request.user.last_logged_out, + is_active__exact=1, ).order_by('-last_login') + context['online_users'] = users return context def post(self, request, *args, **kwargs): @@ -61,7 +67,8 @@ def post(self, request, *args, **kwargs): return self.form_invalid(form) def form_valid(self, form): - form.instance.user = self.request.user + form.instance.created_by = self.request.user + form.instance.created_at = datetime.datetime.now() form.instance.room = get_object_or_404( ChatRoom, slug=self.kwargs['slug']) form.save() diff --git a/apps/messages/forms.py b/apps/messages/forms.py index b8100bb..2f5bd73 100644 --- a/apps/messages/forms.py +++ b/apps/messages/forms.py @@ -16,4 +16,5 @@ class Meta: helper = FormHelper() helper.form_method = 'POST' - helper.add_input(Submit('Post', 'Post', css_class='btn-lg btn-primary')) + helper.add_input(Submit( + 'Send', 'Send', css_class='btn-lg btn-primary pull-right')) diff --git a/apps/messages/models.py b/apps/messages/models.py index 2c34022..dc1f5e6 100644 --- a/apps/messages/models.py +++ b/apps/messages/models.py @@ -8,8 +8,8 @@ class Message(models.Model): created_by = models.ForeignKey(User) room = models.ForeignKey(ChatRoom) created_at = models.DateTimeField(auto_now=False) - body = models.CharField(max_length=140, - help_text='Max characters is 140.') + body = models.CharField(max_length=400, + help_text='Max characters is 400.') def __unicode__(self): return self.body diff --git a/apps/users/forms.py b/apps/users/forms.py index a2eb2f6..d2baa31 100644 --- a/apps/users/forms.py +++ b/apps/users/forms.py @@ -1,6 +1,9 @@ from django import forms from django.contrib.auth.forms import ReadOnlyPasswordHashField +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Submit + from .models import User @@ -45,8 +48,11 @@ class Meta: model = User fields = ('username', 'email') + helper = FormHelper() + helper.form_method = 'POST' + helper.add_input(Submit('Create', 'Create', css_class='btn-lg btn-primary')) + def signup(self, request, user): - email = self.cleaned_data['email'] - user.email = email + user.email = self.cleaned_data['email'] user.username = self.cleaned_data['username'] user.save() diff --git a/apps/users/models.py b/apps/users/models.py index df8d21d..d5fd97f 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -1,5 +1,8 @@ +import datetime + from django.db import models from django.contrib.auth.models import BaseUserManager, AbstractBaseUser +from django.contrib.auth.signals import user_logged_out class MyUserManager(BaseUserManager): @@ -32,6 +35,7 @@ class User(AbstractBaseUser): username = models.CharField(max_length=30, unique=True) is_admin = models.BooleanField(default=False) is_active = models.BooleanField(default=True) + last_logged_out = models.DateTimeField(auto_now=True) objects = MyUserManager() @@ -56,3 +60,9 @@ def has_module_perms(self, app_label): @property def is_staff(self): return self.is_admin + + +def update_logged_out(sender, user, request, **kwargs): + user.last_logged_out = datetime.datetime.now() + +user_logged_out.connect(update_logged_out) diff --git a/chatrooms/settings.py b/chatrooms/settings.py index ea1b794..6d38b13 100644 --- a/chatrooms/settings.py +++ b/chatrooms/settings.py @@ -137,3 +137,5 @@ ) CRISPY_TEMPLATE_PACK = 'bootstrap3' + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' diff --git a/chatrooms/urls.py b/chatrooms/urls.py index d39723c..1d3c7a8 100644 --- a/chatrooms/urls.py +++ b/chatrooms/urls.py @@ -1,10 +1,19 @@ from django.conf.urls import patterns, include, url +from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', + url(r'^$', + TemplateView.as_view(template_name='static/index.html'), + name='home'), + + url(r'^about/$', + TemplateView.as_view(template_name='static/about.html'), + name='about'), + url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('allauth.urls')), url(r'^accounts/', include('apps.users.urls', namespace="users")), diff --git a/static/css/app.css b/static/css/app.css index 5f69d63..d0f8cc0 100644 --- a/static/css/app.css +++ b/static/css/app.css @@ -5,6 +5,41 @@ position: relative; } .message { + font-size: 16px; } -p { +#get-started { + background: url('../img/ocean.jpg') no-repeat; + background-size: cover; + display: block; + height: 93vh; + max-height: 93vh; +} +#greeting { + padding: 15px; + background-color: rgba(255, 255, 255, 0.6); + margin-top: 25vh; +} +.navbar { + margin-bottom: 0; +} +.btn-transparent { + padding: 11px 17px; + font-size: 20px; + letter-spacing: 0.15em; + color: #999; + background-color: rgba(255, 255, 255, 0); + border-color: #999; + transition: all 0.6s ease; + -webkit-transition: all 0.6s ease; + -moz-transition: all 0.6s ease; + -o-transition: all 0.6s ease; +} +.btn-transparent:hover, .btn-transparent:focus { + color: #fff; + background-color: #428bca; + border-color: #fff; +} +ul { + list-style-type: none; + padding-left: 0; } \ No newline at end of file diff --git a/static/img/ocean.jpg b/static/img/ocean.jpg new file mode 100644 index 0000000..9d9c5ae Binary files /dev/null and b/static/img/ocean.jpg differ diff --git a/templates/account/account_inactive.html b/templates/account/account_inactive.html new file mode 100755 index 0000000..3347f4f --- /dev/null +++ b/templates/account/account_inactive.html @@ -0,0 +1,11 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Account Inactive" %}{% endblock %} + +{% block content %} +

{% trans "Account Inactive" %}

+ +

{% trans "This account is inactive." %}

+{% endblock %} diff --git a/templates/account/base.html b/templates/account/base.html new file mode 100755 index 0000000..3070348 --- /dev/null +++ b/templates/account/base.html @@ -0,0 +1,3 @@ +{% extends "base.html" %} + + diff --git a/templates/account/email.html b/templates/account/email.html new file mode 100755 index 0000000..f0a6fbc --- /dev/null +++ b/templates/account/email.html @@ -0,0 +1,88 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% load url from future %} +{% block title %}{% trans "Email" %}{% endblock %} + +{% block content %} + {% if messages %} + {% for message in messages %} +
+ + {{message}} +
+ {% endfor %} + {% endif %} +
+
+
+
+

{% trans "Direcciones de E-mail" %}

+ {% if user.emailaddress_set.all %} +

{% trans 'Estas direcciones de email están asociadas a tu cuenta:' %}

+ + +
+ {% else %} +

+ {% trans 'Warning:'%}{% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

+ + {% endif %} + + +

{% trans "Añadir direcciones de email" %}

+ +
+ {% csrf_token %} +
+ + +
+
+ + Volver a configuración +
+
+
+
+
+
+{% endblock %} {% block extra_bottom %} + +{% endblock %} diff --git a/templates/account/email/email_confirmation_message.txt b/templates/account/email/email_confirmation_message.txt new file mode 100755 index 0000000..50bfb87 --- /dev/null +++ b/templates/account/email/email_confirmation_message.txt @@ -0,0 +1,4 @@ +{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with current_site.name as site_name %}User {{ user_display }} at {{ site_name }} has given this as an email address. + +To confirm this is correct, go to {{ activate_url }} +{% endblocktrans %}{% endautoescape %} diff --git a/templates/account/email/email_confirmation_signup_message.txt b/templates/account/email/email_confirmation_signup_message.txt new file mode 100755 index 0000000..9996f7e --- /dev/null +++ b/templates/account/email/email_confirmation_signup_message.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_message.txt" %} diff --git a/templates/account/email/email_confirmation_signup_subject.txt b/templates/account/email/email_confirmation_signup_subject.txt new file mode 100755 index 0000000..4c85ebb --- /dev/null +++ b/templates/account/email/email_confirmation_signup_subject.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_subject.txt" %} diff --git a/templates/account/email/email_confirmation_subject.txt b/templates/account/email/email_confirmation_subject.txt new file mode 100755 index 0000000..3c960da --- /dev/null +++ b/templates/account/email/email_confirmation_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Confirm E-mail Address{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/password_reset_key_message.txt b/templates/account/email/password_reset_key_message.txt new file mode 100755 index 0000000..585e8b3 --- /dev/null +++ b/templates/account/email/password_reset_key_message.txt @@ -0,0 +1,9 @@ +{% load i18n %}{% blocktrans with site.domain as site_domain and user.username as username %}You're receiving this e-mail because you or someone else has requested a password for your user account at {{site_domain}}. +It can be safely ignored if you did not request a password reset. Click the link below to reset your password. + +{{password_reset_url}} + +In case you forgot, your username is {{username}}. + +Thanks for using our site! +{% endblocktrans %} diff --git a/templates/account/email/password_reset_key_subject.txt b/templates/account/email/password_reset_key_subject.txt new file mode 100755 index 0000000..aa80d11 --- /dev/null +++ b/templates/account/email/password_reset_key_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset E-mail{% endblocktrans %} +{% endautoescape %} \ No newline at end of file diff --git a/templates/account/email_confirm.html b/templates/account/email_confirm.html new file mode 100755 index 0000000..2121576 --- /dev/null +++ b/templates/account/email_confirm.html @@ -0,0 +1,31 @@ +{% extends "account/base.html" %} +{% load url from future %} +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} + + +{% block content %} +

{% trans "Confirm E-mail Address" %}

+ +{% if confirmation %} + +{% user_display confirmation.email_address.user as user_display %} + +

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

+ +
+{% csrf_token %} + +
+ +{% else %} + +{% url 'account_email' as email_url %} + +

{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}

+ +{% endif %} + +{% endblock %} diff --git a/templates/account/email_confirmed.html b/templates/account/email_confirmed.html new file mode 100755 index 0000000..bd498d3 --- /dev/null +++ b/templates/account/email_confirmed.html @@ -0,0 +1,17 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} + + +{% block content %} + +

{% trans "Confirm E-mail Address" %}

+ +{% user_display email_address.user as user_display %} + +

{% blocktrans with email_address.email as email %}You have confirmed that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

+ +{% endblock %} diff --git a/templates/account/login.html b/templates/account/login.html new file mode 100644 index 0000000..3073296 --- /dev/null +++ b/templates/account/login.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} {% block title %} Chatrooms | Login {% endblock %} {% block content %} +
+
+
+
+

Login or Signup

+
+
+ {% csrf_token %} + {% if form.login.errors %} +
+ + {{form.login.errors}}
+
+ + + {% else %} +
+ + + {% endif %} +
+ + {% if form.password.errors %} +
+ + {{form.password.errors}}
+
+ + + {% else %} +
+ + + {% endif %} +
+
+ reset password +
+ {% if redirect_field_value %} + {% endif %} + +
+
+ +
+
+
+{% endblock %} diff --git a/templates/account/logout.html b/templates/account/logout.html new file mode 100755 index 0000000..4447ee8 --- /dev/null +++ b/templates/account/logout.html @@ -0,0 +1,22 @@ +{% extends "account/base.html" %} + +{% load url from future %} +{% load i18n %} + +{% block head_title %}{% trans "Sign Out" %}{% endblock %} + +{% block content %} +

{% trans "Sign Out" %}

+ +

{% trans 'Are you sure you want to sign out?' %}

+ +
+ {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + +
+ + +{% endblock %} diff --git a/templates/account/messages/cannot_delete_primary_email.txt b/templates/account/messages/cannot_delete_primary_email.txt new file mode 100755 index 0000000..de55571 --- /dev/null +++ b/templates/account/messages/cannot_delete_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You cannot remove your primary e-mail address ({{email}}).{% endblocktrans %} diff --git a/templates/account/messages/email_confirmation_sent.txt b/templates/account/messages/email_confirmation_sent.txt new file mode 100755 index 0000000..7a526f8 --- /dev/null +++ b/templates/account/messages/email_confirmation_sent.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Confirmation e-mail sent to {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_confirmed.txt b/templates/account/messages/email_confirmed.txt new file mode 100755 index 0000000..3427a4d --- /dev/null +++ b/templates/account/messages/email_confirmed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_deleted.txt b/templates/account/messages/email_deleted.txt new file mode 100755 index 0000000..5cf7cf9 --- /dev/null +++ b/templates/account/messages/email_deleted.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Removed e-mail address {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_in.txt b/templates/account/messages/logged_in.txt new file mode 100755 index 0000000..f49248a --- /dev/null +++ b/templates/account/messages/logged_in.txt @@ -0,0 +1,4 @@ +{% load account %} +{% load i18n %} +{% user_display user as name %} +{% blocktrans %}Successfully signed in as {{name}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_out.txt b/templates/account/messages/logged_out.txt new file mode 100755 index 0000000..2cd4627 --- /dev/null +++ b/templates/account/messages/logged_out.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have signed out.{% endblocktrans %} diff --git a/templates/account/messages/password_changed.txt b/templates/account/messages/password_changed.txt new file mode 100755 index 0000000..e01766b --- /dev/null +++ b/templates/account/messages/password_changed.txt @@ -0,0 +1,3 @@ +{% load i18n %} +{% blocktrans %}Password successfully changed.{% endblocktrans %} + diff --git a/templates/account/messages/password_set.txt b/templates/account/messages/password_set.txt new file mode 100755 index 0000000..e36cef8 --- /dev/null +++ b/templates/account/messages/password_set.txt @@ -0,0 +1,3 @@ +{% load i18n %} +{% blocktrans %}Password successfully set.{% endblocktrans %} + diff --git a/templates/account/messages/primary_email_set.txt b/templates/account/messages/primary_email_set.txt new file mode 100755 index 0000000..b6a70dd --- /dev/null +++ b/templates/account/messages/primary_email_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Primary e-mail address set.{% endblocktrans %} diff --git a/templates/account/messages/unverified_primary_email.txt b/templates/account/messages/unverified_primary_email.txt new file mode 100755 index 0000000..9c9d0d8 --- /dev/null +++ b/templates/account/messages/unverified_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Your primary e-mail address must be verified.{% endblocktrans %} diff --git a/templates/account/password_change.html b/templates/account/password_change.html new file mode 100755 index 0000000..04ce023 --- /dev/null +++ b/templates/account/password_change.html @@ -0,0 +1,70 @@ +{% extends "account/base.html" %} +{% block header %} +
+
+
+

+ Cambiar Contraseña +

+
+
+
+{% endblock %} + +{% load url from future %} +{% load i18n %} + +{% block content %} +
+
+
+ {% if messages %} + {% for message in messages %} +
+ + {{message}} +
+ {% endfor %} + {% endif %} +
+ {% csrf_token %} +
+
+ {% if form.oldpassword.errors %} +
+ + {{form.oldpassword.errors}} +
+ {% endif %} +

+
+
+ {% if form.password1.errors %} +
+ + {{form.password1.errors}} +
+ {% endif %} + +
+
+
+ {% if form.password2.errors %} +
+ + {{form.password2.errors}} +
+ {% endif %} + +
+
+ +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html new file mode 100755 index 0000000..a766e65 --- /dev/null +++ b/templates/account/password_reset.html @@ -0,0 +1,42 @@ +{% extends "account/base.html" %} +{% block title %}Chatrooms | Password Reset{% endblock %} +{% load i18n %} +{% load account %} +{% load url from future %} +{% block content %} +
+
+

+
+
+ {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} +

Password Reset

+
+

{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

+ +
+ {% csrf_token %} + {% if form.email.errors %} +
+ + {{form.email.errors}}
+ {% endif %} + + +
+ +
+
+
+
+

{% blocktrans %}Feel free to comunicate with me if you have any problems creating your new password.{% endblocktrans %}

+
+
+
+
+ +{% endblock %} diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.html new file mode 100755 index 0000000..837b6e0 --- /dev/null +++ b/templates/account/password_reset_done.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} +{% block title %}Chatrooms | Password reset sent{% endblock %} +{% load i18n %} +{% load account %} +{% load url from future %} + +{% load i18n %} +{% load account %} +{% block content %} +
+
+
+
+
+ {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} + +

{% blocktrans %}Reset account password email sent. Please contact me if you don't receive the email shortly.{% endblocktrans %}

+
+
+
+{% endblock %} diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html new file mode 100755 index 0000000..e7a1e73 --- /dev/null +++ b/templates/account/password_reset_from_key.html @@ -0,0 +1,42 @@ +{% extends "account/base.html" %} +{% load url from future %} +{% load i18n %} +{% block title %}Chatrooms | Password Reset{% endblock %} +{% load url from future %} +{% load i18n %} + +{% block content %} +
+
+
+
+ {% if token_fail %} + {% url 'account_reset_password' as passwd_reset_url %} +

The link to create a new password is invalid, it is possible that it has been used. You can resend the email here.

+ {% else %} + {% if form %} +

Password reset

+
+ {% csrf_token %} +
+
    +
  • + +
  • +
    +
  • + +
  • +
    + +
+
+
+ {% else %} +

{% trans 'Your password has already been changed.' %}

+ {% endif %} + {% endif %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.html new file mode 100755 index 0000000..9201b94 --- /dev/null +++ b/templates/account/password_reset_from_key_done.html @@ -0,0 +1,14 @@ +{% extends "account/base.html" %} +{% load url from future %} +{% load i18n %} +{% block title %}Chatrooms | Password reset done{% endblock %} +{% block content %} +
+
+
+
+

{% trans 'Your new password has been set. Now you may ' %} login {% trans ' with your new password.' %}

+
+
+
+{% endblock %} diff --git a/templates/account/password_set.html b/templates/account/password_set.html new file mode 100755 index 0000000..9720e1f --- /dev/null +++ b/templates/account/password_set.html @@ -0,0 +1,58 @@ +{% extends "account/base.html" %} +{% block header %} +
+
+
+

+ Establecer Contraseña +

+
+
+
+{% endblock %} +{% load url from future %} +{% load i18n %} + +{% block content %} +
+
+
+ {% if messages %} + {% for message in messages %} +
+ + {{message}} +
+ {% endfor %} + {% endif %} +
+ {% csrf_token %} +
+ {% if form.password1.errors %} +
+ + {{form.password1.errors}} +
+ {% endif %} + + +
+
+ {% if form.password2.errors %} +
+ + {{form.password2.errors}} +
+ {% endif %} + + +
+ +
+
+
+
+{% endblock %} diff --git a/templates/account/signup.html b/templates/account/signup.html new file mode 100644 index 0000000..57fdb29 --- /dev/null +++ b/templates/account/signup.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} +{% load crispy_forms_tags %} +{% block title %} Chatrooms | Signup {% endblock %} +{% block content %} +
+
+
+
+
+

Signup

+ {% crispy form %} +
+
+
+{% endblock %} diff --git a/templates/account/signup_closed.html b/templates/account/signup_closed.html new file mode 100755 index 0000000..5ef0709 --- /dev/null +++ b/templates/account/signup_closed.html @@ -0,0 +1,14 @@ +{% extends "account/base.html" %} + +{% load url from future %} +{% load i18n %} + +{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up Closed" %}

+ +

{% trans "We are sorry, but the sign up is currently closed." %}

+{% endblock %} + + diff --git a/templates/account/snippets/already_logged_in.html b/templates/account/snippets/already_logged_in.html new file mode 100755 index 0000000..00799f0 --- /dev/null +++ b/templates/account/snippets/already_logged_in.html @@ -0,0 +1,5 @@ +{% load i18n %} +{% load account %} + +{% user_display user as user_display %} +

{% trans "Note" %}: {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}

diff --git a/templates/account/verification_sent.html b/templates/account/verification_sent.html new file mode 100755 index 0000000..2389cf6 --- /dev/null +++ b/templates/account/verification_sent.html @@ -0,0 +1,25 @@ +{% extends "account/base.html" %} +{% block title %} Verificación Enviada| Notaso {% endblock %} +{% block header %} +
+
+
+

{% trans Verificación enviada %}

+
+
+
+{% endblock %} + +{% load i18n %} + +{% block content %} +
+
+
+

{% blocktrans %}Hemos enviado un e-mail para la verificación. Entre al ensalace provisto en el e-mail para finalizar el proceso de registracion. Favor contactenos si no recibe el e-mail en los proximos minutos.{% endblocktrans %}

+ +
+
+
+ +{% endblock %} diff --git a/templates/account/verified_email_required.html b/templates/account/verified_email_required.html new file mode 100755 index 0000000..a33d2a3 --- /dev/null +++ b/templates/account/verified_email_required.html @@ -0,0 +1,53 @@ +{% extends "account/base.html" %} + +{% load url from future %} +{% load i18n %} + +{% block content %} +

{% trans "Verify Your E-mail Address" %}

+ +{% url 'account_email' as email_url %} + +

{% blocktrans %}This part of the site requires us to verify that +you are who you claim to be. For this purpose, we require that you +verify ownership of your e-mail address. {% endblocktrans %}

+ +

{% blocktrans %}We have sent an e-mail to you for +verification. Please click on the link inside this e-mail. Please +contact us if you do not receive it within a few minutes.{% endblocktrans %}

+ +

{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}

+ + +{% endblock %} + +{% block title %} Verificación Enviada| Notaso {% endblock %} +{% block header %} +
+
+
+

{% trans Verificación enviada requerida %}

+
+
+
+{% endblock %} + +{% load i18n %} + +{% block content %} +
+
+
+ {% url 'account_email' as email_url %} +

{% blocktrans %}Esta parte de la página nos requiere que verifiquemos que eres quien dices ser. Por esta razón, pedimos verificar que usted es el dueño de la cuenta de e-mail que nos fue provista.{% endblocktrans %}

+ +

{% blocktrans %}Hemos enviado un e-mail para la verificación. Entre al enlace provisto en el e-mail para finalizar el proceso de registro. Favor contactenos si no recibe el e-mail en los proximos minutos.{% endblocktrans %}

+ +

{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}

+ + +
+
+
+ +{% endblock %} diff --git a/templates/base.html b/templates/base.html index a29d948..47da480 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,10 +15,8 @@ {% block header %} {% include "common/header.html" %} {% endblock header %} -
{% block content %} {% endblock content %} -
{% block footer %} {# {% include "common/footer.html" %} #} {% endblock footer %} diff --git a/templates/chats/create.html b/templates/chats/create.html index 7f10188..75d6b0e 100644 --- a/templates/chats/create.html +++ b/templates/chats/create.html @@ -1,11 +1,15 @@ {% extends "base.html" %} {% load crispy_forms_tags %} -{% block title %}Chats | Create room{% endblock title %} +{% block title %}ChatRooms | Create room{% endblock title %} {% block content %} +
-
- {% csrf_token %} +
+
+

Create your own room.

+
{% crispy form %}
+
{% endblock content %} \ No newline at end of file diff --git a/templates/chats/enroll.html b/templates/chats/enroll.html index 98732a9..275e68c 100644 --- a/templates/chats/enroll.html +++ b/templates/chats/enroll.html @@ -1,12 +1,15 @@ {% extends "base.html" %} {% load crispy_forms_tags %} -{% block title %}Rooms | Enroll{% endblock title %} +{% block title %}ChatRooms | Enroll{% endblock title %} {% block content %} +
-
-

{{ room.name }}

+
+
+

{{ room.name }} - {{ room.members.count }} members


{% crispy form %}
+
{% endblock content %} \ No newline at end of file diff --git a/templates/chats/index.html b/templates/chats/index.html index d5d5da1..1a8441a 100644 --- a/templates/chats/index.html +++ b/templates/chats/index.html @@ -1,11 +1,22 @@ {% extends "base.html" %} -{% block title %}Chats{% endblock title %} +{% block title %}ChatRooms | Available rooms{% endblock title %} {% block content %} +
+
+ {% if object_list|length > 0 %} +

Available rooms

+
{% for room in object_list %} -

{{ room }}

+

{{ room }} - {{ room.members.count }} members

{% endfor %} + + {% else %} +

No available rooms. If you are an administrator, you can create a room here.

+ {% endif %} +
+
{% endblock content %} \ No newline at end of file diff --git a/templates/chats/room.html b/templates/chats/room.html index d51bb87..9843362 100644 --- a/templates/chats/room.html +++ b/templates/chats/room.html @@ -1,23 +1,37 @@ {% extends "base.html" %} {% load crispy_forms_tags %} -{% block title %}Chats | {{ room.name }}{% endblock title %} +{% block title %}ChatRooms | {{ room.name }}{% endblock title %} {% block content %} +
-
+
+
+
+
Online Members
+
+ {% for u in online_users %} +

{{ u }}

+ {% endfor %} +
+ +
+
+
{{ room.name }}
{% for m in room_messages %} -

{{ m.created_by.username }}

- {{ m }} +

{{ m.created_by.username }} | {{ m.created_at|timesince }} ago

+

{{ m }}


{% endfor %}
-
- +
{% endblock content %} \ No newline at end of file diff --git a/templates/common/header.html b/templates/common/header.html index d3bda61..3e06757 100644 --- a/templates/common/header.html +++ b/templates/common/header.html @@ -7,13 +7,13 @@ - Chat Rooms + Chat Rooms
diff --git a/templates/openid/base.html b/templates/openid/base.html new file mode 100755 index 0000000..671d403 --- /dev/null +++ b/templates/openid/base.html @@ -0,0 +1 @@ +{% extends "socialaccount/base.html" %} diff --git a/templates/openid/login.html b/templates/openid/login.html new file mode 100755 index 0000000..2bcea25 --- /dev/null +++ b/templates/openid/login.html @@ -0,0 +1,19 @@ +{% extends "openid/base.html" %} + +{% load url from future %} +{% load i18n %} + +{% block head_title %}OpenID Sign In{% endblock %} + +{% block content %} + +

{% trans 'OpenID Sign In' %}

+ + + + +{% endblock %} diff --git a/templates/socialaccount/authentication_error.html b/templates/socialaccount/authentication_error.html new file mode 100755 index 0000000..0300295 --- /dev/null +++ b/templates/socialaccount/authentication_error.html @@ -0,0 +1,11 @@ +{% extends "socialaccount/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Social Network Login Failure" %}{% endblock %} + +{% block content %} +

{% trans "Social Network Login Failure" %}

+ +

{% trans "An error occurred while attempting to login via your social network account." %}

+{% endblock %} diff --git a/templates/socialaccount/base.html b/templates/socialaccount/base.html new file mode 100755 index 0000000..18530d1 --- /dev/null +++ b/templates/socialaccount/base.html @@ -0,0 +1,2 @@ +{% extends "account/base.html" %} + diff --git a/templates/socialaccount/connections.html b/templates/socialaccount/connections.html new file mode 100755 index 0000000..46ae8c0 --- /dev/null +++ b/templates/socialaccount/connections.html @@ -0,0 +1,77 @@ +{% extends "socialaccount/base.html" %} + +{% block header %} +
+
+
+

+ Perfiles Sociales +

+
+
+
+ +{% endblock %} +{% load i18n %} +{% load url from future %} +{% block content %} +
+
+
+ {% if messages %} + {% for message in messages %} +
+ + {{message}} +
+ {% endfor %} + {% endif %} +{% if form.accounts %} +

{% blocktrans %}Puedes hacer login usando cualquiera de las siguientes cuentas:{% endblocktrans %}

+ + +
+ {% csrf_token %} + +
+ {% if form.non_field_errors %} +
+ {{form.non_field_errors}}
+ {% endif %} + {% for base_account in form.accounts %} + {% with base_account.get_provider_account as account %} +
+ +
+ {% endwith %} + {% endfor %} + +
+

+ +
+ +
+ +
+ +{% else %} +

{% trans 'Al momento, no tiene ningun perfil social conectado a esta cuenta.' %}

+{% endif %} +
+

{% trans 'Conecta perfiles sociales' %}

+
+
    + {% include "socialaccount/snippets/provider_list.html" with process="connect" %} +
+
+{% include "socialaccount/snippets/login_extra.html" %} +Volver a configuración +
+
+
+{% endblock %} diff --git a/templates/socialaccount/login_cancelled.html b/templates/socialaccount/login_cancelled.html new file mode 100755 index 0000000..f73a769 --- /dev/null +++ b/templates/socialaccount/login_cancelled.html @@ -0,0 +1,17 @@ +{% extends "socialaccount/base.html" %} + +{% load url from future %} +{% load i18n %} + +{% block head_title %}{% trans "Login Cancelled" %}{% endblock %} + +{% block content %} + +

{% trans "Login Cancelled" %}

+ +{% url 'account_login' as login_url %} + +

{% blocktrans %}You decided to cancel logging in to our site using one of your existing accounts. If this was a mistake, please proceed to sign in.{% endblocktrans %}

+ +{% endblock %} + diff --git a/templates/socialaccount/messages/account_connected.txt b/templates/socialaccount/messages/account_connected.txt new file mode 100755 index 0000000..be6aa60 --- /dev/null +++ b/templates/socialaccount/messages/account_connected.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account has been connected.{% endblocktrans %} diff --git a/templates/socialaccount/messages/account_connected_other.txt b/templates/socialaccount/messages/account_connected_other.txt new file mode 100755 index 0000000..e90f6cc --- /dev/null +++ b/templates/socialaccount/messages/account_connected_other.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account is already connected to a different account.{% endblocktrans %} diff --git a/templates/socialaccount/messages/account_disconnected.txt b/templates/socialaccount/messages/account_disconnected.txt new file mode 100755 index 0000000..fd43f30 --- /dev/null +++ b/templates/socialaccount/messages/account_disconnected.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account has been disconnected.{% endblocktrans %} diff --git a/templates/socialaccount/signup.html b/templates/socialaccount/signup.html new file mode 100755 index 0000000..413aa66 --- /dev/null +++ b/templates/socialaccount/signup.html @@ -0,0 +1,67 @@ +{% extends "socialaccount/base.html" %} +{% block title %}Sign-up | Notaso{% endblock %} +{% block header %} +
+
+
+

Registrate

+

Conoces a tus profesores antes de entrar al salón

+
+
+
+{% endblock %} +{% load url from future %} +{% load i18n %} +{% block content %} +
+
+
+

¿Tiene una cuenta? Puedes accederla aquí.

+
+

{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}Vas a usar tu cuenta de {{provider_name}} para acceder a {{site_name}}. Como paso final, favor complete la siguiente informacion:{% endblocktrans %}

+
    + +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/socialaccount/snippets/login_extra.html b/templates/socialaccount/snippets/login_extra.html new file mode 100755 index 0000000..f2c5225 --- /dev/null +++ b/templates/socialaccount/snippets/login_extra.html @@ -0,0 +1,4 @@ +{% load socialaccount %} + +{% providers_media_js %} + diff --git a/templates/socialaccount/snippets/provider_list.html b/templates/socialaccount/snippets/provider_list.html new file mode 100755 index 0000000..906cfff --- /dev/null +++ b/templates/socialaccount/snippets/provider_list.html @@ -0,0 +1,19 @@ +{% load socialaccount %} + +{% for provider in socialaccount.providers %} +{% if provider.id == "openid" %} +{% for brand in provider.get_brands %} +
  • + {{brand.name}} +
  • +{% endfor %} +{% endif %} +
  • + +
  • +{% endfor %} \ No newline at end of file diff --git a/templates/static/about.html b/templates/static/about.html new file mode 100644 index 0000000..2ae5f3b --- /dev/null +++ b/templates/static/about.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} +{% block title %}ChatRooms | About{% endblock title %} +{% block content %} +
    +
    +

    Chatrooms is currently in beta and open for improvements.

    +
    +
    + + + +
    +
    +

    If you have any issue and/or recomendation. Feel free to let us know at the projects issue page on Github.

    +
    + Issues page +
    +
    +{% endblock content %} \ No newline at end of file diff --git a/templates/static/index.html b/templates/static/index.html new file mode 100644 index 0000000..5ba7e90 --- /dev/null +++ b/templates/static/index.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block title %}ChatRooms | Home{% endblock title %} +{% block content %} +
    +
    +
    +
    +

    ChatRooms gives you, your personal room to chat with others.

    +
    +
    + Get Started +
    +
    +
    +
    +
    +{% endblock content %} \ No newline at end of file diff --git a/templates/users/myrooms.html b/templates/users/myrooms.html index 289285c..1a530c8 100644 --- a/templates/users/myrooms.html +++ b/templates/users/myrooms.html @@ -1,12 +1,20 @@ {% extends "base.html" %} {% block title %}Chats | My rooms{% endblock title %} {% block content %} +
    -

    My Rooms

    - {% for room in myrooms %} -

    {{ room }}

    - {% endfor %} + {% if myrooms|length > 0 %} +

    My Rooms

    +
    + {% for room in myrooms %} +

    {{ room }} - {{ room.members.count }} members

    + {% endfor %} + {% else %} +
    +

    You currently have no enrolled rooms. Go here for a list of available rooms.

    + {% endif %}
    +
    {% endblock content %} \ No newline at end of file