Commit 4ff42d0cb485b628b09722790c55fecb96e91992
1 parent
037a8733
Exists in
master
and in
5 other branches
icon open card #205
Showing
3 changed files
with
15 additions
and
8 deletions
Show diff stats
courses/static/js/course.js
| ... | ... | @@ -49,13 +49,13 @@ function subscribe(elem, url, id, confirm_message) { |
| 49 | 49 | function delete_course(url, course, message, return_url) { |
| 50 | 50 | alertify.confirm(message, function(){ |
| 51 | 51 | var csrftoken = getCookie('csrftoken'); |
| 52 | - | |
| 52 | + | |
| 53 | 53 | $.ajax({ |
| 54 | 54 | method: 'post', |
| 55 | 55 | beforeSend: function (request) { |
| 56 | 56 | request.setRequestHeader('X-CSRFToken', csrftoken); |
| 57 | 57 | }, |
| 58 | - url: url, | |
| 58 | + url: url, | |
| 59 | 59 | success: function(data) { |
| 60 | 60 | alertify.alert('Remove Course', 'Course removed successfully!', function(){ |
| 61 | 61 | window.location.href = return_url; |
| ... | ... | @@ -71,10 +71,19 @@ function delete_course(url, course, message, return_url) { |
| 71 | 71 | */ |
| 72 | 72 | function replicate_course(url, course) { |
| 73 | 73 | $.ajax({ |
| 74 | - url: url, | |
| 74 | + url: url, | |
| 75 | 75 | data: {'form': course}, |
| 76 | 76 | success: function(data) { |
| 77 | 77 | $(".course_replicate_form").html(data); |
| 78 | 78 | } |
| 79 | 79 | }); |
| 80 | -} | |
| 81 | 80 | \ No newline at end of file |
| 81 | +} | |
| 82 | +$(".caret-square").on('click', function(){ | |
| 83 | + if( $(this).attr('title') == 'less'){ | |
| 84 | + $(this).attr('title','more'); | |
| 85 | + jQuery(this).html("<i class='fa fa-caret-square-o-up fa-2x' aria-hidden='true'></i>"); | |
| 86 | + }else{ | |
| 87 | + $(this).attr('title','less'); | |
| 88 | + jQuery(this).html("<i class='fa fa-caret-square-o-down fa-2x' aria-hidden='true'></i>"); | |
| 89 | + } | |
| 90 | + }); | |
| 82 | 91 | \ No newline at end of file | ... | ... |
courses/templates/course/course_card.html
| ... | ... | @@ -7,9 +7,7 @@ |
| 7 | 7 | <div class="panel-heading course" role="tab" > |
| 8 | 8 | <div class="row"> |
| 9 | 9 | <div class="col-md-1 moreAccordion" data-toggle="collapse" data-parent="#accordion-{{course.slug}}" href=".collapseOne-{{course.slug}}" aria-expanded="false" aria-controls="collapseOne-{{course.slug}}"> |
| 10 | - <div class="btn-group"> | |
| 11 | - <button class="btn btn-default btn-sm"><i class="fa fa-chevron-circle-down fa-2x" aria-hidden="true"></i></button> | |
| 12 | - </div> | |
| 10 | + <button class="btn btn-default btn-sm caret-square"><i class="fa fa-caret-square-o-down fa-2x" aria-hidden="true"></i></button> | |
| 13 | 11 | </div> |
| 14 | 12 | <div class="col-xs-9 col-md-4 titleTopic"> |
| 15 | 13 | <a role="button" href="{% url 'course:view' course.slug %}"> | ... | ... |
courses/templates/course/index.html