|
|
@@ -160,24 +160,25 @@ def story_delete(request, story_id):
|
|
|
return render(request, 'deletion.html', {'object': story})
|
|
|
|
|
|
@login_required
|
|
|
-def story_close(_, story_id):
|
|
|
+def story_close(request, story_id):
|
|
|
story = get_object_or_404(Story, id=story_id)
|
|
|
story.close()
|
|
|
- return redirect('epic_details', story.epic.id)
|
|
|
-
|
|
|
-def story_close_ajax(_, story_id):
|
|
|
- story = get_object_or_404(Story, id=story_id)
|
|
|
- story.close()
|
|
|
- return HttpResponse(story.to_json())
|
|
|
+ if request.is_ajax():
|
|
|
+ return HttpResponse(story.to_json())
|
|
|
+ else:
|
|
|
+ return redirect('epic_details', story.epic.id)
|
|
|
|
|
|
@login_required
|
|
|
-def story_reaffect_ajax(_, story_id):
|
|
|
+def story_reaffect(request, story_id):
|
|
|
story = get_object_or_404(Story, id=story_id)
|
|
|
next_sprint = Sprint.next()
|
|
|
story.sprints.add(next_sprint)
|
|
|
story.save()
|
|
|
- return HttpResponse(story.to_json())
|
|
|
-
|
|
|
+ if request.is_ajax():
|
|
|
+ return HttpResponse(story.to_json())
|
|
|
+ else:
|
|
|
+ return redirect('story_details', story.id)
|
|
|
+
|
|
|
@login_required
|
|
|
def story_reopen(_, story_id):
|
|
|
story = get_object_or_404(Story, id=story_id)
|
|
|
@@ -361,6 +362,14 @@ def search(request):
|
|
|
results = paginator.get_page(page)
|
|
|
|
|
|
return render(request, 'search_results.html', {'results': results, 'pages': range(1, paginator.num_pages + 1)})
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+@login_required
|
|
|
+def notif_seen(request):
|
|
|
+ pass
|
|
|
+
|
|
|
+@login_required
|
|
|
+def all_notif_seen(request):
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
|