diff --git a/opentech/apply/dashboard/templates/dashboard/dashboard.html b/opentech/apply/dashboard/templates/dashboard/dashboard.html index 73fead516f52b250612d4e7706efe9dee2e00f93..a1e56450f741d3740cc0454fcda688144f5ebe06 100644 --- a/opentech/apply/dashboard/templates/dashboard/dashboard.html +++ b/opentech/apply/dashboard/templates/dashboard/dashboard.html @@ -9,8 +9,9 @@ {% block page_header %} <h1 class="gamma heading heading--no-margin heading--bold">Dashboard</h1> {% endblock %} - <a href="{% url 'wagtailadmin_home' %}" class="button button--primary {{ class }}}"> + <a href="{% url 'wagtailadmin_home' %}" class="button button--primary button--arrow-pixels-white"> Apply admin + <svg><use xlink:href="#arrow-head-pixels--solid"></use></svg> </a> </div> </div> diff --git a/opentech/apply/determinations/views.py b/opentech/apply/determinations/views.py index d537eb3edf7b389af325be5216baf65042ea8302..75ef00a121f924f17877061cb2ccd2581a0cb3f6 100644 --- a/opentech/apply/determinations/views.py +++ b/opentech/apply/determinations/views.py @@ -133,6 +133,23 @@ class AdminDeterminationDetailView(DetailView): return super().dispatch(request, *args, **kwargs) +@method_decorator(login_required, name='dispatch') +class ReviewerDeterminationDetailView(DetailView): + model = Determination + + def get_object(self, queryset=None): + return self.model.objects.get(submission=self.submission) + + def dispatch(self, request, *args, **kwargs): + self.submission = get_object_or_404(ApplicationSubmission, id=self.kwargs['submission_pk']) + determination = self.get_object() + + if not determination.submitted: + return HttpResponseRedirect(reverse_lazy('apply:submissions:detail', args=(self.submission.id,))) + + return super().dispatch(request, *args, **kwargs) + + @method_decorator(login_required, name='dispatch') class ApplicantDeterminationDetailView(DetailView): model = Determination @@ -156,3 +173,4 @@ class ApplicantDeterminationDetailView(DetailView): class DeterminationDetailView(ViewDispatcher): admin_view = AdminDeterminationDetailView applicant_view = ApplicantDeterminationDetailView + reviewer_view = ReviewerDeterminationDetailView diff --git a/opentech/apply/funds/forms.py b/opentech/apply/funds/forms.py index c5efce9d4225f6814f4bdac7ee0c25affb297d5d..dd435d559c7c1ad8fe05463bbf774398e294af66 100644 --- a/opentech/apply/funds/forms.py +++ b/opentech/apply/funds/forms.py @@ -52,8 +52,11 @@ class UpdateReviewersForm(forms.ModelForm): model = ApplicationSubmission fields: list = [] + def can_alter_reviewers(self, user): + return self.instance.stage.has_external_review and user == self.instance.lead + def __init__(self, *args, **kwargs): - user = kwargs.pop('user') + self.user = kwargs.pop('user') super().__init__(*args, **kwargs) reviewers = self.instance.reviewers.all() self.submitted_reviewers = User.objects.filter(id__in=self.instance.reviews.values('author')) @@ -62,7 +65,7 @@ class UpdateReviewersForm(forms.ModelForm): staff_field.queryset = staff_field.queryset.exclude(id__in=self.submitted_reviewers) staff_field.initial = reviewers - if self.instance.stage.has_external_review and user == self.instance.lead: + if self.can_alter_reviewers(self.user): review_field = self.fields['reviewer_reviewers'] review_field.queryset = review_field.queryset.exclude(id__in=self.submitted_reviewers) review_field.initial = reviewers @@ -71,9 +74,14 @@ class UpdateReviewersForm(forms.ModelForm): def save(self, *args, **kwargs): instance = super().save(*args, **kwargs) + if self.can_alter_reviewers(self.user): + reviewers = self.cleaned_data.get('reviewer_reviewers') + else: + reviewers = instance.reviewers_not_reviewed + instance.reviewers.set( self.cleaned_data['staff_reviewers'] | - self.cleaned_data.get('reviewer_reviewers', User.objects.none()) | + reviewers | self.submitted_reviewers ) return instance diff --git a/opentech/apply/funds/models/applications.py b/opentech/apply/funds/models/applications.py index bb7af8ebaed272ac944f9fdb821d00de2dd79b86..ac45115d4a3613888b940884cb8a2f7719472aa1 100644 --- a/opentech/apply/funds/models/applications.py +++ b/opentech/apply/funds/models/applications.py @@ -3,7 +3,7 @@ from datetime import date from django.conf import settings from django.core.exceptions import ValidationError from django.db import models -from django.db.models import Q +from django.db.models import OuterRef, Q, Subquery from django.http import Http404 from django.utils.text import mark_safe @@ -16,6 +16,7 @@ from wagtail.admin.edit_handlers import ( ObjectList, TabbedInterface, ) +from wagtail.core.models import PageManager, PageQuerySet from ..admin_forms import WorkflowFormAdminForm from ..edit_handlers import ReadOnlyPanel, ReadOnlyInlinePanel @@ -24,6 +25,15 @@ from .submissions import ApplicationSubmission from .utils import admin_url, EmailForm, SubmittableStreamForm, WorkflowStreamForm, LIMIT_TO_REVIEWERS, LIMIT_TO_STAFF +class ApplicationBaseManager(PageQuerySet): + def order_by_end_date(self): + # OutRef path__startswith with find all descendants of the parent + # We only have children, so no issues at this time + rounds = RoundBase.objects.open().filter(path__startswith=OuterRef('path')) + qs = self.public().live().annotate(end_date=Subquery(rounds.values('end_date')[:1])) + return qs.order_by('end_date') + + class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore is_createable = False @@ -37,6 +47,8 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore blank=True, ) + objects = PageManager.from_queryset(ApplicationBaseManager)() + parent_page_types = ['apply_home.ApplyHomePage'] def detail(self): @@ -45,11 +57,7 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore @property def open_round(self): - rounds = RoundBase.objects.child_of(self).live().public().specific() - return rounds.filter( - Q(start_date__lte=date.today()) & - Q(Q(end_date__isnull=True) | Q(end_date__gte=date.today())) - ).first() + return RoundBase.objects.child_of(self).open().first() def next_deadline(self): try: @@ -77,10 +85,22 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore ]) +class RoundBaseManager(PageQuerySet): + def open(self): + rounds = self.live().public().specific() + rounds = rounds.filter( + Q(start_date__lte=date.today()) & + Q(Q(end_date__isnull=True) | Q(end_date__gte=date.today())) + ) + return rounds + + class RoundBase(WorkflowStreamForm, SubmittableStreamForm): # type: ignore is_creatable = False submission_class = ApplicationSubmission + objects = PageManager.from_queryset(RoundBaseManager)() + subpage_types = [] # type: ignore lead = models.ForeignKey( diff --git a/opentech/apply/funds/models/submissions.py b/opentech/apply/funds/models/submissions.py index 779f551c64b28956b975dfca4cbf5ffe5c749b49..3f95000183a048b67acf79e3b5d823d79ddd09b9 100644 --- a/opentech/apply/funds/models/submissions.py +++ b/opentech/apply/funds/models/submissions.py @@ -459,7 +459,11 @@ class ApplicationSubmission( if creating: self.reviewers.set(self.get_from_parent('reviewers').all()) - first_revision = ApplicationRevision.objects.create(submission=self, form_data=self.form_data) + first_revision = ApplicationRevision.objects.create( + submission=self, + form_data=self.form_data, + author=self.user, + ) self.live_revision = first_revision self.draft_revision = first_revision self.save() diff --git a/opentech/apply/funds/templates/funds/revisions_compare.html b/opentech/apply/funds/templates/funds/revisions_compare.html index 649f2170ec6fb6e9c19235f23922bdc23b634a1b..4ec01d9cd5e895ffc7608918457c056ca6de76e1 100644 --- a/opentech/apply/funds/templates/funds/revisions_compare.html +++ b/opentech/apply/funds/templates/funds/revisions_compare.html @@ -10,6 +10,10 @@ </div> <div class="wrapper wrapper--large wrapper--tabs"> + <div> + <h2>{{ object.get_title_display }}</h2> + </div> + {% include "funds/includes/rendered_answers.html" %} </div> {% endblock %} diff --git a/opentech/apply/funds/templates/funds/tables/table.html b/opentech/apply/funds/templates/funds/tables/table.html index 24b4046fccaf8a7de364d05e3e47f06a6e5de65d..3c07838c3bfd834143377d9b3604060cfa956074 100644 --- a/opentech/apply/funds/templates/funds/tables/table.html +++ b/opentech/apply/funds/templates/funds/tables/table.html @@ -2,7 +2,14 @@ {% load django_tables2 table_tags review_tags %} {% block table.tbody.row %} - {{ block.super }} + <tr {{ row.attrs.as_html }}> + {% for column, cell in row.items %} + <td {{ column.attrs.td.as_html }}> + <span class="mobile-label {{ column.attrs.td.class }}">{{ column.header }}: </span> + {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %} + </td> + {% endfor %} + </tr> {% with submission=row.record %} <tr class="all-submissions__child" data-parent-id="{{ row.record.id }}"> @@ -11,7 +18,7 @@ <tr class="submission-meta__row"> <th><h6 class="heading heading--normal heading--no-margin">Applicant</h6></th> <th><h6 class="heading heading--normal heading--no-margin">Last updated</h6></th> - <th><h6 class="heading heading--normal heading--no-margin">Reviewers / Outcomes</h6></th> + <th><h6 class="heading heading--normal heading--no-margin">Review outcomes</h6></th> </tr> <tr class="submission-meta__row submission-meta__row--black"> <td><strong>{{ submission.full_name }}</strong></td> diff --git a/opentech/apply/funds/tests/test_models.py b/opentech/apply/funds/tests/test_models.py index a32420a93bf3aef0db8e267539c1ec49441d5adf..32389220da12b4abd0df8e937c299bc889a3ecb0 100644 --- a/opentech/apply/funds/tests/test_models.py +++ b/opentech/apply/funds/tests/test_models.py @@ -378,6 +378,7 @@ class TestApplicationSubmission(TestCase): submission = ApplicationSubmissionFactory() self.assertEqual(submission.revisions.count(), 1) self.assertDictEqual(submission.live_revision.form_data, submission.form_data) + self.assertEqual(submission.live_revision.author, submission.user) def test_create_revision_on_data_change(self): submission = ApplicationSubmissionFactory() diff --git a/opentech/apply/funds/tests/test_views.py b/opentech/apply/funds/tests/test_views.py index 16e33d86a92d4b4dd59d981b485b7d4a21f5e936..6131353fc2f6838764545666b11ff868342a4882 100644 --- a/opentech/apply/funds/tests/test_views.py +++ b/opentech/apply/funds/tests/test_views.py @@ -11,7 +11,12 @@ from opentech.apply.funds.tests.factories import ( SealedSubmissionFactory, ) from opentech.apply.stream_forms.testing.factories import flatten_for_form -from opentech.apply.users.tests.factories import UserFactory, StaffFactory, SuperUserFactory +from opentech.apply.users.tests.factories import ( + ReviewerFactory, + StaffFactory, + SuperUserFactory, + UserFactory, +) from opentech.apply.utils.testing.tests import BaseViewTestCase from ..models import ApplicationRevision @@ -122,7 +127,7 @@ class TestStaffSubmissionView(BaseSubmissionViewTestCase): data = prepare_form_data(self.submission, title=new_title) response = self.post_page(self.submission, {'submit': True, **data}, 'edit') - url = self.url_from_pattern('funds:submissions:detail', kwargs={'pk': self.submission.id}) + url = self.url(self.submission) self.assertRedirects(response, url) submission = self.refresh(self.submission) @@ -132,6 +137,106 @@ class TestStaffSubmissionView(BaseSubmissionViewTestCase): self.assertEqual(new_title, submission.title) +class TestReviewersUpdateView(BaseSubmissionViewTestCase): + user_factory = StaffFactory + + @classmethod + def setUpTestData(cls): + super().setUpTestData() + cls.staff = StaffFactory.create_batch(4) + cls.reviewers = ReviewerFactory.create_batch(4) + + def post_form(self, submission, staff=list(), reviewers=list()): + return self.post_page(submission, { + 'form-submitted-reviewer_form': '', + 'staff_reviewers': [s.id for s in staff], + 'reviewer_reviewers': [r.id for r in reviewers] + }) + + def test_lead_can_add_staff_single(self): + submission = ApplicationSubmissionFactory(lead=self.user) + + self.post_form(submission, self.staff) + + self.assertCountEqual(submission.reviewers.all(), self.staff) + + def test_lead_can_remove_staff_single(self): + submission = ApplicationSubmissionFactory(lead=self.user, reviewers=self.staff) + self.assertCountEqual(submission.reviewers.all(), self.staff) + + self.post_form(submission, []) + + self.assertCountEqual(submission.reviewers.all(), []) + + def test_lead_can_remove_some_staff(self): + submission = ApplicationSubmissionFactory(lead=self.user, reviewers=self.staff) + self.assertCountEqual(submission.reviewers.all(), self.staff) + + self.post_form(submission, self.staff[0:2]) + + self.assertCountEqual(submission.reviewers.all(), self.staff[0:2]) + + def test_lead_cant_add_reviewers_single(self): + submission = ApplicationSubmissionFactory(lead=self.user) + + self.post_form(submission, reviewers=self.reviewers) + + self.assertCountEqual(submission.reviewers.all(), []) + + def test_lead_can_add_staff_and_reviewers_for_proposal(self): + submission = InvitedToProposalFactory(lead=self.user) + + self.post_form(submission, self.staff, self.reviewers) + + self.assertCountEqual(submission.reviewers.all(), self.staff + self.reviewers) + + def test_lead_can_remove_staff_and_reviewers_for_proposal(self): + submission = InvitedToProposalFactory(lead=self.user, reviewers=self.staff + self.reviewers) + self.assertCountEqual(submission.reviewers.all(), self.staff + self.reviewers) + + self.post_form(submission) + + self.assertCountEqual(submission.reviewers.all(), []) + + def test_lead_can_remove_some_staff_and_reviewers_for_proposal(self): + submission = InvitedToProposalFactory(lead=self.user, reviewers=self.staff + self.reviewers) + self.assertCountEqual(submission.reviewers.all(), self.staff + self.reviewers) + + self.post_form(submission, self.staff[0:2], self.reviewers[0:2]) + + self.assertCountEqual(submission.reviewers.all(), self.staff[0:2] + self.reviewers[0:2]) + + def test_staff_can_add_staff_single(self): + submission = ApplicationSubmissionFactory() + + self.post_form(submission, self.staff) + + self.assertCountEqual(submission.reviewers.all(), self.staff) + + def test_staff_can_remove_staff_single(self): + submission = ApplicationSubmissionFactory(reviewers=self.staff) + self.assertCountEqual(submission.reviewers.all(), self.staff) + + self.post_form(submission, []) + + self.assertCountEqual(submission.reviewers.all(), []) + + def test_staff_cant_add_reviewers_proposal(self): + submission = ApplicationSubmissionFactory() + + self.post_form(submission, reviewers=self.reviewers) + + self.assertCountEqual(submission.reviewers.all(), []) + + def test_staff_cant_remove_reviewers_proposal(self): + submission = ApplicationSubmissionFactory(reviewers=self.reviewers) + self.assertCountEqual(submission.reviewers.all(), self.reviewers) + + self.post_form(submission, reviewers=[]) + + self.assertCountEqual(submission.reviewers.all(), self.reviewers) + + class TestApplicantSubmissionView(BaseSubmissionViewTestCase): user_factory = UserFactory diff --git a/opentech/apply/funds/workflow.py b/opentech/apply/funds/workflow.py index 6eebaa6925ef4753e2a388e584879467137c4117..a6d0337bc9ad6199577227a7da64fa290a81f007 100644 --- a/opentech/apply/funds/workflow.py +++ b/opentech/apply/funds/workflow.py @@ -158,7 +158,11 @@ SingleStageDefinition = { }, 'more_info': { 'transitions': { - INITIAL_STATE: {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + INITIAL_STATE: { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Request, @@ -187,7 +191,11 @@ SingleStageDefinition = { }, 'post_review_more_info': { 'transitions': { - 'post_review_discussion': {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + 'post_review_discussion': { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Request, @@ -224,7 +232,11 @@ DoubleStageDefinition = { }, 'concept_more_info': { 'transitions': { - INITIAL_STATE: {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + INITIAL_STATE: { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Concept, @@ -253,7 +265,11 @@ DoubleStageDefinition = { }, 'concept_review_more_info': { 'transitions': { - 'concept_review_discussion': {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + 'concept_review_discussion': { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Concept, @@ -302,7 +318,11 @@ DoubleStageDefinition = { }, 'proposal_more_info': { 'transitions': { - 'proposal_discussion': {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + 'proposal_discussion': { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Proposal, @@ -331,7 +351,11 @@ DoubleStageDefinition = { }, 'post_proposal_review_more_info': { 'transitions': { - 'post_proposal_review_discussion': {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + 'post_proposal_review_discussion': { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Proposal, @@ -360,7 +384,11 @@ DoubleStageDefinition = { }, 'post_external_review_more_info': { 'transitions': { - 'post_external_review_discussion': {'display': 'Submit', 'permissions': {UserPermissions.APPLICANT}, 'method': 'create_revision'}, + 'post_external_review_discussion': { + 'display': 'Submit', + 'permissions': {UserPermissions.APPLICANT, UserPermissions.LEAD, UserPermissions.ADMIN}, + 'method': 'create_revision', + }, }, 'display': 'More information required', 'stage': Proposal, diff --git a/opentech/apply/home/models.py b/opentech/apply/home/models.py index cc25885c0e7d5f44e0a912f33083602c665684d8..3d135ce17c5e27c54899b3753c19ed77d2aa9dc8 100644 --- a/opentech/apply/home/models.py +++ b/opentech/apply/home/models.py @@ -4,6 +4,8 @@ from wagtail.search import index from django.db import models +from opentech.apply.funds.models import ApplicationBase, LabBase + class ApplyHomePage(Page): # Only allow creating HomePages at the root level @@ -19,3 +21,9 @@ class ApplyHomePage(Page): content_panels = Page.content_panels + [ FieldPanel('strapline'), ] + + def get_context(self, *args, **kwargs): + context = super().get_context(*args, **kwargs) + context['open_funds'] = ApplicationBase.objects.order_by_end_date() + context['open_labs'] = LabBase.objects.public().live() + return context diff --git a/opentech/apply/home/templates/apply_home/apply_home_page.html b/opentech/apply/home/templates/apply_home/apply_home_page.html index e1a67fcb97c62e0c0bc9edf7f7de4302bc14e70d..041adf22b6bcfff0b11fd23f667749cc1e4fd316 100644 --- a/opentech/apply/home/templates/apply_home/apply_home_page.html +++ b/opentech/apply/home/templates/apply_home/apply_home_page.html @@ -16,8 +16,11 @@ </div> <div class="wrapper wrapper--listings"> - {% for child_page in page.get_children.public.live %} - {% include "apply_home/includes/apply_listing.html" with page=child_page %} + {% for fund in open_funds %} + {% include "apply_home/includes/apply_listing.html" with page=fund.specific %} + {% endfor %} + {% for lab in open_labs %} + {% include "apply_home/includes/apply_listing.html" with page=lab.specific %} {% endfor %} </div> diff --git a/opentech/apply/home/templates/apply_home/includes/apply_listing.html b/opentech/apply/home/templates/apply_home/includes/apply_listing.html index dd1083c61b3a4bc5e4a78b2fb64f0f9e9e0a6ef5..3faa2671fc9b5b8f7ae235a31a31dcb14ab7b283 100644 --- a/opentech/apply/home/templates/apply_home/includes/apply_listing.html +++ b/opentech/apply/home/templates/apply_home/includes/apply_listing.html @@ -1,37 +1,24 @@ {% load wagtailcore_tags %} -{% with details=page.specific.detail.specific %} -{% if page.specific.open_round %} +{% with details=page.detail.specific %} +{% if page.open_round %} <div class="listing listing--not-a-link"> <div> <h4 class="listing__title listing__title--link"> - {% if details.deadline %} + {% if page.next_deadline %} <p class="listing__deadline"> <svg class="icon icon--calendar icon--small"><use xlink:href="#calendar"></use></svg> - <span>Next deadline: {{ details.deadline|date:"M j, Y" }}</span> + <span>Next deadline: {{ page.next_deadline|date:"M j, Y" }}</span> </p> {% endif %} - {# details may be None, so be more verbose in the handling of the title #} - {% if page.title %} - {% if details %} - <a href="{% pageurl details %}"> - {% endif %} - - {{ page.title }} - - {% if details %} - </a> - {% endif %} - {% else %} - {% if details %} - <a href="{% pageurl details %}"> - {% endif %} + {% if details %} + <a href="{% pageurl details %}"> + {% endif %} - {{ details.listing_title|default:details.title }} + {{ page.title }} - {% if details %} - </a> - {% endif %} + {% if details %} + </a> {% endif %} </h4> @@ -40,6 +27,6 @@ {% endif %} </div> <a class="listing__button" href="{% pageurl page %}">Apply</a> - </div> + </div> {% endif %} {% endwith %} diff --git a/opentech/apply/users/templates/users/account.html b/opentech/apply/users/templates/users/account.html index 6c854cbe158f56f89e25efe8a7dfd37ef5e65d37..6156b72af9b21fcf4911d151201ffd5c8a16cf0b 100644 --- a/opentech/apply/users/templates/users/account.html +++ b/opentech/apply/users/templates/users/account.html @@ -5,8 +5,12 @@ {% block content %} <div class="admin-bar"> - <div class="admin-bar__inner wrapper--search"> + <div class="admin-bar__inner admin-bar__inner--with-button"> <h3 class="admin-bar__heading">Welcome {{ user }}</h3> + <a href="{% url 'dashboard:dashboard' %}" class="button button--primary button--arrow-pixels-white"> + Go to dashboard + <svg><use xlink:href="#arrow-head-pixels--solid"></use></svg> + </a> </div> </div> diff --git a/opentech/static_src/src/sass/apply/components/_all-submissions.scss b/opentech/static_src/src/sass/apply/components/_all-submissions.scss index 73651c3ca276851ac653894b48155897ab20dfe3..d13f4985d5f35ef25f7a014764018e2c5a15864d 100644 --- a/opentech/static_src/src/sass/apply/components/_all-submissions.scss +++ b/opentech/static_src/src/sass/apply/components/_all-submissions.scss @@ -164,10 +164,18 @@ $table-breakpoint: 'tablet-landscape'; } } + &.reviews_stats { + display: none; + + @include media-query($table-breakpoint) { + display: table-cell; + } + } + // arrow to toggle project info - added via js @include media-query($table-breakpoint) { .arrow { - @include triangle(bottom, $color--primary, 6px); + @include triangle(right, $color--primary, 6px); position: relative; display: inline-block; margin-right: 15px; @@ -179,6 +187,19 @@ $table-breakpoint: 'tablet-landscape'; } } } + + > span.mobile-label { + width: 90px; + display: inline-block; + + &.phase, &.title { + display: none; + } + + @include media-query($table-breakpoint) { + display: none; + } + } } } @@ -197,8 +218,8 @@ $table-breakpoint: 'tablet-landscape'; } .arrow { - border-top-color: darken($color--dark-blue, 10%); - transform: rotate(180deg); + border-right-color: darken($color--dark-blue, 10%); + transform: rotate(90deg); } } } @@ -236,4 +257,3 @@ $table-breakpoint: 'tablet-landscape'; padding: 5px 0 5px 5px; } } - diff --git a/opentech/static_src/src/sass/apply/components/_button.scss b/opentech/static_src/src/sass/apply/components/_button.scss index 2af3e6fb2549cb31143ac360967636833ee55bd1..dee9b0ebcad1b84551ac64c352fd2ed15a691746 100644 --- a/opentech/static_src/src/sass/apply/components/_button.scss +++ b/opentech/static_src/src/sass/apply/components/_button.scss @@ -196,4 +196,16 @@ border: 1px solid $color--light-blue; } } + + &--arrow-pixels-white { + display: flex; + align-items: center; + + svg { + width: 10px; + height: 14px; + margin-left: 10px; + fill: $color--white; + } + } } diff --git a/opentech/static_src/src/sass/apply/components/_messages.scss b/opentech/static_src/src/sass/apply/components/_messages.scss index 509c244c9c1806a98c6e7e481ae8090c458c47b7..fa2b2d2f9942e270c8bd4b4b61e5de25a036805e 100644 --- a/opentech/static_src/src/sass/apply/components/_messages.scss +++ b/opentech/static_src/src/sass/apply/components/_messages.scss @@ -13,12 +13,12 @@ padding-right: 35px; border: solid 1px; - &--info { + &--info , &--success { background: $color--pastel-green; border-color: darken($color--pastel-green, 20%); } - &--warning { + &--warning, &--error { font-weight: bold; color: $color--white; background: $color--error; diff --git a/opentech/static_src/src/sass/apply/components/_table.scss b/opentech/static_src/src/sass/apply/components/_table.scss index b757c6239b46d52d8ec5ea9f31a2ac1814f293d4..b8fef0cb7f0c7083e2a04e4af1830b061b5350e3 100644 --- a/opentech/static_src/src/sass/apply/components/_table.scss +++ b/opentech/static_src/src/sass/apply/components/_table.scss @@ -20,7 +20,7 @@ table { } } - // tale rows + // table rows tr { border: 1px solid $color--light-mid-grey; transition: box-shadow 0.15s ease; @@ -62,20 +62,21 @@ table { &.lead { span { - position: relative; - z-index: 1; - display: block; - padding-right: 5px; - overflow: hidden; - text-overflow: ellipsis; - background: $color--white; - - &:hover { - display: inline-block; - overflow: visible; + @include media-query($table-breakpoint) { + position: relative; + z-index: 1; + display: block; + padding-right: 5px; + overflow: hidden; + text-overflow: ellipsis; + background: $color--white; + + &:hover { + display: inline-block; + overflow: visible; + } } } - } } }