调整实训服务器配置

dev_bj
daiao 5 years ago
parent f8e5a7c89c
commit 4af236dc3e

@ -273,6 +273,10 @@ class Shixun < ActiveRecord::Base
return name
end
def child_mirror_ids
self.mirror_repositories.where(:main_type => 0).pluck(:id)
end
def mirror_name
self.mirror_repositories.map(&:type_name).blank? ? "" : self.mirror_repositories.map(&:type_name)
end

@ -71,7 +71,7 @@
<div class="down-select" id="shixun_small_language_option" style="padding: 2px 0px">
<% @small_type.try(:each) do |type| %>
<p data-shixun-value="<%= type.id %>">
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>"/>
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>" <%= @shixun.child_mirror_ids.include?(type.id) ? "checked" : ""%>/>
<label style="top:0px" for="mirror_<%= type.id %>"><%= type.type_name %></label>
</p>
<% end %>

Loading…
Cancel
Save