Commit b00a76bea665cb24e494223caae75a507a81f1f0
Exists in
master
and in
3 other branches
Merge branch 'refactoring' of https://github.com/amadeusproject/amadeuslms into refactoring
Showing
14 changed files
with
354 additions
and
18 deletions
Show diff stats
amadeus/static/css/.sass-cache/a7f87b90919294b62ab4f8079e31dcda8f485534/green.sassc
No preview for this file type
amadeus/static/css/base/amadeus.css
amadeus/static/css/themes/green.css
@@ -411,7 +411,7 @@ a.add-row { | @@ -411,7 +411,7 @@ a.add-row { | ||
411 | .post_action i, .post .post-user .user-action i, .comment .comment-user .user-action i { | 411 | .post_action i, .post .post-user .user-action i, .comment .comment-user .user-action i { |
412 | color: #1d8fe0; } | 412 | color: #1d8fe0; } |
413 | 413 | ||
414 | -.post .post-user, .comment .comment-user, .marked_user { | 414 | +.post .post-user, .comment .comment-user, .marked_user, .post_resource { |
415 | color: #26A69A; } | 415 | color: #26A69A; } |
416 | 416 | ||
417 | .post .post-user .user-action { | 417 | .post .post-user .user-action { |
@@ -459,7 +459,7 @@ a.add-row { | @@ -459,7 +459,7 @@ a.add-row { | ||
459 | .suggestions { | 459 | .suggestions { |
460 | background: #FFFFFF; } | 460 | background: #FFFFFF; } |
461 | 461 | ||
462 | -.mural-category { | 462 | +.mural-category, .mural-subject { |
463 | background: #EEE; } | 463 | background: #EEE; } |
464 | 464 | ||
465 | .btn:not(.btn-raised):not(.btn-link):focus, .btn:not(.btn-raised):not(.btn-link):hover, .input-group-btn .btn:not(.btn-raised):not(.btn-link):focus, .input-group-btn .btn:not(.btn-raised):not(.btn-link):hover { | 465 | .btn:not(.btn-raised):not(.btn-link):focus, .btn:not(.btn-raised):not(.btn-link):hover, .input-group-btn .btn:not(.btn-raised):not(.btn-link):focus, .input-group-btn .btn:not(.btn-raised):not(.btn-link):hover { |
amadeus/static/css/themes/green.css.map
1 | { | 1 | { |
2 | "version": 3, | 2 | "version": 3, |
3 | -"mappings": "AAOA,gJAAgJ;EAC5I,gBAAgB,EAAE,KAAK;;AAG3B,mBAAmB;E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AAGtB,YAAY;EACR,UAAU,EAhnBN,OAAO;;AAmnBf,+BAA+B;EAC3B,UAAU,EAAE,IAAI;;AAGpB,gNAAgN;EAC5M,gBAAgB,EAAE,OAAO;;;EAKzB,mDAAmD;IAC/C,KAAK,EAAE,kBAAkB;;EAE7B,yDAAyD;IACrD,KAAK,EAAE,kBAAyB", |
4 | "sources": ["green.sass"], | 4 | "sources": ["green.sass"], |
5 | "names": [], | 5 | "names": [], |
6 | "file": "green.css" | 6 | "file": "green.css" |
amadeus/static/css/themes/green.sass
@@ -564,7 +564,7 @@ a.add-row | @@ -564,7 +564,7 @@ a.add-row | ||
564 | color: #1d8fe0 | 564 | color: #1d8fe0 |
565 | 565 | ||
566 | 566 | ||
567 | -.post .post-user, .comment .comment-user, .marked_user | 567 | +.post .post-user, .comment .comment-user, .marked_user, .post_resource |
568 | color: #26A69A | 568 | color: #26A69A |
569 | 569 | ||
570 | 570 | ||
@@ -629,7 +629,7 @@ a.add-row | @@ -629,7 +629,7 @@ a.add-row | ||
629 | background: $white | 629 | background: $white |
630 | 630 | ||
631 | 631 | ||
632 | -.mural-category | 632 | +.mural-category, .mural-subject |
633 | background: #EEE | 633 | background: #EEE |
634 | 634 | ||
635 | 635 |
amadeus/static/js/mural_subject.js
@@ -11,6 +11,75 @@ $('.mural-subject').on('shown.bs.collapse', function(e) { | @@ -11,6 +11,75 @@ $('.mural-subject').on('shown.bs.collapse', function(e) { | ||
11 | $(li).append("<span class='divider'>/</span>"); | 11 | $(li).append("<span class='divider'>/</span>"); |
12 | 12 | ||
13 | new_li.appendTo('.breadcrumb'); | 13 | new_li.appendTo('.breadcrumb'); |
14 | + | ||
15 | + var post_section = $(this).find('.posts'), | ||
16 | + without = $(this).find('.no-subjects'), | ||
17 | + loading = $(this).find('.loading-posts'), | ||
18 | + more = $(this).find('.more-posts'), | ||
19 | + filters = $(this).find('.post-filters'), | ||
20 | + clear_filters = $(this).find('.clear_filter'), | ||
21 | + mural = post_section.parent().parent(); | ||
22 | + | ||
23 | + if (post_section.children().length == 0) { | ||
24 | + var url = $(this).find('.mural').data('url'); | ||
25 | + | ||
26 | + $.ajax({ | ||
27 | + url: url, | ||
28 | + dataType: 'json', | ||
29 | + success: function (data) { | ||
30 | + loading.hide(); | ||
31 | + | ||
32 | + if (data.count > 0) { | ||
33 | + post_section.append(data.posts); | ||
34 | + | ||
35 | + mural.data('pages', data.num_pages); | ||
36 | + mural.data('page', data.num_page); | ||
37 | + | ||
38 | + setTimeout(function () { postHeightLimits() }, 100); | ||
39 | + | ||
40 | + if (data.num_page < data.num_pages) { | ||
41 | + more.show(); | ||
42 | + } else { | ||
43 | + more.hide(); | ||
44 | + } | ||
45 | + | ||
46 | + $('.mural_badge').each(function () { | ||
47 | + var actual = $(this).text(); | ||
48 | + | ||
49 | + if (actual != "+99") { | ||
50 | + actual = parseInt(actual, 10) - data.unviewed; | ||
51 | + | ||
52 | + if (actual <= 0) { | ||
53 | + $(this).hide(); | ||
54 | + } else { | ||
55 | + $(this).text(actual); | ||
56 | + } | ||
57 | + } | ||
58 | + }); | ||
59 | + | ||
60 | + $('.sub_badge').each(function () { | ||
61 | + var actual = $(this).text(); | ||
62 | + | ||
63 | + if (actual != "+99") { | ||
64 | + actual = parseInt(actual, 10) - data.unviewed; | ||
65 | + | ||
66 | + if (actual < 0) { | ||
67 | + actual = 0; | ||
68 | + } | ||
69 | + | ||
70 | + $(this).text(actual); | ||
71 | + } | ||
72 | + }); | ||
73 | + | ||
74 | + without.hide(); | ||
75 | + } else { | ||
76 | + more.hide(); | ||
77 | + | ||
78 | + without.show(); | ||
79 | + } | ||
80 | + } | ||
81 | + }); | ||
82 | + } | ||
14 | } | 83 | } |
15 | }); | 84 | }); |
16 | 85 |
mural/forms.py
@@ -2,8 +2,11 @@ | @@ -2,8 +2,11 @@ | ||
2 | from django import forms | 2 | from django import forms |
3 | from django.utils.translation import ugettext_lazy as _ | 3 | from django.utils.translation import ugettext_lazy as _ |
4 | from django.utils.html import strip_tags | 4 | from django.utils.html import strip_tags |
5 | +from django.db.models import Q | ||
5 | 6 | ||
6 | -from .models import GeneralPost, CategoryPost, Comment | 7 | +from topics.models import Resource |
8 | + | ||
9 | +from .models import GeneralPost, CategoryPost, SubjectPost, Comment | ||
7 | 10 | ||
8 | class Validation(forms.ModelForm): | 11 | class Validation(forms.ModelForm): |
9 | MAX_UPLOAD_SIZE = 5*1024*1024 | 12 | MAX_UPLOAD_SIZE = 5*1024*1024 |
@@ -49,6 +52,31 @@ class CategoryPostForm(Validation): | @@ -49,6 +52,31 @@ class CategoryPostForm(Validation): | ||
49 | 'post': forms.Textarea | 52 | 'post': forms.Textarea |
50 | } | 53 | } |
51 | 54 | ||
55 | +class SubjectPostForm(Validation): | ||
56 | + def __init__(self, *args, **kwargs): | ||
57 | + super(SubjectPostForm, self).__init__(*args, **kwargs) | ||
58 | + | ||
59 | + user = kwargs['initial'].get('user', None) | ||
60 | + subject = kwargs['initial'].get('subject', None) | ||
61 | + | ||
62 | + if not kwargs['instance'] is None: | ||
63 | + subject = self.instance.space | ||
64 | + | ||
65 | + if user.is_staff: | ||
66 | + self.fields['resource'].choices = [(r.id, str(r)) for r in Resource.objects.filter(Q(topic__subject = subject))] | ||
67 | + else: | ||
68 | + self.fields['resource'].choices = [(r.id, str(r)) for r in Resource.objects.filter(Q(topic__subject = subject) & (Q(all_students = True) | Q(students = user) | Q(groups__participants = user)))] | ||
69 | + | ||
70 | + self.fields['resource'].choices.append(("", _("Choose an especific resource"))) | ||
71 | + | ||
72 | + class Meta: | ||
73 | + model = SubjectPost | ||
74 | + fields = ['action', 'resource', 'post', 'image'] | ||
75 | + widgets = { | ||
76 | + 'action': forms.RadioSelect, | ||
77 | + 'post': forms.Textarea | ||
78 | + } | ||
79 | + | ||
52 | class CommentForm(forms.ModelForm): | 80 | class CommentForm(forms.ModelForm): |
53 | MAX_UPLOAD_SIZE = 5*1024*1024 | 81 | MAX_UPLOAD_SIZE = 5*1024*1024 |
54 | 82 |
mural/models.py
@@ -74,7 +74,7 @@ class CategoryPost(Mural): | @@ -74,7 +74,7 @@ class CategoryPost(Mural): | ||
74 | 74 | ||
75 | class SubjectPost(Mural): | 75 | class SubjectPost(Mural): |
76 | space = models.ForeignKey(Subject, verbose_name = _('Subject'), related_name = 'post_subject') | 76 | space = models.ForeignKey(Subject, verbose_name = _('Subject'), related_name = 'post_subject') |
77 | - resource = models.ForeignKey(Resource, verbose_name = _('Resource'), related_name = 'post_resource', null = True) | 77 | + resource = models.ForeignKey(Resource, verbose_name = _('Resource'), related_name = 'post_resource', null = True, blank = True) |
78 | 78 | ||
79 | def get_id(self): | 79 | def get_id(self): |
80 | return self.id | 80 | return self.id |
@@ -83,10 +83,10 @@ class SubjectPost(Mural): | @@ -83,10 +83,10 @@ class SubjectPost(Mural): | ||
83 | return self.space.id | 83 | return self.space.id |
84 | 84 | ||
85 | def update_link(self): | 85 | def update_link(self): |
86 | - return "" | 86 | + return "mural:update_subject" |
87 | 87 | ||
88 | def delete_link(self): | 88 | def delete_link(self): |
89 | - return "" | 89 | + return "mural:delete_subject" |
90 | 90 | ||
91 | class Comment(models.Model): | 91 | class Comment(models.Model): |
92 | comment = models.TextField(_('Comment'), blank = True) | 92 | comment = models.TextField(_('Comment'), blank = True) |
mural/templates/mural/_form.html
@@ -27,6 +27,28 @@ | @@ -27,6 +27,28 @@ | ||
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | 29 | ||
30 | + {% if form.resource %} | ||
31 | + <div class="form-group{% if form.has_error %} has-error {% endif %}"> | ||
32 | + <label for="{{ form.resource.auto_id }}">{{ form.resource.label }}</label> | ||
33 | + {% render_field form.resource class='form-control' %} | ||
34 | + | ||
35 | + <span id="helpBlock" class="help-block">{{ form.resource.help_text }}</span> | ||
36 | + | ||
37 | + {% if form.resource.errors %} | ||
38 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
39 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
40 | + <span aria-hidden="true">×</span> | ||
41 | + </button> | ||
42 | + <ul> | ||
43 | + {% for error in form.resource.errors %} | ||
44 | + <li>{{ error }}</li> | ||
45 | + {% endfor %} | ||
46 | + </ul> | ||
47 | + </div> | ||
48 | + {% endif %} | ||
49 | + </div> | ||
50 | + {% endif %} | ||
51 | + | ||
30 | <div class="form-group{% if form.has_error %} has-error {% endif %}"> | 52 | <div class="form-group{% if form.has_error %} has-error {% endif %}"> |
31 | <label for="{{ form.post.auto_id }}">{{ form.post.label }} <span>*</span></label> | 53 | <label for="{{ form.post.auto_id }}">{{ form.post.label }} <span>*</span></label> |
32 | {% render_field form.post class='form-control text_simple_wysiwyg' %} | 54 | {% render_field form.post class='form-control text_simple_wysiwyg' %} |
mural/templates/mural/_view.html
@@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
11 | <span class="user-action"> | 11 | <span class="user-action"> |
12 | <i class="fa {{ post.action|action_icon }}"></i> | 12 | <i class="fa {{ post.action|action_icon }}"></i> |
13 | {{ post.get_action_display }} | 13 | {{ post.get_action_display }} |
14 | + {{ post|has_resource|safe }} | ||
14 | </span> | 15 | </span> |
15 | {% if post|show_settings:request.user %} | 16 | {% if post|show_settings:request.user %} |
16 | <span class="btn-group pull-right"> | 17 | <span class="btn-group pull-right"> |
mural/templates/mural/list_subject.html
@@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
65 | </div> | 65 | </div> |
66 | </div> | 66 | </div> |
67 | <div id="{{subject.slug}}" class="panel-collapse panel-body collapse mural-subject"> | 67 | <div id="{{subject.slug}}" class="panel-collapse panel-body collapse mural-subject"> |
68 | - <div class="col-md-12 cards-content mural" data-url="{% url 'mural:load_category' subject.id %}"> | 68 | + <div class="col-md-12 cards-content mural" data-url="{% url 'mural:load_subject' subject.id %}"> |
69 | <div class="col-md-9 col-sm-9 col-xs-9 mural-list"> | 69 | <div class="col-md-9 col-sm-9 col-xs-9 mural-list"> |
70 | <div class="post_make panel panel-default"> | 70 | <div class="post_make panel panel-default"> |
71 | <div class="panel-body"> | 71 | <div class="panel-body"> |
@@ -74,7 +74,7 @@ | @@ -74,7 +74,7 @@ | ||
74 | </div> | 74 | </div> |
75 | <div class="col-lg-11 col-md-11 col-sm-11 col-xs-11 post-field"> | 75 | <div class="col-lg-11 col-md-11 col-sm-11 col-xs-11 post-field"> |
76 | <div> | 76 | <div> |
77 | - <h4 data-url="{% url 'mural:create_category' subject.slug %}">{% trans 'Wish to make a new post?' %}</h4> | 77 | + <h4 data-url="{% url 'mural:create_subject' subject.slug %}">{% trans 'Wish to make a new post?' %}</h4> |
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
mural/templatetags/mural_filters.py
@@ -66,7 +66,14 @@ def show_settings(post, user): | @@ -66,7 +66,14 @@ def show_settings(post, user): | ||
66 | return True | 66 | return True |
67 | 67 | ||
68 | if post._my_subclass == "categorypost": | 68 | if post._my_subclass == "categorypost": |
69 | - if post.space.coordinators == user: | 69 | + if post.categorypost.space.coordinators == user: |
70 | + return True | ||
71 | + | ||
72 | + if post._my_subclass == "subjectpost": | ||
73 | + if post.subjectpost.space.professor == user: | ||
74 | + return True | ||
75 | + | ||
76 | + if post.subjectpost.space.category.coordinators == user: | ||
70 | return True | 77 | return True |
71 | 78 | ||
72 | return False | 79 | return False |
@@ -80,7 +87,22 @@ def show_settings_comment(comment, user): | @@ -80,7 +87,22 @@ def show_settings_comment(comment, user): | ||
80 | return True | 87 | return True |
81 | 88 | ||
82 | if comment.post._my_subclass == "categorypost": | 89 | if comment.post._my_subclass == "categorypost": |
83 | - if comment.post.space.coordinators == user: | 90 | + if comment.post.categorypost.space.coordinators == user: |
91 | + return True | ||
92 | + | ||
93 | + if comment.post._my_subclass == "subjectpost": | ||
94 | + if comment.post.subjectpost.space.professor == user: | ||
95 | + return True | ||
96 | + | ||
97 | + if comment.post.subjectpost.space.category.coordinators == user: | ||
84 | return True | 98 | return True |
85 | 99 | ||
86 | return False | 100 | return False |
101 | + | ||
102 | +@register.filter(name = 'has_resource') | ||
103 | +def has_resource(post): | ||
104 | + if post._my_subclass == 'subjectpost': | ||
105 | + if post.subjectpost.resource: | ||
106 | + return _("about") + " <span class='post_resource'>" + str(post.subjectpost.resource) + "</span>" | ||
107 | + | ||
108 | + return "" | ||
87 | \ No newline at end of file | 109 | \ No newline at end of file |
mural/urls.py
@@ -7,11 +7,15 @@ urlpatterns = [ | @@ -7,11 +7,15 @@ urlpatterns = [ | ||
7 | url(r'^subjects/$', views.SubjectIndex.as_view(), name='manage_subject'), | 7 | url(r'^subjects/$', views.SubjectIndex.as_view(), name='manage_subject'), |
8 | url(r'^create_gen/$', views.GeneralCreate.as_view(), name='create_general'), | 8 | url(r'^create_gen/$', views.GeneralCreate.as_view(), name='create_general'), |
9 | url(r'^create_cat/(?P<slug>[\w_-]+)/$', views.CategoryCreate.as_view(), name='create_category'), | 9 | url(r'^create_cat/(?P<slug>[\w_-]+)/$', views.CategoryCreate.as_view(), name='create_category'), |
10 | + url(r'^create_sub/(?P<slug>[\w_-]+)/$', views.SubjectCreate.as_view(), name='create_subject'), | ||
10 | url(r'^update_gen/(?P<pk>[\w_-]+)/$', views.GeneralUpdate.as_view(), name='update_general'), | 11 | url(r'^update_gen/(?P<pk>[\w_-]+)/$', views.GeneralUpdate.as_view(), name='update_general'), |
11 | url(r'^update_cat/(?P<pk>[\w_-]+)/$', views.CategoryUpdate.as_view(), name='update_category'), | 12 | url(r'^update_cat/(?P<pk>[\w_-]+)/$', views.CategoryUpdate.as_view(), name='update_category'), |
13 | + url(r'^update_sub/(?P<pk>[\w_-]+)/$', views.SubjectUpdate.as_view(), name='update_subject'), | ||
12 | url(r'^delete_gen/(?P<pk>[\w_-]+)/$', views.GeneralDelete.as_view(), name='delete_general'), | 14 | url(r'^delete_gen/(?P<pk>[\w_-]+)/$', views.GeneralDelete.as_view(), name='delete_general'), |
13 | url(r'^delete_cat/(?P<pk>[\w_-]+)/$', views.CategoryDelete.as_view(), name='delete_category'), | 15 | url(r'^delete_cat/(?P<pk>[\w_-]+)/$', views.CategoryDelete.as_view(), name='delete_category'), |
16 | + url(r'^delete_sub/(?P<pk>[\w_-]+)/$', views.SubjectDelete.as_view(), name='delete_subject'), | ||
14 | url(r'^load_category/([\w_-]+)/$', views.load_category_posts, name='load_category'), | 17 | url(r'^load_category/([\w_-]+)/$', views.load_category_posts, name='load_category'), |
18 | + url(r'^load_subject/([\w_-]+)/$', views.load_subject_posts, name='load_subject'), | ||
15 | url(r'^favorite/([\w_-]+)/$', views.favorite, name='favorite'), | 19 | url(r'^favorite/([\w_-]+)/$', views.favorite, name='favorite'), |
16 | url(r'^deleted/$', views.deleted_post, name='deleted_post'), | 20 | url(r'^deleted/$', views.deleted_post, name='deleted_post'), |
17 | url(r'^comment/(?P<post>[\w_-]+)/$', views.CommentCreate.as_view(), name='create_comment'), | 21 | url(r'^comment/(?P<post>[\w_-]+)/$', views.CommentCreate.as_view(), name='create_comment'), |
mural/views.py
@@ -19,7 +19,7 @@ from subjects.models import Subject | @@ -19,7 +19,7 @@ from subjects.models import Subject | ||
19 | from users.models import User | 19 | from users.models import User |
20 | 20 | ||
21 | from .models import Mural, GeneralPost, CategoryPost, SubjectPost, MuralVisualizations, MuralFavorites, Comment | 21 | from .models import Mural, GeneralPost, CategoryPost, SubjectPost, MuralVisualizations, MuralFavorites, Comment |
22 | -from .forms import GeneralPostForm, CategoryPostForm, CommentForm | 22 | +from .forms import GeneralPostForm, CategoryPostForm, SubjectPostForm, CommentForm |
23 | from .utils import getSpaceUsers | 23 | from .utils import getSpaceUsers |
24 | 24 | ||
25 | """ | 25 | """ |
@@ -322,7 +322,7 @@ class CategoryCreate(LoginRequiredMixin, generic.edit.CreateView): | @@ -322,7 +322,7 @@ class CategoryCreate(LoginRequiredMixin, generic.edit.CreateView): | ||
322 | 322 | ||
323 | self.object.save() | 323 | self.object.save() |
324 | 324 | ||
325 | - users = User.objects.filter(Q(is_staff = True) | Q(coordinators = cat) | Q(professors__category = cat) | Q(subject_student__category = cat)).exclude(id = self.request.user.id) | 325 | + users = getSpaceUsers(self.request.user.id, self.object) |
326 | entries = [] | 326 | entries = [] |
327 | 327 | ||
328 | notify_type = "mural" | 328 | notify_type = "mural" |
@@ -370,7 +370,7 @@ class CategoryUpdate(LoginRequiredMixin, generic.UpdateView): | @@ -370,7 +370,7 @@ class CategoryUpdate(LoginRequiredMixin, generic.UpdateView): | ||
370 | 370 | ||
371 | self.object.save() | 371 | self.object.save() |
372 | 372 | ||
373 | - users = User.objects.all().exclude(id = self.request.user.id) | 373 | + users = getSpaceUsers(self.request.user.id, self.object) |
374 | 374 | ||
375 | notify_type = "mural" | 375 | notify_type = "mural" |
376 | _view = render_to_string("mural/_view.html", {"post": self.object}, self.request) | 376 | _view = render_to_string("mural/_view.html", {"post": self.object}, self.request) |
@@ -407,7 +407,7 @@ class CategoryDelete(LoginRequiredMixin, generic.DeleteView): | @@ -407,7 +407,7 @@ class CategoryDelete(LoginRequiredMixin, generic.DeleteView): | ||
407 | return context | 407 | return context |
408 | 408 | ||
409 | def get_success_url(self): | 409 | def get_success_url(self): |
410 | - users = User.objects.all().exclude(id = self.request.user.id) | 410 | + users = getSpaceUsers(self.request.user.id, self.object) |
411 | 411 | ||
412 | notify_type = "mural" | 412 | notify_type = "mural" |
413 | pathname = reverse("mural:manage_category") | 413 | pathname = reverse("mural:manage_category") |
@@ -420,6 +420,57 @@ class CategoryDelete(LoginRequiredMixin, generic.DeleteView): | @@ -420,6 +420,57 @@ class CategoryDelete(LoginRequiredMixin, generic.DeleteView): | ||
420 | """ | 420 | """ |
421 | Section for SubjectPost classes | 421 | Section for SubjectPost classes |
422 | """ | 422 | """ |
423 | +def load_subject_posts(request, subject): | ||
424 | + context = { | ||
425 | + 'request': request, | ||
426 | + } | ||
427 | + | ||
428 | + user = request.user | ||
429 | + favorites = request.GET.get('favorite', False) | ||
430 | + mines = request.GET.get('mine', False) | ||
431 | + showing = request.GET.get('showing', '') | ||
432 | + n_views = 0 | ||
433 | + | ||
434 | + if not favorites: | ||
435 | + if mines: | ||
436 | + posts = SubjectPost.objects.extra(select = {"most_recent": "greatest(last_update, (select max(mural_comment.last_update) from mural_comment where mural_comment.post_id = mural_subjectpost.mural_ptr_id))"}).filter(space__id = subject, mural_ptr__user = user) | ||
437 | + else: | ||
438 | + posts = SubjectPost.objects.extra(select = {"most_recent": "greatest(last_update, (select max(mural_comment.last_update) from mural_comment where mural_comment.post_id = mural_subjectpost.mural_ptr_id))"}).filter(space__id = subject) | ||
439 | + else: | ||
440 | + if mines: | ||
441 | + posts = SubjectPost.objects.extra(select = {"most_recent": "greatest(last_update, (select max(mural_comment.last_update) from mural_comment where mural_comment.post_id = mural_subjectpost.mural_ptr_id))"}).filter(space__id = subject, favorites_post__isnull = False, favorites_post__user = user, mural_ptr__user = user) | ||
442 | + else: | ||
443 | + posts = SubjectPost.objects.extra(select = {"most_recent": "greatest(last_update, (select max(mural_comment.last_update) from mural_comment where mural_comment.post_id = mural_subjectpost.mural_ptr_id))"}).filter(space__id = subject, favorites_post__isnull = False, favorites_post__user = user) | ||
444 | + | ||
445 | + if showing: #Exclude ajax creation posts results | ||
446 | + showing = showing.split(',') | ||
447 | + posts = posts.exclude(id__in = showing) | ||
448 | + | ||
449 | + has_page = request.GET.get('page', None) | ||
450 | + | ||
451 | + if has_page is None: | ||
452 | + views = MuralVisualizations.objects.filter(Q(user = user) & Q(viewed = False) & (Q(comment__post__subjectpost__space__id = subject) | Q(post__subjectpost__space__id = subject))) | ||
453 | + n_views = views.count() | ||
454 | + views.update(viewed = True) | ||
455 | + | ||
456 | + paginator = Paginator(posts.order_by("-most_recent"), 10) | ||
457 | + | ||
458 | + try: | ||
459 | + page_number = int(request.GET.get('page', 1)) | ||
460 | + except ValueError: | ||
461 | + raise Http404 | ||
462 | + | ||
463 | + try: | ||
464 | + page_obj = paginator.page(page_number) | ||
465 | + except EmptyPage: | ||
466 | + raise Http404 | ||
467 | + | ||
468 | + context['posts'] = page_obj.object_list | ||
469 | + | ||
470 | + response = render_to_string("mural/_list_view.html", context, request) | ||
471 | + | ||
472 | + return JsonResponse({"posts": response, "unviewed": n_views, "count": posts.count(), "num_pages": paginator.num_pages, "num_page": page_obj.number}) | ||
473 | + | ||
423 | class SubjectIndex(LoginRequiredMixin, generic.ListView): | 474 | class SubjectIndex(LoginRequiredMixin, generic.ListView): |
424 | login_url = reverse_lazy("users:login") | 475 | login_url = reverse_lazy("users:login") |
425 | redirect_field_name = 'next' | 476 | redirect_field_name = 'next' |
@@ -453,6 +504,143 @@ class SubjectIndex(LoginRequiredMixin, generic.ListView): | @@ -453,6 +504,143 @@ class SubjectIndex(LoginRequiredMixin, generic.ListView): | ||
453 | 504 | ||
454 | return context | 505 | return context |
455 | 506 | ||
507 | +class SubjectCreate(LoginRequiredMixin, generic.edit.CreateView): | ||
508 | + login_url = reverse_lazy("users:login") | ||
509 | + redirect_field_name = 'next' | ||
510 | + | ||
511 | + template_name = 'mural/_form.html' | ||
512 | + form_class = SubjectPostForm | ||
513 | + | ||
514 | + def get_initial(self): | ||
515 | + initial = super(SubjectCreate, self).get_initial() | ||
516 | + | ||
517 | + slug = self.kwargs.get('slug', None) | ||
518 | + sub = get_object_or_404(Subject, slug = slug) | ||
519 | + | ||
520 | + initial['subject'] = sub | ||
521 | + initial['user'] = self.request.user | ||
522 | + | ||
523 | + return initial | ||
524 | + | ||
525 | + def form_invalid(self, form): | ||
526 | + context = super(SubjectCreate, self).form_invalid(form) | ||
527 | + context.status_code = 400 | ||
528 | + | ||
529 | + return context | ||
530 | + | ||
531 | + def form_valid(self, form): | ||
532 | + self.object = form.save(commit = False) | ||
533 | + | ||
534 | + slug = self.kwargs.get('slug', None) | ||
535 | + sub = get_object_or_404(Subject, slug = slug) | ||
536 | + | ||
537 | + self.object.space = sub | ||
538 | + self.object.user = self.request.user | ||
539 | + | ||
540 | + self.object.save() | ||
541 | + | ||
542 | + #users = User.objects.filter(Q(is_staff = True) | Q(coordinators = cat) | Q(professors__category = cat) | Q(subject_student__category = cat)).exclude(id = self.request.user.id) | ||
543 | + entries = [] | ||
544 | + | ||
545 | + notify_type = "mural" | ||
546 | + user_icon = self.object.user.image_url | ||
547 | + #_view = render_to_string("mural/_view.html", {"post": self.object}, self.request) | ||
548 | + simple_notify = _("%s has made a post in %s")%(str(self.object.user), str(self.object.space)) | ||
549 | + pathname = reverse("mural:manage_category") | ||
550 | + | ||
551 | + #for user in users: | ||
552 | + # entries.append(MuralVisualizations(viewed = False, user = user, post = self.object)) | ||
553 | + # Group("user-%s" % user.id).send({'text': json.dumps({"type": notify_type, "subtype": "create_cat", "user_icon": user_icon, "pathname": pathname, "simple": simple_notify, "complete": _view, "cat": slug})}) | ||
554 | + | ||
555 | + #MuralVisualizations.objects.bulk_create(entries) | ||
556 | + | ||
557 | + return super(SubjectCreate, self).form_valid(form) | ||
558 | + | ||
559 | + def get_context_data(self, *args, **kwargs): | ||
560 | + context = super(SubjectCreate, self).get_context_data(*args, **kwargs) | ||
561 | + | ||
562 | + context['form_url'] = reverse_lazy("mural:create_subject", args = (), kwargs = {'slug': self.kwargs.get('slug', None)}) | ||
563 | + | ||
564 | + return context | ||
565 | + | ||
566 | + def get_success_url(self): | ||
567 | + return reverse_lazy('mural:render_post', args = (self.object.id, 'create', 'sub', )) | ||
568 | + | ||
569 | +class SubjectUpdate(LoginRequiredMixin, generic.UpdateView): | ||
570 | + login_url = reverse_lazy("users:login") | ||
571 | + redirect_field_name = 'next' | ||
572 | + | ||
573 | + template_name = 'mural/_form.html' | ||
574 | + model = SubjectPost | ||
575 | + form_class = SubjectPostForm | ||
576 | + | ||
577 | + def get_initial(self): | ||
578 | + initial = super(SubjectUpdate, self).get_initial() | ||
579 | + | ||
580 | + initial['user'] = self.request.user | ||
581 | + | ||
582 | + return initial | ||
583 | + | ||
584 | + def form_invalid(self, form): | ||
585 | + context = super(SubjectUpdate, self).form_invalid(form) | ||
586 | + context.status_code = 400 | ||
587 | + | ||
588 | + return context | ||
589 | + | ||
590 | + def form_valid(self, form): | ||
591 | + self.object = form.save(commit = False) | ||
592 | + | ||
593 | + self.object.edited = True | ||
594 | + | ||
595 | + self.object.save() | ||
596 | + | ||
597 | + #users = User.objects.all().exclude(id = self.request.user.id) | ||
598 | + | ||
599 | + notify_type = "mural" | ||
600 | + _view = render_to_string("mural/_view.html", {"post": self.object}, self.request) | ||
601 | + pathname = reverse("mural:manage_category") | ||
602 | + | ||
603 | + #for user in users: | ||
604 | + # Group("user-%s" % user.id).send({'text': json.dumps({"type": notify_type, "subtype": "update_cat", "pathname": pathname, "complete": _view, "post_id": self.object.id})}) | ||
605 | + | ||
606 | + return super(SubjectUpdate, self).form_valid(form) | ||
607 | + | ||
608 | + def get_context_data(self, *args, **kwargs): | ||
609 | + context = super(SubjectUpdate, self).get_context_data(*args, **kwargs) | ||
610 | + | ||
611 | + context['form_url'] = reverse_lazy("mural:update_subject", args = (), kwargs = {'pk': self.object.id}) | ||
612 | + | ||
613 | + return context | ||
614 | + | ||
615 | + def get_success_url(self): | ||
616 | + return reverse_lazy('mural:render_post', args = (self.object.id, 'update', 'sub', )) | ||
617 | + | ||
618 | +class SubjectDelete(LoginRequiredMixin, generic.DeleteView): | ||
619 | + login_url = reverse_lazy("users:login") | ||
620 | + redirect_field_name = 'next' | ||
621 | + | ||
622 | + template_name = 'mural/delete.html' | ||
623 | + model = SubjectPost | ||
624 | + | ||
625 | + def get_context_data(self, *args, **kwargs): | ||
626 | + context = super(SubjectDelete, self).get_context_data(*args, **kwargs) | ||
627 | + | ||
628 | + context['form_url'] = reverse_lazy("mural:delete_subject", args = (), kwargs = {'pk': self.object.id}) | ||
629 | + context['message'] = _('Are you sure you want to delete this post?') | ||
630 | + | ||
631 | + return context | ||
632 | + | ||
633 | + def get_success_url(self): | ||
634 | + #users = User.objects.all().exclude(id = self.request.user.id) | ||
635 | + | ||
636 | + notify_type = "mural" | ||
637 | + pathname = reverse("mural:manage_subject") | ||
638 | + | ||
639 | + #for user in users: | ||
640 | + # Group("user-%s" % user.id).send({'text': json.dumps({"type": notify_type, "subtype": "delete_cat", "pathname": pathname, "post_id": self.object.id})}) | ||
641 | + | ||
642 | + return reverse_lazy('mural:deleted_post') | ||
643 | + | ||
456 | """ | 644 | """ |
457 | Section for common post functions | 645 | Section for common post functions |
458 | """ | 646 | """ |
@@ -461,6 +649,8 @@ def render_post(request, post, msg, ptype): | @@ -461,6 +649,8 @@ def render_post(request, post, msg, ptype): | ||
461 | post = get_object_or_404(GeneralPost, id = post) | 649 | post = get_object_or_404(GeneralPost, id = post) |
462 | elif ptype == 'cat': | 650 | elif ptype == 'cat': |
463 | post = get_object_or_404(CategoryPost, id = post) | 651 | post = get_object_or_404(CategoryPost, id = post) |
652 | + elif ptype == 'sub': | ||
653 | + post = get_object_or_404(SubjectPost, id = post) | ||
464 | 654 | ||
465 | context = {} | 655 | context = {} |
466 | context['post'] = post | 656 | context['post'] = post |