parent
3c21e8fcba
commit
383483de26
@ -1,2 +1,5 @@
|
||||
module SyllabusesHelper
|
||||
def get_syllabuses_by_tag(tag_name)
|
||||
Syllabus.tagged_with(tag_name).order('updated_at desc')
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,7 @@
|
||||
class Syllabus < ActiveRecord::Base
|
||||
acts_as_taggable
|
||||
|
||||
belongs_to :user
|
||||
has_many :courses
|
||||
attr_accessible :description, :title
|
||||
attr_accessible :description, :title, :eng_name, :type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
end
|
||||
|
@ -0,0 +1,5 @@
|
||||
<div id="tags">
|
||||
<div id="tags_show">
|
||||
<%= render :partial => "tags/tag_syllabus_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,28 @@
|
||||
<% @tags = obj.reload.tag_list %>
|
||||
<% if non_list_all && @tags.size > 0 %>
|
||||
|
||||
<% else %>
|
||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<span class="re_tag f_l " id="tag">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
|
||||
<span class="del">
|
||||
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if obj.user == User.current %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged?%>
|
||||
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
|
||||
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
||||
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
|
||||
<%= f.text_field :name ,:id => "tags_name4",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
|
||||
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
|
||||
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
||||
<input type="button" class="submit f_l" onclick="$('#tags_name4').parent().submit();" />
|
||||
<% end %>
|
||||
</span>
|
||||
<% end%>
|
@ -0,0 +1,12 @@
|
||||
class AddColumnToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :eng_name, :string
|
||||
add_column :syllabuses, :type, :integer
|
||||
add_column :syllabuses, :credit, :integer
|
||||
add_column :syllabuses, :hours, :integer
|
||||
add_column :syllabuses, :theory_hours, :integer
|
||||
add_column :syllabuses, :practice_hours, :integer
|
||||
add_column :syllabuses, :applicable_major, :string
|
||||
add_column :syllabuses, :pre_course, :string
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 16 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue