Skip to content
Snippets Groups Projects
Commit 92362b33 authored by Chris Lawton's avatar Chris Lawton
Browse files

allow table and search filter to display a heading and also hide the batch...

allow table and search filter to display a heading and also hide the batch actions if they're not being used
parent b4a6c7f9
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{% block content %} {% block content %}
{% block table %} {% block table %}
{% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action %} {% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action use_batch_actions=True %}
{% render_table table %} {% render_table table %}
{% endblock %} {% endblock %}
......
...@@ -2,12 +2,20 @@ ...@@ -2,12 +2,20 @@
<div class="actions-bar"> <div class="actions-bar">
{# Left #} {# Left #}
<div class="actions-bar__inner actions-bar__inner--left"> <div class="actions-bar__inner actions-bar__inner--left">
<p class="actions-bar__total"><span class="js-total-actions">0</span> Selected</p> {% if heading %}
<form action="" class="js-batch-update-status"> <h4 class="heading heading--normal heading--no-margin">{{ heading }}</h4>
<button class="button button--action button--change-status" type="submit">Change status</button> {% endif %}
</form>
<button data-fancybox data-src="#batch-update-reviewers" class="button button--action button--reviewers js-batch-update-reviewers" type="submit">Reviewers</button> {% if use_batch_actions %}
<div class="actions-bar__inner actions-bar__inner--batch-actions">
<p class="actions-bar__total"><span class="js-total-actions">0</span> Selected</p>
<form action="" class="js-batch-update-status">
<button class="button button--action button--change-status" type="submit">Change status</button>
</form>
<button data-fancybox data-src="#batch-update-reviewers" class="button button--action button--reviewers js-batch-update-reviewers" type="submit">Reviewers</button>
</div>
{% endif %}
</div> </div>
{# Right #} {# Right #}
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<div class="wrapper wrapper--large wrapper--inner-space-medium"> <div class="wrapper wrapper--large wrapper--inner-space-medium">
{% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term %} {% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_batch_actions=False %}
{% render_table table %} {% render_table table %}
</div> </div>
......
{% extends "funds/base_submissions_table.html" %} {% extends "funds/base_submissions_table.html" %}
{% load static %} {% load static %}
{% load render_table from django_tables2 %}
{% block title %}Submissions{% endblock %} {% block title %}Submissions{% endblock %}
{% block content %} {% block content %}
...@@ -23,8 +24,9 @@ ...@@ -23,8 +24,9 @@
{% endif %} {% endif %}
{% block table %} {% block table %}
<h4 class="heading heading--normal heading--no-margin">All Submissions</h4> {% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action use_batch_actions=False heading="All Submissions" %}
{{ block.super }}
{% render_table table %}
<div class="all-submissions-table__more"> <div class="all-submissions-table__more">
<a href="{% url 'apply:submissions:list' %}">Show all</a> <a href="{% url 'apply:submissions:list' %}">Show all</a>
</div> </div>
......
...@@ -26,6 +26,16 @@ ...@@ -26,6 +26,16 @@
} }
&--left { &--left {
display: flex;
flex-direction: column;
align-items: flex-start;
}
&--right {
align-items: flex-end;
}
&--batch-actions {
display: none; display: none;
@include media-query(tablet-landscape) { @include media-query(tablet-landscape) {
...@@ -33,6 +43,7 @@ ...@@ -33,6 +43,7 @@
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition: opacity $quick-transition; transition: opacity $quick-transition;
margin: 20px 0 0;
.batch-actions-enabled & { .batch-actions-enabled & {
opacity: 1; opacity: 1;
......
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
max-width: 300px; max-width: 300px;
padding: 15px 20px;
font-weight: $weight--normal; font-weight: $weight--normal;
color: $color--default; color: $color--default;
background: url('./../../images/filters.svg') $color--white no-repeat 93% center; background: url('./../../images/filters.svg') $color--white no-repeat 93% center;
...@@ -215,7 +214,7 @@ ...@@ -215,7 +214,7 @@
@include media-query(tablet-landscape) { @include media-query(tablet-landscape) {
background: none; background: none;
padding: 0; padding: 10px;
border: 0; border: 0;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
......
...@@ -267,12 +267,9 @@ ...@@ -267,12 +267,9 @@
} }
&--table-actions { &--table-actions {
margin-bottom: 20px;
@include media-query(tablet-portrait) { @include media-query(tablet-portrait) {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
@include media-query(tablet-landscape) { @include media-query(tablet-landscape) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment