From 5010a064694b04fa394bb9837dff7affaf757f75 Mon Sep 17 00:00:00 2001 From: Zambom Date: Mon, 20 Feb 2017 20:08:10 -0300 Subject: [PATCH] Adjusting mural responsivity --- amadeus/static/css/base/amadeus.css | 12 ++++++++++++ amadeus/static/css/base/amadeus_responsive.css | 20 ++++++++++++++++++++ amadeus/static/js/mural_subject.js | 136 ---------------------------------------------------------------------------------------------------------------------------------------- amadeus/static/js/mural_ungeneral.js | 18 +++++++++++++++++- amadeus/templates/base.html | 2 +- mural/templates/mural/_view.html | 2 +- mural/templates/mural/list.html | 24 ++++++++++++++++++++++-- mural/templates/mural/list_category.html | 24 ++++++++++++++++++++++-- mural/templates/mural/list_subject.html | 24 ++++++++++++++++++++++-- 9 files changed, 117 insertions(+), 145 deletions(-) delete mode 100644 amadeus/static/js/mural_subject.js diff --git a/amadeus/static/css/base/amadeus.css b/amadeus/static/css/base/amadeus.css index 1139c9e..8b95327 100755 --- a/amadeus/static/css/base/amadeus.css +++ b/amadeus/static/css/base/amadeus.css @@ -1084,6 +1084,18 @@ li.item .notify_badge { cursor: text; } +.post-filter-small { + padding-top: 10px; + padding-left: 15px; + margin-bottom: 10px; +} +.post-filter-small h4 { + margin-bottom: 10px !important; +} +.post-filter-small .checkbox { + margin-right: 15px; +} + .post-filter h4 { font-weight: 700; margin-bottom: 15px; diff --git a/amadeus/static/css/base/amadeus_responsive.css b/amadeus/static/css/base/amadeus_responsive.css index e79a86e..5c9d256 100644 --- a/amadeus/static/css/base/amadeus_responsive.css +++ b/amadeus/static/css/base/amadeus_responsive.css @@ -43,6 +43,16 @@ .mural .post_make .post-field h4 { line-height: 2.3em; } + + .post .post-comment .user-img { + padding-left: 10px; + padding-right: 10px; + } + + .comment-section .comment .comment-img { + padding-left: 10px; + padding-right: 10px; + } } @media(max-width: 768px) { @@ -132,6 +142,16 @@ .mural .post_make .post-field h4 { line-height: 2em; } + + .post .post-comment .user-img { + padding-left: 5px; + padding-right: 5px; + } + + .comment-section .comment .comment-img { + padding-left: 5px; + padding-right: 5px; + } } @media(min-width: 768px) { diff --git a/amadeus/static/js/mural_subject.js b/amadeus/static/js/mural_subject.js deleted file mode 100644 index 144203a..0000000 --- a/amadeus/static/js/mural_subject.js +++ /dev/null @@ -1,136 +0,0 @@ -$('.mural-subject').on('shown.bs.collapse', function(e) { - if($(this).is(e.target)){ - var li = $(".breadcrumb").find('li:last-child'); - var li_text = $(li).html(); - var url = $(".mural_url").val(); - var new_li = $(li).clone(); - - new_li.html($(this).parent().find('.panel-title span').text()); - - $(li).html("" + li_text + ""); - $(li).append("/"); - - new_li.appendTo('.breadcrumb'); - - var post_section = $(this).find('.posts'), - without = $(this).find('.no-subjects'), - loading = $(this).find('.loading-posts'), - more = $(this).find('.more-posts'), - filters = $(this).find('.post-filters'), - clear_filters = $(this).find('.clear_filter'), - mural = post_section.parent().parent(); - - if (post_section.children().length == 0) { - var url = $(this).find('.mural').data('url'); - - $.ajax({ - url: url, - dataType: 'json', - success: function (data) { - loading.hide(); - - if (data.count > 0) { - post_section.append(data.posts); - - mural.data('pages', data.num_pages); - mural.data('page', data.num_page); - - setTimeout(function () { postHeightLimits() }, 100); - - if (data.num_page < data.num_pages) { - more.show(); - } else { - more.hide(); - } - - $('.mural_badge').each(function () { - var actual = $(this).text(); - - if (actual != "+99") { - actual = parseInt(actual, 10) - data.unviewed; - - if (actual <= 0) { - $(this).hide(); - } else { - $(this).text(actual); - } - } - }); - - $('.sub_badge').each(function () { - var actual = $(this).text(); - - if (actual != "+99") { - actual = parseInt(actual, 10) - data.unviewed; - - if (actual < 0) { - actual = 0; - } - - $(this).text(actual); - } - }); - - without.hide(); - } else { - more.hide(); - - without.show(); - } - } - }); - } - - more.click(function () { - var url = mural.data('url'), - pageNum = mural.data('page'), - numberPages = mural.data('pages'), - favorites = mural.data('fav'), - mine = mural.data('mine'), - showing = new_posts.join(','); - - if (pageNum == numberPages) { - return false - } - - pageNum = pageNum + 1; - - more.hide(); - - loading.show(); - - $.ajax({ - url: url, - data: {'page': pageNum, 'favorite': favorites, 'mine': mine, 'showing': showing}, - dataType: 'json', - success: function (data) { - loading.hide(); - - post_section.append(data.posts); - - mural.data('pages', data.num_pages); - mural.data('page', data.num_page); - - setTimeout(function () { postHeightLimits() }, 100); - - if (data.num_page < data.num_pages) { - more.show(); - } else { - more.hide(); - } - } - }); - }); - } -}); - -$('.mural-subject').on('hidden.bs.collapse', function(e) { - if($(this).is(e.target)){ - $(".breadcrumb").find('li:last-child').remove(); - - var li = $(".breadcrumb").find('li:last-child'); - var text = $(li).find('a').text(); - - $(li).html(text); - } -}); \ No newline at end of file diff --git a/amadeus/static/js/mural_ungeneral.js b/amadeus/static/js/mural_ungeneral.js index 1c0b406..f240e8b 100644 --- a/amadeus/static/js/mural_ungeneral.js +++ b/amadeus/static/js/mural_ungeneral.js @@ -122,6 +122,22 @@ $('.mural-ungeneral').on('shown.bs.collapse', function(e) { }); }); + $("input[name='favorite']").on('click', function () { + var checked = $(this).is(':checked'); + + $("input[name='favorite']").each(function () { + $(this).prop('checked', checked); + }); + }); + + $("input[name='mine']").on('click', function () { + var checked = $(this).is(':checked'); + + $("input[name='mine']").each(function () { + $(this).prop('checked', checked); + }); + }); + filters.submit(function () { var favorite = $(this).find("input[name='favorite']").is(':checked') ? "True" : "", mine = $(this).find("input[name='mine']").is(':checked') ? "True" : "", @@ -169,7 +185,7 @@ $('.mural-ungeneral').on('shown.bs.collapse', function(e) { clear_filters.click(function () { var frm = $(this).parent(); - frm.find("input[type='checkbox']").prop('checked', false); + $("input[type='checkbox']").prop('checked', false); frm.submit(); }); diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 4171372..f666dcf 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -30,7 +30,7 @@ - + diff --git a/mural/templates/mural/_view.html b/mural/templates/mural/_view.html index 780f9ab..69c814c 100644 --- a/mural/templates/mural/_view.html +++ b/mural/templates/mural/_view.html @@ -50,7 +50,7 @@ {% comments_list request post %} -
+
diff --git a/mural/templates/mural/list.html b/mural/templates/mural/list.html index 2b22771..ef959cd 100644 --- a/mural/templates/mural/list.html +++ b/mural/templates/mural/list.html @@ -21,7 +21,27 @@
-
+
+
+

{% trans 'Filter' %}

+ +
+
+ +
+
+ +
+ + +
+
+
+
@@ -50,7 +70,7 @@

{% trans 'There are no posts in this mural yet.' %}

-
+
-
+
+
+

{% trans 'Filter' %}

+ + +
+ +
+
+ +
+ + + +
+
+
@@ -99,7 +119,7 @@

{% trans 'There are no posts in this mural yet.' %}

-
+
-
+
+
+

{% trans 'Filter' %}

+ + +
+ +
+
+ +
+ + + +
+
+
@@ -98,7 +118,7 @@

{% trans 'There are no posts in this mural yet.' %}

-
+