栏目创建类型添加老师、学生类型

hjq_mail
huang 9 years ago
parent 65bcca76c1
commit 878bcc8cf1

@ -148,4 +148,10 @@ module OrganizationsHelper
org_acts org_acts
end end
def org_subfield_had_created?(org, type)
sub_field = org.org_subfields.select{|subfield| subfield.field_type == type}
result = sub_field.length > 0 ? true : false
result
end
end end

@ -118,7 +118,6 @@
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a> <a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
</li> </li>
<% end %> <% end %>
<% else %> <% else %>
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
<% if !field.subfield_subdomain_dir.nil? %> <% if !field.subfield_subdomain_dir.nil? %>

@ -152,10 +152,22 @@
<input type="radio" id="orgMeb" value="Resource" name="field_type" /> <input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label> <label for="orgMeb">资源</label>
</li> </li>
<!--<li class="fl">--> <li class="fl mr15">
<!--<input type="radio" id="orgCom" value="Complex" name="field_type" />--> <input type="radio" id="orgCom" value="Complex" name="field_type" />
<!--<label for="orgMeb">综合</label>--> <label for="orgMeb">综合</label>
<!--</li>--> </li>
<% unless org_subfield_had_created?(@organization, "Comptec") %>
<li class="fl mr15">
<input type="radio" id="orgTec" value="Comptec" name="field_type" />
<label for="orgMeb">教师</label>
</li>
<% end %>
<% unless org_subfield_had_created?(@organization, "Compstu") %>
<li class="fl">
<input type="radio" id="orgStu" value="Compstu" name="field_type" />
<label for="orgMeb">学生</label>
</li>
<% end %>
<li class="fr"><a href="javascript:void(0);" class="saveBtn db" onclick="add_org_subfield();">新增</a></li> <li class="fr"><a href="javascript:void(0);" class="saveBtn db" onclick="add_org_subfield();">新增</a></li>
<li class="cl"></li> <li class="cl"></li>
</ul> </ul>

Loading…
Cancel
Save