From 169228186d8c9ad880ee33c5190e49203d2c5243 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Wed, 15 Apr 2020 21:19:09 +0530 Subject: Resolve comments - Fix "'image' attribute has no file associated with it" issue. - Don't allow users who are not part of a course to see the discussion forum of that course. - Add Discussion forum link in moderator interface under course_details page. - Remove custom css for post and comments in Discussion forum. Use bootstrap 'img-fluid' class instead. 'img-fluid' fills the height and width of the card. - Use instance.uid instead of just instance in get_image_dir. --- yaksh/models.py | 2 +- yaksh/static/yaksh/css/custom.css | 9 --------- yaksh/templates/yaksh/course_detail_options.html | 5 +++++ yaksh/templates/yaksh/course_forum.html | 5 +---- yaksh/templates/yaksh/post_comments.html | 10 ++++++---- yaksh/views.py | 15 +++++++++++++++ 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index 424e2f5..4a7c4ba 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -243,7 +243,7 @@ def validate_image(image): def get_image_dir(instance, filename): return os.sep.join(( - 'post_%s' % (instance), filename + 'post_%s' % (instance.uid), filename )) diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index d6b9bdc..63ee455 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -97,12 +97,3 @@ body, .dropdown-menu { min-height: 100vh; transition: all 0.3s; } - -/* --------------------------------------------------- - Forum STYLE ------------------------------------------------------ */ - -.comment_image { - width: 350px; - height: 350px; -} \ No newline at end of file diff --git a/yaksh/templates/yaksh/course_detail_options.html b/yaksh/templates/yaksh/course_detail_options.html index 90662d6..4dd4dda 100644 --- a/yaksh/templates/yaksh/course_detail_options.html +++ b/yaksh/templates/yaksh/course_detail_options.html @@ -29,6 +29,11 @@ Send Mail +