Commit 7af9c21b068cc694fc56ec8fc866b11f41a8da5d
1 parent
95627028
Exists in
master
and in
3 other branches
Adding mail sender update
Showing
6 changed files
with
89 additions
and
7 deletions
Show diff stats
amadeus/templates/base.html
| ... | ... | @@ -49,8 +49,7 @@ |
| 49 | 49 | <link rel="stylesheet" type="text/css" href="{% static 'css/base/amadeus.css' %}"> |
| 50 | 50 | |
| 51 | 51 | <!--Javascript block for specific-app ones --> |
| 52 | - <script src="{% static 'js/base/amadeus.js' %}"></script> | |
| 53 | - | |
| 52 | + <script src="{% static 'js/base/amadeus.js' %}"></script> | |
| 54 | 53 | |
| 55 | 54 | {% block style %} |
| 56 | 55 | {% endblock %} |
| ... | ... | @@ -114,7 +113,7 @@ |
| 114 | 113 | <div class="panel-collapse collapse" id="system_menu"> |
| 115 | 114 | <div class="panel-body"> |
| 116 | 115 | <ul class="submenu"> |
| 117 | - <li><a href="{% url 'categories:index' %}">{% trans 'Mail Sender' %}</a></li> | |
| 116 | + <li><a href="{% url 'mailsender:update' %}">{% trans 'Mail Sender' %}</a></li> | |
| 118 | 117 | <li><a href="{% url 'categories:index' %}">{% trans 'Security' %}</a></li> |
| 119 | 118 | <li><a href="{% url 'categories:index' %}">{% trans 'Theme' %}</a></li> |
| 120 | 119 | </ul> | ... | ... |
amadeus/urls.py
| ... | ... | @@ -26,7 +26,8 @@ urlpatterns = [ |
| 26 | 26 | url(r'^admin/', admin.site.urls), |
| 27 | 27 | url(r'^$', index, name = 'home'), |
| 28 | 28 | url(r'^categories/', include('categories.urls', namespace = 'categories')), |
| 29 | - url(r'^subjects/', include('subjects.urls', namespace='subjects')), | |
| 29 | + url(r'^subjects/', include('subjects.urls', namespace = 'subjects')), | |
| 30 | + url(r'^mailsender/', include('mailsender.urls', namespace = 'mailsender')), | |
| 30 | 31 | #API |
| 31 | 32 | url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')), |
| 32 | 33 | #S3Direct | ... | ... |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +{% extends 'base.html' %} | |
| 2 | + | |
| 3 | +{% load static i18n %} | |
| 4 | +{% load widget_tweaks %} | |
| 5 | +{% load django_bootstrap_breadcrumbs %} | |
| 6 | + | |
| 7 | +{% block breadcrumbs %} | |
| 8 | + {{ block.super }} | |
| 9 | + {% breadcrumb 'Settings' 'subjects:home' %} | |
| 10 | + {% breadcrumb 'Mail Sender' 'mailsender:update' %} | |
| 11 | +{% endblock %} | |
| 12 | + | |
| 13 | +{% block content %} | |
| 14 | + <div class="card"> | |
| 15 | + <div class="card-content"> | |
| 16 | + <div class="card-body"> | |
| 17 | + <form method="post" action="" enctype="multipart/form-data"> | |
| 18 | + {% csrf_token %} | |
| 19 | + <legend>{% trans 'General server settings' %}</legend> | |
| 20 | + {% for field in form %} | |
| 21 | + {% if field.auto_id == 'id_username' %} | |
| 22 | + <br clear="all" /> | |
| 23 | + <legend>{% trans 'Autentication' %}</legend> | |
| 24 | + {% elif field.auto_id == 'id_crypto' %} | |
| 25 | + <br clear="all" /> | |
| 26 | + <legend>{% trans 'Criptografy' %}</legend> | |
| 27 | + {% endif %} | |
| 28 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | |
| 29 | + {% if field.field.required %} | |
| 30 | + <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label> | |
| 31 | + {% else %} | |
| 32 | + <label for="{{ field.auto_id }}">{{ field.label }}</label> | |
| 33 | + {% endif %} | |
| 34 | + {% render_field field class='form-control' %} | |
| 35 | + | |
| 36 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | |
| 37 | + | |
| 38 | + {% if field.errors %} | |
| 39 | + <div class="alert alert-danger alert-dismissible" role="alert"> | |
| 40 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
| 41 | + <span aria-hidden="true">×</span> | |
| 42 | + </button> | |
| 43 | + <ul> | |
| 44 | + {% for error in field.errors %} | |
| 45 | + <li>{{ error }}</li> | |
| 46 | + {% endfor %} | |
| 47 | + </ul> | |
| 48 | + </div> | |
| 49 | + {% endif %} | |
| 50 | + </div> | |
| 51 | + {% endfor %} | |
| 52 | + <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12"> | |
| 53 | + <div class="text-center"> | |
| 54 | + <input type="submit" value="{% trans 'Save' %}" class="btn btn-raised btn-primary" /> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </form> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <br clear="all" /> | |
| 62 | + <br clear="all" /> | |
| 63 | +{% endblock %} | ... | ... |
mailsender/views.py
| 1 | 1 | from django.views import generic |
| 2 | 2 | from django.shortcuts import render |
| 3 | +from django.contrib import messages | |
| 3 | 4 | from django.core.urlresolvers import reverse, reverse_lazy |
| 4 | 5 | from django.utils.translation import ugettext_lazy as _ |
| 5 | 6 | |
| ... | ... | @@ -28,8 +29,9 @@ class MailSenderSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffus |
| 28 | 29 | return super(MailSenderSettings, self).form_valid(form) |
| 29 | 30 | |
| 30 | 31 | def get_context_data(self, **kwargs): |
| 31 | - context = super(MailSenderSettings, self).context(**kwargs) | |
| 32 | + context = super(MailSenderSettings, self).get_context_data(**kwargs) | |
| 32 | 33 | |
| 33 | 34 | context['title'] = _('Mail Sender') |
| 35 | + context['settings_menu_active'] = "settings_menu_active" | |
| 34 | 36 | |
| 35 | 37 | return context |
| 36 | 38 | \ No newline at end of file | ... | ... |
subjects/templates/subjects/initial.html
| ... | ... | @@ -3,9 +3,19 @@ |
| 3 | 3 | {% load static pagination i18n %} |
| 4 | 4 | |
| 5 | 5 | {% block content %} |
| 6 | + {% if messages %} | |
| 7 | + {% for message in messages %} | |
| 8 | + <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert"> | |
| 9 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
| 10 | + <span aria-hidden="true">×</span> | |
| 11 | + </button> | |
| 12 | + <p>{{ message }}</p> | |
| 13 | + </div> | |
| 14 | + {% endfor %} | |
| 15 | + {% endif %} | |
| 16 | + | |
| 6 | 17 | <h2 class=" my-subjects-title"><b><i>{% trans "Palavras-chave mais populares" %}</i></b></h2> |
| 7 | 18 | <div id="" class="col-md-12"> |
| 8 | - | |
| 9 | 19 | <div class="users-cloud div-users-cloud"> |
| 10 | 20 | <ul class=" users-cloud"> |
| 11 | 21 | {% for tag in tags %} |
| ... | ... | @@ -24,6 +34,7 @@ |
| 24 | 34 | </div> |
| 25 | 35 | </div> |
| 26 | 36 | |
| 27 | - {% pagination request paginator page_obj %} | |
| 37 | + {% pagination request paginator page_obj %} | |
| 38 | + | |
| 28 | 39 | <script type="text/javascript" src="{% static 'js/course.js' %}"></script> |
| 29 | 40 | {% endblock content %} |
| 30 | 41 | \ No newline at end of file | ... | ... |