-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0607da
commit 2f0cb7c
Showing
14 changed files
with
101 additions
and
44 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 |
---|---|---|
|
@@ -17,3 +17,7 @@ div#html5-player { | |
} | ||
} | ||
} | ||
|
||
#video_create_box { | ||
padding-left: 40px; | ||
} |
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 |
---|---|---|
|
@@ -18,4 +18,3 @@ | |
// Components: Popovers | ||
@import "bootstrap/modals"; | ||
@import "bootstrap/tooltip"; | ||
|
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,5 +1,5 @@ | ||
class Course < ActiveRecord::Base | ||
has_many :comments | ||
has_many :videos | ||
attr_accessible :cat, :description, :name | ||
attr_accessible :cat, :description, :name, :title | ||
end |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<h3><%= t("add_class") %></h3> | ||
<% if course.videos.empty? %> | ||
<% this_video_no = 0 %> | ||
<% else %> | ||
<% this_video_no = course.videos.reorder('no').last.no + 1 %> | ||
<% end %> | ||
|
||
<div id="video_create_box"> | ||
<%= form_for(Video.new(:course_id => course.id)) do |f| %> | ||
<%= f.label t("video_no") %> | ||
<%= f.select :no, ((0..20).map {|i| [i,i] }), :selected => this_video_no %> | ||
(第0课为课程简介,第一课序号为1,以此类推) | ||
<br> | ||
<br> | ||
<%= f.hidden_field :course_id %> | ||
<% if not course.videos.empty? %> | ||
<%= f.label t("video_title") %> | ||
<%= f.text_field :title %> | ||
<br> | ||
<br> | ||
<% end %> | ||
<%= f.label t("video_link") %> | ||
<%= f.text_field :link %> | ||
<br> | ||
<br> | ||
<%= f.submit "#{t('add_this_video')}", :class => "btn btn-success", :id => "comment_btn" %> | ||
<% end %> | ||
</div> |
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
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
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
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,3 +1,21 @@ | ||
<%= div_for videos do %> | ||
<%= link_to videos.title, "/courses/" + videos.course.name + "/" + videos.no.to_s%> | ||
<% end %> | ||
<ul class="nav nav-pills nav-stacked"> | ||
<% videos.each do |video| %> | ||
<% if video.no == current_video.no %> | ||
<li class = "active"> | ||
<% if video.no == 0 %> | ||
<%= link_to t("course_intro")+ " (#{t('playing')})", "/courses/" + video.course.name %> | ||
<% else %> | ||
<%= link_to " 第#{video.no}课: " + video.title + " (#{t('playing')})", "/courses/" + video.course.name + "/" + video.no.to_s %> | ||
<% end %> | ||
</li> | ||
<% else %> | ||
<li> | ||
<% if video.no == 0 %> | ||
<%= link_to t("course_intro"), "/courses/" + video.course.name %> | ||
<% else %> | ||
<%= link_to "第#{video.no}课:" + video.title, "/courses/" + video.course.name + "/" + video.no.to_s %> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% end %> | ||
</ul> |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class DropPeters < ActiveRecord::Migration | ||
def up | ||
drop_table :peters | ||
end | ||
|
||
def down | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddTitleToCourses < ActiveRecord::Migration | ||
def change | ||
add_column :courses, :title, :string | ||
end | ||
end |
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