Skip to content

Commit

Permalink
[#159] Add conditional rota display
Browse files Browse the repository at this point in the history
- If rota manager:
    display appropriate rota status messages for draft/published rotas
- If not rota manager:
    Only show rota info if published;
    If draft, show appropriate message
	    modified:   string_rota/templates/string_rota/rota.html

Add testing for conditional rota display to README
	modified:   README.md
	new file:   readme_assets/images/testing-issue159.png
  • Loading branch information
mikerae committed Oct 5, 2023
1 parent 9730ad0 commit fe46aa1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ The following manual tests were made:
- [see issue #138 here](https://github.com/mikerae/string-rota/issues/138)
- [External BoostrapMade link #157 Testing](/readme_assets/images/testing-issue157.png)
- [see issue #157 here](https://github.com/mikerae/string-rota/issues/157)
- [Display Draft/Published rota data #159 Testing](/readme_assets/images/testing-issue159.png)
- [see issue #159 here](https://github.com/mikerae/string-rota/issues/159)
#### Human Testing
No human testing was done for this MVP, but once office manager functionality, and the hiding of draft rotas is implemented, user feedback will be sort.

Expand Down
Binary file added readme_assets/images/testing-issue159.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 16 additions & 8 deletions string_rota/templates/string_rota/rota.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,24 @@ <h2 class="card-title">Repertoire<span></h2>
<div class="card-body">
<h2 class="card-title">
Seating Plan for {{seating_plan.section}} Section
Status: {{seating_plan.get_plan_status_display}}
<span {% if not rota_manager %}class="d-none"
{% elif rota_manager and seating_plan.plan_status == "D"%}class="text-danger"
{% elif rota_manager and seating_plan.plan_status == "P"%}class="text-success" {% endif %}>Status:
{{seating_plan.get_plan_status_display}}</span>
</h2>
<p>This project needs <strong>{{ strength }}</strong> players.</p>
<p {% if not rota_manager %}class="d-none" {% endif %}>This project
needs <strong>{{ strength }}</strong> players.</p>
{% if not rota_manager %}
{% if seating_plan.get_plan_status_display == "Draft" %}
<h3>The Seating Plan for {{ project.name }} is not ready yet.</h3>
<h5>Please contact your Rota Manager</h5>
<h3 class="text-danger">The Seating Plan for {{ project.name }} is not ready yet.</h3>
<h5 class="text-info">Please contact your Rota Manager</h5>
{% endif %}
{% endif %}

<!-- Active Table -->

<table class="rota table table-borderless">
<table
class="rota table table-borderless {% if seating_plan.plan_status == 'D' and not rota_manager %}d-none {% endif %}">
<thead>
<tr>
<th scope="col">Name</th>
Expand Down Expand Up @@ -137,7 +142,8 @@ <h5>Please contact your Rota Manager</h5>
<!-- Right side columns -->
<div class="col-lg-5">
<!-- Reserve Player -->
<div class="col-xxl-5 col-md-6">
<div class="col-xxl-5 col-md-6 {% if seating_plan.plan_status == 'D' and not rota_manager %}d-none
{% endif %}">
<div class="card info-card sales-card">
<div class="card-body">
<h2 class="card-title">Reserve Player<span></h2>
Expand Down Expand Up @@ -166,7 +172,8 @@ <h2 class="card-title">Reserve Player<span></h2>
</div>
</div><!-- End Reserve Player -->
<!-- Reduced Rep Player -->
<div class="col-xxl-5 col-md-6">
<div class="col-xxl-5 col-md-6 {% if seating_plan.plan_status == 'D' and not rota_manager %}d-none
{% endif %}">
<div class="card info-card sales-card">
<div class="card-body">
<h2 class="card-title">Reduced Rep Player(s)<span></h2>
Expand All @@ -189,7 +196,8 @@ <h2 class="card-title">Reduced Rep Player(s)<span></h2>
</div>
</div><!-- End Reduced Rep Player -->
<!-- Not Available -->
<div class="col-xxl-5 col-md-6">
<div class="col-xxl-5 col-md-6 {% if seating_plan.plan_status == 'D' and not rota_manager %}d-none
{% endif %}">
<div class="card info-card sales-card">
<div class="card-body">
<h2 class="card-title">Players Not Available<span></h2>
Expand Down

0 comments on commit fe46aa1

Please sign in to comment.