Merge remote-tracking branch 'origin/szzh' into guange_homework
This commit is contained in:
commit
8ab08ea30f
|
@ -259,7 +259,7 @@ class ProjectsController < ApplicationController
|
||||||
# Author lizanle
|
# Author lizanle
|
||||||
# Description 项目动态展示方法,删除了不必要的代码
|
# Description 项目动态展示方法,删除了不必要的代码
|
||||||
def show
|
def show
|
||||||
|
update_invite_message(User.current, @project)
|
||||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -464,6 +464,8 @@ class ProjectsController < ApplicationController
|
||||||
# by young
|
# by young
|
||||||
# include CoursesHelper
|
# include CoursesHelper
|
||||||
def member
|
def member
|
||||||
|
# 更新消息状态
|
||||||
|
update_invite_message(User.current, @project)
|
||||||
# 消息"同意加入项目"
|
# 消息"同意加入项目"
|
||||||
if params[:message_id]
|
if params[:message_id]
|
||||||
message_invite(params[:message_id], params[:key])
|
message_invite(params[:message_id], params[:key])
|
||||||
|
@ -523,6 +525,13 @@ class ProjectsController < ApplicationController
|
||||||
@members = paginateHelper @members
|
@members = paginateHelper @members
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_invite_message(user, project)
|
||||||
|
forge_invite_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =?", user, project, "ProjectInvite")
|
||||||
|
forge_invite_messages.each do |forge_invite_messages|
|
||||||
|
forge_invite_messages.update_attribute(:viewed, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def message_invite(message_id, key)
|
def message_invite(message_id, key)
|
||||||
forge_message = ForgeMessage.find(message_id)
|
forge_message = ForgeMessage.find(message_id)
|
||||||
if key == forge_message.secret_key
|
if key == forge_message.secret_key
|
||||||
|
|
|
@ -78,11 +78,7 @@
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
|
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<% if homework.homework_detail_programing.language.to_i == 1%>
|
<%= homework.language_name%>
|
||||||
C
|
|
||||||
<% elsif homework.homework_detail_programing.language.to_i == 2%>
|
|
||||||
C++
|
|
||||||
<% end%>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -36,11 +36,7 @@
|
||||||
<% if activity.homework_type == 2%>
|
<% if activity.homework_type == 2%>
|
||||||
<div class="homepagePostDeadline mr15">
|
<div class="homepagePostDeadline mr15">
|
||||||
语言:
|
语言:
|
||||||
<% if activity.homework_detail_programing.language.to_i == 1%>
|
<%= activity.language_name%>
|
||||||
C
|
|
||||||
<% elsif activity.homework_detail_programing.language.to_i == 2%>
|
|
||||||
C++
|
|
||||||
<% end%>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -34,11 +34,7 @@
|
||||||
<% if homework_common.homework_type == 2%>
|
<% if homework_common.homework_type == 2%>
|
||||||
<div class="homepagePostDeadline mr15">
|
<div class="homepagePostDeadline mr15">
|
||||||
语言:
|
语言:
|
||||||
<% if homework_common.homework_detail_programing.language.to_i == 1%>
|
<%= homework_common.language_name%>
|
||||||
C
|
|
||||||
<% elsif homework_common.homework_detail_programing.language.to_i == 2%>
|
|
||||||
C++
|
|
||||||
<% end%>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline">
|
||||||
|
|
|
@ -364,7 +364,11 @@
|
||||||
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
|
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">邀请你加入项目:</span>
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">邀请你加入项目:</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="homepageHomeworkContent fl">
|
<% if ma.user.member_of?(ma.project) %>
|
||||||
|
<li class="homepageNewsContent fl">
|
||||||
|
<% else %>
|
||||||
|
<li class="homepageHomeworkContent fl">
|
||||||
|
<% end %>
|
||||||
<%= link_to ma.project, project_path(ma.project),
|
<%= link_to ma.project, project_path(ma.project),
|
||||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
:onmouseover => "message_titile_show($(this),event)",
|
:onmouseover => "message_titile_show($(this),event)",
|
||||||
|
@ -373,7 +377,7 @@
|
||||||
<div style="display: none" class="message_title_red system_message_style">
|
<div style="display: none" class="message_title_red system_message_style">
|
||||||
<%= ma.project %>
|
<%= ma.project %>
|
||||||
</div>
|
</div>
|
||||||
<% if User.current == @user %>
|
<% unless ma.user.member_of?(ma.project) %>
|
||||||
<li class="homepageHomeworkContentWarn fl">
|
<li class="homepageHomeworkContentWarn fl">
|
||||||
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
||||||
:value => ma.secret_key,
|
:value => ma.secret_key,
|
||||||
|
|
17
db/schema.rb
17
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# 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 => 20150918005722) do
|
ActiveRecord::Schema.define(:version => 20150918134804) do
|
||||||
|
|
||||||
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
|
||||||
|
@ -572,6 +572,7 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
|
||||||
t.integer "viewed"
|
t.integer "viewed"
|
||||||
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 "secret_key"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "forums", :force => true do |t|
|
create_table "forums", :force => true do |t|
|
||||||
|
@ -683,6 +684,7 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
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 "mail"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "issue_categories", :force => true do |t|
|
create_table "issue_categories", :force => true do |t|
|
||||||
|
@ -1304,9 +1306,9 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
|
||||||
|
|
||||||
create_table "student_work_tests", :force => true do |t|
|
create_table "student_work_tests", :force => true do |t|
|
||||||
t.integer "student_work_id"
|
t.integer "student_work_id"
|
||||||
t.integer "status"
|
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 "status", :default => 9
|
||||||
t.text "results"
|
t.text "results"
|
||||||
t.text "src"
|
t.text "src"
|
||||||
end
|
end
|
||||||
|
@ -1359,8 +1361,10 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
|
||||||
create_table "system_messages", :force => true do |t|
|
create_table "system_messages", :force => true do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.string "content"
|
t.string "content"
|
||||||
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.text "description"
|
||||||
|
t.string "subject"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "taggings", :force => true do |t|
|
create_table "taggings", :force => true do |t|
|
||||||
|
@ -1552,7 +1556,6 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
|
||||||
t.string "identity_url"
|
t.string "identity_url"
|
||||||
t.string "mail_notification", :default => "", :null => false
|
t.string "mail_notification", :default => "", :null => false
|
||||||
t.string "salt", :limit => 64
|
t.string "salt", :limit => 64
|
||||||
t.integer "gid"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
||||||
|
|
|
@ -146,7 +146,14 @@ $(function(){
|
||||||
test_numbers += 1;
|
test_numbers += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
var language = $('select.language_type').val() == 1 ? 'C语言' : 'C++语言';
|
var language = '';
|
||||||
|
if($('select.language_type').val() == 1){
|
||||||
|
language = 'C';
|
||||||
|
}else if($('select.language_type').val() == 2){
|
||||||
|
language = 'C++';
|
||||||
|
}else if($('select.language_type').val() == 3){
|
||||||
|
language = 'Python';
|
||||||
|
}
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
$("input[name=homework_type]").val(2);
|
$("input[name=homework_type]").val(2);
|
||||||
|
|
Loading…
Reference in New Issue