find-classroom/app/views/homes/index.html.erb

82 lines
2.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- 轮播Carousel项目 -->
<div class="carousel-inner">
<div class="item active">
<%= link_to detail_course_path(@course_play_first) do %>
<%= image_tag @course_play_first.avatar_url(:thumb) if !@course_play_first.avatar.blank? %>
<%= image_tag "fallback/default.jpg" if @course_play_first.avatar.blank? %>
<div class="carousel-caption"><%= @course_play_first.name %></div>
<% end %>
</div>
<% @course_play.each do |play| %>
<div class="item" >
<%= link_to detail_course_path(play) do %>
<%= image_tag play.avatar_url(:thumb) if !play.avatar.blank? %>
<%= image_tag "fallback/default.jpg" if play.avatar.blank? %>
<div class="carousel-caption"><%= play.name %></div>
<% end %>
</div>
<% end %>
</div>
<!-- 轮播Carousel导航 -->
<a class="carousel-control left" href="#myCarousel"
data-slide="prev">&lsaquo;
</a>
<a class="carousel-control right" href="#myCarousel"
data-slide="next">&rsaquo;
</a>
</div>
<hr>
<div class="container">
<div class="col-sm-12">
<div class="panel">
<div class="panel-body" style="min-height: 450px">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>讲座编号</th>
<th>讲座名称</th>
<th>讲座时间</th>
<th>教室地点</th>
<th>主讲人</th>
</tr>
</thead>
<tbody>
<% @course.each do |course| %>
<tr>
<td><%= course.course_code %></td>
<td><%= link_to course.name, detail_course_path(course), class: 'btn-sm' %></td>
<td><%= course.course_time%></td>
<td><%= course.class_room %></td>
<td><%= course.teacher.name %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>