-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up My Stuff cards and show "None found" when empty
- Loading branch information
Showing
8 changed files
with
70 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_event_series_card"> | ||
<% presenter.recent_event_series(10).each do |series| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to series.name, organization_event_series_path(series.organization, series) %></strong> | ||
</h4> | ||
<% if presenter.recent_event_series(1).any? %> | ||
<% presenter.recent_event_series(10).each do |series| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to series.name, organization_event_series_path(series.organization, series) %></strong> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_events_card"> | ||
<% presenter.recent_event_groups(20).each do |event_group| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to event_group.name, event_group_path(event_group) %></strong> | ||
</h4> | ||
<% if presenter.recent_event_groups(1).any? %> | ||
<% presenter.recent_event_groups(20).each do |event_group| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to event_group.name, event_group_path(event_group) %></strong> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_interests_card"> | ||
<% presenter.interests.each do |person| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to person.full_name, person_path(person) %></strong> | ||
</h4> | ||
<% if presenter.interests.any? %> | ||
<% presenter.interests.each do |person| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to person.full_name, person_path(person) %></strong> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_live_updates_card"> | ||
<% presenter.watch_efforts.each do |effort| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to "#{effort.full_name} at #{effort.event_name}", effort_path(effort) %></strong> | ||
</h4> | ||
<% if presenter.watch_efforts.any? %> | ||
<% presenter.watch_efforts.each do |effort| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to "#{effort.full_name} at #{effort.event_name}", effort_path(effort) %></strong> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_organizations_card"> | ||
<% presenter.owned_organizations.each do |organization| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to organization.name, organization_path(organization) %></strong> | ||
<span class="badge bg-secondary">Owner</span> | ||
</h4> | ||
<% end %> | ||
<% presenter.steward_organizations.each do |organization| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to organization.name, organization_path(organization) %></strong> | ||
<span class="badge bg-secondary">Steward</span> | ||
</h4> | ||
<% if presenter.owned_organizations.any? || presenter.steward_organizations.any? %> | ||
<% presenter.owned_organizations.each do |organization| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to organization.name, organization_path(organization) %></strong> | ||
<span class="badge bg-secondary">Owner</span> | ||
</h4> | ||
<% end %> | ||
<% presenter.steward_organizations.each do |organization| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to organization.name, organization_path(organization) %></strong> | ||
<span class="badge bg-secondary">Steward</span> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_results_card"> | ||
<% presenter.recent_user_efforts(20).each do |effort| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to effort.event_name, effort_path(effort) %></strong> | ||
</h4> | ||
<% if presenter.recent_user_efforts(1).any? %> | ||
<% presenter.recent_user_efforts(20).each do |effort| %> | ||
<h4 class="card-text"> | ||
<strong><%= link_to effort.event_name, effort_path(effort) %></strong> | ||
</h4> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<%# locals: (presenter:) %> | ||
|
||
<turbo-frame id="my_stuff_service_requirements_card"> | ||
<% presenter.drawn_lottery_entrants.each do |lottery_entrant| %> | ||
<h4 class="card-text fw-bold"> | ||
<%= link_to lottery_entrant.lottery.name, organization_lottery_entrant_service_detail_path(lottery_entrant.organization, lottery_entrant.lottery, lottery_entrant) %> | ||
</h4> | ||
<% if presenter.drawn_lottery_entrants.any? %> | ||
<% presenter.drawn_lottery_entrants.each do |lottery_entrant| %> | ||
<div class="card-text h4 fw-bold"> | ||
<%= link_to lottery_entrant.lottery.name, organization_lottery_entrant_service_detail_path(lottery_entrant.organization, lottery_entrant.lottery, lottery_entrant) %> | ||
</div> | ||
<% end %> | ||
<% else %> | ||
<div class="card-text h5">None found</div> | ||
<% end %> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters