diff --git a/community/urls.py b/community/urls.py index 546c9ec3..da4fd519 100644 --- a/community/urls.py +++ b/community/urls.py @@ -13,7 +13,7 @@ from log.view_log import index as log_index from data.views import ContributorsListView from gamification.views import index as gamification_index -from meta_review.views import index as meta_review_index +from meta_review.views import ContributorsMetaReview from inactive_issues.inactive_issues_scraper import inactive_issues_json from openhub.views import index as openhub_index from model.views import index as model_index @@ -116,7 +116,7 @@ def get_organization(): distill_file='contributors/index.html', ), distill_url( - r'meta-review/$', meta_review_index, + r'meta-review/$', ContributorsMetaReview.as_view(), name='meta_review_data', distill_func=get_index, distill_file='meta-review/index.html', diff --git a/meta_review/urls.py b/meta_review/urls.py index a3780aa2..6189e683 100644 --- a/meta_review/urls.py +++ b/meta_review/urls.py @@ -1,7 +1,7 @@ from django.conf.urls import url -from . import views +from .views import ContributorsMetaReview urlpatterns = [ - url(r'^$', views.index, name='index'), + url(r'^$', ContributorsMetaReview.as_view(), name='index'), ] diff --git a/meta_review/views.py b/meta_review/views.py index 45e68cfd..7e30a539 100644 --- a/meta_review/views.py +++ b/meta_review/views.py @@ -1,15 +1,22 @@ from meta_review.models import Participant -from django.shortcuts import render from django.db.models import Q +from django.views.generic import TemplateView +from community.views import get_header_and_footer -def index(request): - participants = Participant.objects.all().exclude( - Q(pos_in=0), - Q(neg_in=0), - Q(pos_out=0), - Q(neg_out=0), - Q(offset=0) - ) - args = {'participants': participants} - return render(request, 'meta_review.html', args) + +class ContributorsMetaReview(TemplateView): + template_name = 'meta_review.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context = get_header_and_footer(context) + participants = Participant.objects.all().exclude( + Q(pos_in=0), + Q(neg_in=0), + Q(pos_out=0), + Q(neg_out=0), + Q(offset=0) + ) + context['contributors_meta_review_details'] = participants + return context diff --git a/static/css/meta-reviewers.css b/static/css/meta-reviewers.css new file mode 100644 index 00000000..6b734844 --- /dev/null +++ b/static/css/meta-reviewers.css @@ -0,0 +1,98 @@ +.contributor-details-part-1 { + padding-right: 5px; +} + +.contributor-details-part-2 { + padding-left: 5px; + border-left: 1px #37474f solid; +} + +.column-flex { + display: flex; + flex-direction: column; +} + +.received-reactions div { + padding-left: 14px; +} + +.meta-reviewer { + background-color: #c7da99; + width: 580px; + border: 4px #6c9a55 solid; +} + +.metareviewer-details { + display: flex; + width: 66%; +} + +.meta-reviewer-image { + position: relative; + text-align: center; + color: white; +} + +.meta-reviewer-image img{ + border-radius: 30px; + margin: 20px; + width: 150px; +} + +.top-right { + position: absolute; + top: 30px; + right: 25px; + width: 30px; + border-radius: 100%; + background-color: #37474f; +} + +@media only screen and (max-width: 706px){ + .contributors-cards { + margin: 50px 0px; + } + .contributor-card { + margin: 0px 10px; + margin-bottom: 20px; + min-height: 230px; + } + + .metareviewer-details { + width: 60%; + } + + .meta-reviewer-image { + width: 40%; + } + + .meta-reviewer-image img { + max-width: 80%; + margin: 20px 10px; + } + + @media only screen and (max-width:419px){ + + .metareviewer-details { + width: 100%; + } + + .meta-reviewer { + margin: 0px 10px 20px 10px; + } + + .meta-reviewer-image { + width: 100%; + } + + .contributor-details-part-1 { + padding: 0px 0px 10px 10px; + } + + .top-right { + right: 105px; + } + + } + +} diff --git a/static/js/contributors.js b/static/js/contributors.js index a6164024..beaa9d64 100644 --- a/static/js/contributors.js +++ b/static/js/contributors.js @@ -13,7 +13,13 @@ $(document).ready(function(){ var row_id = result_td.id; var login = row_id.replace('td-', ''); $('.contributor-card').css('display', 'none'); - $('[login=' + login +']').css('display', 'block'); + var contrib_card = $('[login=' + login +']'); + if(contrib_card.hasClass('meta-reviewer')){ + contrib_card.css('display', 'flex'); + } + else{ + contrib_card.css('display', 'block'); + } $('.search-results').css('display', 'none'); }); } @@ -57,8 +63,15 @@ $(document).ready(function(){ }); close_icon.on('click', function(){ - $('.contributor-card').css('display', 'block'); + var all_contrib_cards = $('.contributor-card'); + if(all_contrib_cards.hasClass('meta-reviewer')){ + all_contrib_cards.css('display', 'flex'); + } + else { + all_contrib_cards.css('display', 'block'); + } close_icon.css('display', 'none'); search_input.val(null); + $('.search-results').css('display', 'none'); }); }); diff --git a/templates/meta_review.html b/templates/meta_review.html index a6215de4..108d2172 100644 --- a/templates/meta_review.html +++ b/templates/meta_review.html @@ -1,53 +1,144 @@ - - -
- - - - - -+ Contributor meta-review related details are calculated based upon the + GitHub reactions made by that contributor on any issue or merge request + within an organization, for example - {{ org.name }}. +
+Search Results | +
---|
+ No results found! + | +