Merge remote-tracking branch 'remotes/origin/szzh' into develop
This commit is contained in:
commit
164d4f9e78
|
@ -33,7 +33,7 @@ class WelcomeController < ApplicationController
|
||||||
if params[:school_id]
|
if params[:school_id]
|
||||||
@school_id = params[:school_id]
|
@school_id = params[:school_id]
|
||||||
elsif User.current.logged? && User.current.user_extensions.school
|
elsif User.current.logged? && User.current.user_extensions.school
|
||||||
@school_id = User.current.user_extensions.school.id
|
@school_id = User.current.user_extensions.school.try(:id)
|
||||||
end
|
end
|
||||||
@logoLink ||= logolink()
|
@logoLink ||= logolink()
|
||||||
end
|
end
|
||||||
|
|
|
@ -247,4 +247,15 @@ module UsersHelper
|
||||||
displayed_flag = %w|index|
|
displayed_flag = %w|index|
|
||||||
!displayed_flag.include?(params['action'])
|
!displayed_flag.include?(params['action'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#获取指定用户的未过期的课程列表
|
||||||
|
def user_courses_list user
|
||||||
|
result = []
|
||||||
|
user.coursememberships.map(&:course).each do |course|
|
||||||
|
if !course_endTime_timeout?(course)
|
||||||
|
result << course
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -274,4 +274,7 @@ class Course < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
class CourseStatus < ActiveRecord::Base
|
class CourseStatus < ActiveRecord::Base
|
||||||
attr_accessible :changesets_count, :course_ac_para, :course_id, :grade, :watchers_count
|
attr_accessible :changesets_count, :course_ac_para, :course_id, :grade, :watchers_count
|
||||||
|
|
||||||
|
belongs_to :course
|
||||||
|
validates_presence_of :course_id
|
||||||
|
validates_uniqueness_of :course_id
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
|
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
|
||||||
<%# 提交作业按钮 %>
|
<%# 提交作业按钮 %>
|
||||||
<!--<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@course) %>-->
|
<!--<%#= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@course) %>-->
|
||||||
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||||
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
|
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
|
||||||
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
|
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
|
||||||
|
@ -41,19 +41,19 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><span class="font_lighter">
|
<td colspan="2"><span class="font_lighter">
|
||||||
<% @bidding_project = bid.biding_projects.all
|
<% bidding_project = bid.biding_projects.all
|
||||||
@temp = []
|
temp = []
|
||||||
@bidding_project.each do |pro|
|
bidding_project.each do |pro|
|
||||||
if pro.project && pro.project.project_status
|
if pro.project && pro.project.project_status
|
||||||
@temp << pro
|
temp << pro
|
||||||
end
|
end
|
||||||
@temp
|
temp
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<% if bid.homework_type == 1%>
|
<% if bid.homework_type == 1%>
|
||||||
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %></strong>)
|
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %></strong>)
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, course_for_bid_path(bid.id) %></strong>)
|
<%= l(:label_x_homework_project, :count => temp.count) %>(<strong><%= link_to temp.count, course_for_bid_path(bid.id) %></strong>)
|
||||||
<% end %></span>
|
<% end %></span>
|
||||||
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
|
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'"><%= bid.budget%></span></strong>
|
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'"><%= bid.budget%></span></strong>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
|
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> --></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580px" ><span class="font_description">
|
<td colspan="2" width="580px" ><span class="font_description">
|
||||||
|
|
|
@ -13,7 +13,34 @@
|
||||||
<td width="500">
|
<td width="500">
|
||||||
<table border="0">
|
<table border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td> <% if bid.reward_type.nil? or bid.reward_type == 1%> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2%> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
|
<td>
|
||||||
|
<% if bid.reward_type.nil? or bid.reward_type == 1%>
|
||||||
|
<strong>
|
||||||
|
<%= l(:label_bids_reward_method) %>
|
||||||
|
<span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'">
|
||||||
|
<%= l(:label_call_bonus) %>
|
||||||
|
<%= l(:label_RMB_sign) %>
|
||||||
|
<%= bid.budget%>
|
||||||
|
</span>
|
||||||
|
</strong>
|
||||||
|
<% elsif bid.reward_type == 2%>
|
||||||
|
<strong>
|
||||||
|
<%= l(:label_bids_reward_method) %>
|
||||||
|
<span style="color: #15bccf;font-family: 14px; font-family: '微软雅黑'"><%= bid.budget%></span>
|
||||||
|
</strong>
|
||||||
|
<% else %> <!-- <strong>
|
||||||
|
<%#= l(:label_bids_reward_method) %>
|
||||||
|
<span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑">
|
||||||
|
<%#= l(:label_bids_credit) %>
|
||||||
|
<%#= bid.budget%>
|
||||||
|
<%#= l(:label_bids_credit_number) %>
|
||||||
|
</span></strong> -->
|
||||||
|
<% end %>
|
||||||
|
<!-- <td style="color: rgb(255, 0, 0);">
|
||||||
|
<strong>
|
||||||
|
<%#= l(:label_price) %>
|
||||||
|
<%#= l(:label_RMB_sign) %>
|
||||||
|
<%#= bid.budget%></strong></td> --></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% if bid.reward_type == 3 %>
|
<% if bid.reward_type == 3 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -60,6 +87,6 @@
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<ul>
|
<ul>
|
||||||
<%= pagination_links_full bid_pages %>
|
<%= pagination_links_full bid_pages %>
|
||||||
<ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,13 @@
|
||||||
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
|
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
|
||||||
<ul style="margin-right:0px">
|
<ul style="margin-right:0px">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %>
|
<%#= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_sort_by_active), calls_path(:bid_sort_type => '1') %>
|
<%#= link_to l(:label_sort_by_active), calls_path(:bid_sort_type => '1') %>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li>
|
<!-- <li>
|
||||||
<%= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
|
<%#= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
|
||||||
</li> -->
|
</li> -->
|
||||||
<!-- </ul>
|
<!-- </ul>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<%= link_to "全部学校",school_index_path %>
|
<%= link_to "全部学校",school_index_path %>
|
||||||
<%= link_to '我的学校',school_course_list_path(User.current.user_extensions.school) %>
|
<%= link_to '我的学校',school_course_list_path(User.current.user_extensions.school) if User.current.logged? %>
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li style="width: 40%; float: left">请选择省份:
|
<li style="width: 40%; float: left">请选择省份:
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<!-- modified by bai -->
|
<!-- modified by bai -->
|
||||||
<div style="position:relative;float:left;margin-top:-2px;margin-left: 160px">
|
<div style="position:relative;float:left;margin-top:-2px;margin-left: 160px">
|
||||||
<%= l(:label_user_grade) %>: <span style="color:#ec6300">
|
<span style="color:#ec6300">
|
||||||
<%= render :partial => 'users/user_score', :locals => {:user => user}%></span>
|
<%= render :partial => 'users/user_score', :locals => {:user => user}%></span>
|
||||||
</div>
|
</div>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
@ -61,14 +61,17 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<% unless user.memberships.empty? %>
|
<%# unless user.memberships.empty? %>
|
||||||
<% cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
|
<%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
|
||||||
<% memberships = user.memberships.all(:conditions => cond) %>
|
<%# memberships = user.memberships.all(:conditions => cond) %>
|
||||||
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
|
<% user_courses = user.coursememberships.map(&:course) %>
|
||||||
<% for member in memberships %>
|
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
|
||||||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
<% for course in user_courses %>
|
||||||
<% end %>
|
<%# if course.name != nil %>
|
||||||
|
<%= link_to course.name,course_path(course) %><%= (user_courses.last == course) ? '' : ',' %>
|
||||||
|
<%# end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%# end %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
|
<%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
|
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
|
||||||
<ul style="margin-right:0px">
|
<ul style="margin-right:0px">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_sort_by_time), users_path(:user_sort_type => '0') %>
|
<%#= link_to l(:label_sort_by_time), users_path(:user_sort_type => '0') %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_sort_by_active), users_path(:user_sort_type => '1') %>
|
<%#= link_to l(:label_sort_by_active), users_path(:user_sort_type => '1') %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_sort_by_influence), users_path(:user_sort_type => '2') %>
|
<%#= link_to l(:label_sort_by_influence), users_path(:user_sort_type => '2') %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<table width="580" border="0" class="info-break">
|
<table width="580" border="0" class="info-break">
|
||||||
<% case e.act_type %>
|
<% case e.act_type %>
|
||||||
<% when 'JournalsForMessage' %>
|
<% when 'JournalsForMessage' %>
|
||||||
<% if User.current.login == @user.login %>
|
<% if User.current.login == e.user.try(:login) %>
|
||||||
<%# if e.user_id == act.jour.id %>
|
<%# if e.user_id == act.jour.id %>
|
||||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %><%=
|
<tr><td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_have_feedback) %><%=
|
||||||
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span></td></tr>
|
||||||
|
|
|
@ -31,7 +31,7 @@ class StoredCourseProcedure < ActiveRecord::Migration
|
||||||
courseStatus.watchers_count = projectstatus.watchers_count
|
courseStatus.watchers_count = projectstatus.watchers_count
|
||||||
courseStatus.grade = projectstatus.grade
|
courseStatus.grade = projectstatus.grade
|
||||||
courseStatus.course_ac_para = projectstatus.course_ac_para
|
courseStatus.course_ac_para = projectstatus.course_ac_para
|
||||||
courseStatus.save(:validate => false)
|
courseStatus.save()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
class ClearCourseStatus < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
# 删除重复的课程状态
|
||||||
|
# 之前做迁移的时候未加验证可能引起此问题
|
||||||
|
courseidlist = "(-1"
|
||||||
|
CourseStatus.all.each do |status|
|
||||||
|
sql = "delete from course_statuses where course_id=" + status.course_id.to_s + " and id<>" + status.id.to_s +
|
||||||
|
" and course_id not in " +courseidlist + ")"
|
||||||
|
courseidlist += "," + status.course_id.to_s;
|
||||||
|
execute(sql)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
|
@ -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 => 20140703085204) do
|
ActiveRecord::Schema.define(:version => 20140704034832) 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
|
||||||
|
@ -794,10 +794,10 @@ ActiveRecord::Schema.define(:version => 20140703085204) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "relative_memos", :force => true do |t|
|
create_table "relative_memos", :force => true do |t|
|
||||||
t.integer "osp_id", :null => false
|
t.integer "osp_id"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.string "subject", :null => false
|
t.string "subject", :null => false
|
||||||
t.text "content", :null => false
|
t.text "content", :limit => 16777215, :null => false
|
||||||
t.integer "author_id"
|
t.integer "author_id"
|
||||||
t.integer "replies_count", :default => 0
|
t.integer "replies_count", :default => 0
|
||||||
t.integer "last_reply_id"
|
t.integer "last_reply_id"
|
||||||
|
|
Loading…
Reference in New Issue