diff --git a/amadeus/settings.py b/amadeus/settings.py index 6f023ed..c1852f7 100644 --- a/amadeus/settings.py +++ b/amadeus/settings.py @@ -47,6 +47,7 @@ INSTALLED_APPS = [ 'app', 'courses', 'users', + 'forum', ] MIDDLEWARE_CLASSES = [ @@ -78,8 +79,8 @@ TEMPLATES = [ 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', - # 'core.context_processors.notifications', - # 'courses.context_processors.courses', + 'core.context_processors.notifications', + 'courses.context_processors.courses', ], }, }, @@ -143,6 +144,10 @@ USE_TZ = True STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "static"), +] + # Files MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'uploads') MEDIA_URL = '/uploads/' @@ -165,6 +170,16 @@ LOGS_URL = 'logs/' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' DEFAULT_FROM_EMAIL = 'admin@admin.com' +# Messages +from django.contrib.messages import constants as messages_constants +MESSAGE_TAGS = { + messages_constants.DEBUG: 'debug', + messages_constants.INFO: 'info', + messages_constants.SUCCESS: 'success', + messages_constants.WARNING: 'warning', + messages_constants.ERROR: 'danger', +} + try: from .local_settings import * diff --git a/amadeus/urls.py b/amadeus/urls.py index ce80d26..434b791 100644 --- a/amadeus/urls.py +++ b/amadeus/urls.py @@ -23,6 +23,7 @@ urlpatterns = [ url(r'^home/', include('app.urls', namespace = 'app')), url(r'^course/', include('courses.urls', namespace = 'course')), url(r'^users/', include('users.urls', namespace = 'users')), + url(r'^forum/', include('forum.urls', namespace = 'forum')), url(r'^admin/', admin.site.urls), url(r'^', include('core.urls', namespace = 'core')), ] diff --git a/app/locale/he_il/LC_MESSAGES/django.po b/app/locale/he_il/LC_MESSAGES/django.po new file mode 100644 index 0000000..cdb3a09 --- /dev/null +++ b/app/locale/he_il/LC_MESSAGES/django.po @@ -0,0 +1,178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-16 02:41-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: app/templates/app/base.html:10 +msgid "The Project" +msgstr "" + +#: app/templates/app/base.html:11 +msgid "CCTE Group" +msgstr "" + +#: app/templates/app/base.html:14 +msgid "Hi" +msgstr "" + +#: app/templates/app/base.html:16 +msgid "See Profile" +msgstr "" + +#: app/templates/app/base.html:17 +msgid "Settings" +msgstr "" + +#: app/templates/app/base.html:18 +msgid "Logout" +msgstr "" + +#: app/templates/app/index.html:6 +msgid "You have:" +msgstr "" + +#: app/templates/app/index.html:10 app/templates/home.html:88 +msgid "Pending Tasks" +msgstr "" + +#: app/templates/app/index.html:14 +msgid "Users Online" +msgstr "" + +#: app/templates/app/index.html:20 +msgid "You can:" +msgstr "" + +#: app/templates/app/index.html:24 app/templates/home_professor.html:25 +msgid "Create Course" +msgstr "" + +#: app/templates/app/index.html:29 app/templates/home.html:93 +msgid "Manage Users" +msgstr "" + +#: app/templates/app/index.html:33 app/templates/home.html:96 +msgid "Manage Courses" +msgstr "" + +#: app/templates/app/index.html:37 +msgid "Gerenciar Categorias" +msgstr "" + +#: app/templates/app/index.html:45 +msgid "Your course(s):" +msgstr "" + +#: app/templates/app/index.html:46 +msgid "No courses subscribed yet" +msgstr "" + +#: app/templates/app/index.html:56 +msgid "Search course:" +msgstr "" + +#: app/templates/app/index.html:62 +msgid "Search" +msgstr "" + +#: app/templates/app/index.html:67 +msgid "Most popular keywords:" +msgstr "" + +#: app/templates/home.html:86 +msgid "Home" +msgstr "" + +#: app/templates/home.html:87 app/templates/home_student.html:25 +msgid "Profile" +msgstr "" + +#: app/templates/home.html:90 +msgid "My courses" +msgstr "" + +#: app/templates/home.html:105 app/templates/home_professor.html:33 +msgid "Courses" +msgstr "" + +#: app/templates/home.html:131 +msgid "No pending tasks at the moment." +msgstr "" + +#: app/templates/home_admin_content.html:10 +msgid "Students" +msgstr "" + +#: app/templates/home_admin_content.html:11 +msgid "Beginning" +msgstr "" + +#: app/templates/home_admin_content.html:12 +msgid "End" +msgstr "" + +#: app/templates/home_admin_content.html:15 +msgid "Edit" +msgstr "" + +#: app/templates/home_professor.html:20 app/templates/home_student.html:21 +msgid "Menu" +msgstr "" + +#: app/templates/home_professor.html:24 +msgid "Pending tasks" +msgstr "" + +#: app/templates/home_professor.html:26 +msgid "Manage Course" +msgstr "" + +#: app/templates/home_professor.html:43 +msgid "Students:" +msgstr "" + +#: app/templates/home_professor.html:44 +msgid "Beginning:" +msgstr "" + +#: app/templates/home_professor.html:45 +msgid "End:" +msgstr "" + +#: app/templates/home_professor.html:52 +msgid "You didn't create any course yet." +msgstr "" + +#: app/templates/home_professor.html:58 app/templates/home_student.html:73 +msgid "Goals" +msgstr "" + +#: app/templates/home_student.html:26 +msgid "My Courses" +msgstr "" + +#: app/templates/home_student.html:27 +msgid "Google accounts" +msgstr "" + +#: app/templates/home_student.html:34 +msgid "Notifications" +msgstr "" + +#: app/templates/home_student.html:76 +msgid "Favorites" +msgstr "" diff --git a/app/templates/home_admin_content.html b/app/templates/home_admin_content.html index 9e858a5..af7de39 100644 --- a/app/templates/home_admin_content.html +++ b/app/templates/home_admin_content.html @@ -12,6 +12,6 @@
  • {% trans 'End' %}: {{ course.end_date }}
  • - + {% trans 'Edit' %} {% endfor %} \ No newline at end of file diff --git a/app/views.py b/app/views.py index 90ce690..e60b23f 100644 --- a/app/views.py +++ b/app/views.py @@ -42,7 +42,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): else: self.template_name = "home_teacher_student_content.html" - #super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") + super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) diff --git a/core/context_processors.py b/core/context_processors.py index 71e44d7..cd4dcf8 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -3,9 +3,8 @@ from .models import Notification def notifications(request): context = {} context['notifications'] = None - if not request.user is None: - if request.user.is_authenticated: - return { - 'notifications': Notification.objects.filter(user= request.user, read=False).order_by('-datetime') - } + if request.user.is_authenticated: + return { + 'notifications': Notification.objects.filter(user= request.user, read=False).order_by('-datetime') + } return context diff --git a/core/locale/he_il/LC_MESSAGES/django.po b/core/locale/he_il/LC_MESSAGES/django.po new file mode 100644 index 0000000..28f25a0 --- /dev/null +++ b/core/locale/he_il/LC_MESSAGES/django.po @@ -0,0 +1,66 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-16 02:41-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: core/templates/base.html:97 +msgid "Log out" +msgstr "" + +#: core/templates/index.html:38 +msgid "Username" +msgstr "" + +#: core/templates/index.html:44 +msgid "Password" +msgstr "" + +#: core/templates/index.html:52 +msgid "Remember Email" +msgstr "" + +#: core/templates/index.html:61 +msgid "Guest" +msgstr "" + +#: core/templates/index.html:64 core/templates/register_user.html:71 +msgid "Login" +msgstr "" + +#: core/templates/index.html:73 +msgid "Sign Up" +msgstr "" + +#: core/templates/register_user.html:29 +msgid "User Register" +msgstr "" + +#: core/templates/register_user.html:68 +msgid "Save" +msgstr "" + +#: core/templates/remember_password.html:27 +msgid "E-mail" +msgstr "" + +#: core/templates/remember_password.html:31 +msgid "Registration" +msgstr "" + +#: core/templates/remember_password.html:35 +msgid "Send" +msgstr "" diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index 70c28e4..c957894 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-09-20 13:57 +# Generated by Django 1.10 on 2016-09-22 05:46 from __future__ import unicode_literals import autoslug.fields @@ -25,8 +25,8 @@ class Migration(migrations.Migration): ('created_date', models.DateField(auto_now_add=True, verbose_name='Created Date')), ], options={ - 'verbose_name_plural': 'Actions', 'verbose_name': 'Action', + 'verbose_name_plural': 'Actions', }, ), migrations.CreateModel( @@ -36,8 +36,8 @@ class Migration(migrations.Migration): ('action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action', verbose_name='Action_Applied')), ], options={ - 'verbose_name_plural': 'Action_Resources', 'verbose_name': 'Action_Resource', + 'verbose_name_plural': 'Action_Resources', }, ), migrations.CreateModel( @@ -49,8 +49,8 @@ class Migration(migrations.Migration): ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Actor')), ], options={ - 'verbose_name_plural': 'Logs', 'verbose_name': 'Log', + 'verbose_name_plural': 'Logs', }, ), migrations.CreateModel( @@ -65,8 +65,8 @@ class Migration(migrations.Migration): ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_Actor', to=settings.AUTH_USER_MODEL, verbose_name='User')), ], options={ - 'verbose_name_plural': 'Notifications', 'verbose_name': 'Notification', + 'verbose_name_plural': 'Notifications', }, ), migrations.CreateModel( @@ -79,8 +79,8 @@ class Migration(migrations.Migration): ('url', models.CharField(default='', max_length=100, verbose_name='URL')), ], options={ - 'verbose_name_plural': 'Resources', 'verbose_name': 'Resource', + 'verbose_name_plural': 'Resources', }, ), migrations.AddField( diff --git a/core/static/css/base/amadeus.css b/core/static/css/base/amadeus.css index 5adf55f..5539b62 100644 --- a/core/static/css/base/amadeus.css +++ b/core/static/css/base/amadeus.css @@ -70,6 +70,10 @@ ul { /*CSS TIMELINE*/ +.panel-title{ /*Because we use an outer a tag*/ + color: rgba(255,255,255,.84); +} + .bubble { width: 100%; padding: .5em 1em; @@ -218,13 +222,8 @@ ul { transition-timing-function: ease-in; } -h3 { - font-size: 1.2em; - font-weight: bold; - font-family: 'Lato'; - display: inline-block; - margin-bottom: .2em; - color: #95a5a6; } + +.icon-more-horiz {margin-top: 0px; margin-bottom: 0px; padding-left: 0px;} .retweet { position: absolute; @@ -272,3 +271,35 @@ a.alert_message:hover{color : grey} .accordion_list { background: #e0e0e0; } + +body .container .jumbotron-inverse, body .container .well-inverse, body .container-fluid .jumbotron-inverse, body .container-fluid .well-inverse { + background-color: white; +} +.forum_collapse { + color: #000; +} +.forum_collapse:hover, .forum_collapse:focus { + text-decoration: none; + color: #000; +} + +.timeline.post { + border-top-left-radius: 8px; + border-top-right-radius: 8px; + padding-bottom: 0px; + -webkit-padding-start: 0px !important; + width: 100%; +} +.timeline.post a { + color: #000; +} +.timeline.post li { + padding: 10px; + border-bottom: 1px solid #fff; +} +.timeline.post li:last-child { + border: none; +} +.timeline.post h3 { + margin-top: 5px; +} \ No newline at end of file diff --git a/core/static/css/base/header.css b/core/static/css/base/header.css index deb3afb..c337f9f 100644 --- a/core/static/css/base/header.css +++ b/core/static/css/base/header.css @@ -10,15 +10,25 @@ .logo{ height:100%; - margin-left: 30%; } .link{ - transition-duration: 0.5s; + text-decoration: none; + position: relative; } -.link:hover{ - transform:scale(1.1); +.link:after{ + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 0%; + border-bottom: 2px solid; + transition: 0.4s; +} + +.link:hover:after{ + width: 100%; } .notification-count{ diff --git a/core/static/img/topo-amadeus-white.png b/core/static/img/topo-amadeus-white.png new file mode 100644 index 0000000..d50a8b5 Binary files /dev/null and b/core/static/img/topo-amadeus-white.png differ diff --git a/core/static/js/base/amadeus.js b/core/static/js/base/amadeus.js new file mode 100644 index 0000000..6baf3b0 --- /dev/null +++ b/core/static/js/base/amadeus.js @@ -0,0 +1,129 @@ +function campoNumerico(campo, evento){ + var codTecla; + var tamanho; + + if( document.all ) {// Internet Explorer + codTecla = evento.keyCode; + } else if( document.layers ) { // Nestcape + codTecla = evento.which; + } + else if( evento) { // Firefox + codTecla = evento.which; + } + if( (codTecla > 47 && codTecla < 58) || codTecla==8 || codTecla == 0){ + return true; + } else { + evento.returnValue = false; + return false; + } +} + +function formatarCpf(campo, evento){ + var codTecla; + var tamanho; + if( document.all ) { // Internet Explorer + codTecla = evento.keyCode; + } else if( document.layers ) { // Nestcape + codTecla = evento.which; + } + else if( evento ) { // Firefox + codTecla = evento.which; + } + tamanho = campo.value.length; + if( (codTecla > 47 && codTecla < 58) || codTecla== 8 || codTecla == 0){ + if(tamanho < 14 ){ + if( tamanho == 3 && codTecla != 8 && codTecla != 0){ + campo.value = campo.value + "."; + }else if( tamanho == 7 && codTecla != 8 && codTecla != 0){ + campo.value = campo.value + "."; + }else if( tamanho == 11 && codTecla != 8 && codTecla != 0){ + campo.value = campo.value + "-"; + } + }else{ + evento.returnValue = false; + } + return true; + } else { + return false; + } + return false; +} + +function validarCpfSemAlert(campo,nome,idElementoMensagemErro){ + //alert("teste"); + cpf = campo.value; + + cpf = cpf.replace(".",""); + cpf = cpf.replace("-",""); + cpf = cpf.replace(".",""); + retorno = true; + + if(trim(cpf).length > 0){ + //alert("teste2"); + cpfstr= ''; + temp = cpf + ''; + + cpfstr = temp.substring(0,3); + cpfstr = cpfstr + temp.substring(3,6); + cpfstr = cpfstr + temp.substring(6,9); + cpfstr = cpfstr + temp.substring(9,11); + + + + retorno = false; + if(cpf != null){ + //alert("teste3"); + soma = 0; + digito1 = 0; + digito2 = 0; + for(i = 0; i < 9; i = i + 1) { + soma = soma + ((parseInt(cpf.substring(i,i+1)))*(11-(i+1))); + } + soma = soma % 11; + if (soma == 0 || soma == 1) { + digito1 = 0; + } else { + digito1 = 11 - soma; + } + soma = 0; + + for(i = 0; i < 9; i = i + 1) { + soma = soma + ((parseInt(cpf.substring(i,i+1)))*(12-(i+1))); + } + soma = soma + (digito1*2); + soma = soma % 11; + if (soma == 0 || soma == 1) { + digito2 = 0; + } + else{ + digito2 = 11 - soma; + } + digito = digito1 +''+ digito2; + + + //alert(cpfstr.substring(9,11)); + if(digito == (cpfstr.substring(9,11))){ + retorno = true; + } else{ + //alert("teste4"); + retorno = false; + + } + } else { + retorno = false; + } + }else{ + retorno = false; + } + //alert(retorno); + if(retorno == false){ + //alert('E-mail informado invalido! Por favor, especifique um E-mail válido para o campo \"' + nome + '\".'); + document.getElementById(idElementoMensagemErro).style.display = ''; + campo.focus(); + return false; + }else{ + document.getElementById(idElementoMensagemErro).style.display = 'none'; + return true; + } + return retorno; +} \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e46c08..b88608a 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -32,28 +32,25 @@ - +
    {% block nav %}
    -
    -
    -
    -
    {% endblock %}
    -
    -
    -
    +
    {% block sidebar %} {% endblock %}
    -
    +
    {% block breadcrumbs %} {% endblock %} - + {% block render_breadcrumbs %} {% endblock %} +
    +
    + {% block content %} -
    -
    -
    - {% block content %} + {% endblock %} +
    - {% endblock %} -
    +
    + {% block rightbar %} + + {% endblock rightbar %} +
    +
    +
    -
    - {% block rightbar %} - {% endblock rightbar %} -
    -
    -
    -
    -
    -
    diff --git a/core/templates/index.html b/core/templates/index.html index 310f460..6603763 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -11,9 +11,9 @@ {% block content %}
    -
    +
    -
    +


    logo amadeus @@ -28,7 +28,7 @@
    -
    +
    {% if message %} -
    +
    {#
    #}
    -
    -
    -
    diff --git a/core/templates/register_user.html b/core/templates/register_user.html index 67989a6..ab9343c 100644 --- a/core/templates/register_user.html +++ b/core/templates/register_user.html @@ -45,7 +45,7 @@
    {% else %} - {% render_field field class='form-control input-sm' %} + {% render_field field class='form-control' %} {{ field.help_text }} {% endif %}
    @@ -68,7 +68,7 @@
    diff --git a/core/templates/remember_password.html b/core/templates/remember_password.html index 1eab8e7..15aaa5c 100644 --- a/core/templates/remember_password.html +++ b/core/templates/remember_password.html @@ -3,9 +3,9 @@ {% block content%}
    -
    +
    -
    +


    logo amadeus @@ -14,7 +14,7 @@
    -
    +
    {% if success %} {% endfor %}
    - +
    -
    +
    +
    +
    +
    +{% endblock %} + +{% block javascript %} -
    {% endblock %} diff --git a/users/templates/users/edit_profile.html b/users/templates/users/edit_profile.html index 0bb6594..e948d32 100644 --- a/users/templates/users/edit_profile.html +++ b/users/templates/users/edit_profile.html @@ -31,7 +31,7 @@
    {% if field.auto_id == 'id_birth_date' %} - {% render_field field class='form-control input-sm' type='date' %} + {{ field.help_text }} {% elif field.auto_id == 'id_image' %} {% render_field field class='form-control input-sm' %} @@ -50,7 +50,7 @@
    {% else %} - {% render_field field class='form-control input-sm' %} + {% render_field field class='form-control' %} {{ field.help_text }} {% endif %} {% if field.errors.length > 0 %} diff --git a/users/templates/users/update.html b/users/templates/users/update.html index 2bd5aed..74ed76d 100644 --- a/users/templates/users/update.html +++ b/users/templates/users/update.html @@ -24,7 +24,7 @@
    {% endfor %} {% endif %} - +
    @@ -34,7 +34,7 @@
    {% if field.auto_id == 'id_birth_date' %} - {% render_field field class='form-control input-sm' type='date' %} + {{ field.help_text }} {% elif field.auto_id == 'id_image' %} {% render_field field class='form-control input-sm' %} @@ -53,7 +53,7 @@
    {% else %} - {% render_field field class='form-control input-sm' %} + {% render_field field class='form-control' %} {{ field.help_text }} {% endif %} {% if field.errors.length > 0 %} diff --git a/users/views.py b/users/views.py index bfb1e3c..584634a 100644 --- a/users/views.py +++ b/users/views.py @@ -37,10 +37,10 @@ class Create(HasRoleMixin, LoginRequiredMixin, generic.edit.CreateView): template_name = 'users/create.html' form_class = UserForm context_object_name = 'acc' - success_url = reverse_lazy('user:manage') + success_url = reverse_lazy('users:manage') def form_valid(self, form): - self.object = form.save(commit = False) + self.object = form.save() if self.object.type_profile == 2: assign_role(self.object, 'student') -- libgit2 0.21.2