<% if @subPage_title == l(:label_student_list) %>
diff --git a/public/stylesheets/course_group.css b/public/stylesheets/course_group.css
index 9bd56212c..cf1806819 100644
--- a/public/stylesheets/course_group.css
+++ b/public/stylesheets/course_group.css
@@ -45,7 +45,9 @@ input.f_2 {
/*.st_search input.f_2{ background:#1c9ec7; padding: 3px; margin-left: 3px; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:28px; font-size:12px; }*/
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
-.st_addclass ul li.selected { border:1px solid #f8df8c; background:#f8df8c; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
+.classbox a { border:0px; color: #0d90c3; float:left;text-decoration: none;}
+.st_addclass ul li.selected {border:1px solid #f8df8c; background:#f6f098; padding:0 3px; float:left; margin-left:15px;}
+.st_addclass ul li.selected a { color:#716cad;text-decoration: none;}
.st_addclass{ margin-top:5px;}
.st_addclass ul li{ margin-bottom:10px;}
.st_addclass ul li,.st_addclass a,.st_addclass img{ float:left;}
@@ -83,11 +85,11 @@ a:hover.st_add{ color:#ff8e15;}
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.group_in {
width:90px !important;
- height:28px !important;
+
color:#1c9ec7!important;
margin-right:5px !important;
border:none !important;
- font-size: 14px !important;
+ font-size: 12px !important;
margin-left:0px !important;
box-shadow: none !important;
float: right;
From 61a859f91a0c75417e6c2b34cbddaf8311f51877 Mon Sep 17 00:00:00 2001
From: zhuhao
Date: Mon, 22 Dec 2014 17:12:59 +0800
Subject: [PATCH 11/28] =?UTF-8?q?=E6=89=98=E7=AE=A1=E5=B9=B3=E5=8F=B0?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=BB=E4=B8=9A=E6=90=9C=E7=B4=A2=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_projects.html.erb | 2 +-
public/stylesheets/application.css | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index fe5bae034..835564a7b 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -67,7 +67,7 @@
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
-
+
<%= l(:label_search)%>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 250ff49a4..ce3ac85de 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2899,7 +2899,7 @@ div.repos_explain{
input[class~='ButtonClolr'],.ButtonColor{
color: #fffbff !important;
- padding: 5px;
+ /*padding: 5px;*/
width: auto;
height: 24px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
From 053edb7934bd55827486e31ed6267a9a4447e72a Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 22 Dec 2014 17:22:22 +0800
Subject: [PATCH 12/28] =?UTF-8?q?#1730=20=20=20=E4=BF=AE=E6=94=B9=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E4=B8=AD=EF=BC=8C=E5=BD=93=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E5=90=8D=E5=AD=97=E8=BF=87=E9=95=BF=E6=97=B6=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8D=E8=83=BD=E6=8D=A2=E8=A1=8C=EF=BC=8C=E8=B4=B4?=
=?UTF-8?q?=E8=BF=91=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_bid_homework_show.html.erb | 8 +++++---
app/views/stores/index.html.erb | 12 +++++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb
index 7937912e4..a8296165f 100644
--- a/app/views/bids/_bid_homework_show.html.erb
+++ b/app/views/bids/_bid_homework_show.html.erb
@@ -45,7 +45,7 @@
-
+ |
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
@@ -55,6 +55,8 @@
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
+ |
+
<% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
@@ -83,8 +85,8 @@
<%end%>
<%= link_to(
- l(:button_edit),
- {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
+ l(:button_edit),
+ {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
) %>
<%#= link_to(
diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb
index 6eca2b0bf..e6f795722 100644
--- a/app/views/stores/index.html.erb
+++ b/app/views/stores/index.html.erb
@@ -11,9 +11,15 @@
- <%=l(:label_attachment)%>
- <%=l(:field_downloads)%>
- <%=l(:button_download)%>
+
+ <%=l(:label_attachment)%>
+
+
+ <%=l(:field_downloads)%>
+
+
+ <%=l(:button_download)%>
+
From f68e62d1c13465ccd74a8e11771dad35e19dae65 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 23 Dec 2014 09:33:39 +0800
Subject: [PATCH 13/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9403=E3=80=81404?=
=?UTF-8?q?=E7=9A=84html=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/common/403.html | 2 +-
app/views/common/404.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/common/403.html b/app/views/common/403.html
index f3696c4ea..a89be932d 100644
--- a/app/views/common/403.html
+++ b/app/views/common/403.html
@@ -7,7 +7,7 @@
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;}
-table,tr,td{border:0 cellspacing:0; cellpadding:0;}
+table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
diff --git a/app/views/common/404.html b/app/views/common/404.html
index 8453e0a41..0d632c4c8 100644
--- a/app/views/common/404.html
+++ b/app/views/common/404.html
@@ -7,7 +7,7 @@
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;}
-table,tr,td{border:0 cellspacing:0; cellpadding:0;}
+table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
From f834759d843d7aaef5b833554af792e5ac97038c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 23 Dec 2014 11:05:31 +0800
Subject: [PATCH 14/28] =?UTF-8?q?#1709=E6=B5=8B=E8=AF=95=E7=89=88--?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B--=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=EF=BC=9A=E6=88=90=E5=8A=9F=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=EF=BC=8C=E8=BF=98=E6=98=AF=E6=98=BE=E7=A4=BA=E4=B8=BA=E2=80=9C?=
=?UTF-8?q?=E5=8A=A0=E5=85=A5=E2=80=9D=EF=BC=8C=E9=9C=80=E6=89=8B=E5=8A=A8?=
=?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/watchers_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index 935fb440e..842e1f1b7 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -98,7 +98,7 @@ module WatchersHelper
# modify by nwb
# 主讲教师不允许退出课程
return '' if user.id == course.tea_id
- joined = user.member_of_course?(course)
+ joined = course.members.map{|m| m.user}.include? user
text = joined ? l(:label_exit_course) : l(:label_new_join)
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
From 30d8d82f377800bb763aef3f27dc00b73a6979e1 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 23 Dec 2014 15:13:16 +0800
Subject: [PATCH 15/28] =?UTF-8?q?=20#1734=20=E6=9F=90=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E4=B8=BB=E9=A1=B5=E4=B8=AD=E5=BD=93=E6=90=9C=E7=B4=A2=E6=A1=86?=
=?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/contests/index.html.erb | 16 ++++++++--------
app/views/layouts/base_newcontest.html.erb | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb
index 5867d7fcd..f49c91213 100644
--- a/app/views/contests/index.html.erb
+++ b/app/views/contests/index.html.erb
@@ -21,36 +21,36 @@
|
- <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName();' %>
+ <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();' %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<%= l(:label_search)%>
-
+
|
diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb
index 7d25cb80b..404b3d604 100644
--- a/app/views/layouts/base_newcontest.html.erb
+++ b/app/views/layouts/base_newcontest.html.erb
@@ -37,37 +37,37 @@
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
- <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName();' %>
+ <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();' %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%= l(:label_search)%>
-
+
<% end %>
|
From 3caf5c86570e00223b7ec43f5d25c20c1144428f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 23 Dec 2014 15:18:55 +0800
Subject: [PATCH 16/28] =?UTF-8?q?#1736=20=E7=8C=8E=E8=B1=B9=E6=B5=8F?=
=?UTF-8?q?=E8=A7=88=E5=99=A8=E4=B8=AD=EF=BC=8C=E6=89=93=E5=BC=80=E6=9F=90?=
=?UTF-8?q?=E7=AB=9E=E8=B5=9B=EF=BC=8C=E8=BF=9B=E5=85=A5=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E4=B8=BB=E9=A1=B5=E7=9C=8B=E5=88=B0=E5=8F=B3=E4=B8=8A=E6=96=B9?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8C=89=E9=92=AE=E4=B8=8B=E7=A7=BB=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/contests/index.html.erb | 2 +-
app/views/layouts/base_newcontest.html.erb | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb
index f49c91213..75b892461 100644
--- a/app/views/contests/index.html.erb
+++ b/app/views/contests/index.html.erb
@@ -43,7 +43,7 @@
if(regexName1()){$("#contests_serch").submit();}
}
- <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();' %>
+ <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();', :width => "125px" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb
index 404b3d604..494cc1f7a 100644
--- a/app/views/layouts/base_newcontest.html.erb
+++ b/app/views/layouts/base_newcontest.html.erb
@@ -61,13 +61,14 @@
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
- <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();' %>
+ <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%= l(:label_search)%>
-
+
+
<% end %>
From 2a94c61a3e043579233c56a08a7540e9271ed12f Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Tue, 23 Dec 2014 17:37:45 +0800
Subject: [PATCH 17/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug(=E9=A1=B9=E7=9B=AE-?=
=?UTF-8?q?-=E7=BC=BA=E9=99=B7=EF=BC=9A=E6=9B=B4=E6=96=B0=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=E6=97=B6=E5=9C=A8=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=E4=B8=AD=E6=B2=A1=E6=9C=89=E7=9B=B8=E5=85=B3=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E5=9B=BE=E7=89=87=E5=8F=AA=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=B8=80=E4=B8=AA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E4=B9=9F=E4=B8=8D=E5=90=88=E7=90=86)=20Signed-off-by:=20alan?=
=?UTF-8?q?=20<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/issues_helper.rb | 4 ++--
app/models/issue.rb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index dfa485a70..8390fc61c 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -227,7 +227,7 @@ module IssuesHelper
strings = []
values_by_field = {}
details.each do |detail|
- unless detail.property == 'attachment'
+
if detail.property == 'cf'
field_id = detail.prop_key
field = CustomField.find_by_id(field_id)
@@ -243,7 +243,7 @@ module IssuesHelper
end
end
strings << show_detail(detail, no_html, options)
- end
+
end
values_by_field.each do |field_id, changes|
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 09e093177..4dc685b3b 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -51,7 +51,7 @@ class Issue < ActiveRecord::Base
acts_as_nested_set :scope => 'root_id', :dependent => :destroy
- acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
+ acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
acts_as_customizable
acts_as_watchable
acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
@@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment
def attachment_added(obj)
- if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id
+ if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end
end
From b512bc53e90196d522470a2780bbe1bbfe5d8e1f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 24 Dec 2014 09:08:42 +0800
Subject: [PATCH 18/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=A0=E6=B3=95=E7=B2=BE=E7=A1=AE=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E7=9A=84bUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 2 +-
app/models/user.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 8183ed7ad..56777fd22 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -377,7 +377,7 @@ class UsersController < ApplicationController
}
scope = User.logged.status(@status)
@search_by = params[:search_by] ? params[:search_by][:id] : 0
- scope = scope.like(params[:name],@search_by) if params[:name].present?
+ scope = scope.like(params[:name],"0") if params[:name].present?
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'users_base'
diff --git a/app/models/user.rb b/app/models/user.rb
index cae5f1aa2..e966742f1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -206,11 +206,11 @@ class User < Principal
pattern = "%#{arg.to_s.strip.downcase}%"
#where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
if type == "0"
- where(" LOWER(login) LIKE :p ", :p => pattern)
+ where(" LOWER(login) LIKE '#{pattern}' ")
elsif type == "1"
- where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
+ where(" LOWER(concat(lastname, firstname)) LIKE '#{pattern}' ")
else
- where(" LOWER(mail) LIKE :p ", :p => pattern)
+ where(" LOWER(mail) LIKE '#{pattern}' ")
end
end
}
From e6aab5baf2d90ffa39bb2d65d92862e46c626683 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 24 Dec 2014 09:30:45 +0800
Subject: [PATCH 19/28] =?UTF-8?q?#1650=20=E8=80=81=E5=B8=88=E5=BA=94?=
=?UTF-8?q?=E8=AF=A5=E5=8F=AF=E4=BB=A5=E5=88=A0=E9=99=A4=E8=87=AA=E5=B7=B1?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E7=95=99=E8=A8=80=EF=BC=8C=E6=88=96?=
=?UTF-8?q?=E5=B8=96=E5=AD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/_courses_jours.html.erb | 10 ++++++---
app/views/courses/_history.html.erb | 21 ++++++++++++++-----
app/views/words/_journal_reply.html.erb | 3 ++-
app/views/words/_journal_reply_items.html.erb | 3 ++-
4 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb
index 68b92c00e..23c74ed4b 100644
--- a/app/views/courses/_courses_jours.html.erb
+++ b/app/views/courses/_courses_jours.html.erb
@@ -1,8 +1,10 @@
- <% reply_allow = JournalsForMessage.create_by_user? User.current %>
+ <%# reply_allow = JournalsForMessage.create_by_user? User.current %>
- <%= l(:label_user_response) %>
+
+ <%= l(:label_user_response) %>
+
<% if !User.current.logged?%>
@@ -30,5 +32,7 @@
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
\ No newline at end of file
diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb
index 19b5cef0d..555e94f6d 100644
--- a/app/views/courses/_history.html.erb
+++ b/app/views/courses/_history.html.erb
@@ -5,18 +5,29 @@
<% if journals.size > 0 %>
<% for journal in journals %>
-
+
- <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= format_time(journal.created_on) %>
+
+ <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
+
+
+ <%= format_time(journal.created_on) %>
+
- <%= textilizable journal.notes%>
+
+ <%= textilizable journal.notes%>
+
diff --git a/app/views/words/_journal_reply.html.erb b/app/views/words/_journal_reply.html.erb
index 39321394c..5a6511999 100644
--- a/app/views/words/_journal_reply.html.erb
+++ b/app/views/words/_journal_reply.html.erb
@@ -1,7 +1,8 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
+<% allow_delete ||= false%>
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
- <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
+ <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :allow_delete => allow_delete} %>
<% end %>
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index fa69176a8..24577c2ee 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -1,4 +1,5 @@
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
+<% allow_delete ||= false %>
<% if parent_jour%>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
@@ -30,7 +31,7 @@
<%= format_time reply.created_on %>
|
From 0e7f7a42543e5cdbe313ab1fe6bbaa5a5a3f9376 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Wed, 24 Dec 2014 18:31:45 +0800
Subject: [PATCH 27/28] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=8A=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E8=AF=84=E5=88=86=E3=80=8B=20Signed-off-by:=20alan=20?=
=?UTF-8?q?<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 83 +++++++++----------
app/helpers/courses_helper.rb | 41 +++++----
app/models/member.rb | 11 ++-
app/views/courses/_member_list.html.erb | 2 +-
.../courses/_member_list_detail.html.erb | 2 +-
app/views/courses/_show_member_score.html.erb | 4 +-
6 files changed, 80 insertions(+), 63 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 13a79e0a0..ae6ad4ce3 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -213,12 +213,12 @@ class CoursesController < ApplicationController
q = "#{params[:name].strip}"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:incourse]
- @results = searchStudent_by_name(@course, q)
+ @results = searchmember_by_name(@@member_scores, q)
elsif params[:ingroup]
@group = CourseGroup.find(params[:search_group_id])
- @results = searchgroupstudent_by_name(@group, @course, q)
+ @results = @results =searchgroupmember_by_name(@@member_scores, @group, q)
end
- @member_scores = @@member_scores
+
@result_count = @results.count
@results = paginateHelper @results
@@ -234,8 +234,7 @@ class CoursesController < ApplicationController
end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
- @members = searchStudent(@course)
- @membercount = @members.count
+
@course_groups = @course.course_groups
end
@@ -244,8 +243,7 @@ class CoursesController < ApplicationController
@subPage_title = l :label_student_list
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
- @members = searchStudent(@course)
- @membercount = @members.count
+
@course_groups = @course.course_groups
end
@@ -258,8 +256,7 @@ class CoursesController < ApplicationController
end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
- @members = searchStudent(@course)
- @membercount = @members.count
+
@course_groups = @course.course_groups
end
@@ -312,28 +309,18 @@ class CoursesController < ApplicationController
@is_remote = true
if params[:group_id] && params[:group_id] != "0"
@group = CourseGroup.find(params[:group_id])
- @results = searchStudent_by_group(@group, @course)
+ @results = @@member_scores.find_all {|mem| mem.course_group_id == group.id}
else
- @results = searchStudent(@course)
+ @results = @@member_scores
end
@@result = @results
- @member_scores = @@member_scores
+
@members = searchStudent(@course)
@membercount = @members.count
@results = paginateHelper @results
end
- def search_group_members group
- @subPage_title = l :label_student_list
- @render_file = 'member_list'
- @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
- @is_remote = true
- @member_scores = @@member_scores
- @members = searchStudent(@course)
- @membercount = @members.count
- @results = searchStudent_by_group(group, @course)
- @@result = @results
- @results = paginateHelper @results
- end
+
+
def member
## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@@ -350,8 +337,9 @@ class CoursesController < ApplicationController
when '2'
@subPage_title = l :label_student_list
@@member_scores = student_homework_score
- @member_scores = @@member_scores
- @members = searchStudent_sort(@course, 'desc', @@member_scores)
+ @members = @@member_scores
+ # @member_scores = @@member_scores
+ # @members = searchStudent_sort(@course, 'desc', @@member_scores)
@membercount = @members.count
else
@@ -375,7 +363,7 @@ class CoursesController < ApplicationController
@show_serch = params[:role] == '2'
@subPage_title = l :label_student_list
@render_file = 'member_list'
- @member_scores = @@member_scores
+
unless @@result.nil?
@results = @@result.reverse
@@result = @results
@@ -384,7 +372,7 @@ class CoursesController < ApplicationController
end
# 显示每个学生的作业评分详情
def show_member_score
- @member_scores = @@member_scores
+
@member_score = Member.find(params[:member_id]) if params[:member_id]
respond_to do |format|
format.html {render :layout => 'course_base'}
@@ -895,23 +883,34 @@ class CoursesController < ApplicationController
def student_homework_score
teachers = find_course_teachers(@course)
- score_count = 0
-
- homeworks = HomeworkAttach.find_by_sql("SELECT homework_attaches.id
- FROM homework_attaches, bids where
- homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses where course_id = #{@course.id}
- and homework_attaches.bid_id = bids.id)")
- homeworks = homeworks.map {|homework| homework.id}.join(",")
- homework_scores = HomeworkAttach.find_by_sql("SELECT homework_attaches.user_id, AVG(s1.stars) AS t_score,
- AVG(s2.stars) AS s_score
- FROM homework_attaches, seems_rateable_rates s1,seems_rateable_rates s2 WHERE
- homework_attaches.id in (#{homeworks}) and s1.rateable_type = 'HomeworkAttach' and s1.rateable_id = homework_attaches.id
- AND s1.rater_id IN (#{teachers}) and s2.rateable_type = 'HomeworkAttach'
- and s2.rateable_id = homework_attaches.id
- AND s2.rater_id not IN (#{teachers})")
+ homework_scores = Member.find_by_sql("SELECT id, user_id,course_id, course_group_id,created_on,IFNULL(SUM(CASE WHEN t_score <> 0 AND t_score IS NOT NULL THEN t_score ELSE s_score END),0) as score
+ FROM (
+ SELECT members.id as id, members.user_id AS user_id, members.course_id AS course_id, members.created_on as created_on,members.course_group_id AS course_group_id,
+ (SELECT AVG(seems_rateable_rates.stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (3040,4762,4765)) AS t_score,
+ (SELECT AVG(seems_rateable_rates.stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (3040,4762,4765)) AS s_score
+ FROM `homework_attaches` , members
+ WHERE members.course_id = #{@course.id}
+ AND members.user_id NOT IN (#{teachers}) AND homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id})
+ AND homework_attaches.user_id = members.user_id
+ ) AS table1 GROUP BY user_id ORDER BY score DESC")
+ homework_scores
end
#获取课程的老师列表
def find_course_teachers course
searchTeacherAndAssistant(course).map{|teacher| teacher.user_id}.join(",")
end
+
+ #当加入,退出分班时查询分班的学生
+ def search_group_members group
+ @subPage_title = l :label_student_list
+ @render_file = 'member_list'
+ @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
+ @is_remote = true
+
+ @members = searchStudent(@course)
+ @membercount = @members.count
+ @results = @@member_scores.find_all {|mem| mem.course_group_id == group.id}
+ @@result = @results
+ @results = paginateHelper @results
+ end
end
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 80925f55b..a5ae7d760 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -175,22 +175,7 @@ module CoursesHelper
end
members
end
- def searchStudent_sort project, sort_by, member_scores
- #searchPeopleByRoles(project, StudentRoles)
- members = []
- project.members.each do |m|
- if m && m.user && m.user.allowed_to?(:as_student,project)
- members << m
-
- end
- end
- members.sort!{ |mem1, mem2| mem1.student_homework_score(member_scores)[1].to_f <=> mem2.student_homework_score(member_scores)[1].to_f}
- if sort_by == "desc"
- members.reverse!
- end
- members
- end
def searchStudent_by_name project, name
@@ -206,6 +191,32 @@ module CoursesHelper
end
members
end
+ def searchmember_by_name members, name
+ #searchPeopleByRoles(project, StudentRoles)
+ mems = []
+ members.each do |m|
+
+ username = m.user[:lastname].to_s + m.user[:firstname].to_s
+ if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
+ mems << m
+ end
+
+ end
+ mems
+ end
+ def searchgroupmember_by_name members, name, group
+ #searchPeopleByRoles(project, StudentRoles)
+ mems = []
+ members.each do |m|
+ if m.course_group_id == group.id
+ username = m.user[:lastname].to_s + m.user[:firstname].to_s
+ if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
+ mems << m
+ end
+ end
+ end
+ mems
+ end
def searchgroupstudent_by_name(group, project, name)
members = []
group.members.each do |m|
diff --git a/app/models/member.rb b/app/models/member.rb
index ac0e590e0..446bb02e7 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -115,9 +115,16 @@ class Member < ActiveRecord::Base
end
# 查找每个学生每个作业的评分
- def student_homework_score homework_scores
+ def student_homework_score
score_count = 0
- homework_score = homework_scores.find_all { |e| e.user_id == self.user_id}
+ homework_score = HomeworkAttach.find_by_sql("SELECT bids.`name`, 0 as score,
+ (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach'
+ AND rateable_id = homework_attaches.id ) AS t_score,
+ (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach'
+ AND rateable_id = homework_attaches.id ) AS s_score
+ FROM homework_attaches, bids where homework_attaches.user_id = #{self.user_id}
+ and homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses where course_id = #{self.course_id})
+ AND homework_attaches.bid_id = bids.id ")
homework_score.each do |homework|
if !homework.t_score.nil? && homework.t_score != 0
score = homework.t_score
diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb
index 3e8f5a359..25be8709f 100644
--- a/app/views/courses/_member_list.html.erb
+++ b/app/views/courses/_member_list.html.erb
@@ -68,7 +68,7 @@
<% end %>
<% if @subPage_title == l(:label_student_list) %>
- <%= link_to member.student_homework_score(@member_scores)[1].to_s, {
+ <%= link_to format("%0.2f",member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
diff --git a/app/views/courses/_member_list_detail.html.erb b/app/views/courses/_member_list_detail.html.erb
index 18ac99dd0..f37067cb5 100644
--- a/app/views/courses/_member_list_detail.html.erb
+++ b/app/views/courses/_member_list_detail.html.erb
@@ -27,7 +27,7 @@
<% end %>
<% if @subPage_title == l(:label_student_list) %>
- <%= link_to member.student_homework_score(@member_scores)[1].to_s, {
+ <%= link_to format("%0.2f",member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
diff --git a/app/views/courses/_show_member_score.html.erb b/app/views/courses/_show_member_score.html.erb
index e20ac028b..57dd7b2be 100644
--- a/app/views/courses/_show_member_score.html.erb
+++ b/app/views/courses/_show_member_score.html.erb
@@ -39,7 +39,7 @@
<%= @member_score.user.name %> 历次作业积分
- 作业名称得分
- <% @member_score.student_homework_score(@member_scores)[0].each do |homework_score| %>
+ <% @member_score.student_homework_score[0].each do |homework_score| %>
<% if !homework_score.t_score.nil? && homework_score.t_score != 0 %>
<% score = homework_score.t_score %>
<% else %>
@@ -51,7 +51,7 @@
<% end %>
- <%= homework_score.name %><%= format("%0.2f",score) %>
<% end %>
- - 作业积分(总得分)<%= @member_score.student_homework_score(@member_scores)[1] %>
+ - 作业积分(总得分)<%= @member_score.student_homework_score[1] %>
From 9545b1da0c48018e5319bde0fc3cd8d50cab9b24 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 25 Dec 2014 09:02:58 +0800
Subject: [PATCH 28/28] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E8=AE=BF=E9=97=AE=E6=95=88?=
=?UTF-8?q?=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 9 +++----
app/views/courses/_member_list.html.erb | 33 +++++++++++++++++--------
2 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index ae6ad4ce3..e0d7feff5 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -333,10 +333,11 @@ class CoursesController < ApplicationController
case params[:role]
when '1'
@subPage_title = l :label_teacher_list
- @members = searchTeacherAndAssistant(@course)
+ @members = @teachers
when '2'
@subPage_title = l :label_student_list
- @@member_scores = student_homework_score
+ teachers = @teachers.map{|teacher| teacher.user_id}.join(",")
+ @@member_scores = student_homework_score teachers
@members = @@member_scores
# @member_scores = @@member_scores
# @members = searchStudent_sort(@course, 'desc', @@member_scores)
@@ -880,9 +881,7 @@ class CoursesController < ApplicationController
end
end
- def student_homework_score
- teachers = find_course_teachers(@course)
-
+ def student_homework_score teachers
homework_scores = Member.find_by_sql("SELECT id, user_id,course_id, course_group_id,created_on,IFNULL(SUM(CASE WHEN t_score <> 0 AND t_score IS NOT NULL THEN t_score ELSE s_score END),0) as score
FROM (
SELECT members.id as id, members.user_id AS user_id, members.course_id AS course_id, members.created_on as created_on,members.course_group_id AS course_group_id,
diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb
index 25be8709f..9b3a0443d 100644
--- a/app/views/courses/_member_list.html.erb
+++ b/app/views/courses/_member_list.html.erb
@@ -24,35 +24,46 @@
<% if members.any? %>
<% if @result_count %>
- <%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %>
+
+ <%= l(:label_search_member_count) %>
+ <%= @result_count %>
+ <%= l(:label_member_people) %>
+
<% end %>
<% if @subPage_title == l(:label_student_list) %>
- <%= link_to '作业积分', member_score_sort_course_path ,method: 'get', remote: true, :onclick => "change_pic('pic')"%>
-
- - 加入时间
+
+
+ -
+ 加入时间
+
<% else %>
- - 加入时间
+ -
+
+ -
+ 加入时间
+
<% end %>
<% members.each do |member| %>
-
<% next if member.new_record? %>
-
-
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
+
+ <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
+
<% if @canShowCode %>
-
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
-
-
+
+
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
@@ -89,7 +100,9 @@
<% end; reset_cycle %>
-
+
<% else %>
<%= l(:label_no_data) %>