个人资料页面学校选择框更改

This commit is contained in:
Wen 2014-04-30 17:47:20 +08:00
parent 3962a9d541
commit c893227609
2 changed files with 32 additions and 15 deletions

View File

@ -108,22 +108,23 @@
<!-- added by Wen -->
<p style="width:357px;padding-left: 26px;">
<p style="padding-left: 26px;">
<% unless User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onclick => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="<%=User.current.user_extensions.school.province%>" readonly />
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<!--<%= select_tag "occupation",
options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>-->
<% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly >
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<% end %>
<!-- <input id="occupation" readonly />-->
</p>
@ -131,6 +132,18 @@
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>
<h2>学校列表</h2>
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
<% @ss.each do |s| %>
<li style="width: 15%; float: left;">
<a style="cursor: pointer;" onclick = "get_options('<%= s.province %>')"><%= s.province %>
</a>
</li>
<% end %>
</ul>
</div>
<hr/>
<div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list">

View File

@ -227,17 +227,15 @@ body {
display: none;
padding-bottom: 2px;
width: 1000px;
height: 500px;
z-index: 100;
left: 50%;
margin-left: -202px;
opacity: 1;
position: fixed;
top: 200px;
overflow: scroll;
}
#WOpenWindow .school_list{
width1000px;
width: 900px;
line-height: 20px;
}
@ -259,6 +257,12 @@ body {
}
#WOpenWindow .content{
width: 1000px;
height: 220px;
overflow: scroll;
}
#WOpenWindow .pcontent{
}