diff --git a/amadeus/static/css/base/amadeus.css b/amadeus/static/css/base/amadeus.css index 194fd7c..1e8ea31 100755 --- a/amadeus/static/css/base/amadeus.css +++ b/amadeus/static/css/base/amadeus.css @@ -947,7 +947,7 @@ li.item .notify_badge { .mural .post_make .panel-body { padding: 0; } -.mural .post_make .user-img { +.mural .post_make .user-img, .post .post-img { padding: 0; display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ @@ -977,4 +977,72 @@ li.item .notify_badge { .post-button { padding-right: inherit !important; padding-left: inherit !important; +} + +.post .post-body { + padding-right: 0; +} + +.post .post-user { + margin-top: 0; + margin-bottom: 5px; + font-size: 18px; + font-weight: 700; +} + +.post .post-user .btn-group { + margin: 0; +} + +.post .post-user .btn-group .btn_menu i { + font-size: 18px; +} + +.post .post-user .user-action { + padding-left: 5px; + font-size: 16px; + font-weight: normal; +} + +.post .post-user .user-action i { + font-size: 22px; +} + +.post .time { + font-size: 14px; +} + +.post .post-comment { + margin-top: 10px; + border-top-width: 1px; + border-top-style: solid; + padding: 10px 0px 8px 0px; +} + +.post .post-comment .user-img { + display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; /* TWEENER - IE 10 */ + display: -webkit-flex; /* NEW - Chrome */ + display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */ + flex-direction: column; + justify-content: center; +} + +.post .post-comment .comment-field { + padding-left: 0px; +} + +.post .post-comment .comment-field div { + border-width: 1px; + border-style: solid; +} + +.post .post-comment .comment-field h4 { + margin: 5px 0px; + line-height: 1.8em; + padding-left: 10px; + font-size: 14px; + font-style: italic; + cursor: text; } \ No newline at end of file diff --git a/amadeus/static/css/themes/green.css b/amadeus/static/css/themes/green.css index 4774d52..79f6d3a 100644 --- a/amadeus/static/css/themes/green.css +++ b/amadeus/static/css/themes/green.css @@ -504,10 +504,32 @@ a.add-row { color: #CCCCCC; } -.post_action i { +.post_action i, .post .post-user .user-action i { color: #1d8fe0; } +.post .post-user { + color: #4caf50; +} + +.post .post-user .user-action { + color: #BBBBBB; +} + +.post .time { + color: #ABABAB; +} + +.post .post-comment { + border-top-color: #888888; + background: #D5D5D5; +} + +.post .post-comment .comment-field div { + border-color: #888888; + background: #FFFFFF; +} + @media(max-width: 768px) { .navbar .navbar-nav .dropdown .dropdown-menu li > a { color: #333333 !important; diff --git a/mural/templates/mural/_view.html b/mural/templates/mural/_view.html index 441d693..077d677 100644 --- a/mural/templates/mural/_view.html +++ b/mural/templates/mural/_view.html @@ -1,5 +1,53 @@ +{% load i18n mural_filters %} +
-
- {{ post.user }} +
+
+ +
+
+

+ {{ post.user }} + + + {{ post.get_action_display }} + + {% if request.user == post.user %} + + + + + {% endif %} +

+

+ + {% trans 'In' %} {{ post.last_update }} +

+ + {% autoescape off %} + {{ post.post }} + {% endautoescape %} + + {% if post.image %} + + {% endif %} + +
+
+
+ +
+
+
+

{% trans 'Make a comment...' %}

+
+
+
\ No newline at end of file diff --git a/mural/templates/mural/list.html b/mural/templates/mural/list.html index 5834b75..9ef0aa0 100644 --- a/mural/templates/mural/list.html +++ b/mural/templates/mural/list.html @@ -73,11 +73,14 @@ var frm = $('#post-form'); frm.submit(function () { + var formData = new FormData($(this)[0]); + $.ajax({ type: frm.attr('method'), url: frm.attr('action'), - data: frm.serialize(), + data: formData, dataType: "json", + async: false, success: function (data) { $('.posts').prepend(data.view); @@ -90,7 +93,10 @@ error: function(data) { $(".modal").html(data.responseText); setPostFormSubmit(); - } + }, + cache: false, + contentType: false, + processData: false }); return false; diff --git a/mural/templatetags/__init__.py b/mural/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/mural/templatetags/__init__.py diff --git a/mural/templatetags/mural_filters.py b/mural/templatetags/mural_filters.py new file mode 100644 index 0000000..4bb05d6 --- /dev/null +++ b/mural/templatetags/mural_filters.py @@ -0,0 +1,12 @@ +from django import template + +register = template.Library() + +@register.filter(name = 'action_icon') +def action_icon(action): + if action == "comment": + icon = "fa-commenting-o" + elif action == "help": + icon = "fa-comments-o" + + return icon \ No newline at end of file diff --git a/mural/views.py b/mural/views.py index 489a511..e9778b3 100644 --- a/mural/views.py +++ b/mural/views.py @@ -27,7 +27,7 @@ class GeneralIndex(LoginRequiredMixin, generic.ListView): def get_queryset(self): user = self.request.user - general = GeneralPost.objects.all() + general = GeneralPost.objects.extra(select={"most_recent": "greatest(last_update, (select max(mural_comment.last_update) from mural_comment where mural_comment.post_id = mural_generalpost.mural_ptr_id))"}).order_by("-most_recent") self.totals['general'] = MuralVisualizations.objects.filter(Q(user = user) & Q(viewed = False) & (Q(post__generalpost__isnull = False) | Q(comment__post__generalpost__isnull = False))).distinct().count() self.totals['category'] = MuralVisualizations.objects.filter(Q(user = user) & Q(viewed = False) & (Q(post__categorypost__space__coordinators = user) | Q(comment__post__categorypost__space__coordinators = user) | Q(post__categorypost__space__subject_category__professor = user) | Q(post__categorypost__space__subject_category__students = user) | Q(comment__post__categorypost__space__subject_category__professor = user) | Q(comment__post__categorypost__space__subject_category__students = user))).distinct().count() -- libgit2 0.21.2