Skip to content

Commit

Permalink
fix: rename is_available to is_expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoStorm96 committed Oct 1, 2024
1 parent 383be30 commit 35c7e74
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main/templates/base/stepper.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span>{{ item.title }}</span>
</a>
{% endif %}
{% if item.children and item.is_available %}
{% if item.children and item.is_expanded %}
<ul>
{% for child in item.children %}
{% include child with bubble_size=bubble_size|slice:"1:" %}
Expand Down
2 changes: 1 addition & 1 deletion main/templates/base/stepper_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<span>{{ item.title }}</span>
</a>
{% endif %}
{% if item.children and item.is_available %}
{% if item.children and item.is_expanded %}
<ul>
{% for child in item.children %}
{% include "base/stepper_item.html" with item=child bubble_size=bubble_size|slice:"1:" %}
Expand Down
4 changes: 2 additions & 2 deletions proposals/utils/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ def check_all(self, next_checkers):
def item_is_current_check(self, item):
"""
Sets current_item and current_item_ancestor attributes, when these
are found, and set the is_available attribute to True for these
are found, and set the is_expanded attribute to True for these
items.
"""
if not self.current_item_ancestors:
if item.is_current(self.request):
self.current_item_ancestors = item.get_ancestors()
for item in self.current_item_ancestors:
item.is_available = True
item.is_expanded = True

def has_multiple_studies(
self,
Expand Down
4 changes: 2 additions & 2 deletions proposals/utils/stepper_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, stepper, parent=None, title=None, location=None):
self.proposal = stepper.proposal
self.children = []
self.parent = parent
self.is_available = False
self.is_expanded = False
self.css_classes = set()
# Don't override default location if not provided explicitly
if location:
Expand Down Expand Up @@ -306,7 +306,7 @@ def build_css_classes(self):
its children, otherwise, it only depends on the form the
the item represents.
"""
if not self.is_available and self.children:
if not self.is_expanded and self.children:
if self.get_errors(include_children=True):
self.css_classes.add("incomplete")
else:
Expand Down

0 comments on commit 35c7e74

Please sign in to comment.