Skip to content

Commit fe6c538

Browse files
committed
refactor: Link to global goal when there are no features
1 parent 3e1d865 commit fe6c538

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

project/scripts/{% if insiders %}insiders.py{% endif %}.jinja

+12-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,18 @@ class Goal:
7878

7979
def render(self, rel_base: str = "..") -> None: # noqa: D102
8080
print(f"#### $ {self.human_readable_amount} — {self.name}\n")
81-
for feature in self.features:
82-
feature.render(rel_base)
83-
print("")
81+
if self.features:
82+
for feature in self.features:
83+
feature.render(rel_base)
84+
print("")
85+
else:
86+
print("There are no features in this goal for this project. ")
87+
{%- if author_username == "pawamoy" %}
88+
print(
89+
"[See the features in this goal **for all Insiders projects.**]"
90+
f"(https://pawamoy.github.io/insiders/#{self.amount}-{self.name.lower().replace(' ', '-')})",
91+
)
92+
{%- endif %}
8493

8594

8695
def load_goals(data: str, funding: int = 0, project: Project | None = None) -> dict[int, Goal]:

0 commit comments

Comments
 (0)