Commit f220b7a8811dbc3563306684931f4e39840b5a34
1 parent
27792fef
Exists in
master
and in
5 other branches
Adapting forum deletion [Issue: #86 and #96]
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
forum/static/js/forum.js
... | ... | @@ -92,7 +92,7 @@ function createForum(url, topic) { |
92 | 92 | * Function to delete a forum |
93 | 93 | * |
94 | 94 | */ |
95 | -function delete_forum(url, forum, message) { | |
95 | +function delete_forum(url, forum, message, return_url) { | |
96 | 96 | alertify.confirm(message, function(){ |
97 | 97 | var csrftoken = getCookie('csrftoken'); |
98 | 98 | |
... | ... | @@ -103,8 +103,9 @@ function delete_forum(url, forum, message) { |
103 | 103 | }, |
104 | 104 | url: url, |
105 | 105 | success: function(data) { |
106 | - $("#forum_"+forum).remove(); | |
107 | - $('#forumModal').modal('hide'); | |
106 | + alertify.alert('Amadeus', data, function(){ | |
107 | + window.location.href = return_url; | |
108 | + }); | |
108 | 109 | } |
109 | 110 | }); |
110 | 111 | }); | ... | ... |
forum/templates/forum/forum_view.html
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | <div class="panel-body"> |
43 | 43 | <ul class="nav nav-pills nav-stacked"> |
44 | 44 | <li><a href="javascript:edit_forum('{% url 'course:forum:index' %}', '{{ forum.id }}')">{% trans 'Edit' %}</a></li> |
45 | - <li><a href="javascript:delete_forum('{% url 'course:forum:delete' forum.id %}', '{{ forum.id }}', '{% trans "Are you sure you want to delete this forum?" %}')">{% trans 'Delete' %}</a></li> | |
45 | + <li><a href="javascript:delete_forum('{% url 'course:forum:delete' forum.id %}', '{{ forum.id }}', '{% trans "Are you sure you want to delete this forum?" %}', '{% url 'course:view_subject' forum.topic.subject.slug %}')">{% trans 'Delete' %}</a></li> | |
46 | 46 | </ul> |
47 | 47 | </div> |
48 | 48 | </div> | ... | ... |