Files
nairobi/app/views/dashboard/_next_goal.html.erb
Javi Martín 6ea9383743 Allow toggling elements with the keyboard
Using `<a>` tags with no `href` means these elements cannot be activated
by keyboard users, so we're replacing them with buttons.

In the future we probably want to add more consistency so all toggle
buttons use the same code. We might also add styles depending on the
`aria-expanded` property.
2021-03-31 13:38:38 +02:00

30 lines
932 B
Plaintext

<% if next_goal.present? %>
<div id="goals-section" class="goals-section">
<h3 class="title"><%= t("dashboard.next_goal.title") %></h3>
<div id="next_goal" data-toggler=".hide">
<%= render "goal", goal: next_goal %>
<% if course.count > 1 %>
<div class="margin small">
<button type="button" id="see_complete_course_link" data-toggle="complete_course next_goal">
<%= t("dashboard.next_goal.see_complete_course") %>
</button>
</div>
<% end %>
</div>
<% if course.count > 1 %>
<div id="complete_course" class="hide" data-toggler=".hide">
<%= render partial: "goal", collection: course %>
<div class="margin small">
<button type="button" data-toggle="complete_course next_goal">
<%= t("dashboard.next_goal.hide_course") %>
</button>
</div>
</div>
<% end %>
</div>
<% end %>