Skip to content

Commit

Permalink
only add student button when no students, arrow in go back button and…
Browse files Browse the repository at this point in the history
… margin top for invite teacher button
  • Loading branch information
Annelein committed Jun 3, 2024
1 parent 72f9343 commit 59ee581
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions templates/class-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endif %}
<div class="flex flex-col gap-4">
<button class="back-btn" id="go_back_button" data-cy="go_back_button" onclick="window.location.href = '/for-teachers'">
<span class="fa fa-arrow-{% if g.dir == " ltr" %}left{% else %}right{% endif %}">&nbsp;</span>
<span class="fa fa-arrow-{% if g.dir == " ltr" %}right{% else %}left{% endif %}">&nbsp;</span>
{{_('go_back')}}
</button>
<div id="survey" data-cy="survey" class="hidden"></div>
Expand Down Expand Up @@ -93,7 +93,7 @@ <h2>{{ _('teachers')}}</h2>
</div>
{% endif %}
{% if class_info.teacher == username %}
<button class="green-btn w-40" data-cy="add_second_teacher" _="on click call hedyApp.invite_student('{{class_info.id}}', {{_('second_teacher_prompt')|default(None)|tojson}}, '/invite-second-teacher')">{{_('invite_teacher')}}</button>
<button class="green-btn w-40 mt-4" data-cy="add_second_teacher" _="on click call hedyApp.invite_student('{{class_info.id}}', {{_('second_teacher_prompt')|default(None)|tojson}}, '/invite-second-teacher')">{{_('invite_teacher')}}</button>
{% endif %}
{% if invites %}
<div data-cy="invites_block" class="pt-4">
Expand Down
9 changes: 6 additions & 3 deletions templates/customize-grid/partial-grid-levels.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div id="adventure_overview">
{% if class_info.students %}
<div id="level_button" class="dropdown relative mb-4">
<button class="white-btn rounded inline-flex gap-2 text-xl" id="dropdown_level_button"
onclick="$('#level_dropdown').slideToggle('medium');">
Expand Down Expand Up @@ -28,22 +29,23 @@
{% endfor %}
</div>
</div>

{# The actual table that holds the data #}
<div class="w-full overflow-x-auto border rounded-lg">
{{ render_partial('customize-grid/partial-grid-table.html',
class_info=class_info,
level=level,
adventure_table=adventure_table)
}}
{% endif %}
</div>
<button class="green-btn mt-4" data-cy="add_student" _="on click toggle the *display of #add_students_options">{{_('add_students')}}</button>
<div id="add_students_options" class=" flex flex-row gap-2 items-left my-4" style="display: none;">
<button class="green-btn mt-4 w-40" data-cy="add_student" _="on click toggle the *display of #add_students_options">{{_('add_students')}}</button>
<div id="add_students_options" class="flex flex-row gap-2 items-left my-4" style="display: none;">
<button class="green-btn" data-cy="copy_join_link" onclick='hedyApp.copy_join_link("{{class_info.link}}", {{_('copy_link_success')|default(None)|tojson}})'>{{_('copy_join_link')}}</button>
<button class="green-btn" data-cy="invite_student" onclick='hedyApp.invite_student("{{class_info.id}}", {{_('invite_prompt')|default(None)|tojson}})'>{{_('invite_by_username')}}</button>
<button class="green-btn" data-cy="create_accounts" onclick="window.open('/for-teachers/create-accounts/{{ class_info.id }}', '_self')">{{_('create_accounts')}}</button>
</div>
<div class="mt-4">
{% if class_info.students %}
<h2>
{{_('class_performance_graph')}}
<button type="button" _="on click toggle .hidden on #explanation">
Expand All @@ -60,5 +62,6 @@ <h2>
<div id="graph" class="w-2/3 relative h-[32rem]"><canvas data-graph='{{ adventure_table["graph_options"]|tojson|safe }}' id="adventure_bubble"></canvas></div>
<div class="w-1/3 overflow-auto hidden" style="height: 32rem;" id="programs_container"></div>
</div>
{% endif %}
</div>
</div>

0 comments on commit 59ee581

Please sign in to comment.