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

This commit is contained in:
huang 2016-05-09 14:43:28 +08:00
parent 65bcca76c1
commit 878bcc8cf1
3 changed files with 22 additions and 5 deletions

View File

@ -148,4 +148,10 @@ module OrganizationsHelper
org_acts
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

View File

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

View File

@ -152,10 +152,22 @@
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<!--<li class="fl">-->
<!--<input type="radio" id="orgCom" value="Complex" name="field_type" />-->
<!--<label for="orgMeb">综合</label>-->
<!--</li>-->
<li class="fl mr15">
<input type="radio" id="orgCom" value="Complex" name="field_type" />
<label for="orgMeb">综合</label>
</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="cl"></li>
</ul>