Merge branch 'develop' into dev_shcool

This commit is contained in:
daiao 2016-08-01 19:55:40 +08:00
commit 7d7c8bcd8c
7 changed files with 35 additions and 11 deletions

View File

@ -53,7 +53,7 @@ gem 'elasticsearch-rails'
gem "test-unit", "~>3.0"
### profile
# gem 'oneapm_rpm'
gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'

View File

@ -677,7 +677,9 @@ class AdminController < ApplicationController
users.each do |user|
user.update_column("school_id", school[0].id)
end
if aas.school_id != school[0].id.to_i
aas.school.destroy
end
aas.update_attribute(:school_id, school[0].id)
rescue Exception => e
puts e
@ -689,7 +691,7 @@ class AdminController < ApplicationController
# 单位审核:更改功能搜索合法学校弹框
def all_schools
apply_schools = ApplyAddSchools.where("status != 1")
apply_schools = ApplyAddSchools.where("status = 0")
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"

View File

@ -59,6 +59,8 @@ class AppliedProjectController < ApplicationController
@flag = 2
elsif params[:member].nil?
@flag = 3
elsif !AppliedProject.where(:project_id => @project.id, :user_id => User.current.id).first.nil?
@flag = 5
else
@flag = 4
role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5)

View File

@ -55,7 +55,7 @@
</td>
<td class="name" title='<%=apply.name%>' >
<span id="apply_title_<%= apply.id %>"><%= apply.name %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.name %></textarea>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"></textarea>
</td>
<td class="center">
<% user = User.where("id=?", apply.user_id).first %>

View File

@ -60,7 +60,7 @@
<% unless apply.school_id.nil? %>
<% school_name = School.where("id=?", apply.school_id).first %>
<span title="双击可编辑" ondblclick = "show_edit_school_name('<%= apply.id %>');" id="apply_title_<%= apply.id %>"><%= school_name.name %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"><%= school_name.name %></textarea>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"></textarea>
<% end %>
</td>
<td class="center">

View File

@ -15,6 +15,8 @@
<p>请选择一个角色</p>
<% elsif @flag == 4 %>
<p>您的申请已提交,请等待项目管理员审批</p>
<% elsif @flag == 5 %>
<p>您已经申请加入该项目了,请耐心等待</p>
<% end %>
</li>
<li>

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160725091759) do
ActiveRecord::Schema.define(:version => 20160729124833) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -52,9 +52,24 @@ ActiveRecord::Schema.define(:version => 20160725091759) do
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
create_table "applied_messages", :force => true do |t|
t.integer "user_id"
t.integer "applied_id"
t.string "applied_type"
t.integer "viewed", :default => 0
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "name"
t.integer "applied_user_id"
t.integer "role"
t.integer "project_id"
end
create_table "applied_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
t.integer "role", :default => 0
end
create_table "apply_add_schools", :force => true do |t|
@ -1109,6 +1124,7 @@ ActiveRecord::Schema.define(:version => 20160725091759) do
t.integer "member_id", :null => false
t.integer "role_id", :null => false
t.integer "inherited_from"
t.integer "is_current", :default => 1
end
add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
@ -1539,6 +1555,8 @@ ActiveRecord::Schema.define(:version => 20160725091759) do
t.integer "boards_reply_count", :default => 0
t.integer "visits", :default => 0
t.integer "hot", :default => 0
t.string "invite_code"
t.string "qrcode"
end
add_index "projects", ["lft"], :name => "index_projects_on_lft"