Commit 369dc5422ab32764fbf16e4229e751d9e5f1f85b
1 parent
7d5faa43
Exists in
master
and in
5 other branches
Creating home base html [Issue: #45]
Showing
2 changed files
with
89 additions
and
2 deletions
Show diff stats
app/templates/home.html
1 | -{% load static i18n %} | |
2 | 1 | \ No newline at end of file |
2 | +{% extends 'base.html' %} | |
3 | + | |
4 | +{% load static i18n django_bootstrap_breadcrumbs permission_tags %} | |
5 | + | |
6 | +{% block breadcrumbs %} | |
7 | + | |
8 | + {% clear_breadcrumbs %} | |
9 | + {% breadcrumb 'Home' 'app:index' %} | |
10 | + | |
11 | +{% endblock %} | |
12 | + | |
13 | +{% block render_breadcrumbs %} | |
14 | + {% render_breadcrumbs %} | |
15 | +{% endblock %} | |
16 | + | |
17 | +{% block sidebar %} | |
18 | + <div class="panel panel-primary"> | |
19 | + <div class="panel-heading"> | |
20 | + <img src="{{ user.image.url }}" id="img" class="img-rounded"> | |
21 | + <p></p> | |
22 | + <div class="row"> | |
23 | + <div class="col-xs-3 col-md-3"> | |
24 | + <i class="fa fa-facebook-official fa-2x" aria-hidden="true"></i> | |
25 | + </div> | |
26 | + <div class="col-xs-3 col-md-3"> | |
27 | + <i class="fa fa-twitter fa-2x" aria-hidden="true"></i> | |
28 | + </div> | |
29 | + <div class="col-xs-3 col-md-3"> | |
30 | + <i class="fa fa-linkedin-square fa-2x" aria-hidden="true"></i> | |
31 | + </div> | |
32 | + <div class="col-xs-3 col-md-3"> | |
33 | + <i class="fa fa-google-plus-official fa-2x" aria-hidden="true"></i> | |
34 | + </div> | |
35 | + </div> | |
36 | + </div> | |
37 | + <div class="panel-body"> | |
38 | + <ul class="nav nav-pills nav-stacked"> | |
39 | + <li> <a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | |
40 | + <li> <a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | |
41 | + <li> <a href="#">{% trans 'Pending Tasks' %}</a></li> | |
42 | + {% if user|has_role:'student' %} | |
43 | + <li> <a href="#">{% trans 'My courses' %}</a></li> | |
44 | + {% endif %} | |
45 | + {% if user|has_role:'system_admin' %} | |
46 | + <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | |
47 | + {% endif %} | |
48 | + {% if user|has_role:'system_admin, professor' %} | |
49 | + <li> <a href="../../course/home_course.html">{% trans 'Manage Courses' %}</a></li> | |
50 | + {% endif %} | |
51 | + </ul> | |
52 | + </div> | |
53 | + </div> | |
54 | +{% endblock %} | |
55 | + | |
56 | +{% block content %} | |
57 | + <h3>{% trans 'Courses' %}</h3> | |
58 | + {% if courses|length > 0 %} | |
59 | + {% for course in courses %} | |
60 | + <a href="{% url 'course:view' course.slug %}"> | |
61 | + <div class="panel panel-default courseHome"> | |
62 | + <div class="panel-body"> | |
63 | + <p>{{ course }}</p> | |
64 | + </div> | |
65 | + <div class="panel-footer"> | |
66 | + <ul> | |
67 | + <li>{% trans 'Students:' %} 5</li> | |
68 | + <li>{% trans 'Beginning:' %} {{ course.init_date }}</li> | |
69 | + <li>{% trans 'End:' %} {{ course.end_date }}</li> | |
70 | + </ul> | |
71 | + </div> | |
72 | + </div> | |
73 | + </a> | |
74 | + {% endfor %} | |
75 | + {% else %} | |
76 | + <p>{% trans "You didn't create any course yet." %}</p> | |
77 | + {% endif %} | |
78 | +{% endblock %} | |
79 | + | |
80 | +{% block rightbar %} | |
81 | + <div class="panel panel-warning"> | |
82 | + <div class="panel-heading"> | |
83 | + <h3 class="panel-title">Pending Stuffs</h3> | |
84 | + </div> | |
85 | + <div class="panel-body"> | |
86 | + <p>{% trans 'No pending tasks at the moment.' %}</p> | |
87 | + </div> | |
88 | + </div> | |
89 | +{% endblock rightbar %} | |
3 | 90 | \ No newline at end of file | ... | ... |
app/views.py
... | ... | @@ -12,7 +12,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, TemplateView, NotificationMixin): |
12 | 12 | log_resource = "Home" |
13 | 13 | login_url = reverse_lazy("core:home") |
14 | 14 | redirect_field_name = 'next' |
15 | - template_name = "home_professor.html" | |
15 | + template_name = "home.html" | |
16 | 16 | |
17 | 17 | not_action = "Acessar" |
18 | 18 | not_resource = "home" | ... | ... |