调整实训服务器配置

dev_bj
daiao 6 years ago
parent f8e5a7c89c
commit 4af236dc3e

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

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

Loading…
Cancel
Save