diff --git a/opentech/apply/activity/views.py b/opentech/apply/activity/views.py index 7249fd4227192cc0488fd81e5f15a5e67e968203..c04b4b267f0ca23de654474a86ebcf03c5429581 100644 --- a/opentech/apply/activity/views.py +++ b/opentech/apply/activity/views.py @@ -8,34 +8,6 @@ from .messaging import messenger, MESSAGES from .models import Activity, COMMENT -ACTIVITY_LIMIT = 50 - - -class AllActivityContextMixin: - def get_context_data(self, **kwargs): - extra = { - 'actions': Activity.actions.select_related( - 'user', - ).prefetch_related( - 'source', - 'related_object', - )[:ACTIVITY_LIMIT], - 'comments': Activity.comments.select_related( - 'user', - ).prefetch_related( - 'source', - 'related_object', - )[:ACTIVITY_LIMIT], - 'all_activity': Activity.objects.select_related( - 'user', - ).prefetch_related( - 'source', - 'related_object', - )[:ACTIVITY_LIMIT], - } - return super().get_context_data(**extra, **kwargs) - - class ActivityContextMixin: def get_context_data(self, **kwargs): related_query = self.model.activities.rel.related_query_name diff --git a/opentech/apply/funds/templates/funds/includes/activity-feed.html b/opentech/apply/funds/templates/funds/includes/activity-feed.html deleted file mode 100644 index 37117315ccd58c1fb4b4da12cd87404d99020698..0000000000000000000000000000000000000000 --- a/opentech/apply/funds/templates/funds/includes/activity-feed.html +++ /dev/null @@ -1,34 +0,0 @@ -<div class="js-activity-feed activity-feed"> - <div class="activity-feed__header"> - <div class="wrapper wrapper--medium wrapper--relative"> - <h4 class="activity-feed__heading">Activity Feed <svg class="icon icon--speech-bubble"><use xlink:href="#speech-bubble"></use></svg></h4> - <a href="#" class="js-close-feed link link--close-feed">Close</a> - <div class="tabs js-tabs"> - <div class="tabs__container"> - <a class="tab__item tab__item--active" href="#" data-tab="tab-1">Communications</a> - <a class="tab__item" href="#" data-tab="tab-2">Activity</a> - <a class="tab__item" href="#" data-tab="tab-3">All</a> - </div> - </div> - </div> - </div> - - <div class="wrapper wrapper--medium wrapper--activity-feed js-tabs-content"> - <div class="tabs__content tabs__content--current" id="tab-1"> - {% include "activity/include/comment_list.html" with submission_title=True editable=False %} - </div> - - <div class="tabs__content" id="tab-2"> - {% include "activity/include/action_list.html" with submission_title=True %} - </div> - - <div class="tabs__content" id="tab-3"> - {% include "activity/include/all_activity_list.html" with submission_title=True %} - </div> - </div> - - <a href="#" class="js-to-top link link--to-top"> - <svg class="icon icon--to-top"><use xlink:href="#chevron"></use></svg> - <h6>Back to top</h6> - </a> -</div> diff --git a/opentech/apply/funds/templates/funds/submissions.html b/opentech/apply/funds/templates/funds/submissions.html index 353450fa78d785a9339a12023d7eb3f69c5f3736..0ed85d1e4044ef43e383b0c5f021a3c6219562c7 100644 --- a/opentech/apply/funds/templates/funds/submissions.html +++ b/opentech/apply/funds/templates/funds/submissions.html @@ -1,5 +1,4 @@ {% extends "funds/base_submissions_table.html" %} -{% load static %} {% block title %}Submissions{% endblock %} {% block content %} @@ -18,15 +17,4 @@ {{ block.super }} {% endblock %} </div> - -<a href="#" class="js-open-feed link link--open-feed"> - <h4 class="heading heading--no-margin heading--activity-feed">Activity Feed</h4> -</a> -{% include "funds/includes/activity-feed.html" %} - -{% endblock %} - -{% block extra_js %} - {{ block.super }} - <script src="{% static 'js/apply/activity-feed.js' %}"></script> {% endblock %} diff --git a/opentech/apply/funds/templates/funds/submissions_by_round.html b/opentech/apply/funds/templates/funds/submissions_by_round.html index f09d574a2b7b0a371a9f59e3779181165e732f24..b4f56a7ce7739147ee9f5439f1c6771701051c80 100644 --- a/opentech/apply/funds/templates/funds/submissions_by_round.html +++ b/opentech/apply/funds/templates/funds/submissions_by_round.html @@ -23,15 +23,4 @@ </div> </div> {% render_bundle 'submissionsByRound' %} - -<a href="#" class="js-open-feed link link--open-feed"> - <h4 class="heading heading--no-margin heading--activity-feed">Activity Feed</h4> -</a> -{% include "funds/includes/activity-feed.html" %} - -{% endblock %} - -{% block extra_js %} - {{ block.super }} - <script src="{% static 'js/apply/activity-feed.js' %}"></script> {% endblock %} diff --git a/opentech/apply/funds/templates/funds/submissions_overview.html b/opentech/apply/funds/templates/funds/submissions_overview.html index e712be96f56205853bec7ca2e7a957e0ba7af060..94c9092a804252fa86a7c31685f685e0faf15651 100644 --- a/opentech/apply/funds/templates/funds/submissions_overview.html +++ b/opentech/apply/funds/templates/funds/submissions_overview.html @@ -1,5 +1,4 @@ {% extends "funds/base_submissions_table.html" %} -{% load static %} {% load render_table from django_tables2 %} {% block title %}Submissions{% endblock %} @@ -32,15 +31,4 @@ </div> {% endblock %} </div> - -<a href="#" class="js-open-feed link link--open-feed"> - <h4 class="heading heading--no-margin heading--activity-feed">Activity Feed</h4> -</a> -{% include "funds/includes/activity-feed.html" %} - -{% endblock %} - -{% block extra_js %} - {{ block.super }} - <script src="{% static 'js/apply/activity-feed.js' %}"></script> {% endblock %} diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index b134a851bdbef3bdc382ce6d7870e6940c4c44d5..3347d8621c28eafb0387d2fe77059671e4727d66 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -19,7 +19,6 @@ from django_tables2.views import SingleTableMixin from wagtail.core.models import Page from opentech.apply.activity.views import ( - AllActivityContextMixin, ActivityContextMixin, CommentFormView, DelegatedViewMixin, @@ -231,7 +230,7 @@ class BaseReviewerSubmissionsTable(BaseAdminSubmissionsTable): @method_decorator(staff_required, name='dispatch') -class SubmissionOverviewView(AllActivityContextMixin, BaseAdminSubmissionsTable): +class SubmissionOverviewView(BaseAdminSubmissionsTable): template_name = 'funds/submissions_overview.html' table_class = SummarySubmissionsTable table_pagination = False @@ -274,7 +273,7 @@ class SubmissionOverviewView(AllActivityContextMixin, BaseAdminSubmissionsTable) ) -class SubmissionAdminListView(AllActivityContextMixin, BaseAdminSubmissionsTable, DelegateableListView): +class SubmissionAdminListView(BaseAdminSubmissionsTable, DelegateableListView): template_name = 'funds/submissions.html' form_views = [ BatchUpdateLeadView, @@ -283,7 +282,7 @@ class SubmissionAdminListView(AllActivityContextMixin, BaseAdminSubmissionsTable ] -class SubmissionReviewerListView(AllActivityContextMixin, BaseReviewerSubmissionsTable): +class SubmissionReviewerListView(BaseReviewerSubmissionsTable): template_name = 'funds/submissions.html' @@ -293,7 +292,7 @@ class SubmissionListView(ViewDispatcher): @method_decorator(staff_required, name='dispatch') -class SubmissionsByRound(AllActivityContextMixin, BaseAdminSubmissionsTable, DelegateableListView): +class SubmissionsByRound(BaseAdminSubmissionsTable, DelegateableListView): template_name = 'funds/submissions_by_round.html' form_views = [ BatchUpdateLeadView, diff --git a/opentech/static_src/src/javascript/apply/activity-feed.js b/opentech/static_src/src/javascript/apply/activity-feed.js deleted file mode 100644 index bedfb677d04535df7d04a62a98e6c827ef023d21..0000000000000000000000000000000000000000 --- a/opentech/static_src/src/javascript/apply/activity-feed.js +++ /dev/null @@ -1,52 +0,0 @@ -(function ($) { - - 'use strict'; - - // Open the activity feed - $('.js-open-feed').click((e) => { - e.preventDefault(); - $('body').addClass('no-scroll'); - $('.js-activity-feed').addClass('is-open'); - }); - - // Close the activity feed - $('.js-close-feed').click((e) => { - e.preventDefault(); - $('body').removeClass('no-scroll'); - $('.js-activity-feed').removeClass('is-open'); - }); - - // Show scroll to top of activity feed button on scroll - $('.js-activity-feed').on('scroll', function () { - if ($(this).scrollTop() === 0) { - $('.js-to-top').removeClass('is-visible'); - } - else { - $('.js-to-top').addClass('is-visible'); - } - }); - - // Scroll to the top of the activity feed - $('.js-to-top').click((e) => { - e.preventDefault(); - $('.js-activity-feed').animate({scrollTop: 0}, 250); - }); - - // Collaps long comments in activity feed. - $('.feed__item').each(function () { - var $content = $(this).find('.feed__content'); - var content_height = $content.outerHeight(); - if (content_height > 300) { - $(this).addClass('feed__item--collaps'); - $(this).append('<p class="feed__show-button"><a class="link link--button link--button--narrow" href="#">Show</a></p>'); - } - }); - - // Allow users to show full comment. - $('.feed__show-button').find('.link').click(function (e) { - e.preventDefault(); - $(this).parents('.feed__item').removeClass('feed__item--collaps'); - $(this).parent().detach(); - }); - -})(jQuery); diff --git a/opentech/static_src/src/sass/apply/components/_activity-feed.scss b/opentech/static_src/src/sass/apply/components/_activity-feed.scss deleted file mode 100644 index c239ded17e00d3b91e82c2a3fb48849b861f64e7..0000000000000000000000000000000000000000 --- a/opentech/static_src/src/sass/apply/components/_activity-feed.scss +++ /dev/null @@ -1,37 +0,0 @@ -.activity-feed { - position: fixed; - top: 100vh; - right: 0; - left: 0; - transition: top .3s cubic-bezier(0, .52, .58, 1); - - &.is-open { - top: 0; - z-index: 99999; - width: 100%; - height: 100vh; - max-height: 100%; - overflow: scroll; - background: $color--white; - } - - &__header { - padding: 0 20px; - background-color: $color--default; - - @include media-query(tablet-portrait) { - padding: 0; - } - } - - &__heading { - display: flex; - align-items: center; - padding: 20px 0; - color: $color--white; - - @include media-query(tablet-portrait) { - justify-content: center; - } - } -} diff --git a/opentech/static_src/src/sass/apply/main.scss b/opentech/static_src/src/sass/apply/main.scss index 2846143b74327a9b989584fa52857fe741d4a99d..d2cd0d97d0c70c71b9e56bbda14aba977e6c7fb4 100644 --- a/opentech/static_src/src/sass/apply/main.scss +++ b/opentech/static_src/src/sass/apply/main.scss @@ -11,7 +11,6 @@ @import 'components/all-submissions-table'; @import 'components/all-rounds-table'; @import 'components/admin-bar'; -@import 'components/activity-feed'; @import 'components/actions-bar'; @import 'components/card'; @import 'components/comment';