diff --git a/app/assets/v2/css/activity_stream.css b/app/assets/v2/css/activity_stream.css index 80fa298bd19..05cb32916df 100644 --- a/app/assets/v2/css/activity_stream.css +++ b/app/assets/v2/css/activity_stream.css @@ -161,7 +161,8 @@ a .sup { .like_activity:hover, .flag_activity:hover, .comment_activity:hover, -.copy_activity:hover { +.copy_activity:hover, +.pin_activity:hover { text-decoration: none; } .funder-avatar, @@ -299,6 +300,21 @@ iframe.popout{ border: 1px solid; margin-left: 25%; } +.activity_pinned { + display: none; +} +.pinned .activity_pinned { + display: block; +} + +.pinned-activity { + background-color: #e7fff5; + border: 1px solid #82febd; +} + +.activity_stream .box.pinned-activity { + border-bottom-color: #82febd; +} @media (min-width: 768px) { .activity_feed_kudos_image{ diff --git a/app/assets/v2/js/activity.js b/app/assets/v2/js/activity.js index 89c5be32d13..39cb7c59bf8 100644 --- a/app/assets/v2/js/activity.js +++ b/app/assets/v2/js/activity.js @@ -475,7 +475,7 @@ $(document).ready(function() { // like activity - $(document).on('click', '.like_activity, .flag_activity, .favorite_activity', function(e) { + $(document).on('click', '.like_activity, .flag_activity, .favorite_activity, .pin_activity', function(e) { e.preventDefault(); const current_tab = getURLParams('tab'); @@ -889,6 +889,37 @@ $(document).ready(function() { }, 300); }); + // pinned activity tribes + $(document).on('click', '.pin_activity', function(e) { + e.preventDefault(); + + state = $(this).data('state') + + if (state == 'unpin') { + $('.pinned-activity').addClass('bg-white'); + $('.pinned-activity .tip_activity').css({'background-color': 'white'}); + $('.pinned-activity').css({'border-bottom-color':'#EFEFEF;'}) + $('.pinned-activity .activity_pinned').hide(); + $('.box').removeClass('pinned-activity'); + _alert('Sucess unpin.', 'success', 1000); + } + + if (state == 'pinned') { + + $(this).closest('.box').addClass('pinned-activity'); + + + if ($('.pinned-activity')) { + $('.pinned-activity .tip_activity').css({'background-color': '#e7fff5'}); + $('.pinned-activity').removeClass('bg-white'); + $('.pinned-activity .activity_pinned').show(); + } + _alert('Status pinned.', 'success', 1000); + } + + + }); + $(document).on('click', '.fund_issue', function(e) { e.preventDefault(); const url = $(this).data('url'); diff --git a/app/retail/templates/shared/activity.html b/app/retail/templates/shared/activity.html index 3a4bf504a95..5c59076e6a3 100644 --- a/app/retail/templates/shared/activity.html +++ b/app/retail/templates/shared/activity.html @@ -295,6 +295,15 @@
+