Commit bd630b8e974d4279cb027db5f1e5c721d20e3e2f

Authored by Matheus Lins
1 parent ca2e0ed6

updated template list courses

app/templates/home.html
@@ -117,6 +117,9 @@ @@ -117,6 +117,9 @@
117 <div id="timeline"> 117 <div id="timeline">
118 {% include page_template %} 118 {% include page_template %}
119 </div> 119 </div>
  120 + <a class="btn-floating btn-large waves-effect waves-light red" href="{% url 'course:create' %}">
  121 + <i class="fa fa-plus" aria-hidden="true"></i>
  122 + </a>
120 {% else %} 123 {% else %}
121 <ul class="timeline" style="-webkit-padding-start: 0px"> 124 <ul class="timeline" style="-webkit-padding-start: 0px">
122 <div id="timeline"> 125 <div id="timeline">
app/templates/home_professor.html
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 {% endblock %} 30 {% endblock %}
31 31
32 {% block content %} 32 {% block content %}
  33 +
33 <h3>{% trans 'Courses' %}</h3> 34 <h3>{% trans 'Courses' %}</h3>
34 {% if courses|length > 0 %} 35 {% if courses|length > 0 %}
35 {% for course in courses %} 36 {% for course in courses %}
@@ -54,7 +55,23 @@ @@ -54,7 +55,23 @@
54 {% endblock %} 55 {% endblock %}
55 56
56 {% block rightbar %} 57 {% block rightbar %}
57 - <div class="well well-lg goal">  
58 - {% trans 'Goals' %} 58 + <div class="col-md-12">
  59 + <div><div class="panel panel-warning">
  60 + <div class="panel-heading">
  61 + <h3 class="panel-title">{% trans 'Pending Stuffs' %}</h3>
  62 + </div>
  63 + <div class="panel-body">
  64 +
  65 + </div>
  66 +</div></div>
  67 + <div><div class="panel panel-warning">
  68 + <div class="panel-heading">
  69 + <h3 class="panel-title">{% trans 'Goals' %}</h3>
59 </div> 70 </div>
  71 + <div class="panel-body">
  72 +
  73 + </div>
  74 +</div></div>
  75 + </div>
  76 +
60 {% endblock rightbar %} 77 {% endblock rightbar %}
core/static/materialize/css/materialize.css
1 -.z-depth-1, nav, .card-panel, .card, .toast, .btn, .btn-large, .btn-floating, .dropdown-content, .collapsible, .side-nav {  
2 - box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);  
3 -}  
4 -  
5 -.z-depth-1-half, .btn:hover, .btn-large:hover, .btn-floating:hover {  
6 - box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);  
7 -}  
8 -nav ul a.btn, nav ul a.btn-large, nav ul a.btn-large, nav ul a.btn-flat, nav ul a.btn-floating {  
9 - margin-top: -2px;  
10 - margin-left: 15px;  
11 - margin-right: 15px;  
12 -}  
13 -.card .card-action a:not(.btn):not(.btn-large):not(.btn-floating) {  
14 - color: #ffab40;  
15 - margin-right: 20px;  
16 - transition: color .3s ease;  
17 - text-transform: uppercase;  
18 -}  
19 1
20 -.card .card-action a:not(.btn):not(.btn-large):not(.btn-floating):hover {  
21 - color: #ffd8a6;  
22 -}  
23 -  
24 -.card .card-reveal {  
25 - padding: 20px;  
26 - position: absolute;  
27 - background-color: #fff;  
28 - width: 100%;  
29 - overflow-y: auto;  
30 - top: 100%;  
31 - height: 100%;  
32 - z-index: 3;  
33 - display: none;  
34 -}  
35 -  
36 -.btn.disabled, .disabled.btn-large,  
37 .btn-floating.disabled, 2 .btn-floating.disabled,
38 -.btn-large.disabled,  
39 -.btn:disabled,  
40 -.btn-large:disabled,  
41 -.btn-large:disabled,  
42 -.btn-floating:disabled,  
43 -.btn[disabled],  
44 -[disabled].btn-large,  
45 -.btn-large[disabled],  
46 -.btn-floating[disabled] { 3 + {
47 background-color: #DFDFDF !important; 4 background-color: #DFDFDF !important;
48 box-shadow: none; 5 box-shadow: none;
49 color: #9F9F9F !important; 6 color: #9F9F9F !important;
50 cursor: default; 7 cursor: default;
51 } 8 }
52 9
53 -.btn.disabled *, .disabled.btn-large *,  
54 .btn-floating.disabled *, 10 .btn-floating.disabled *,
55 -.btn-large.disabled *,  
56 -.btn:disabled *, .btn-large:disabled *,  
57 -.btn-large:disabled *,  
58 .btn-floating:disabled *, 11 .btn-floating:disabled *,
59 -.btn[disabled] *, [disabled].btn-large *,  
60 -.btn-large[disabled] *,  
61 .btn-floating[disabled] * { 12 .btn-floating[disabled] * {
62 pointer-events: none; 13 pointer-events: none;
63 } 14 }
64 15
65 -.btn.disabled:hover, .disabled.btn-large:hover,  
66 .btn-floating.disabled:hover, 16 .btn-floating.disabled:hover,
67 -.btn-large.disabled:hover,  
68 -.btn:disabled:hover,  
69 -.btn-large:disabled:hover,  
70 -.btn-large:disabled:hover,  
71 .btn-floating:disabled:hover, 17 .btn-floating:disabled:hover,
72 -.btn[disabled]:hover,  
73 -[disabled].btn-large:hover,  
74 -.btn-large[disabled]:hover,  
75 .btn-floating[disabled]:hover { 18 .btn-floating[disabled]:hover {
76 background-color: #DFDFDF !important; 19 background-color: #DFDFDF !important;
77 color: #9F9F9F !important; 20 color: #9F9F9F !important;
78 } 21 }
79 22
80 -.btn i, .btn-large i,  
81 -.btn-floating i,  
82 -.btn-large i,  
83 -.btn-flat i { 23 +.btn-floating i{
84 font-size: 1.3rem; 24 font-size: 1.3rem;
85 line-height: inherit; 25 line-height: inherit;
86 } 26 }
87 27
88 -.btn, .btn-large { 28 +/*.btn, .btn-large {
89 text-decoration: none; 29 text-decoration: none;
90 color: #fff; 30 color: #fff;
91 background-color: #26a69a; 31 background-color: #26a69a;
@@ -93,11 +33,7 @@ nav ul a.btn, nav ul a.btn-large, nav ul a.btn-large, nav ul a.btn-flat, nav ul @@ -93,11 +33,7 @@ nav ul a.btn, nav ul a.btn-large, nav ul a.btn-large, nav ul a.btn-flat, nav ul
93 letter-spacing: .5px; 33 letter-spacing: .5px;
94 transition: .2s ease-out; 34 transition: .2s ease-out;
95 cursor: pointer; 35 cursor: pointer;
96 -}  
97 -  
98 -.btn:hover, .btn-large:hover {  
99 - background-color: #2bbbad;  
100 -} 36 +}*/
101 37
102 .btn-floating { 38 .btn-floating {
103 display: inline-block; 39 display: inline-block;
@@ -151,22 +87,4 @@ button.btn-floating { @@ -151,22 +87,4 @@ button.btn-floating {
151 .fixed-action-btn ul a.btn-floating { 87 .fixed-action-btn ul a.btn-floating {
152 opacity: 0; 88 opacity: 0;
153 } 89 }
154 -.side-nav a.btn, .side-nav a.btn-large, .side-nav a.btn-large, .side-nav a.btn-flat, .side-nav a.btn-floating {  
155 - margin: 10px 15px;  
156 -}  
157 -  
158 -.side-nav a.btn, .side-nav a.btn-large, .side-nav a.btn-large, .side-nav a.btn-floating {  
159 - color: #fff;  
160 -}  
161 90
162 -.side-nav a.btn-flat {  
163 - color: #343434;  
164 -}  
165 -  
166 -.side-nav a.btn:hover, .side-nav a.btn-large:hover, .side-nav a.btn-large:hover {  
167 - background-color: #2bbbad;  
168 -}  
169 -  
170 -.side-nav a.btn-floating:hover {  
171 - background-color: #26a69a;  
172 -}  
courses/models.py
@@ -31,7 +31,7 @@ class Course(models.Model): @@ -31,7 +31,7 @@ class Course(models.Model):
31 end_date = models.DateField(_('End of Course Date')) 31 end_date = models.DateField(_('End of Course Date'))
32 image = models.ImageField(verbose_name = _('Image'), blank = True, upload_to = 'courses/') 32 image = models.ImageField(verbose_name = _('Image'), blank = True, upload_to = 'courses/')
33 category = models.ForeignKey(Category, verbose_name = _('Category')) 33 category = models.ForeignKey(Category, verbose_name = _('Category'))
34 - professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='courses') 34 + professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='courses_professors')
35 students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='courses_student') 35 students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='courses_student')
36 36
37 class Meta: 37 class Meta:
courses/templates/course/index.html
@@ -11,31 +11,17 @@ @@ -11,31 +11,17 @@
11 {% endblock %} 11 {% endblock %}
12 12
13 {% block sidebar %} 13 {% block sidebar %}
14 - <div class="list-group">  
15 - <a href="{% url 'course:manage' %}" class="list-group-item active">  
16 - {% trans 'Courses' %}  
17 - </a>  
18 - <a href="{% url 'course:create' %}" class="list-group-item">  
19 - {% trans 'Create Course' %}  
20 - </a>  
21 - </div>  
22 -  
23 - <hr />  
24 -  
25 - {% if categories|length > 0 %}  
26 -  
27 - <h4>{% trans 'Categories:' %} </h4>  
28 -  
29 - <ul class="categories">  
30 - {% for category in categories %}  
31 - <li>  
32 - <a href="{% url 'course:filter' category.slug %}">  
33 - {{ category }}  
34 - </a>  
35 - </li>  
36 - {% endfor %}  
37 - </ul>  
38 - {% endif %} 14 + <div class="panel panel-primary navigation">
  15 + <div class="panel-heading">
  16 + <h5>{% trans 'Menu' %}</h5>
  17 + </div>
  18 + <div class="panel-body">
  19 + <ul class="nav nav-pills nav-stacked">
  20 + <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li>
  21 + <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li>
  22 + </ul>
  23 + </div>
  24 + </div>
39 {% endblock %} 25 {% endblock %}
40 26
41 {% block content %} 27 {% block content %}
@@ -49,7 +35,16 @@ @@ -49,7 +35,16 @@
49 </div> 35 </div>
50 {% endfor %} 36 {% endfor %}
51 {% endif %} 37 {% endif %}
52 - 38 + <div class="col-md-12">
  39 + <div class="input-group">
  40 + <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div>
  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">search</i>
  44 + </button>
  45 + </span>
  46 +</div>
  47 + </div>
53 {% if courses|length > 0 %} 48 {% if courses|length > 0 %}
54 {% for course in courses %} 49 {% for course in courses %}
55 <div class="col-md-12"> 50 <div class="col-md-12">
@@ -89,34 +84,6 @@ @@ -89,34 +84,6 @@
89 </div> 84 </div>
90 </div> 85 </div>
91 </div> 86 </div>
92 - <div class="row">  
93 - <div class="col-md-10">  
94 - <div class="row">  
95 - <!--<div class="col-md-12">  
96 - <div class="pull-right">  
97 - <a href="{% url 'course:view' course.slug %}" class="btn btn-sm btn-info">  
98 - <span class="glyphicon glyphicon-eye-open"></span>  
99 - </a>  
100 -  
101 - </div>  
102 - <h4>  
103 - <a href="{% url 'course:view' course.slug %}">  
104 - {{ course }}  
105 - </a>  
106 - </h4>  
107 -  
108 - <small>  
109 - <em>{{ course.objectivies|linebreaks }}</em>  
110 - </small>  
111 - </div>  
112 - <div class="col-md-12">  
113 - <strong>{% trans 'Subscribe Period:' %} </strong> <em>de</em> <u>{{ course.init_register_date }}</u> <em>até</em> <u>{{ course.end_register_date }}</u>  
114 - <br />  
115 - <strong>{% trans 'Period:' %} </strong> <em>de</em> <u>{{ course.init_date }}</u> <em>até</em> <u>{{ course.end_date }}</u>  
116 - </div> -->  
117 - </div>  
118 - </div>  
119 - </div>  
120 87
121 {% endfor %} 88 {% endfor %}
122 89
courses/urls.py
@@ -9,7 +9,7 @@ urlpatterns = [ @@ -9,7 +9,7 @@ urlpatterns = [
9 url(r'^(?P<slug>[\w_-]+)/$', views.CourseView.as_view(), name='view'), 9 url(r'^(?P<slug>[\w_-]+)/$', views.CourseView.as_view(), name='view'),
10 url(r'^delete/(?P<slug>[\w_-]+)/$', views.DeleteCourseView.as_view(), name='delete'), 10 url(r'^delete/(?P<slug>[\w_-]+)/$', views.DeleteCourseView.as_view(), name='delete'),
11 url(r'^category/(?P<slug>[\w_-]+)/$', views.FilteredView.as_view(), name='filter'), 11 url(r'^category/(?P<slug>[\w_-]+)/$', views.FilteredView.as_view(), name='filter'),
12 - url(r'^categories/view/view/$', views.IndexCatView.as_view(), name='manage_cat'), 12 + url(r'^categories/view/$', views.IndexCatView.as_view(), name='manage_cat'),
13 url(r'^categories/create/$', views.CreateCatView.as_view(), name="create_cat"), 13 url(r'^categories/create/$', views.CreateCatView.as_view(), name="create_cat"),
14 url(r'^categories/edit/(?P<slug>[\w_-]+)/$', views.UpdateCatView.as_view(), name='update_cat'), 14 url(r'^categories/edit/(?P<slug>[\w_-]+)/$', views.UpdateCatView.as_view(), name='update_cat'),
15 url(r'^categories/(?P<slug>[\w_-]+)/$', views.ViewCat.as_view(), name='view_cat'), 15 url(r'^categories/(?P<slug>[\w_-]+)/$', views.ViewCat.as_view(), name='view_cat'),
courses/views.py
@@ -30,6 +30,8 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): @@ -30,6 +30,8 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView):
30 def get_context_data(self, **kwargs): 30 def get_context_data(self, **kwargs):
31 context = super(IndexView, self).get_context_data(**kwargs) 31 context = super(IndexView, self).get_context_data(**kwargs)
32 context['categories'] = Category.objects.all() 32 context['categories'] = Category.objects.all()
  33 +
  34 + # context['professors'] = Course.objects.all().select_related('professors__name')
33 # super.createNotification(users= User.obejcts.all(), message="testando a notificacao em login") 35 # super.createNotification(users= User.obejcts.all(), message="testando a notificacao em login")
34 return context 36 return context
35 37