canvas-lms/app/views/layouts/_fixed_bottom.html.erb

50 lines
2.8 KiB
Plaintext

<div id="fixed_bottom">
<% if @fixed_warnings.present? %>
<% @fixed_warnings.each_with_index do |warning, index| %>
<div id="element_toggler_<%= index %>" class="element_toggler fixed_warning" role="button" aria-controls="element_toggler_<%= index %>" tabindex="0">
<i class=<%= "icon-#{warning[:icon]}" %>></i>
<b><%= warning[:title] %></b>
<div style="float: right;"><%= warning[:message] %></div>
</div>
<% end %>
<% end %>
<% if @real_current_user && @real_current_user != @current_user %>
<% if @current_user.fake_student? %>
<div id="masquerade_bar" class="ic-fixed-bottom-alert">
<% student_view_course = @current_user.all_courses.first %>
<div class="ic-fixed-bottom-module ic-fixed-bottom-module--header">
<div class="ic-image-text-combo">
<i class="icon-student-view"></i>
<div class="ic-image-text-combo__text"><%= t('student_view.warning_title', "You are currently logged into Student View") %></div>
</div>
</div>
<div class="button-explanation ic-fixed-bottom-module ic-fixed-bottom-module--description">
<%= t('student_view.reset_explanation', "Resetting the test student will clear all history for this student, allowing you to view the course as a brand new student.") %>
</div>
<div class="buttons ic-fixed-bottom-module ic-fixed-bottom-module--buttons">
<%= link_to t('student_view.reset', "Reset Student"), course_test_student_path(student_view_course), 'data-method' => :delete, :rel => 'nofollow', :class => 'Button Button--small reset_test_student'%>
<%= link_to t('student_view.leave', "Leave Student View"), course_student_view_path(student_view_course), 'data-method' => :delete, :rel => 'nofollow', :class => 'Button Button--small Button--primary leave_student_view'%>
</div>
</div>
<% else %>
<div id="masquerade_bar" class="ic-fixed-bottom-alert">
<div class="ic-fixed-bottom-module ic-fixed-bottom-module--header">
<div class="ic-image-text-combo">
<% if service_enabled?(:avatars) %>
<div class="masquerading_avatar">
<%= avatar(@current_user, url: nil) %>
</div>
<% end %>
<div class="ic-image-text-combo__text">
<%= t('masquerading.warning_title', "You are currently masquerading as %{user_name}", :user_name => @current_user.short_name) %>
</div>
</div>
</div>
<div class="buttons ic-fixed-bottom-module ic-fixed-bottom-module--buttons">
<%= link_to t('masquerading.stop', "Stop Masquerading"), user_masquerade_url(@real_current_user.id), 'data-method' => :post, :rel => 'nofollow', :class => 'Button Button--primary stop_masquerading' %>
</div>
</div>
<% end %>
<% end %>
</div>