Commit d0f762481e923d40b9904474dab2fea6cb0c062f
1 parent
af13a248
Exists in
master
and in
5 other branches
updating view course in teacher
Showing
3 changed files
with
219 additions
and
110 deletions
Show diff stats
courses/templates/course/index.html
@@ -56,8 +56,8 @@ | @@ -56,8 +56,8 @@ | ||
56 | {% if user|has_role:'professor, system_admin' %} | 56 | {% if user|has_role:'professor, system_admin' %} |
57 | 57 | ||
58 | <div class="col-md-12"> | 58 | <div class="col-md-12"> |
59 | - {% if subjects_student|length > 0 %} | ||
60 | - {% for subject in subjects_teacher %} | 59 | + {% if courses_teacher|length > 0 %} |
60 | + {% for course in courses_teacher %} | ||
61 | <!-- Put your content here! --> | 61 | <!-- Put your content here! --> |
62 | <div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false"> | 62 | <div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false"> |
63 | <div class="group"> | 63 | <div class="group"> |
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | <div class="row"> | 66 | <div class="row"> |
67 | <div class="col-xs-9 col-md-10 titleTopic"> | 67 | <div class="col-xs-9 col-md-10 titleTopic"> |
68 | <a role="button" data-toggle="collapse" data-parent="#accordion" href=".collapseOne" aria-expanded="false" aria-controls="collapseOne" class="collapsed"> | 68 | <a role="button" data-toggle="collapse" data-parent="#accordion" href=".collapseOne" aria-expanded="false" aria-controls="collapseOne" class="collapsed"> |
69 | - <h4>{{subject.name}}</h4> | 69 | + <h4>{{course.name}}</h4> |
70 | </a> | 70 | </a> |
71 | </div> | 71 | </div> |
72 | <div class="col-xs-4 col-md-2" id="divMoreActions"> | 72 | <div class="col-xs-4 col-md-2" id="divMoreActions"> |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | 81 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> |
82 | </button> | 82 | </button> |
83 | <ul class="dropdown-menu" aria-labelledby="moreActions"> | 83 | <ul class="dropdown-menu" aria-labelledby="moreActions"> |
84 | - <li><a href="http://127.0.0.1:8080/html/screens/users/teacher/course_detail_teacher.html"><i class="fa fa-angle-double-right fa-fw" aria-hidden="true"></i> Access</a></li> | 84 | + <li><a href="{% url 'course:view' course.slug %}"><i class="fa fa-angle-double-right fa-fw" aria-hidden="true"></i> Access</a></li> |
85 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> Replicate</a></li> | 85 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> Replicate</a></li> |
86 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeCourse"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> Remove</a></li> | 86 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeCourse"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> Remove</a></li> |
87 | </ul> | 87 | </ul> |
@@ -91,13 +91,13 @@ | @@ -91,13 +91,13 @@ | ||
91 | </div> | 91 | </div> |
92 | <div class="panel-collapse collapseOne collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0"> | 92 | <div class="panel-collapse collapseOne collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0"> |
93 | <div class="panel-body"> | 93 | <div class="panel-body"> |
94 | - <p><b>Course Name: </b>{{subject.name}}</p> | 94 | + <p><b>Course Name: </b>{{course.name}}</p> |
95 | <p><b>Duration (in semesters): </b>09</p> | 95 | <p><b>Duration (in semesters): </b>09</p> |
96 | - <p><b>Coordinator: </b>{{subject.professors}}</p> | 96 | + <p><b>Coordinator: </b>{{course.professors}}</p> |
97 | <p> | 97 | <p> |
98 | <b>Description:</b> | 98 | <b>Description:</b> |
99 | <i> | 99 | <i> |
100 | - {{subject.description}} | 100 | + {{course.description}} |
101 | </i> | 101 | </i> |
102 | </p> | 102 | </p> |
103 | 103 | ||
@@ -146,7 +146,7 @@ | @@ -146,7 +146,7 @@ | ||
146 | </div> | 146 | </div> |
147 | 147 | ||
148 | {% if subjects_student|length > 0 %} | 148 | {% if subjects_student|length > 0 %} |
149 | - {% for subject in subjects_student %} | 149 | + {% for course in courses_student %} |
150 | <div class="col-md-12"> | 150 | <div class="col-md-12"> |
151 | <div class="panel panel-info"> | 151 | <div class="panel panel-info"> |
152 | <!--{% if course.image %} | 152 | <!--{% if course.image %} |
@@ -156,13 +156,13 @@ | @@ -156,13 +156,13 @@ | ||
156 | {% endif %} --> | 156 | {% endif %} --> |
157 | <div class="panel-heading"> | 157 | <div class="panel-heading"> |
158 | <h3 class="panel-title">Course</h3> | 158 | <h3 class="panel-title">Course</h3> |
159 | - <span class="label label-info">{{ subject.category }}</span> | ||
160 | - <span class="label label-warning">{{ subject.max_students }} {% trans 'students tops' %}</span> | 159 | + <span class="label label-info">{{ course.category }}</span> |
160 | + <span class="label label-warning">{{ course.max_students }} {% trans 'students tops' %}</span> | ||
161 | </div> | 161 | </div> |
162 | <div class="panel-body"> | 162 | <div class="panel-body"> |
163 | - <p><b>Course Name: </b>{{ subject.name }}</p> | 163 | + <p><b>Course Name: </b>{{ course.name }}</p> |
164 | <p><b>Duration (in semesters): </b>09</p> | 164 | <p><b>Duration (in semesters): </b>09</p> |
165 | - <p><b>Coordinator: </b>{{subject.professors}}</p> | 165 | + <p><b>Coordinator: </b>{{course.professors}}</p> |
166 | <p> | 166 | <p> |
167 | <b>Description:</b> | 167 | <b>Description:</b> |
168 | <i> | 168 | <i> |
@@ -171,15 +171,15 @@ | @@ -171,15 +171,15 @@ | ||
171 | </p> | 171 | </p> |
172 | 172 | ||
173 | {% if user|has_role:'professor, system_admin' %} | 173 | {% if user|has_role:'professor, system_admin' %} |
174 | - <a href="{% url 'course:update' subject.slug %}" class="btn btn-sm btn-primary"> | 174 | + <a href="{% url 'course:update' course.slug %}" class="btn btn-sm btn-primary"> |
175 | <span class="glyphicon glyphicon-edit"></span> | 175 | <span class="glyphicon glyphicon-edit"></span> |
176 | </a> | 176 | </a> |
177 | - <a href="{% url 'course:delete' subject.slug %}" class="btn btn-sm btn-danger"> | 177 | + <a href="{% url 'course:delete' course.slug %}" class="btn btn-sm btn-danger"> |
178 | <span class="glyphicon glyphicon-trash"></span> | 178 | <span class="glyphicon glyphicon-trash"></span> |
179 | </a> | 179 | </a> |
180 | {% endif %} | 180 | {% endif %} |
181 | 181 | ||
182 | - <a href="{% url 'course:view' subject.slug %}" class="btn btn-raised btn-default center-block">View Course</a> | 182 | + <a href="{% url 'course:view' course.slug %}" class="btn btn-raised btn-default center-block">View Course</a> |
183 | </div> | 183 | </div> |
184 | </div> | 184 | </div> |
185 | </div> | 185 | </div> |
courses/templates/course/view.html
@@ -15,120 +15,206 @@ | @@ -15,120 +15,206 @@ | ||
15 | {% endblock %} | 15 | {% endblock %} |
16 | 16 | ||
17 | {% block sidebar %} | 17 | {% block sidebar %} |
18 | -<div class="panel panel-primary"> | ||
19 | - <div class="panel-heading"> | ||
20 | - <img src="{{ user.image_url }}" id="img" class="img-circle img-responsive"> | ||
21 | - </br> | ||
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> | 18 | + <div class="panel panel-primary navigation"> |
19 | + <div class="panel-heading"> | ||
20 | + <h5>{% trans 'Menu' %}</h5> | ||
21 | + </div> | ||
22 | + <div class="panel-body"> | ||
23 | + <ul class="nav nav-pills nav-stacked"> | ||
24 | + <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
25 | + <li><a href="{% url 'course:manage' %}">{% trans 'My Courses' %}</a></li> | ||
26 | + </ul> | ||
27 | + </div> | ||
25 | </div> | 28 | </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> | 29 | + |
30 | +{% if user|has_role:'professor, system_admin' %} | ||
31 | + | ||
32 | + <div class="panel panel-primary navigation"> | ||
33 | + <div class="panel-heading"> | ||
34 | + <h3 class="panel-title">Actions</h3> | ||
35 | + </div> | ||
36 | + <div class="panel-body"> | ||
37 | + <ul class="nav nav-pills nav-stacked"> | ||
38 | + <li><a href="teacher/course_participants_teacher.html" target="_self">Participants</a></li> | ||
39 | + <li><a href="javascript:void(0)">Replicate Subject</a></li> | ||
40 | + <li><a href="javascript:void(0)">Create Subject</a></li> | ||
41 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal">Create Topic</a></li> | ||
42 | + </ul> | ||
35 | </div> | 43 | </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 "Courses" %}</a></li>#} | ||
42 | - </ul> | ||
43 | - </div> | ||
44 | -</div> | ||
45 | -{% if courses.count > 0 %} | ||
46 | -<div class="panel panel-primary"> | ||
47 | - <div class="panel-heading"> | ||
48 | - <h5>{% trans "Courses" %}</h5> | ||
49 | - </div> | ||
50 | - <div class="panel-body"> | ||
51 | - <ul class="nav nav-pills nav-stacked"> | ||
52 | - {% for course in courses %} | ||
53 | - <li><a href="{% url 'course:view' course.slug %}">{{course}}</a></li> | ||
54 | - {% endfor %} | ||
55 | - </ul> | ||
56 | - </div> | ||
57 | </div> | 44 | </div> |
58 | {% endif %} | 45 | {% endif %} |
46 | + | ||
59 | {% endblock %} | 47 | {% endblock %} |
60 | 48 | ||
61 | {% block content %} | 49 | {% block content %} |
62 | 50 | ||
63 | -<div class="panel panel-info"> | ||
64 | - <div class="panel-heading"> | ||
65 | - <div class="row"> | ||
66 | - <div class="col-xs-10 col-md-11"> | ||
67 | - <h3 class="panel-title">{{course.name}}</h3> | ||
68 | - </div> | ||
69 | - <div class="col-xs-2 col-md-1"> | ||
70 | - {% if user|has_role:'professor, system_admin' %} | ||
71 | - | ||
72 | - <div class="btn-group icon-more-horiz"> | ||
73 | - <button class="btn btn-default btn-xs dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
74 | - <i class="material-icons">more_horiz</i> | ||
75 | - </button> | ||
76 | - <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | ||
77 | - <li><a href="{% url 'course:update' course.slug %}"><i class="material-icons">create</i> Edit</a></li> | ||
78 | - <li><a href="{% url 'course:delete' course.slug %}"><i class="material-icons">delete_sweep</i> Remove</a></li> | ||
79 | - </ul> | 51 | + <div class="col-md-12"> |
52 | + <div class="panel panel-info"> | ||
53 | + <div class="panel-heading headingOne"> | ||
54 | + <div class="row"> | ||
55 | + <div class="col-xs-8 col-md-10 titleTopic"> | ||
56 | + <h4>{{course}}</h4> | ||
57 | + </div> | ||
58 | + <div class="col-xs-4 col-md-2" id="divMoreActions"> | ||
59 | + <div class="btn-group"> | ||
60 | + <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | ||
61 | + <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | ||
62 | + </button> | ||
80 | 63 | ||
64 | + </div> | ||
65 | + <div class="btn-group"> | ||
66 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
67 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | ||
68 | + <div class="ripple-container"></div></button> | ||
69 | + <ul class="dropdown-menu" aria-labelledby="moreActions"> | ||
70 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createSubject"><i class="fa fa-plus-square-o" aria-hidden="true"></i> Create Subject</a></li> | ||
71 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> Replicate</a></li> | ||
72 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal3"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Edit</a></li> | ||
73 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal2"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> Remove</a></li> | ||
74 | + </ul> | ||
75 | + </div> | ||
81 | </div> | 76 | </div> |
82 | - {% endif %} | ||
83 | - </div> | ||
84 | </div> | 77 | </div> |
78 | + </div> | ||
79 | + <div class="panel-body"> | ||
80 | + <p><b>Course Name: </b>{{course.name}}</p> | ||
81 | + <p><b>Duration (in semesters): </b>09</p> | ||
82 | + <p><b>Coordinator: </b>{{course.professors}}</p> | ||
83 | + <p> | ||
84 | + <b>Description:</b> | ||
85 | + <i> | ||
86 | + {{course.description}} | ||
87 | + </i> | ||
88 | + </p> | ||
89 | + | ||
90 | + </div> | ||
85 | </div> | 91 | </div> |
86 | - <div class="panel-body"> | ||
87 | - <p><b>Course Name: </b>{{course.name}}</p> | ||
88 | - <p><b>Duration (in semesters): </b></p> | ||
89 | - {% for professor in course.professors.all %} | ||
90 | - <p><b>Professor: </b>{{professor.name}}</p> | ||
91 | - {% endfor %} | ||
92 | - | ||
93 | - <p> | ||
94 | - <b>Description:</b> | ||
95 | - <i> | ||
96 | - {{course.content}} | ||
97 | - </i> | ||
98 | - </p> | ||
99 | 92 | ||
93 | +<!-- MODAL CREATE SUBJECT --> | ||
94 | +<div class="modal" tabindex="-1" role="dialog " id="createSubject"> | ||
95 | + <div class="modal-dialog"> | ||
96 | + <div class="modal-content"> | ||
97 | + <div class="modal-header"> | ||
98 | + <h4 class="modal-title">Create a New Subject</h4> | ||
99 | + </div> | ||
100 | + <div class="modal-body"> | ||
101 | + <div> | ||
102 | + <form class="form-horizontal"> | ||
103 | + <div class="form-group is-empty"> | ||
104 | + <label class="control-label col-md-2 col-md-offset-1 col-xs-2 col-xs-offset-1">Name</label> | ||
105 | + <div class="col-md-8 col-xs-8"> | ||
106 | + <input type="text" class="form-control" name="nameSubject"> | ||
107 | + </div> | ||
108 | + </div> | ||
109 | + <div class="form-group is-empty"> | ||
110 | + <label class="control-label col-md-2 col-md-offset-1 col-xs-2 col-xs-offset-1">Description</label> | ||
111 | + <div class="col-md-8 col-xs-8"> | ||
112 | + <textarea class="form-control" rows="3" id="textAreaSubject"></textarea> | ||
113 | + <span class="help-block">Sign the description of the course.</span> | ||
114 | + </div> | ||
115 | + </div> | ||
116 | + <div class="form-group is-empty"> | ||
117 | + <label class="control-label col-md-2 col-md-offset-1 col-xs-2 col-xs-offset-1">Goals</label> | ||
118 | + <div class="col-md-8 col-xs-8"> | ||
119 | + <textarea class="form-control" rows="3" id="textAreaSubject"></textarea> | ||
120 | + <span class="help-block">Sign the objectives of the course until the end of the course.</span> | ||
121 | + </div> | ||
122 | + </div> | ||
123 | + <div class="form-group is-empty"> | ||
124 | + <label class="control-label col-md-2 col-md-offset-1 col-xs-2 col-xs-offset-1">Students Limit</label> | ||
125 | + <div class="col-md-8 col-xs-8"> | ||
126 | + <input type="number" class="form-control" name="StudentLimit"> | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + <div class="row"> | ||
130 | + <div class="col-md-6 col-xs-12"> | ||
131 | + <div class="row"> | ||
132 | + <div class="form-group is-empty"> | ||
133 | + <label class="control-label col-md-4 col-xs-4 col-xs-offset-1">Begining</label> | ||
134 | + <div class="col-md-8 col-xs-6"> | ||
135 | + <input type="date" class="form-control" name="BeginDate"> | ||
136 | + </div> | ||
137 | + </div> | ||
138 | + </div> | ||
139 | + </div> | ||
140 | + <div class="col-md-6 col-xs-12"> | ||
141 | + <div class="row"> | ||
142 | + <div class="form-group is-empty"> | ||
143 | + <label class="control-label col-md-4 col-xs-4 col-xs-offset-1">End</label> | ||
144 | + <div class="col-md-8 col-xs-6"> | ||
145 | + <input type="date" class="form-control" name="EndDate"> | ||
146 | + </div> | ||
147 | + </div> | ||
148 | + </div> | ||
149 | + </div> | ||
150 | + </div> | ||
151 | + </form> | ||
152 | + </div> | ||
153 | + <div class="modal-footer"> | ||
154 | + <button type="button" data-dismiss="modal" class="btn btn-default">Cancel</button> | ||
155 | + <a href="#" target="_self"><button type="button" class="btn btn-primary">Confirm</button></a> | ||
156 | + </div> | ||
157 | + </div> | ||
158 | + </div> | ||
100 | </div> | 159 | </div> |
101 | </div> | 160 | </div> |
102 | 161 | ||
162 | +<div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false"> | ||
163 | + <div><div class="panel panel-info"> | ||
164 | +</div> | ||
103 | 165 | ||
104 | -{% for subject in subjects %} | ||
105 | - <div class="panel panel-info"> | ||
106 | - <div class="panel-heading"> | ||
107 | - <div class="row"> | ||
108 | - <a href="{% url 'course:view_subject' subject.slug %}"> | ||
109 | - <div class="col-md-11"> | ||
110 | 166 | ||
111 | - <h3 class="panel-title">{{subject}}</h3> | 167 | +<!-- MODAL REMOVE --> |
168 | +<div class="modal" id="removeSubject"> | ||
169 | + <div class="modal-dialog"> | ||
170 | + <div class="modal-content"> | ||
171 | + <div class="modal-header"> | ||
172 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | ||
173 | + <h4 class="modal-title"></h4> | ||
174 | + </div> | ||
175 | + <div class="modal-body"> | ||
176 | + <p>Are you sure you want to remove this subject?</p> | ||
177 | + </div> | ||
178 | + <div class="modal-footer"> | ||
179 | + | ||
180 | + <a href="http://127.0.0.1:8080/html/screens/users/teacher/home_course_teacher.html" target="_self"><button type="button" class="btn btn-primary">Confirm</button></a> | ||
112 | 181 | ||
182 | + </div> | ||
183 | + </div> | ||
184 | + </div> | ||
185 | +</div> | ||
186 | +</div> | ||
187 | +<div> | ||
188 | + | ||
189 | +{% for subject in subjects %} | ||
190 | +<div class="panel panel-info"> | ||
191 | + <div class="panel-heading headingTwo ui-sortable-handle" role="tab"> | ||
192 | + <div class="row"> | ||
193 | + <div class="col-xs-9 col-md-10 titleTopic"> | ||
194 | + <a role="button" data-toggle="collapse" data-parent="#accordion" href=".collapseTwo" aria-expanded="true" aria-controls="collapseTwo"> | ||
195 | + <h4>{{subject.name}}</h4> | ||
196 | + </a> | ||
113 | </div> | 197 | </div> |
114 | - </a> | ||
115 | - <div class="col-md-1 text-right"> | ||
116 | - {% if user|has_role:'professor, system_admin' %} | ||
117 | - <div class="btn-group icon-more-horiz"> | ||
118 | - <button class="btn btn-default btn-xs dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
119 | - <i class="material-icons">more_horiz</i> | 198 | + <div class="col-xs-3 col-md-2" id="divMoreActions"> |
199 | + <div class="btn-group"> | ||
200 | + <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | ||
201 | + <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | ||
120 | </button> | 202 | </button> |
121 | - <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | ||
122 | - <li><a href="{% url 'course:update_subject' subject.slug %}"><i class="material-icons">create</i> {% trans "Edit" %}</a></li> | ||
123 | - <li><a href="{% url 'course:delete_subject' subject.slug %}"><i class="material-icons">delete_sweep</i> {% trans "Remove" %}</a></li> | 203 | + </div> |
204 | + <div class="btn-group"> | ||
205 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
206 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | ||
207 | + </button> | ||
208 | + <ul class="dropdown-menu" aria-labelledby="moreActions"> | ||
209 | + <li><a href="{% url 'course:view_subject' subject.slug %}"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> Access</a></li> | ||
210 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal3"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Replicate</a></li> | ||
211 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeSubject2"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> Remove</a></li> | ||
124 | </ul> | 212 | </ul> |
125 | - | ||
126 | </div> | 213 | </div> |
127 | - {% endif %} | ||
128 | </div> | 214 | </div> |
129 | </div> | 215 | </div> |
130 | - </div> | ||
131 | - <div class="panel-body"> | 216 | + </div> |
217 | + <div class="panel-body"> | ||
132 | <p><b>{% trans "Professor" %}: </b>{% for professor in subject.professors.all %}{% if not forloop.first %},{% endif %} | 218 | <p><b>{% trans "Professor" %}: </b>{% for professor in subject.professors.all %}{% if not forloop.first %},{% endif %} |
133 | {{professor}}{% if forloop.last %}.{% endif %}{% endfor %}</p> | 219 | {{professor}}{% if forloop.last %}.{% endif %}{% endfor %}</p> |
134 | <p> | 220 | <p> |
@@ -146,11 +232,33 @@ | @@ -146,11 +232,33 @@ | ||
146 | </div> | 232 | </div> |
147 | </div> | 233 | </div> |
148 | </div> | 234 | </div> |
149 | - </div> | 235 | +</div> |
150 | {% endfor %} | 236 | {% endfor %} |
151 | -<a class="btn-floating btn-large waves-effect waves-light red" href="{% url 'course:create' %}"> | ||
152 | - <i class="fa fa-plus" aria-hidden="true"></i> | ||
153 | - </a> | 237 | + |
238 | + | ||
239 | +<!-- MODAL REMOVE --> | ||
240 | + <div class="modal" id="removeSubject2"> | ||
241 | + <div class="modal-dialog"> | ||
242 | + <div class="modal-content"> | ||
243 | + <div class="modal-header"> | ||
244 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | ||
245 | + <h4 class="modal-title"></h4> | ||
246 | + </div> | ||
247 | + <div class="modal-body"> | ||
248 | + <p>Are you sure you want to remove this subject?</p> | ||
249 | + </div> | ||
250 | + <div class="modal-footer"> | ||
251 | + | ||
252 | + <a href="http://127.0.0.1:8080/html/screens/users/teacher/home_course_teacher.html" target="_self"><button type="button" class="btn btn-primary">Confirm</button></a> | ||
253 | + | ||
254 | + </div> | ||
255 | + </div> | ||
256 | + </div> | ||
257 | + </div> | ||
258 | +</div> | ||
259 | +</div> | ||
260 | +</div> | ||
261 | + | ||
154 | {% endblock %} | 262 | {% endblock %} |
155 | 263 | ||
156 | 264 |
courses/views.py
@@ -24,13 +24,14 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -24,13 +24,14 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
24 | redirect_field_name = 'next' | 24 | redirect_field_name = 'next' |
25 | queryset = Course.objects.all() | 25 | queryset = Course.objects.all() |
26 | template_name = 'course/index.html' | 26 | template_name = 'course/index.html' |
27 | - context_object_name = 'subjects_student' | 27 | + context_object_name = 'courses_student' |
28 | paginate_by = 3 | 28 | paginate_by = 3 |
29 | 29 | ||
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 | - context['subjects_teacher'] = Course.objects.filter(professors__name = self.request.user.name) | 33 | + context['courses_teacher'] = Course.objects.filter(professors__name = self.request.user.name) |
34 | + | ||
34 | return context | 35 | return context |
35 | 36 | ||
36 | class CreateCourseView(LoginRequiredMixin, HasRoleMixin, NotificationMixin,generic.edit.CreateView): | 37 | class CreateCourseView(LoginRequiredMixin, HasRoleMixin, NotificationMixin,generic.edit.CreateView): |