parent
41fdc61fec
commit
436569c88d
|
@ -152,7 +152,8 @@ class AccountController < ApplicationController
|
||||||
unless @user.id.nil?
|
unless @user.id.nil?
|
||||||
ue = UserExtensions.create(:identity => params[:identity].to_i,:technical_title => params[:technical_title], :gender => params[:gender].to_i, :user_id => @user.id, :student_id => params[:no])
|
ue = UserExtensions.create(:identity => params[:identity].to_i,:technical_title => params[:technical_title], :gender => params[:gender].to_i, :user_id => @user.id, :student_id => params[:no])
|
||||||
unless params[:province].nil? || params[:city].nil?
|
unless params[:province].nil? || params[:city].nil?
|
||||||
ue.location = params[:province]+params[:city]
|
ue.location = params[:province]
|
||||||
|
ue.location_city = params[:city]
|
||||||
ue.save
|
ue.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -81,10 +81,15 @@ class MyController < ApplicationController
|
||||||
if @user.user_extensions.nil?
|
if @user.user_extensions.nil?
|
||||||
se = UserExtensions.new
|
se = UserExtensions.new
|
||||||
se.user_id = @user.id
|
se.user_id = @user.id
|
||||||
|
if params[:occupation]
|
||||||
se.occupation = params[:occupation]
|
se.occupation = params[:occupation]
|
||||||
|
end
|
||||||
|
|
||||||
se.gender = params[:gender]
|
se.gender = params[:gender]
|
||||||
|
|
||||||
if params[:province] && params[:city]
|
if params[:province] && params[:city]
|
||||||
se.location = params[:province]+params[:city]
|
se.location = params[:province]
|
||||||
|
se.location_city = params[:city]
|
||||||
end
|
end
|
||||||
if params[:identity]
|
if params[:identity]
|
||||||
se.identity = params[:identity].to_i
|
se.identity = params[:identity].to_i
|
||||||
|
@ -98,11 +103,17 @@ class MyController < ApplicationController
|
||||||
se.save
|
se.save
|
||||||
else
|
else
|
||||||
se = @user.user_extensions
|
se = @user.user_extensions
|
||||||
|
if params[:occupation]
|
||||||
se.occupation = params[:occupation]
|
se.occupation = params[:occupation]
|
||||||
se.gender = params[:gender]
|
|
||||||
if params[:province] && params[:city]
|
|
||||||
se.location = params[:province]+params[:city]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
se.gender = params[:gender]
|
||||||
|
|
||||||
|
if params[:province] && params[:city]
|
||||||
|
se.location = params[:province]
|
||||||
|
se.location_city = params[:city]
|
||||||
|
end
|
||||||
|
|
||||||
if params[:identity]
|
if params[:identity]
|
||||||
se.identity= params[:identity].to_i
|
se.identity= params[:identity].to_i
|
||||||
end
|
end
|
||||||
|
|
|
@ -271,19 +271,38 @@ function init_province_and_city(pField, province, cField, city) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function init_identity_and_title(pField, identity, cField, title) {
|
||||||
|
for(var i = 0; i < pField.options.length; i++) {
|
||||||
|
if (pField.options[i].value==identity)
|
||||||
|
{
|
||||||
|
pField.selectedIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showtechnical_title(identity, cField);
|
||||||
|
for(var i = 0; i < cField.options.length; i++) {
|
||||||
|
if (cField.options[i].value==title)
|
||||||
|
{
|
||||||
|
cField.selectedIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<% province = User.current.user_extensions.location %>
|
||||||
|
<% city = User.current.user_extensions.location_city %>
|
||||||
|
<% identity = User.current.user_extensions.identity %>
|
||||||
|
<% title = User.current.user_extensions.technical_title %>
|
||||||
|
<script type="text/javascript" language="javascript">
|
||||||
|
$().ready(function(){
|
||||||
|
var province = "<%= "#{province}" %>"
|
||||||
|
var city = "<%= "#{city}" %>"
|
||||||
|
init_province_and_city(document.getElementById('userProvince'),province, document.getElementById('userCity'),city);
|
||||||
|
var identity = "<%= "#{identity}" %>"
|
||||||
|
var title = "<%= "#{title}" %>"
|
||||||
|
init_identity_and_title(document.getElementById('userIdentity'),identity, document.getElementById('userTechnical_title'),title);
|
||||||
|
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- <script type="text/javascript">
|
|
||||||
$().ready(funtion(){
|
|
||||||
init_province_and_ city(document.getElementById('userProvince'),'湖南', document.getElementById('userCity'),'长沙');
|
|
||||||
$("input[type='checkbox']").click( function (){
|
|
||||||
if($(this).is(':checked'))
|
|
||||||
$(this).next("label").addClass("SELECTED");
|
|
||||||
else
|
|
||||||
$(this).next("label").removeClass("SELECTED");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script> -->
|
|
||||||
<p style="width:400px;padding-left: 26px;"><%= l(:label_location) %>
|
<p style="width:400px;padding-left: 26px;"><%= l(:label_location) %>
|
||||||
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
|
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
|
||||||
<option value="">--请选择省份--</option>
|
<option value="">--请选择省份--</option>
|
||||||
|
@ -386,7 +405,16 @@ $().ready(funtion(){
|
||||||
<span id = 'technical_title' style = 'display:none'>
|
<span id = 'technical_title' style = 'display:none'>
|
||||||
<select name="technical_title" id="userTechnical_title"></select></span>
|
<select name="technical_title" id="userTechnical_title"></select></span>
|
||||||
<span id = 'no' style = 'display:none'>
|
<span id = 'no' style = 'display:none'>
|
||||||
<input name="no" id="no" placeholder="请输入学号"></span>
|
|
||||||
|
<!-- modified by fq -->
|
||||||
|
<% unless User.current.user_extensions.student_id.nil? %>
|
||||||
|
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %></span>
|
||||||
|
<!-- <input name="no" id="no" value=<%= "#{User.current.user_extensions.student_id}" %> placeholder="请输入学号"></span> -->
|
||||||
|
<% else %>
|
||||||
|
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
|
||||||
|
<!-- <input name="no" id="no" placeholder="请输入学号"></span> -->
|
||||||
|
<% end %>
|
||||||
|
<!-- end -->
|
||||||
</td></tr></table></p>
|
</td></tr></table></p>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,12 +15,12 @@ production:
|
||||||
|
|
||||||
development:
|
development:
|
||||||
adapter: mysql2
|
adapter: mysql2
|
||||||
database: tr
|
database: bitnami_redmine
|
||||||
host: localhost
|
host: 10.0.47.245
|
||||||
#socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock
|
#socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock
|
||||||
port: 3306
|
port: 3306
|
||||||
username: root
|
username: root
|
||||||
password: "1234"
|
password: "bitnami"
|
||||||
encoding: utf8
|
encoding: utf8
|
||||||
|
|
||||||
# Warning: The database defined as "test" will be erased and
|
# Warning: The database defined as "test" will be erased and
|
||||||
|
|
85
db/schema.rb
85
db/schema.rb
|
@ -11,7 +11,15 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20130922123849) do
|
ActiveRecord::Schema.define(:version => 20130925031313) do
|
||||||
|
|
||||||
|
create_table "a_user_watchers", :force => true do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.text "description"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "member_id"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -69,6 +77,7 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.string "reward"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bids", :force => true do |t|
|
create_table "bids", :force => true do |t|
|
||||||
|
@ -277,7 +286,7 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
create_table "issue_relations", :force => true do |t|
|
create_table "issue_relations", :force => true do |t|
|
||||||
t.integer "issue_from_id", :null => false
|
t.integer "issue_from_id", :null => false
|
||||||
t.integer "issue_to_id", :null => false
|
t.integer "issue_to_id", :null => false
|
||||||
t.string "relation_type", :default => "", :null => false
|
t.string "relation_type", :null => false
|
||||||
t.integer "delay"
|
t.integer "delay"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -419,6 +428,22 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
|
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
|
||||||
add_index "messages", ["parent_id"], :name => "messages_parent_id"
|
add_index "messages", ["parent_id"], :name => "messages_parent_id"
|
||||||
|
|
||||||
|
create_table "messages_for_bids", :force => true do |t|
|
||||||
|
t.string "message"
|
||||||
|
t.integer "user_id"
|
||||||
|
t.integer "bid_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "messages_for_users", :force => true do |t|
|
||||||
|
t.integer "messager_id"
|
||||||
|
t.integer "user_id"
|
||||||
|
t.string "message"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "news", :force => true do |t|
|
create_table "news", :force => true do |t|
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
t.string "title", :limit => 60, :default => "", :null => false
|
t.string "title", :limit => 60, :default => "", :null => false
|
||||||
|
@ -479,6 +504,18 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count"
|
||||||
|
add_index "project_statuses", ["watchers_count"], :name => "index_project_statuses_on_watchers_count"
|
||||||
|
|
||||||
|
create_table "project_tags", :force => true do |t|
|
||||||
|
t.integer "project_id"
|
||||||
|
t.integer "tag_id"
|
||||||
|
t.string "description"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "user_id"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "projects", :force => true do |t|
|
create_table "projects", :force => true do |t|
|
||||||
t.string "name", :default => "", :null => false
|
t.string "name", :default => "", :null => false
|
||||||
t.text "description"
|
t.text "description"
|
||||||
|
@ -546,26 +583,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
t.string "issues_visibility", :limit => 30, :default => "default", :null => false
|
t.string "issues_visibility", :limit => 30, :default => "default", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "seems_rateable_cached_ratings", :force => true do |t|
|
|
||||||
t.integer "cacheable_id", :limit => 8
|
|
||||||
t.string "cacheable_type"
|
|
||||||
t.float "avg", :null => false
|
|
||||||
t.integer "cnt", :null => false
|
|
||||||
t.string "dimension"
|
|
||||||
t.datetime "created_at", :null => false
|
|
||||||
t.datetime "updated_at", :null => false
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "seems_rateable_rates", :force => true do |t|
|
|
||||||
t.integer "rater_id", :limit => 8
|
|
||||||
t.integer "rateable_id"
|
|
||||||
t.string "rateable_type"
|
|
||||||
t.float "stars", :null => false
|
|
||||||
t.string "dimension"
|
|
||||||
t.datetime "created_at", :null => false
|
|
||||||
t.datetime "updated_at", :null => false
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "settings", :force => true do |t|
|
create_table "settings", :force => true do |t|
|
||||||
t.string "name", :default => "", :null => false
|
t.string "name", :default => "", :null => false
|
||||||
t.text "value"
|
t.text "value"
|
||||||
|
@ -576,13 +593,20 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
|
|
||||||
create_table "shares", :force => true do |t|
|
create_table "shares", :force => true do |t|
|
||||||
t.date "created_on"
|
t.date "created_on"
|
||||||
t.string "url"
|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
t.integer "share_type"
|
t.string "share_type"
|
||||||
|
t.string "url"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
t.string "description"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "students", :force => true do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "students_for_courses", :force => true do |t|
|
create_table "students_for_courses", :force => true do |t|
|
||||||
|
@ -643,7 +667,7 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
create_table "tokens", :force => true do |t|
|
create_table "tokens", :force => true do |t|
|
||||||
t.integer "user_id", :default => 0, :null => false
|
t.integer "user_id", :default => 0, :null => false
|
||||||
t.string "action", :limit => 30, :default => "", :null => false
|
t.string "action", :limit => 30, :default => "", :null => false
|
||||||
t.string "value", :limit => 40, :default => "", :null => false
|
t.string "value", :limit => 40
|
||||||
t.datetime "created_on", :null => false
|
t.datetime "created_on", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -669,11 +693,12 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
t.integer "zip_code"
|
t.integer "zip_code"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.string "technical_title"
|
|
||||||
t.integer "identity"
|
t.integer "identity"
|
||||||
|
t.string "technical_title"
|
||||||
t.integer "student_id"
|
t.integer "student_id"
|
||||||
t.string "teacher_realname"
|
t.string "teacher_realname"
|
||||||
t.string "student_realname"
|
t.string "student_realname"
|
||||||
|
t.string "location_city"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "user_preferences", :force => true do |t|
|
create_table "user_preferences", :force => true do |t|
|
||||||
|
@ -696,6 +721,14 @@ ActiveRecord::Schema.define(:version => 20130922123849) do
|
||||||
add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count"
|
add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count"
|
||||||
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
|
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
|
||||||
|
|
||||||
|
create_table "user_tags", :force => true do |t|
|
||||||
|
t.integer "user_id"
|
||||||
|
t.integer "tag_id"
|
||||||
|
t.string "description"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "users", :force => true do |t|
|
create_table "users", :force => true do |t|
|
||||||
t.string "login", :default => "", :null => false
|
t.string "login", :default => "", :null => false
|
||||||
t.string "hashed_password", :limit => 40, :default => "", :null => false
|
t.string "hashed_password", :limit => 40, :default => "", :null => false
|
||||||
|
|
Loading…
Reference in New Issue