Commit 990ccb3c41db82636dd2f4863a2ed05b142e1047
1 parent
82bb8a2b
Exists in
master
and in
5 other branches
Date type and image type in register template #14
Showing
6 changed files
with
68 additions
and
18 deletions
Show diff stats
amadeus/settings.py
@@ -41,6 +41,8 @@ INSTALLED_APPS = [ | @@ -41,6 +41,8 @@ INSTALLED_APPS = [ | ||
41 | 'widget_tweaks', | 41 | 'widget_tweaks', |
42 | 'rolepermissions', | 42 | 'rolepermissions', |
43 | 'rest_framework', | 43 | 'rest_framework', |
44 | + 'flask', | ||
45 | + 'flask_breadcrumbs', | ||
44 | 46 | ||
45 | 'core', | 47 | 'core', |
46 | 'app', | 48 | 'app', |
@@ -58,6 +60,9 @@ MIDDLEWARE_CLASSES = [ | @@ -58,6 +60,9 @@ MIDDLEWARE_CLASSES = [ | ||
58 | 'django.contrib.messages.middleware.MessageMiddleware', | 60 | 'django.contrib.messages.middleware.MessageMiddleware', |
59 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', | 61 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
60 | 'django.middleware.locale.LocaleMiddleware', | 62 | 'django.middleware.locale.LocaleMiddleware', |
63 | + | ||
64 | + #libs-middleware | ||
65 | + | ||
61 | ] | 66 | ] |
62 | 67 | ||
63 | ROOT_URLCONF = 'amadeus.urls' | 68 | ROOT_URLCONF = 'amadeus.urls' |
app/templates/home_student.html
@@ -4,12 +4,10 @@ | @@ -4,12 +4,10 @@ | ||
4 | 4 | ||
5 | {% block breadcrumbs %} | 5 | {% block breadcrumbs %} |
6 | <div class="row"> | 6 | <div class="row"> |
7 | - <div class="col-md-12"> | ||
8 | - <ul class="breadcrumb"> | ||
9 | - <li><a href="{% url 'core:home' %}">{% trans 'Home' %} {{ logged }}</a></li> | ||
10 | - </ul> | ||
11 | - </div> | ||
12 | - </div> | 7 | + {% for breadcrumb in breadcrumbs %} |
8 | + <a href="{{ breadcrumb.url }}">{{ breadcrumb.text }}</a> | ||
9 | + {% endfor %} | ||
10 | + </div> | ||
13 | {% endblock %} | 11 | {% endblock %} |
14 | 12 | ||
15 | {% block sidebar %} | 13 | {% block sidebar %} |
app/views.py
@@ -6,6 +6,23 @@ from core.mixins import LogMixin | @@ -6,6 +6,23 @@ from core.mixins import LogMixin | ||
6 | 6 | ||
7 | from courses.models import Course | 7 | from courses.models import Course |
8 | 8 | ||
9 | + | ||
10 | +from flask import Flask | ||
11 | +from flask_breadcrumbs import Breadcrumbs, register_breadcrumb | ||
12 | + | ||
13 | +app = Flask(__name__) | ||
14 | + | ||
15 | +# Initialize Flask-Breadcrumbs | ||
16 | +Breadcrumbs(app=app) | ||
17 | + | ||
18 | +@app.route('/') | ||
19 | +@register_breadcrumb(app, '.', 'Home') | ||
20 | +def index(): | ||
21 | + pass | ||
22 | + | ||
23 | +if __name__ == '__main__': | ||
24 | + app.run(debug=True) | ||
25 | + | ||
9 | class AppIndex(LoginRequiredMixin, LogMixin, TemplateView): | 26 | class AppIndex(LoginRequiredMixin, LogMixin, TemplateView): |
10 | log_action = "Acessar" | 27 | log_action = "Acessar" |
11 | log_resource = "Home" | 28 | log_resource = "Home" |
core/templates/index.html
@@ -15,6 +15,12 @@ | @@ -15,6 +15,12 @@ | ||
15 | <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus" id="logo"> | 15 | <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block " alt="logo amadeus" id="logo"> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | + <div class="row"> | ||
19 | + {% for breadcrumb in breadcrumbs %} | ||
20 | + <a href="{{ breadcrumb.url }}">{{ breadcrumb.text }}</a> | ||
21 | + {% endfor %} | ||
22 | + </div> | ||
23 | + | ||
18 | <div class="row "> | 24 | <div class="row "> |
19 | <div class="col-md-8 col-md-offset-2 col-sm-6 col-sm-offset-3"> | 25 | <div class="col-md-8 col-md-offset-2 col-sm-6 col-sm-offset-3"> |
20 | <div class="card"> | 26 | <div class="card"> |
core/templates/register_user.html
@@ -28,11 +28,26 @@ | @@ -28,11 +28,26 @@ | ||
28 | {% csrf_token %} | 28 | {% csrf_token %} |
29 | <legend>{% trans 'User Register' %}</legend> | 29 | <legend>{% trans 'User Register' %}</legend> |
30 | {% for field in form %} | 30 | {% for field in form %} |
31 | - <div class="form-group is-empy{% if form.has_error %} has-error {% endif %}"> | 31 | + <div class="form-group is-empy{% if form.has_error %} has-error {% endif %} is-fileinput"> |
32 | <label for="{{ field.auto_id }}" class="col-md-4 control-label">{{ field.label }}</label> | 32 | <label for="{{ field.auto_id }}" class="col-md-4 control-label">{{ field.label }}</label> |
33 | <div class="col-md-8"> | 33 | <div class="col-md-8"> |
34 | - {% render_field field class='form-control input-sm' %} | ||
35 | - <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 34 | + {% if field.auto_id == 'id_birth_date' %} |
35 | + {% render_field field class='form-control input-sm' type='date' %} | ||
36 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | ||
37 | + {% elif field.auto_id == 'id_image' %} | ||
38 | + {% render_field field class='form-control input-sm' %} | ||
39 | + <div class="input-group"> | ||
40 | + <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."> | ||
41 | + <span class="input-group-btn input-group-sm"> | ||
42 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
43 | + <i class="material-icons">attach_file</i> | ||
44 | + </button> | ||
45 | + </span> | ||
46 | + </div> | ||
47 | + {% else %} | ||
48 | + {% render_field field class='form-control input-sm' %} | ||
49 | + <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | ||
50 | + {% endif %} | ||
36 | </div> | 51 | </div> |
37 | 52 | ||
38 | {% if field.errors %} | 53 | {% if field.errors %} |
requirements.txt
1 | -Django==1.10 | ||
2 | -django-discover-runner==1.0 | ||
3 | -django-role-permissions==1.2.1 | ||
4 | -django-widget-tweaks==1.4.1 | ||
5 | -djangorestframework==3.4.6 | ||
6 | -Pillow==3.3.1 | ||
7 | -psycopg2==2.6.2 | ||
8 | -six==1.10.0 | ||
9 | -slugify==0.0.1 | 1 | +click==6.6 |
2 | +Django==1.10 | ||
3 | +django-discover-runner==1.0 | ||
4 | +django-role-permissions==1.2.1 | ||
5 | +django-widget-tweaks==1.4.1 | ||
6 | +djangorestframework==3.4.6 | ||
7 | +Flask==0.11.1 | ||
8 | +Flask-Breadcrumbs==0.4.0 | ||
9 | +Flask-Menu==0.5.0 | ||
10 | +itsdangerous==0.24 | ||
11 | +Jinja2==2.8 | ||
12 | +MarkupSafe==0.23 | ||
13 | +Pillow==3.3.1 | ||
14 | +psycopg2==2.6.2 | ||
15 | +six==1.10.0 | ||
16 | +slugify==0.0.1 | ||
17 | +Werkzeug==0.11.11 | ||
18 | +wheel==0.24.0 |