Commit 93032820b4e92715ac87a182f6402513acdef795
1 parent
289bd78f
Exists in
master
and in
5 other branches
improvemented course's and subject's template
Showing
3 changed files
with
40 additions
and
24 deletions
Show diff stats
courses/templates/course/index.html
@@ -53,10 +53,20 @@ | @@ -53,10 +53,20 @@ | ||
53 | {% endfor %} | 53 | {% endfor %} |
54 | {% endif %} | 54 | {% endif %} |
55 | 55 | ||
56 | +<div class="col-md-12"> | ||
57 | + <div class="input-group"> | ||
58 | + <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div> | ||
59 | + <span class="input-group-btn input-group-sm"> | ||
60 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
61 | + <i class="material-icons">search</i> | ||
62 | + </button> | ||
63 | + </span> | ||
64 | + </div> | ||
65 | + </div> | ||
56 | {% if user|has_role:'professor, system_admin' %} | 66 | {% if user|has_role:'professor, system_admin' %} |
57 | 67 | ||
58 | <div class="col-md-12"> | 68 | <div class="col-md-12"> |
59 | - {% if courses_teacher|length > 0 %} | 69 | + {% if courses|length > 0 %} |
60 | {% for course in courses_teacher %} | 70 | {% for course in courses_teacher %} |
61 | <!-- Put your content here! --> | 71 | <!-- 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"> | 72 | <div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false"> |
@@ -130,21 +140,11 @@ | @@ -130,21 +140,11 @@ | ||
130 | </div> | 140 | </div> |
131 | </div> | 141 | </div> |
132 | </div> | 142 | </div> |
143 | +{% endif %} | ||
133 | 144 | ||
134 | -{% else %} | 145 | +{% if user|has_role:'students' %} |
135 | 146 | ||
136 | - <div class="col-md-12"> | ||
137 | - <div class="input-group"> | ||
138 | - <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div> | ||
139 | - <span class="input-group-btn input-group-sm"> | ||
140 | - <button type="button" class="btn btn-fab btn-fab-mini"> | ||
141 | - <i class="material-icons">search</i> | ||
142 | - </button> | ||
143 | - </span> | ||
144 | - </div> | ||
145 | - </div> | ||
146 | - | ||
147 | - {% if subjects_student|length > 0 %} | 147 | + {% if courses|length > 0 %} |
148 | {% for course in courses_student %} | 148 | {% for course in courses_student %} |
149 | <div class="col-md-12"> | 149 | <div class="col-md-12"> |
150 | <div class="panel panel-info"> | 150 | <div class="panel panel-info"> |
@@ -154,9 +154,15 @@ | @@ -154,9 +154,15 @@ | ||
154 | <img src="" class="img-responsive" /> | 154 | <img src="" class="img-responsive" /> |
155 | {% endif %} --> | 155 | {% endif %} --> |
156 | <div class="panel-heading"> | 156 | <div class="panel-heading"> |
157 | - <h3 class="panel-title">Course</h3> | ||
158 | - <span class="label label-info">{{ course.category }}</span> | ||
159 | - <span class="label label-warning">{{ course.max_students }} {% trans 'students tops' %}</span> | 157 | + <div class="row"> |
158 | + <div class="col-md-9"> | ||
159 | + <h3 class="panel-title">{{course.name}}</h3> | ||
160 | + </div> | ||
161 | + <div class="col-md-3"> | ||
162 | + <span class="label label-info">{{ course.category }}</span> | ||
163 | + <span class="label label-warning">{{ course.max_students }} {% trans 'students tops' %}</span> | ||
164 | + </div> | ||
165 | + </div> | ||
160 | </div> | 166 | </div> |
161 | <div class="panel-body"> | 167 | <div class="panel-body"> |
162 | <p><b>Course Name: </b>{{ course.name }}</p> | 168 | <p><b>Course Name: </b>{{ course.name }}</p> |
@@ -165,18 +171,22 @@ | @@ -165,18 +171,22 @@ | ||
165 | <p> | 171 | <p> |
166 | <b>Description:</b> | 172 | <b>Description:</b> |
167 | <i> | 173 | <i> |
168 | - "Lorem ipsum dolor sit amet, consecctetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | 174 | + {% if couse.description %} |
175 | + {{course.description|linebreaks}} | ||
176 | + {% else %} | ||
177 | + {% trans 'No description' %} | ||
178 | + {% endif %} | ||
169 | </i> | 179 | </i> |
170 | </p> | 180 | </p> |
171 | 181 | ||
172 | - {% if user|has_role:'professor, system_admin' %} | 182 | + <!--{% if user|has_role:'professor, system_admin' %} |
173 | <a href="{% url 'course:update' course.slug %}" class="btn btn-sm btn-primary"> | 183 | <a href="{% url 'course:update' course.slug %}" class="btn btn-sm btn-primary"> |
174 | <span class="glyphicon glyphicon-edit"></span> | 184 | <span class="glyphicon glyphicon-edit"></span> |
175 | </a> | 185 | </a> |
176 | <a href="{% url 'course:delete' course.slug %}" class="btn btn-sm btn-danger"> | 186 | <a href="{% url 'course:delete' course.slug %}" class="btn btn-sm btn-danger"> |
177 | <span class="glyphicon glyphicon-trash"></span> | 187 | <span class="glyphicon glyphicon-trash"></span> |
178 | </a> | 188 | </a> |
179 | - {% endif %} | 189 | + {% endif %}--> |
180 | 190 | ||
181 | <a href="{% url 'course:view' course.slug %}" class="btn btn-raised btn-default center-block">View Course</a> | 191 | <a href="{% url 'course:view' course.slug %}" class="btn btn-raised btn-default center-block">View Course</a> |
182 | </div> | 192 | </div> |
@@ -185,7 +195,6 @@ | @@ -185,7 +195,6 @@ | ||
185 | 195 | ||
186 | {% endfor %} | 196 | {% endfor %} |
187 | 197 | ||
188 | - | ||
189 | <nav aria-label="Page navigation"> | 198 | <nav aria-label="Page navigation"> |
190 | <ul class="pagination"> | 199 | <ul class="pagination"> |
191 | {% for page_number in paginator.page_range %} | 200 | {% for page_number in paginator.page_range %} |
@@ -199,4 +208,5 @@ | @@ -199,4 +208,5 @@ | ||
199 | {% trans 'No courses found' %} | 208 | {% trans 'No courses found' %} |
200 | {% endif %} | 209 | {% endif %} |
201 | {% endif %} | 210 | {% endif %} |
211 | + | ||
202 | {% endblock %} | 212 | {% endblock %} |
courses/templates/course/view.html
@@ -99,7 +99,7 @@ | @@ -99,7 +99,7 @@ | ||
99 | </div> | 99 | </div> |
100 | <div class="modal-body"> | 100 | <div class="modal-body"> |
101 | <div> | 101 | <div> |
102 | - <form class="form-horizontal"> | 102 | + <!--<form class="form-horizontal"> |
103 | <div class="form-group is-empty"> | 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> | 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"> | 105 | <div class="col-md-8 col-xs-8"> |
@@ -148,7 +148,7 @@ | @@ -148,7 +148,7 @@ | ||
148 | </div> | 148 | </div> |
149 | </div> | 149 | </div> |
150 | </div> | 150 | </div> |
151 | - </form> | 151 | + </form>--> |
152 | </div> | 152 | </div> |
153 | <div class="modal-footer"> | 153 | <div class="modal-footer"> |
154 | <button type="button" data-dismiss="modal" class="btn btn-default">Cancel</button> | 154 | <button type="button" data-dismiss="modal" class="btn btn-default">Cancel</button> |
@@ -233,6 +233,10 @@ | @@ -233,6 +233,10 @@ | ||
233 | <a href="{% url 'course:view_subject' subject.slug %}" class="btn btn-raised btn-default center-block">{% trans 'View Subject' %}<div class="ripple-container"></div></a> | 233 | <a href="{% url 'course:view_subject' subject.slug %}" class="btn btn-raised btn-default center-block">{% trans 'View Subject' %}<div class="ripple-container"></div></a> |
234 | </div> | 234 | </div> |
235 | </div> | 235 | </div> |
236 | +<div class="form-group"> | ||
237 | + <a href="{% url 'course:create_subject' subject.slug %}" data-toggle="modal" data-target="" class="btn btn-primary btn-lg btn-block btn-raised">{% trans 'Create Subject' %}<div class="ripple-container"></div></a> | ||
238 | +</div> | ||
239 | + | ||
236 | {% endfor %} | 240 | {% endfor %} |
237 | 241 | ||
238 | 242 |
courses/templates/subject/index.html
@@ -67,7 +67,9 @@ | @@ -67,7 +67,9 @@ | ||
67 | {% endfor %} | 67 | {% endfor %} |
68 | 68 | ||
69 | {% if user|has_role:'system_admin' or topic.owner == user%} | 69 | {% if user|has_role:'system_admin' or topic.owner == user%} |
70 | - <a name="create_topic" class="btn btn-primary btn-md btn-block" href="{% url 'course:create_topic' subject.slug %}">{% trans "Create Topic" %}</a> | 70 | + <div class="form-group"> |
71 | + <a href="{% url 'course:create_topic' subject.slug %}" data-toggle="modal" data-target="" class="btn btn-primary btn-lg btn-block btn-raised" name="create_topic">{% trans "Create Topic" %}<div class="ripple-container"></div></a> | ||
72 | + </div> | ||
71 | {% endif %} | 73 | {% endif %} |
72 | 74 | ||
73 | {% endblock %} | 75 | {% endblock %} |