From 535ec333c3d7370517aa2c4afff5be9cc2d45f48 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Mon, 24 Nov 2014 15:36:58 +0800 Subject: [PATCH 001/130] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=A0=B7?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E5=8A=A8=EF=BC=9A=E9=A1=B9=E7=9B=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7d6cc85b2..3037c5990 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1169,7 +1169,7 @@ zh: text_wiki_page_nullify_children: 将子页面保留为根页面 text_wiki_page_destroy_children: 删除子页面及其所有下级页面 text_wiki_page_reassign_children: 将子页面的上级页面设置为 - text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该项目了。你确定要继续吗? + text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗? text_zoom_in: 放大 text_zoom_out: 缩小 text_applied_project: "用户 %{id} 申请加入项目 %{project}" From 851ef240c1bb1e633850b29242ae32d6a5f6c7f6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 10:57:53 +0800 Subject: [PATCH 002/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_bids.html.erb | 176 ++++++++++++++++++--------- 1 file changed, 118 insertions(+), 58 deletions(-) diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index d7d9e3924..e04889d2a 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -34,27 +34,42 @@
- - - - - - - - - - -
企业众包社区<%= l(:label_user_location) %> : - -
<%= link_to request.host()+"/calls", :controller => 'bids', :action => 'index' %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> > - <%=link_to @bid.name ,bid_path %>
+ + + + + + + + + + +
+ 企业众包社区 + + + <%= l(:label_user_location) %> : + + +
+ + + + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> > + + <%=link_to @bid.name ,bid_path %> + +
@@ -66,50 +81,98 @@ <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> - + - - - - - <% if User.current.login? %> - - - - - - - <% end %> -
<%= link_to @bid.name,bid_path %>
<%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %>
<%= watcher_link(@bid, User.current) %>
+ + + + + <% if User.current.login? %> + + + + + + + <% end %> +
+ <%= link_to @bid.name,bid_path %> +
+ <%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %> +
+ + + <%= watcher_link(@bid, User.current) %> + +
+ - + <% if @bid.reward_type.nil? or @bid.reward_type == 1%> - + <% elsif @bid.reward_type == 2%> - - <% else %> - + + <% else %> + <% end %> - + - + - - - + + + +
<%= l(:label_investor) %><%= link_to(@user, user_path(@user))%> + <%= l(:label_investor) %> + <%= link_to(@user, user_path(@user))%> +
<%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%> + <%= l(:label_bids_reward_method) %> + + <%= l(:label_call_bonus) %>  + <%= l(:label_RMB_sign) %> + <%= @bid.budget%> + + <%= l(:label_bids_reward_method) %><%= @bid.budget%><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %> + <%= l(:label_bids_reward_method) %> + <%= @bid.budget%> + + <%= l(:label_bids_reward_method) %> + <%= l(:label_bids_credit) %>  + <%= @bid.budget%>  + <%= l(:label_bids_credit_number) %> +
<%= l(:label_investment_time_limit) %><%= @bid.deadline%> + <%= l(:label_investment_time_limit) %> + <%= @bid.deadline%> +
被 <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %>  - 个高校课程引用为作业!
+
被  + + <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %> +   + 个高校课程引用为作业! +
+
有 <%= link_to(count_bid_project, show_bid_project_path(@bid)) %>  - 个项目正在实现该需求!
有 <%= link_to(count_bid_user, show_bid_user_path(@bid)) %>  - 个高校用户正在努力完成此需求!
+
+ 有  + <%= link_to(count_bid_project, show_bid_project_path(@bid)) %>  + 个项目正在实现该需求! +
+
+
+ 有  + <%= link_to(count_bid_user, show_bid_user_path(@bid)) %>  + 个高校用户正在努力完成此需求! +
+
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %>   @@ -121,10 +184,12 @@
- <%= l(:label_tag) %> + + <%= l(:label_tag) %> +
- +
@@ -177,10 +243,7 @@
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> @@ -144,11 +209,12 @@ <% if @bid.watcher_users.size>0 %> <% for user in @bid.watcher_users%> - <%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ),user_path(user) %> <% end %> <% else %> -

<%= l(:label_project_no_follow) %>

+

+ <%= l(:label_project_no_follow) %> +

<% end%>
- -
- @@ -190,7 +253,6 @@ <%= render_menu :bid_menu %> <% end %> - <%= yield %> <%= call_hook :view_layouts_base_content %>
@@ -199,12 +261,10 @@ - - <%= call_hook :view_layouts_base_body_bottom %> From ff93a626857711ffd88863f45accfe35c7fdec5f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 11:44:39 +0800 Subject: [PATCH 003/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E7=AB=9E=E8=B5=9Blayout=E4=B8=AD=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E3=80=82=20=E4=BF=AE=E6=94=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_contest.html.erb | 120 ++++++++++++++++-------- app/views/layouts/base_courses.html.erb | 18 ++-- 2 files changed, 93 insertions(+), 45 deletions(-) diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index cf8b7d475..6e980957b 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -29,8 +29,16 @@
- - + + - - +
<%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + + <%= l(:label_user_location) %> : + +
<%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > - <%= link_to @bid.name, bid_path %> + <%=link_to l(:field_homepage), home_path %> > + <%= l(:label_contest_innovate)%> > + + <%= link_to @bid.name, bid_path %> + +
@@ -58,27 +70,29 @@ <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> - + - - - - - <% if User.current.login? %> - - + <% if User.current.login? %> + + + + <% end %> +
<%= h @bid.name %>
- - <%= join_in_contest(@bid, User.current)%> - - - - <%= watcher_link(@bid, User.current) %> - + + + - - <% end %> -
+ <%= h @bid.name %>
- +
+ + <%= join_in_contest(@bid, User.current)%> + + + + <%= watcher_link(@bid, User.current) %> + +
+ <% if User.current.logged? %> <% if @bid.author.id == User.current.id %> <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> @@ -100,8 +114,12 @@ :action => 'show_project' %> - <%= l(:label_participator) %> - <%= l(:label_bidding_project) %> + + <%= l(:label_participator) %> + + + <%= l(:label_bidding_project) %> +
@@ -110,14 +128,22 @@
- + - - + - +
<%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%> + <%= l(:lable_contest_user) %> + <%= link_to(@user.name, user_path(@user))%> +
<%= l(:label_bids_reward_method) %><%= @bid.budget%> + <%= l(:label_bids_reward_method) %> + <%= @bid.budget%> +
<%= l(:label_limit_time) %> : <%= @bid.deadline%> + <%= l(:label_limit_time) %> : + <%= @bid.deadline%> +
@@ -130,7 +156,6 @@
<% if @bid.description.size>0 %>
- <%= textilizable @bid.description %>
<% else %> @@ -139,7 +164,10 @@
<% end %>
- <%= l(:label_create_time) %>:<%= format_time(@bid.created_on) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@bid.created_on) %>
@@ -158,9 +186,13 @@
- <%= l(:label_x_followers, :count => @bid.watcher_users.count) %> + + <%= l(:label_x_followers, :count => @bid.watcher_users.count) %> + <% if show_more_fans?(@bid) %> - <%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%> + + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%> + <% end %>
@@ -177,9 +209,13 @@
- <%= l(:label_bidding_project) %> + + <%= l(:label_bidding_project) %> + <% if show_more_bid_project?(@bid) %> - <%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%> + + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%> + <% end %>
@@ -200,7 +236,9 @@
- <%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %> + + <%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %> + <% if show_more_participate?(@bid) %> <%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%> @@ -210,7 +248,9 @@
- +
<%= show_participate_picture(@bid) %> + <%= show_participate_picture(@bid) %> +
@@ -234,7 +274,9 @@
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 6de46d2fe..beb3291d0 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -34,7 +34,11 @@
- + - + From 54ffd59eaf7c18191d3883e9cf8b71a4a725303d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 14:46:08 +0800 Subject: [PATCH 004/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E3=80=81=E7=94=A8=E6=88=B7base?= =?UTF-8?q?=E7=9A=84=E4=B8=BB=E9=A1=B5=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_homework.html.erb | 9 +-- app/views/layouts/base_projects.html.erb | 52 +++++++++++---- app/views/layouts/base_users.html.erb | 83 ++++++++++++++++-------- 3 files changed, 100 insertions(+), 44 deletions(-) diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 9e615eaec..9fd826bf5 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -46,15 +46,16 @@
高校课程实践社区 + + 高校课程实践社区 + + <%= l(:label_user_location) %> : @@ -50,14 +54,16 @@
- <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %> -

<%= link_to "主页", home_path %> - > <%=l(:label_courses_management_platform)%> - > <%= link_to @course.name, nil %> + > + + <%=l(:label_courses_management_platform)%> + + > + <%= link_to @course.name, nil %>

- + -
高校课程实践社区 + + 高校课程实践社区 + + <%= l(:label_user_location) %> :
- <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %> -

<%= link_to "主页", home_path %> > diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index ee490c653..b6620b141 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -30,8 +30,14 @@

- - + + - - +
软件项目托管社区<%= l(:label_user_location) %> : + + 软件项目托管社区 + + + <%= l(:label_user_location) %> : +
<%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>

<%=link_to l(:label_home),home_path %> > <%=link_to @project, project_path(@project) %>

+

+ <%=link_to l(:label_home),home_path %> > + <%=link_to @project, project_path(@project) %> +

+
@@ -54,7 +64,9 @@ <% @project = Project.find_by_id(@project.id)%> - + - - - + + + - - - + + +
<%= image_tag(url_to_avatar(@project), :class => 'avatar2') %> + <%= image_tag(url_to_avatar(@project), :class => 'avatar2') %> +
<%= link_to @project.name, project_path(@project)%> @@ -86,15 +98,26 @@ <% @project.versions.each do |version| %> <% files_count += version.attachments.count %> <% end %> -
<%=link_to "#{@project.members.count}", project_member_path(@project) %><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %><%=link_to "#{@project.issues.count}", project_issues_path(@project) %> + <%=link_to "#{@project.members.count}", project_member_path(@project) %> + + <%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %> + + <%=link_to "#{@project.issues.count}", project_issues_path(@project) %> +
<%= l(:label_member) %><%= l(:label_user_watchered) %> <%= l(:label_project_issues) %> + <%= l(:label_member) %> + + <%= l(:label_user_watchered) %> + + <%= l(:label_project_issues) %> +
@@ -109,7 +132,10 @@ <%= textilizable @project.description %>
- <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@project.created_on) %>
diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index f3bbe0098..186166dc8 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -101,8 +101,12 @@
- - + + -
<%= l(:label_user_home) %><%= l(:label_user_location) %> : + <%= l(:label_user_home) %> + + <%= l(:label_user_location) %> : +
- <%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %> - <%=link_to "主页", home_path %> > - <%=link_to @user.name, user_path %> + + <%=link_to @user.name, user_path %> +
@@ -131,23 +134,28 @@
- + +
<%= image_tag(url_to_avatar(@user), :class => 'avatar2') %> + <%= image_tag(url_to_avatar(@user), :class => 'avatar2') %> + - + - + - - -
<%= link_to h (@user.name) %> - <%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%> + <%= link_to h (@user.name) %> + <%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%> +
<% unless User.current == @user %> - <%= watcher_link(@user, User.current) %> - <% else %> - <%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %> - <% end %> + <% unless User.current == @user %> + <%= watcher_link(@user, User.current) %> + <% else %> + <%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %> + <% end %> +
@@ -156,8 +164,8 @@
+
@@ -228,29 +236,42 @@ <% unless @user.user_extensions.nil? %> <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %> - <%= l(:field_occupation) %>: + + <%= l(:field_occupation) %>: + + <% unless @user.user_extensions.school.nil? %> <%= @user.user_extensions.school.name %> <% end %> - + <% elsif @user.user_extensions.identity == 3 %> - <%= l(:field_occupation) %>: + + <%= l(:field_occupation) %>: + <%= @user.user_extensions.occupation %> - + <% elsif @user.user_extensions.identity == 2 %> - <%= l(:label_company_name) %>: + + <%= l(:label_company_name) %>: + <%= @user.firstname %> <% end %> - <%= l(:label_location) %>:<%= @user.user_extensions.location %><%= @user.user_extensions.location_city %> + + <%= l(:label_location) %>: + + + <%= @user.user_extensions.location %> + <%= @user.user_extensions.location_city %> + <% if @user.user_extensions.identity == 0 %> @@ -307,7 +328,9 @@
- <%= l(:label_user_watcher) %> + + <%= l(:label_user_watcher) %> + <% if show_more_watchers?(@user) %>
<%= link_to l(:label_more), :controller => "users", :action => "user_watchlist"%> @@ -318,7 +341,9 @@
- +
<%= show_watcher_profile(@user) %> + <%= show_watcher_profile(@user) %> +
@@ -327,7 +352,9 @@
- <%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %> + + <%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %> + <% if show_more_fans?(@user) %>
<%= link_to l(:label_more), :controller => "users", :action => "user_fanslist"%> @@ -337,7 +364,9 @@
- +
<%= show_fans_picture(@user) %> + <%= show_fans_picture(@user) %> +
From 6f0e18f3a696d246d730cd8f32bd16233bc8be86 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 14:49:55 +0800 Subject: [PATCH 005/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=A8=A1=E5=9D=97=E7=9A=84=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=A0=8F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...softapplication_index_top_content.html.erb | 16 +++++++++----- ..._base_softapplication_top_content.html.erb | 22 ++++++++++++------- app/views/layouts/base_newcontest.html.erb | 9 ++++---- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/app/views/layouts/_base_softapplication_index_top_content.html.erb b/app/views/layouts/_base_softapplication_index_top_content.html.erb index ff897a866..f5daa020e 100644 --- a/app/views/layouts/_base_softapplication_index_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_index_top_content.html.erb @@ -13,8 +13,14 @@
- - + + - -
<%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : +
<%=link_to request.host()+"/softapplications", :controller=>'softapplications', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %> + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %>
diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb index 71c708d63..e92ce7c34 100644 --- a/app/views/layouts/_base_softapplication_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -1,18 +1,24 @@
- - + + - - diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index 381a6a61d..52a65e379 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -27,8 +27,10 @@
<%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : +
<%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > - - <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> - + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + + <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> +
- -
- <%=l(:label_contest_innovate_community)%> + + + <%=l(:label_contest_innovate_community)%> + <%= l(:label_user_location) %> : @@ -44,9 +46,6 @@
- <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> - <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > From d073cca7129b1553013d22087cf1fc3ef974a847 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 15:24:41 +0800 Subject: [PATCH 006/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_list.html.erb | 2 +- app/views/homework_attach/_app_link.html.erb | 2 +- app/views/homework_attach/_homework.html.erb | 4 ++-- app/views/homework_attach/_show.html.erb | 18 +++++++++++---- app/views/homework_attach/edit.html.erb | 20 +++++++++------- app/views/homework_attach/new.html.erb | 13 ++++++----- app/views/layouts/base_homework.html.erb | 3 ++- public/stylesheets/css.css | 24 ++++++++++---------- 8 files changed, 51 insertions(+), 35 deletions(-) diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 23f7070b2..202a2ee91 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -22,7 +22,7 @@ <%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> (<%= @jours_count %>) -
  • +
  • <%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
  • diff --git a/app/views/homework_attach/_app_link.html.erb b/app/views/homework_attach/_app_link.html.erb index 1c089dbe0..97c2e2f37 100644 --- a/app/views/homework_attach/_app_link.html.erb +++ b/app/views/homework_attach/_app_link.html.erb @@ -1,6 +1,6 @@ <% for attachment in attachments %> <% if attachments.count > 1 && attachment != attachments.first%> -
                     +
                 <% end %> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <% if attachment.is_text? %> diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index d11ea3333..7b214268f 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -1,4 +1,4 @@ -
  • +
  • <% if is_student_batch_homework %> <%= image_tag(url_to_avatar("匿名"), :width => "40", :height => "40")%> @@ -51,7 +51,7 @@ <% if is_my_homework %> <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %> -
  • +
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index bce3e4d03..0b36d431b 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -61,16 +61,24 @@
  • -
  • <%= l(:label_activity_time) %>:<%=format_time @homework.created_at %>
  • +
  • + <%= l(:label_activity_time) %>: + + <%=format_time @homework.created_at %> + +
  • <% if @homework.users.count > 0 %> -
    <%= l(:label_participation_person) %>: +
    + <%= l(:label_participation_person) %>: <% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %> <%= l(:label_anonymous) %> <%else%> <% @homework.users.each do |homework_user| %> - <%= link_to homework_user, user_path(homework_user)%> + + <%= link_to homework_user, user_path(homework_user)%> + <% if @homework.users.count > 1 && homework_user != @homework.users.last %> 、                 <% end %> @@ -84,7 +92,9 @@ <%= @homework.description %> <% else %>
    - <%= l(:label_homework_without_description) %> + + <%= l(:label_homework_without_description) %> +
    <% end %>

    diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index cfe4bf097..d88285385 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -41,13 +41,13 @@
      -
    • +
    • 修改作业
    • 成员
    • -
    • +
    • <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, @@ -60,22 +60,26 @@
      <%= form_for(@homework) do |f|%>

      - + <%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();"%>

      -

      - - <%#= render :partial => 'attachments/form' %> + <% unless @homework.attachments.empty?%>

      <% options = {:author => true, :deletable => attach_delete(@homework)} %> diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index c843482a9..877cb6d18 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -41,10 +41,10 @@

        -
      • +
      • 创建作品
      • -
      • +
      • <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, @@ -72,19 +72,20 @@

        -

        - - <%#= render :partial => 'attachments/form' %> +

        <%= render :partial => 'attachments/form' %>

        diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 9fd826bf5..9ce2a6edf 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -29,7 +29,8 @@ background: #15bccf; color: #fff; text-align: center; - padding: 5px !important; + padding-left: 5px !important; + padding-right: 5px !important; } .span_wping a:hover{ background-color:#03a1b3;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index e49f2651f..57304220a 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -1,5 +1,5 @@ /* CSS Document */ -body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; background:#fff; font-style:normal;} +body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; 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,textarea{ margin:0; padding:0;} div,img,tr,td,textarea{ border:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;} @@ -15,7 +15,7 @@ a:hover{ text-decoration:underline;} /* TAB 切换效果 */ .tb_{ background-color: #eaeaea; height:40px; } .tb_ ul{height:40px; } -.tb_ li{float:left;height:30px;width: 90px;cursor:pointer; font-size:14px; padding-top:10px; text-align:center; } +.tb_ li{float:left;height:35px;width: 90px;cursor:pointer; font-size:14px; padding-top:5px; text-align:center; } a.tb_all{ margin-left:235px; font-size:12px; display:block; height:23px; padding-top:4px; width:90px; color:#7a7a7a; border:1px solid #cbcbcb; background:#fff; text-align: center;} a:hover.tb_all{ background:#eaeaea; text-decoration:none;} @@ -38,13 +38,13 @@ a:hover.tb_all{ background:#eaeaea; text-decoration:none;} .pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;} .pic_head img{ border:1px solid #fff;} .pic_head img:hover{border:1px solid #15bccf;} -.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:25px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} -.dis ul li.wdown a{padding-top:25px; color:#3d7ec2; margin-right:35px;} -.wscore{ padding-top:25px; color:#888888; width:96px;} +.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} +.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;} +.wscore{ padding-top:22px; color:#888888; width:96px;} .dis ul li.wping{margin-left:12px; } -.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:8px;} +.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:3px;} .dis ul li.wping a:hover{ background-color:#03a1b3;} -ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-height: 1.9; } +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } .wlist span{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a:hover{ background:#15bccf; color:#fff; text-decoration:none;} @@ -55,7 +55,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-hei .c_grey{ color:#999; font-weight:normal;} .dis ul li.wname02 a{ width:200px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} .dis ul li.wmine{ margin:12px 0 0 10px;} -.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;line-height: 1.9;} +.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;} .wzan{ margin:15px 0 0 25px; width:32px; height:44px;} .wzan a{ display: block;text-align: center;} a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;} @@ -83,8 +83,8 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;} .ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} -a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;padding-top: 5px;} -a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;line-height: 1.9;} +a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} +a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;} a:hover.ping_sub{ background:#14a8b9;} .recall{ border-top:1px solid #CCC; padding:5px 0;} .recall_head{ float:left;} @@ -128,9 +128,9 @@ a:hover.ping_sub{ background:#14a8b9;} .w430{ width:430px;} .w350{ width:350px;} -.w620{ width:580px; height:160px; border:1px solid #CCC !important; padding-left: 3px !important;} +.w620{ width:580px; height:160px; border:1px solid #CCC;} .bo{height:26px; border:1px solid #CCC !important; padding: 0 !important;} -a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;line-height: 1.9;} +a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;} a:hover.tijiao{ background:#0f99a9 !important;} .members_left{ float:left; width:570px; margin-right:20px;} .members_left{} From dd78bc25ffcee562518cc5e059ab024f3c77d5ed Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 15:33:36 +0800 Subject: [PATCH 007/130] =?UTF-8?q?#1619=20=E4=BD=9C=E4=B8=9A=E6=9C=AA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=99=84=E4=BB=B6=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_show.html.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index 0b36d431b..bf797e441 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -98,11 +98,17 @@
      <% end %>

      -

      <%= l(:label_attachment) %>: +

      + + <%= l(:label_attachment) %>: - <% options = {:author => true } %> - <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + <% if @homework.attachments.empty?%> + 尚未提交附件 + <% else%> + <% options = {:author => true } %> + <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + <% end%>

      From b9118a0212514fce47d9212d25caf7ac1dd85442 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 15:41:13 +0800 Subject: [PATCH 008/130] =?UTF-8?q?#1612=20=E4=BF=AE=E6=94=B9=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=AD=A6=E7=94=9F=E4=BD=9C=E4=B8=9A=E4=B8=BA=E5=AD=A6?= =?UTF-8?q?=E5=8F=B7=5F=E5=AD=A6=E7=94=9F=E5=A7=93=E5=90=8D=5F=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E5=90=8D=E7=A7=B0.rar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 6cbe0dd95..cee26ae32 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -44,7 +44,7 @@ class ZipdownController < ApplicationController if homework != nil unless homework.attachments.empty? zipfile = zip_homework_by_user homework - send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) + send_file zipfile, :filename => homework.user.user_extensions.student_id + "_" + homework.user.lastname + homework.user.firstname + "_" + homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else render file: 'public/no_file_found.html' end From e68900b9a0c6760d7ac5f341c66c7731432f6d2d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 16:08:14 +0800 Subject: [PATCH 009/130] =?UTF-8?q?#1616=20=E4=BF=AE=E6=94=B9=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=97=B6=E5=BC=80=E8=AF=BE=E6=97=A5=E6=9C=9F=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 4 ++-- app/views/courses/_course_form.html.erb | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 178782da3..73e7daa26 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -450,9 +450,9 @@ module CoursesHelper end #课程实践年份下拉框 - def course_time_option + def course_time_option year type = [] - now_year = Time.now.year + now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year) for i in (now_year..now_year + 10) option = [] option << i diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index b722956e8..591c6aa07 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -38,12 +38,18 @@
      - <%= l(:label_class_period) %> - *   + + <%= l(:label_class_period) %> + *   + <%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> -  <%= l(:label_class_hour) %> +   + + <%= l(:label_class_hour) %> + +   <%= l(:label_class_hour) %> @@ -98,7 +104,7 @@ - <%= select_tag :time,options_for_select(course_time_option,@course.time), {} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> From 8c81346ffb657cf52f99320fd85c159f2130e989 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 16:29:17 +0800 Subject: [PATCH 010/130] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D#1622?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 1 - app/views/homework_attach/_jour.html.erb | 2 +- .../homework_attach/_journal_reply_items.html.erb | 7 +------ app/views/homework_attach/add_jour_reply.js.erb | 2 +- app/views/words/_journal_reply.html.erb | 3 +-- app/views/words/_journal_reply_items.html.erb | 15 +++------------ app/views/words/_new_respond.html.erb | 3 +-- app/views/words/create_reply.js.erb | 2 +- 8 files changed, 9 insertions(+), 26 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 4e7768785..89fa0e1dc 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -47,7 +47,6 @@ class WordsController < ApplicationController # 删除留言功能要调用destroy,也记得在destroy.js中修改 # deny api. api useless - @show_real_name = params[:show_real_name] || false parent_id = params[:reference_id] author_id = User.current.id reply_user_id = params[:reference_user_id] diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb index 055e1a015..fe2eca8dc 100644 --- a/app/views/homework_attach/_jour.html.erb +++ b/app/views/homework_attach/_jour.html.erb @@ -46,7 +46,7 @@
      - <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name, :show_real_name => true } %> + <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name} %>
      diff --git a/app/views/homework_attach/_journal_reply_items.html.erb b/app/views/homework_attach/_journal_reply_items.html.erb index dd09bd84f..ac60709ad 100644 --- a/app/views/homework_attach/_journal_reply_items.html.erb +++ b/app/views/homework_attach/_journal_reply_items.html.erb @@ -1,4 +1,3 @@ -<% show_real_name ||= false %> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
      @@ -15,11 +14,7 @@ 回复 <% parent_jour = JournalsForMessage.find reply.m_reply_id %> <% if show_name && parent_jour %> - <% if show_real_name%> - <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> - <% else %> - <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> - <% end %> + <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> <% else %> <%= l(:label_anonymous) %> <% end %> diff --git a/app/views/homework_attach/add_jour_reply.js.erb b/app/views/homework_attach/add_jour_reply.js.erb index 34cec1cca..564229d81 100644 --- a/app/views/homework_attach/add_jour_reply.js.erb +++ b/app/views/homework_attach/add_jour_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm, :show_real_name => true} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); diff --git a/app/views/words/_journal_reply.html.erb b/app/views/words/_journal_reply.html.erb index 2f823ebf6..39321394c 100644 --- a/app/views/words/_journal_reply.html.erb +++ b/app/views/words/_journal_reply.html.erb @@ -1,8 +1,7 @@ <% id = "journal_reply_ul_" + journal.id.to_s%> -<% show_real_name ||= 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, :show_real_name => show_real_name} %> + <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %> <% end %>
      diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 76359794c..1b20ce45b 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -1,4 +1,3 @@ -<% show_real_name ||= false %> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
      @@ -11,19 +10,11 @@
      <% id = 'project_respond_form_'+ reply.id.to_s %> - <% if show_real_name%> - <%= link_to reply.user.lastname+reply.user.firstname, user_path(reply.user) %> - <% else %> - <%= link_to reply.user.name, user_path(reply.user) %> - <% end %> + <%= link_to reply.user.name, user_path(reply.user) %> 回复 <% parent_jour = JournalsForMessage.find reply.m_reply_id %> <% if show_name && parent_jour %> - <% if show_real_name%> - <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> - <% else %> - <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> - <% end %> + <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> <% else %> <%= l(:label_anonymous) %> <% end %> @@ -51,7 +42,7 @@
      <% if reply_allow %> - <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name, :show_real_name => show_real_name} %> + <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %> <% end %>
      diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb index a4cad1a38..edb313bb5 100644 --- a/app/views/words/_new_respond.html.erb +++ b/app/views/words/_new_respond.html.erb @@ -1,5 +1,4 @@ -<% show_real_name ||= false%> -<%= form_tag(words_create_reply_path(:show_real_name=>show_real_name), :remote => true) do %> +<%= form_tag(words_create_reply_path, :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content), diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index 04cbee26e..eeb4e3ef6 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "words/journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name, :show_real_name=>@show_real_name} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); From a9349084392964229563428e72491e9ca85b5443 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 17:07:39 +0800 Subject: [PATCH 011/130] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99?= =?UTF-8?q?=E6=97=B6=E5=AD=A6=E6=A0=A1=E5=88=97=E8=A1=A8=E6=89=8B=E5=BD=A2?= =?UTF-8?q?=E7=8A=B6=202.=E9=AB=98=E6=A0=A1=E5=88=97=E8=A1=A8=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=82=AC=E6=B5=AE=E5=9C=A8=E5=AD=A6=E6=A0=A1=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E6=98=AF=E6=8C=87=E9=92=88=E5=8F=98=E4=B8=BA=E6=89=8B?= =?UTF-8?q?=E5=BD=A2=E7=8A=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index a7bf1edb8..008fe00fc 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -58,7 +58,7 @@ class SchoolController < ApplicationController options_s = "" school.each do |s| - options_s << "
    • #{s.name}
    • " + options_s << "
    • #{s.name}
    • " end res = Hash.new @@ -78,7 +78,7 @@ class SchoolController < ApplicationController @school.each do |s| #options << "" - options << "
    • #{s.name}
    • " + options << "
    • #{s.name}
    • " end @@ -91,7 +91,7 @@ class SchoolController < ApplicationController options = "" @school.each do |s| - options << "
    • #{s.name}
    • " + options << "
    • #{s.name}
    • " end render :text => options @@ -105,7 +105,7 @@ class SchoolController < ApplicationController options = "" @school.each do |s| - options << "
    • #{s.name}
    • " + options << "
    • #{s.name}
    • " end options = "
      #{l(:label_school_not_fount)}
      " if options.blank? From 86413df2774298e9b60b80493f2aaa7babad764d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 17:09:52 +0800 Subject: [PATCH 012/130] =?UTF-8?q?#1624=20=E6=96=B0=E5=BB=BA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B/=E8=AF=BE=E7=A8=8B=E9=85=8D=E7=BD=AE=EF=BC=9A?= =?UTF-8?q?=E2=80=9D=E5=AD=A6=E6=97=B6=E6=80=BB=E6=95=B0=E2=80=9C=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=A4=E4=B8=AA=E5=AD=A6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_form.html.erb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 591c6aa07..c48d24935 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -50,11 +50,6 @@ <%= l(:label_class_hour) %> -   - - <%= l(:label_class_hour) %> - -
      From ad2cf141cbca5170e953e2987e76a611a56c49fd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 17:22:15 +0800 Subject: [PATCH 013/130] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E5=88=B0=E7=AB=9E=E8=B5=9B=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=20=20=20#1600?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 627e1945b..af532cd87 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -188,10 +188,10 @@ class ContestsController < ApplicationController # Added by Longjun def destroy_contest @contest = Contest.find(params[:id]) - if @contest.author_id == User.current.id + if @contest.author_id == User.current.id || User.current.admin? @contest.destroy - redirect_to action: 'index' + redirect_to welcome_contest_url else render_403 :message => :notice_not_contest_delete_authorized end From 9898e1650b0ed31358b2e9e3ec6d1427b8a96fdc Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 27 Nov 2014 10:18:41 +0800 Subject: [PATCH 014/130] =?UTF-8?q?1=E3=80=81=E5=AD=A6=E7=94=9F=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E7=A7=81=E6=9C=89=E8=B5=84=E6=BA=90bug?= =?UTF-8?q?=E3=80=822=E3=80=81=E5=BC=95=E7=94=A8=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=B8=AD=E6=97=A0=E8=AF=BE=E7=A8=8B=E5=8F=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E6=88=91=E7=9A=84=E8=AF=BE=E7=A8=8B=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E3=80=823=E3=80=81=E5=BC=95=E7=94=A8=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 9 +++++++-- app/helpers/attachments_helper.rb | 2 +- app/helpers/files_helper.rb | 6 +++--- app/views/attachments/add_exist_file_to_courses.js.erb | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 89a96a836..25bb31cbb 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -351,8 +351,13 @@ class AttachmentsController < ApplicationController courses.each do |course| c = Course.find(course); if course_contains_attachment?(c,file) - @message += l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed) - next + if @message && @message == "" + @message += l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed) + next + else + @message += "
      " + l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed) + next + end end attach_copied_obj = file.copy attach_copied_obj.tag_list.add(file.tag_list) # tag关联 diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index f631f56ff..52002b028 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -69,7 +69,7 @@ module AttachmentsHelper def course_contains_attachment? course,attachment course.attachments.each do |att| - if att.id == attachment.id || att.copy_from == attachment.copy_from || att.copy_from = attachment.id || att.id == attachment.copy_from + if att.id == attachment.id || (!att.copy_from.nil? && !attachment.copy_from.nil? && att.copy_from == attachment.copy_from) || att.copy_from == attachment.id || att.id == attachment.copy_from return true end end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index d51606d90..c3a6a7b3e 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -54,11 +54,11 @@ module FilesHelper s.html_safe end - #判断用户是否拥有课程,需用户在该课程中角色为教师 + #判断用户是否拥有课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期 def has_course? user result = false user.courses.each do |course| - if is_course_teacher(user,course) + if is_course_teacher(User.current,course) && course_in_current_or_next_term(course) return true end end @@ -86,7 +86,7 @@ module FilesHelper def visable_attachemnts attachments result = [] attachments.each do |attachment| - if attachment.is_public? || attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end diff --git a/app/views/attachments/add_exist_file_to_courses.js.erb b/app/views/attachments/add_exist_file_to_courses.js.erb index 761111cec..eec1e255a 100644 --- a/app/views/attachments/add_exist_file_to_courses.js.erb +++ b/app/views/attachments/add_exist_file_to_courses.js.erb @@ -1,7 +1,7 @@ <% if !@save_flag && @save_message %> $("#error_show").html("<%= @save_message.join(', ') %>"); -<% elsif @message || @message != "" %> - $("#error_show").html("<%= @message %>"); +<% elsif @message && @message != "" %> + $("#error_show").html("<%= @message.html_safe %>"); <% else %> closeModal(); <% end %> From fe93a9c2c54075ad446284db94e61f0ee6891e23 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 15:39:57 +0800 Subject: [PATCH 015/130] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=96=99=E6=95=B0?= =?UTF-8?q?=E4=B8=BA0=EF=BC=8C=E5=88=99=E5=8F=96=E6=B6=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_course_list.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 8d0d6c40d..da6c0fbf0 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -25,8 +25,10 @@ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <% end %> (<%= course.members.count %>人) - <%# files_count = course.attachments.count.to_s %> - (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料) + <% files_count = course.attachments.count %> + <% if files_count > 0%> + (<%= link_to "#{files_count.to_s}份", course_files_path(course) %>资料) + <% end %>
    • <% end %> From bb1c1a0bb01470c44160de4268c628e184565c66 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 16:14:00 +0800 Subject: [PATCH 016/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E4=B8=9A=E8=AF=84=E5=88=86=E5=B1=85?= =?UTF-8?q?=E7=84=B6=E6=98=AF6=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20141127072548_update_student_score.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20141127072548_update_student_score.rb diff --git a/db/migrate/20141127072548_update_student_score.rb b/db/migrate/20141127072548_update_student_score.rb new file mode 100644 index 000000000..615e33541 --- /dev/null +++ b/db/migrate/20141127072548_update_student_score.rb @@ -0,0 +1,9 @@ +class UpdateStudentScore < ActiveRecord::Migration + def up + sql = ActiveRecord::Base.connection() + sql.update_sql("update seems_rateable_rates set stars = 5 where stars > 5") + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 973e2afbe..4baec2343 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141120091234) do +ActiveRecord::Schema.define(:version => 20141127072548) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 743bfd551aacc83fc4dbf035973d454dd553301c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 16:22:59 +0800 Subject: [PATCH 017/130] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=97=B6=E9=97=B4=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_homework.html.erb | 4 ++++ public/stylesheets/css.css | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 7b214268f..e14475f9f 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -19,6 +19,10 @@ <% homework_filename = homework.name %> <% end %> <%= link_to homework_filename , homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type), :title => homework_filename, :remote => true%> + + 提交时间: + <%= format_time homework.created_at%> +
    • <%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%> diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 57304220a..17316c095 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -38,7 +38,7 @@ a:hover.tb_all{ background:#eaeaea; text-decoration:none;} .pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;} .pic_head img{ border:1px solid #fff;} .pic_head img:hover{border:1px solid #15bccf;} -.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} +.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:15px 0 0 0px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} .dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;} .wscore{ padding-top:22px; color:#888888; width:96px;} .dis ul li.wping{margin-left:12px; } From 9a7160178c8cc2283470f285521b4ad9932c6302 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 16:33:17 +0800 Subject: [PATCH 018/130] =?UTF-8?q?#1633=20=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=EF=BC=9A=E2=80=9C=E6=8F=90=E4=BA=A4=E2=80=9D?= =?UTF-8?q?=E3=80=81=E2=80=9C=E9=A2=84=E8=A7=88=E2=80=9D=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=98=BE=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/boards/_course_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index cde2019a1..7514b48f6 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -20,7 +20,7 @@ <%= render :partial => 'messages/form', :locals => {:f => f} %>

      - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>

      <% end %> From cd3f4ef8d3395d2528dcb6463d136251b043e4e0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 16:44:14 +0800 Subject: [PATCH 019/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BAjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- app/views/layouts/_tag.html.erb | 8 ++++---- app/views/tags/_tag.html.erb | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c5d8c9b5..8c2542aa2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -251,7 +251,7 @@ module ApplicationHelper end def toggle_link(name, id, options={}) - onclick = "$('##{id}').toggle(); " + onclick = "$('##{id}').slideToggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") onclick << "return false;" link_to(name, "#", :onclick => onclick) diff --git a/app/views/layouts/_tag.html.erb b/app/views/layouts/_tag.html.erb index e0e2b49fd..898d9b580 100644 --- a/app/views/layouts/_tag.html.erb +++ b/app/views/layouts/_tag.html.erb @@ -11,12 +11,12 @@
    @@ -29,12 +29,12 @@
    diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 3efd0cfab..06680d373 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -44,7 +44,7 @@ <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", - :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> + :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %> <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>    @@ -72,7 +72,7 @@ <% end %> From 7fa8d2fff854ad7852a40632860c7487fe94bf89 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 17:05:53 +0800 Subject: [PATCH 020/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=A0=87=E9=A2=98=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/contest.html.erb | 16 ++++++++++++---- app/views/contests/index.html.erb | 12 +++++++++--- .../_base_softapplication_top_content.html.erb | 2 +- app/views/layouts/base_newcontest.html.erb | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/views/bids/contest.html.erb b/app/views/bids/contest.html.erb index bd069c8c8..a5dcf8041 100644 --- a/app/views/bids/contest.html.erb +++ b/app/views/bids/contest.html.erb @@ -2,8 +2,14 @@ <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> - - + + - - +
    <%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : + <% if User.current.logged? %> <% unless User.current.user_extensions.identity == 1 %> @@ -20,8 +26,10 @@
    <%= link_to request.host()+"/contest", :controller => 'bids', :action => 'index' %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> + <%=link_to l(:field_homepage), home_path %> > + <%= l(:label_contest_innovate) %> +
    <% end %> diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 0c6b0e109..f966f149d 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -2,8 +2,14 @@ <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> - - + + diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb index e92ce7c34..afa2e1d29 100644 --- a/app/views/layouts/_base_softapplication_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -15,7 +15,7 @@
    <%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : + <% if User.current.logged? %> <% unless User.current.user_extensions.identity == 1 %> @@ -29,7 +35,7 @@ <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> + <%= l(:label_contest_innovate) %>
    <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + <%= l(:label_contest_innovate) %> <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index 52a65e379..c118078d0 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -47,7 +47,7 @@
    <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + <%= l(:label_contest_innovate) %> > <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> From 71e7d2c8725ce8ed98f1693e8ea2c70fe417286e Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 27 Nov 2014 17:17:33 +0800 Subject: [PATCH 021/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A8=E7=AB=99?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA=E7=AD=96?= =?UTF-8?q?=E7=95=A5=EF=BC=9A=E7=A7=81=E6=9C=89=E8=B5=84=E6=BA=90=E5=B1=9E?= =?UTF-8?q?=E4=BA=8E=E5=BD=93=E5=89=8D=E8=AF=BE=E7=A8=8B=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E4=B8=BA=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=88=90=E5=91=98=E6=97=B6=E5=8F=AF?= =?UTF-8?q?=E8=A7=81=EF=BC=8C=E5=85=B6=E4=BB=96=E6=83=85=E5=86=B5=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E8=B5=84=E6=BA=90=E4=B8=8D=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 5 +++-- app/helpers/files_helper.rb | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index aa1c158e0..ac228e0d4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -51,7 +51,7 @@ class FilesController < ApplicationController #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? if params[:insite] @result = find_public_attache q - @result = visable_attachemnts @result + @result = visable_attachemnts_insite @result,@course @searched_attach = paginateHelper @result,10 else @result = find_course_attache q,@course @@ -66,8 +66,9 @@ class FilesController < ApplicationController end def find_course_attache keywords,course - resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%"). + resultSet = Attachment.where("(attachments.container_type = 'Course'And attachments.container_id = '#{course.id}') OR (attachments.container_type = 'HomeworkAttach' AND ) AND filename LIKE :like ", like: "%#{keywords}%"). reorder("created_on DESC") + #resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC") end def find_public_attache keywords diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index c3a6a7b3e..253ce34a5 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -93,6 +93,27 @@ module FilesHelper result end + def visable_attachemnts_incourse attachments + result = [] + attachments.each do |attachment| + if attachment.is_public? || (attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + result << attachment + end + end + result + end + + def visable_attachemnts_insite attachments,course + result = [] + attachments.each do |attachment| + if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + result << attachment + end + end + result + end + + def get_qute_number attachment if attachment.copy_from result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.copy_from}") From 21c1b63c6de5b15df489144c50f18e7f11f0c00a Mon Sep 17 00:00:00 2001 From: zhuhao Date: Thu, 27 Nov 2014 17:34:27 +0800 Subject: [PATCH 022/130] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=92=8C=E7=95=99=E8=A8=80=E4=B8=A4=E5=A4=84=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 6 ++++-- app/views/courses/new_homework.html.erb | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index e1efe4f58..68b92c00e 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -14,11 +14,13 @@
    <%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> - <%= f.text_area 'course_message', :rows => 3, :cols => 65, + <%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65, :placeholder => "#{l(:label_welcome_my_respond)}", :style => "resize: none; width: 98%", :class => 'noline',:maxlength => 250%> - <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> + + <%= l(:button_leave_meassge)%> + <% end %>
    <% end %> diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index 7b6784243..e3121c6ad 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -106,7 +106,8 @@ <%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
    <%= render :partial => 'homework_form', :locals => { :f => f } %> - + + <%= l(:button_create)%> <%= javascript_tag "$('#bid_name').focus();" %> <% end %>
    \ No newline at end of file From a33084545f0edd9b177594e4d884f54e1295db76 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Fri, 28 Nov 2014 09:27:43 +0800 Subject: [PATCH 023/130] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/edit.html.erb | 5 ++++- app/views/boards/_course_show.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index 0a2d17e7d..17e805fce 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -118,6 +118,9 @@
    <%#= render :partial => 'homework_form', :locals => { :f => f } %> <%= render :partial => 'homework_form', :locals => { :f => f } %> - + + + <%= l(:button_create)%> + <% end %>
    \ No newline at end of file diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 7514b48f6..7a7d001ed 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -19,7 +19,7 @@ <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %> <%= render :partial => 'messages/form', :locals => {:f => f} %>

    - + <%= l(:button_submit)%> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>

    From 514dcb97a0afedd84e105786374e562e1897002d Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 28 Nov 2014 11:33:51 +0800 Subject: [PATCH 024/130] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8C=89=E6=97=B6=E9=97=B4=E3=80=81=E4=B8=8B=E8=BD=BD=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 34 ++++++++++++++++++++------- app/helpers/files_helper.rb | 6 ++--- app/views/files/_course_list.html.erb | 23 +++++++++--------- app/views/files/search.js.erb | 2 +- 4 files changed, 41 insertions(+), 24 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index ac228e0d4..c20b5a0de 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -45,16 +45,28 @@ class FilesController < ApplicationController end def search + sort = "" + @sort = "" + @order = "" + @is_remote = true + if params[:sort] + order_by = params[:sort].split(":") + @sort = order_by[0] + if order_by.count > 1 + @order = order_by[1] + end + sort = "#{@sort} #{@order}" + end + begin - @is_remote = true q = "%#{params[:name].strip}%" #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? if params[:insite] - @result = find_public_attache q + @result = find_public_attache q,sort @result = visable_attachemnts_insite @result,@course @searched_attach = paginateHelper @result,10 else - @result = find_course_attache q,@course + @result = find_course_attache q,@course,sort @result = visable_attachemnts @result @searched_attach = paginateHelper @result,10 end @@ -65,18 +77,24 @@ class FilesController < ApplicationController end end - def find_course_attache keywords,course - resultSet = Attachment.where("(attachments.container_type = 'Course'And attachments.container_id = '#{course.id}') OR (attachments.container_type = 'HomeworkAttach' AND ) AND filename LIKE :like ", like: "%#{keywords}%"). - reorder("created_on DESC") + def find_course_attache keywords,course,sort = "" + if sort == "" + sort = "created_on DESC" + end + resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%"). + reorder(sort) #resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC") end - def find_public_attache keywords + def find_public_attache keywords,sort = "" # StoresController#search 将每条文件都查出来,再次进行判断过滤。---> resultSet.to_a.map # 此时内容不多速度还可,但文件增长,每条判断多则进行3-4次表连接。 # 现在还木有思路 药丸 + if sort == "" + sort = "created_on DESC" + end resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%"). - reorder("created_on DESC") + reorder(sort) end def index diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 253ce34a5..c9a232c36 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -54,11 +54,11 @@ module FilesHelper s.html_safe end - #判断用户是否拥有课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期 - def has_course? user + #判断用户是否拥有除current_course以外的课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期 + def has_course? user,current_course result = false user.courses.each do |course| - if is_course_teacher(User.current,course) && course_in_current_or_next_term(course) + if current_course.id != course.id && is_course_teacher(User.current,course) && course_in_current_or_next_term(course) return true end end diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 93e39f73f..02dc816b2 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -2,16 +2,15 @@

    共有 <%= all_attachments.count%> 个资源

    - - 资源列表的多样化排序将在下周上线... + <% if order == "asc" %> + 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /  + <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> 排序 + <% else %> + 按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /  + <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> 排序 + <% end %>

    @@ -21,7 +20,7 @@ <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if is_course_teacher(User.current,@course) && file.author_id == User.current.id %> - <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %> + <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,@course) %> <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %> @@ -31,7 +30,7 @@ <% end %> <% else %> - <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %> + <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,@course) %> <% end %> <% else %> <% end %> diff --git a/app/views/files/search.js.erb b/app/views/files/search.js.erb index 84c9a4707..50f46d2f5 100644 --- a/app/views/files/search.js.erb +++ b/app/views/files/search.js.erb @@ -1 +1 @@ -$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:"create_on",order:"",curse_attachments:@searched_attach})%>"); \ No newline at end of file +$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>"); \ No newline at end of file From 179b6852da54f68718847fa54b8e2ea047fec743 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 28 Nov 2014 16:16:22 +0800 Subject: [PATCH 025/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E4=BB=A5=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index bd389ff68..5cffcc31c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -485,7 +485,7 @@ class CoursesController < ApplicationController end def homework - if @course.is_public != 0 || User.current.member_of_course?(@course) + if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin? @offset, @limit = api_offset_and_limit({:limit => 10}) @bids = @course.homeworks.order('deadline DESC') @bids = @bids.like(params[:name]) if params[:name].present? From 38a912672af4bfd23094191c45233daa3f50b65d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 11:15:03 +0800 Subject: [PATCH 026/130] =?UTF-8?q?=E6=89=8B=E5=86=99=E8=AF=84=E5=88=86?= =?UTF-8?q?=E7=9B=B8=E5=85=B3js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 8 ++--- app/views/homework_attach/_show.html.erb | 31 +++++++++++------- app/views/homework_attach/_show_star.html.erb | 22 ++++--------- app/views/homework_attach/show.js.erb | 2 +- public/images/bid/star.png | Bin 0 -> 1601 bytes public/stylesheets/css.css | 3 +- 6 files changed, 30 insertions(+), 36 deletions(-) create mode 100644 public/images/bid/star.png diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index ff6463036..dacf897da 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -393,17 +393,15 @@ class HomeworkAttachController < ApplicationController unless annymous_users.nil? || annymous_users.count == 0 @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") end - @totle_score = score_for_homework @homework - @teaher_score = teacher_score_for_homework @homework + #@totle_score = score_for_homework @homework + #@teaher_score = teacher_score_for_homework @homework is_student = is_cur_course_student @homework.bid.courses.first is_teacher = is_course_teacher User.current,@homework.bid.courses.first @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 if !User.current.member_of_course?(@homework.bid.courses.first) @is_comprehensive_evaluation = 3 #留言 - elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 - @is_comprehensive_evaluation = 2 #匿评 - elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 + elsif is_student && @is_anonymous_comments#是学生且开启了匿评 @is_comprehensive_evaluation = 2 #匿评 elsif is_student && !@is_anonymous_comments #是学生未开启匿评 @is_comprehensive_evaluation = 3 #留言 diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index bf797e441..416ca4f66 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -36,17 +36,18 @@ this.relatedElement.className = ''; this.relatedElement.firstChild.nodeValue = currentLength; } - function test(){alert('test');} - //中的onmouseover 改成 onclick; - //]]> + function g(o){return document.getElementById(o);} + function HoverLi(n){ + for(var i=3;i<=5;i++){g('ping_tb_'+i).className='ping_normaltab';g('tbc_0'+i).className='ping_undis';}g('tbc_0'+n).className='ping_dis';g('ping_tb_'+n).className='ping_hovertab'; + } + + function ChoseStars(num) + { + for (var i = num + 1; i <= 5; i++) {$("#star0" + i).css("background-position","-2px 0");} + for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");} + $("#stars_value").val(num); + } -<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>

    <%= @homework.name %>

    @@ -113,8 +114,14 @@

    - <%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation , - :homework => @homework} %> + <% if @is_comprehensive_evaluation == 3 || User.current == homework.user%> + + <% else @is_comprehensive_evaluation == 2 %> + + <%= l(:label_work_rating) %>: + <%= render :partial => 'show_star',:locals => {start_score:@m_score} %> + <% end %> +
    diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index 0f842a1cd..d98e35a0e 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -1,16 +1,6 @@ -<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> - -<% elsif is_comprehensive_evaluation == 2 %> - <% if has_evaluation %> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %> - <% else %> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> - <% end %> - -<% elsif @is_comprehensive_evaluation == 1%> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %> -<% end %> \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/app/views/homework_attach/show.js.erb b/app/views/homework_attach/show.js.erb index d63b5fb8f..ac0a3e505 100644 --- a/app/views/homework_attach/show.js.erb +++ b/app/views/homework_attach/show.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').css('height','569px'); $('#ajax-modal').siblings().remove(); diff --git a/public/images/bid/star.png b/public/images/bid/star.png new file mode 100644 index 0000000000000000000000000000000000000000..507e19020d7030cd0ccd5e07f0f74cebce399475 GIT binary patch literal 1601 zcmV-H2EO@;P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ>$4Nv%RCwC#m_ck4R~pBEGd8xd9UGirBH9pD1%iVjN+}XZyP!s^4J)mXno|!8 z((Z-54}DN<9>D*aOvSwNkPYyAmsbHqvU*T7oJSE{;tgq)zN63{D)^j>j|e z=Jnvlj^o%&7WcIMq)+mE{=fgc`Oo*h_q|c1l>BV1rtWrtuIoRYl9j*yWZb1vX;<9J zZZbyGG#Lm4c>er3Cr+GDx;pcW(wN9$*;Ve@+1WaGEEZF`nlVBM>G62*`Fw;zA` z=P?YU?(_5W-K#O>a#?yj9#mDuwryN47vXT2#l^+ff3s^hB*nYU!W8e;;;(5dD=RXe z&$BgS^7%X~D=YGKYK*jPn@XjEWm)v}^dP0gw(U9~m&>td&mImQJc!HX0&rFvq>$Jp zDEtMoe{7F?;|tjLA*ex6T#mS+3vu z@}wRMg+dGu4-*cDm6oOS=+ProRi&@5k4Pj!Fc|D83V`45r?6Dnr}D<6oJz_V7~%Fz|kMC zf7Q9axpnK-|6H&yU%sroviM3V<()fsID7Uie!rg`YE#`d3v@gl=iW#bS{}BGJ@?UA=l0kH^!(?QVAikH@2w%Vnu33a>gg$oF+cU?pNn6$*`q`hMtikb*pyzEUJcjgVko|izUQr$QG1Y1n zfRT|AW@cu1`t&JX2RM@+B zZ&Ok3?d_#pE)x!ioe5LTH?jd>@ovpK;e7`jQEzN)uqn*Vn>SnjUs_t?{{8z+_|2n^ zBVj6)3U0R>%d#*{lT<22B9WlKzn|shWkyCuIDY&%UayxxAV8r|a4t;g+h$<^_5|V0 zi?H-hFiWj?hr+C`u3{L*_T|OVqeq#Wn``-R>lx6IFoi+^%d$u&lg!S}a_Q0~&Ye4_ zZ0$C0-@Z*O7GwYZ{gg^2=S%7POzljxX}`~dH_}Mw>Z;^Vz0LT(_naNQ*48l1hU(X^ zU&rtFD_b%|Ub}X!2|q9}(7q4Z?m`GTIXNkl$)vPxTeia`lSw%_IVr2vYFkW;3scI^ zk#g}~=P`@-YB*s!<`zQ8iHQlBPNzGLNvG3tVq!uHA$G)d{7_}vwsg{$2qC1)<=WlH zC8q^-7ln6g0ahIB8l7;;&)A?E00000NkvXXu0mjf)oc^Q literal 0 HcmV?d00001 diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 17316c095..b6d61c865 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -80,8 +80,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p span a{ color:#777777;} .ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;} -.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;} -.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;} +.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;} From f5b1cbcfe456ee36e823e0745180ca6f21b70a21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 14:47:07 +0800 Subject: [PATCH 027/130] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E6=95=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 14 +++++++++----- app/views/homework_attach/_addjour.html.erb | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index dacf897da..2f6be7611 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -372,11 +372,11 @@ class HomeworkAttachController < ApplicationController def show if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first) # 打分统计 - stars_reates = @homework. rates(:quality) + #stars_reates = @homework. rates(:quality) #是否已经进行过评价 temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{@homework.id} AND rater_id = #{User.current.id}").first @m_score = temp.nil? ? 0:temp.stars - @has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0 + @has_evaluation = @homework.has_rated?( User.current,:quality) #@jours留言 is null条件用以兼容历史数据 @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC") @cur_page = params[:cur_page] || 1 @@ -385,13 +385,17 @@ class HomeworkAttachController < ApplicationController teachers = searchTeacherAndAssistant @course @comprehensive_evaluation = [] + #JourForMessage的is_comprehensive_evaluation字段: + #1:老师评价 + #2:学生评价 + #3 || null:学生留言 teachers.each do|teacher| temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first @comprehensive_evaluation << temp if temp end - annymous_users = @homework.homework_evaluations.map(&:user) - unless annymous_users.nil? || annymous_users.count == 0 - @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") + annymous_users = @homework.homework_evaluations.map { |homework_evaluation| homework_evaluation.user.id}.join(',') + unless annymous_users.nil? || annymous_users == "" + @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in (#{annymous_users})").order("created_on DESC") end #@totle_score = score_for_homework @homework #@teaher_score = teacher_score_for_homework @homework diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb index 5b2889b57..8d4c1eaf2 100644 --- a/app/views/homework_attach/_addjour.html.erb +++ b/app/views/homework_attach/_addjour.html.erb @@ -50,7 +50,7 @@ } } - function submit1(button) + function submit1() { $('#jours_submit').parent().submit(); } From 298b767fc4676674920eef5f4de656fe127264b7 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 1 Dec 2014 15:03:47 +0800 Subject: [PATCH 028/130] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=AF=B9=E4=BA=8E=E8=AF=BE=E7=A8=8B=E5=A4=96=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=B8=8D=E5=9C=A8=E6=98=BE=E7=A4=BA=E7=A7=81=E6=9C=89?= =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/files_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index c9a232c36..e1aebefdc 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -86,7 +86,7 @@ module FilesHelper def visable_attachemnts attachments result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end @@ -106,7 +106,7 @@ module FilesHelper def visable_attachemnts_insite attachments,course result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end From 9a613543287e6998a07e98677330c24ccbfd1e39 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 15:41:49 +0800 Subject: [PATCH 029/130] =?UTF-8?q?1.=E8=AF=84=E5=88=86=E3=80=81=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E4=BD=9C=E4=B8=BA=E4=B8=80=E4=B8=AAaction=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=88=B0=E6=9C=8D=E5=8A=A1=E5=99=A8=202.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=9A=84show=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8F=82=E6=95=B0=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 51 ++++++++----------- app/views/homework_attach/_addjour.html.erb | 15 +++++- app/views/homework_attach/_show.html.erb | 14 +---- app/views/homework_attach/_show_star.html.erb | 2 +- .../lib/seems_rateable/model.rb | 6 +-- 5 files changed, 41 insertions(+), 47 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 2f6be7611..17dbb5cae 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -403,10 +403,13 @@ class HomeworkAttachController < ApplicationController is_student = is_cur_course_student @homework.bid.courses.first is_teacher = is_course_teacher User.current,@homework.bid.courses.first @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 + #@is_comprehensive_evaluation 1:教师评论,2:学生匿评,3:学生留言 if !User.current.member_of_course?(@homework.bid.courses.first) @is_comprehensive_evaluation = 3 #留言 - elsif is_student && @is_anonymous_comments#是学生且开启了匿评 + elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 @is_comprehensive_evaluation = 2 #匿评 + elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 + @is_comprehensive_evaluation = 3 #留言 elsif is_student && !@is_anonymous_comments #是学生未开启匿评 @is_comprehensive_evaluation = 3 #留言 elsif is_teacher @@ -458,14 +461,17 @@ class HomeworkAttachController < ApplicationController #添加留言 def addjours @homework = HomeworkAttach.find(params[:jour_id]) + #保存评分 + @homework.rate(params[:stars_value],User.current.id,:quality) + #保存评论 @add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation] if @add_jour.is_comprehensive_evaluation == 3 @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC") @jour = paginateHelper @jours,5 elsif @add_jour.is_comprehensive_evaluation == 2 - annymous_users = @homework.homework_evaluations.map(&:user) - unless annymous_users.nil? || annymous_users.count == 0 - @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") + annymous_users = @homework.homework_evaluations.map { |homework_evaluation| homework_evaluation.user.id}.join(',') + unless annymous_users.nil? || annymous_users == "" + @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in (#{annymous_users})").order("created_on DESC") end elsif @add_jour.is_comprehensive_evaluation == 1 teachers = searchTeacherAndAssistant @homework.bid.courses.first @@ -476,36 +482,23 @@ class HomeworkAttachController < ApplicationController end end - - #@limit = 10 - #@feedback_count = @jours.count - #@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] - #@offset ||= @feedback_pages.offset - #@jour = @jours[@offset, @limit] - #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC") - - @totle_score = score_for_homework @homework - @teaher_score = teacher_score_for_homework @homework - stars_reates = @homework. rates(:quality) is_student = is_cur_course_student @homework.bid.courses.first - is_teacher = is_course_teacher User.current,@homework.bid.courses.first - @has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0 - @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 - if !User.current.member_of_course?(@homework.bid.courses.first) - @is_comprehensive_evaluation = 3 #留言 - elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 - @is_comprehensive_evaluation = 2 #匿评 - elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 - @is_comprehensive_evaluation = 3 #留言 - elsif is_student && !@is_anonymous_comments #是学生未开启匿评 - @is_comprehensive_evaluation = 3 #留言 - elsif is_teacher - @is_comprehensive_evaluation = 1 #教师评论 + #@has_evaluation = @homework.has_rated?( User.current,:quality) + is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 + if User.current.member_of_course?(@homework.bid.courses.first) + if is_student && is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 + @is_comprehensive_evaluation = 2 #匿评 + elsif is_student && is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 + @is_comprehensive_evaluation = 3 #留言 + elsif is_student && !is_anonymous_comments #是学生未开启匿评 + @is_comprehensive_evaluation = 3 #留言 + else #是老师 + @is_comprehensive_evaluation = 1 #教师评论 + end else @is_comprehensive_evaluation = 3 end - respond_to do |format| format.js end diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb index 8d4c1eaf2..a2b0013e0 100644 --- a/app/views/homework_attach/_addjour.html.erb +++ b/app/views/homework_attach/_addjour.html.erb @@ -52,6 +52,8 @@ function submit1() { + if($("#stars_value").val() == "0"){alert("您还没有打分");return;} + if($("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;} $('#jours_submit').parent().submit(); } @@ -62,6 +64,18 @@ :jour_id => homework_attach.id, :is_comprehensive_evaluation => is_comprehensive_evaluation, :sta => sta}) do |f|%> + +
    + <% if @is_comprehensive_evaluation == 3 || User.current == homework_attach.user%> + + <% else @is_comprehensive_evaluation == 2 %> + + <%= l(:label_work_rating) %>: + <%= render :partial => 'show_star',:locals => {start_score:m_score} %> + <% end %> +
    +
    +
    <%= render :partial => 'words/pre_show', :locals => {:content => @content} %> @@ -75,7 +89,6 @@ <%= f.text_field :reference_user_id, :style=>"display:none"%> <% else %>
    diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index 416ca4f66..42a5cead5 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -112,20 +112,8 @@ <% end%>

    - -
    - <% if @is_comprehensive_evaluation == 3 || User.current == homework.user%> - - <% else @is_comprehensive_evaluation == 2 %> - - <%= l(:label_work_rating) %>: - <%= render :partial => 'show_star',:locals => {start_score:@m_score} %> - <% end %> - -
    -
    - <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %> + <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation, :m_score => @m_score} %>
    diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index d98e35a0e..3b6e23880 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -3,4 +3,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/lib/seems_rateable/lib/seems_rateable/model.rb b/lib/seems_rateable/lib/seems_rateable/model.rb index b4ebbb196..83d37d555 100644 --- a/lib/seems_rateable/lib/seems_rateable/model.rb +++ b/lib/seems_rateable/lib/seems_rateable/model.rb @@ -37,9 +37,9 @@ module SeemsRateable def update_users_rating(stars, user_id, dimension=nil) obj = rates(dimension).where(:rater_id => user_id).first - current_record = average(dimension) - current_record.avg = (current_record.avg*current_record.cnt - obj.stars + stars) / (current_record.cnt) - current_record.save! + #current_record = average(dimension) + #current_record.avg = (current_record.avg*current_record.cnt - obj.stars + stars) / (current_record.cnt) + #current_record.save! obj.stars = stars obj.save! end From 21c4caa7a696230197b1376073bf0abddf6e51ab Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 16:31:13 +0800 Subject: [PATCH 030/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=84=E8=AE=BA=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E3=80=81=E7=95=99=E8=A8=80=E5=80=BC=E8=AE=BE?= =?UTF-8?q?=E5=AE=9A=E9=80=BB=E8=BE=91=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 17dbb5cae..816ee0bf8 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -400,20 +400,20 @@ class HomeworkAttachController < ApplicationController #@totle_score = score_for_homework @homework #@teaher_score = teacher_score_for_homework @homework - is_student = is_cur_course_student @homework.bid.courses.first + #is_student = is_cur_course_student @homework.bid.courses.first is_teacher = is_course_teacher User.current,@homework.bid.courses.first @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 #@is_comprehensive_evaluation 1:教师评论,2:学生匿评,3:学生留言 - if !User.current.member_of_course?(@homework.bid.courses.first) - @is_comprehensive_evaluation = 3 #留言 - elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 - @is_comprehensive_evaluation = 2 #匿评 - elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 - @is_comprehensive_evaluation = 3 #留言 - elsif is_student && !@is_anonymous_comments #是学生未开启匿评 - @is_comprehensive_evaluation = 3 #留言 - elsif is_teacher - @is_comprehensive_evaluation = 1 #教师评论 + if User.current.member_of_course?(@homework.bid.courses.first) + if is_teacher + @is_comprehensive_evaluation = 1 #教师评论 + else + if is_student && @is_anonymous_comments && !@has_evaluation #是学生且开启了匿评且未进行评分 + @is_comprehensive_evaluation = 2 #匿评 + else #是学生未开启匿评或者已经进行评分 + @is_comprehensive_evaluation = 3 #留言 + end + end else @is_comprehensive_evaluation = 3 end @@ -438,9 +438,9 @@ class HomeworkAttachController < ApplicationController @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC") @jour = paginateHelper @jours,5 elsif @is_comprehensive_evaluation == 2 - annymous_users = @homework.homework_evaluations.map(&:user) - unless annymous_users.nil? || annymous_users.count == 0 - @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") + annymous_users = @homework.homework_evaluations.map { |homework_evaluation| homework_evaluation.user.id}.join(',') + unless annymous_users.nil? || annymous_users.count == "" + @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in (#{annymous_users})").order("created_on DESC") end elsif @is_comprehensive_evaluation == 1 teachers = searchTeacherAndAssistant @course @@ -450,9 +450,6 @@ class HomeworkAttachController < ApplicationController @comprehensive_evaluation << temp if temp end end - - - respond_to do |format| format.js end @@ -482,18 +479,18 @@ class HomeworkAttachController < ApplicationController end end - is_student = is_cur_course_student @homework.bid.courses.first - #@has_evaluation = @homework.has_rated?( User.current,:quality) - is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 + is_teacher = is_course_teacher User.current,@homework.bid.courses.first + @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 + #@is_comprehensive_evaluation 1:教师评论,2:学生匿评,3:学生留言 if User.current.member_of_course?(@homework.bid.courses.first) - if is_student && is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 - @is_comprehensive_evaluation = 2 #匿评 - elsif is_student && is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 - @is_comprehensive_evaluation = 3 #留言 - elsif is_student && !is_anonymous_comments #是学生未开启匿评 - @is_comprehensive_evaluation = 3 #留言 - else #是老师 + if is_teacher @is_comprehensive_evaluation = 1 #教师评论 + else + if is_student && @is_anonymous_comments && !@has_evaluation #是学生且开启了匿评且未进行评分 + @is_comprehensive_evaluation = 2 #匿评 + else #是学生未开启匿评或者已经进行评分 + @is_comprehensive_evaluation = 3 #留言 + end end else @is_comprehensive_evaluation = 3 From d37d7fb83de0a6d1f55138441a9209222fdcb20f Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 1 Dec 2014 16:34:25 +0800 Subject: [PATCH 031/130] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A8=A1=E5=9D=97=E4=B8=A4=E4=B8=AA=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8C=89=E9=92=AE=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=89=8D=E6=94=B9=E5=8F=98=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E4=BB=A3=E7=A0=81=E8=A2=AB=E8=BF=98=E5=8E=9F=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 85 ++++++++++++++------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 04ce917c8..030b6cb24 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -4,55 +4,60 @@ <%= stylesheet_link_tag 'resource', :media => 'all' %>
    -
    -
    +
    +
    <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onclick => "presscss('incourse')"%> - <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onclick => "presscss('insite')" %> + <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> - <% if is_course_teacher(User.current,@course) %> - 上传资源 - <% end %> -
    -
    + <% if is_course_teacher(User.current,@course) %> + 上传资源 + <% end %> +
    +
    -
    -<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %> -
    +
    + <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %> +
    -
    +
    <% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file From 6fd68806d542b4a11b32b813ff940cfef9d2891c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 16:45:03 +0800 Subject: [PATCH 032/130] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=95=99=E5=B8=88=E5=B0=B1=E5=85=B7=E6=9C=89=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E3=80=81=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 3 +++ app/views/bids/_bid_homework_show.html.erb | 2 +- app/views/layouts/base_homework.html.erb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 816ee0bf8..28bac9627 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -570,6 +570,9 @@ class HomeworkAttachController < ApplicationController #获取课程的老师列表 def find_course_teachers course + t = [] + course.members.map{|m| t << m.user_id if m.user.allowed_to?(:as_teacher,course)} + teachers = "(" teacher_members = searchTeacherAndAssistant(course) teacher_members.each do |member| diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 630d7552c..e7b58fefc 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -68,7 +68,7 @@ <% end %> <% end %> - <% if (User.current.admin?||User.current.id==bid.author_id) %> + <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %> <% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%> <% case bid.comment_status %> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 9ce2a6edf..7c40173a0 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -117,7 +117,7 @@
    - <% if (User.current.admin?||User.current.id==@bid.author_id) %> + <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,course)) %>
    <% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%> From a7d7b790d2045d2cc84d122f9ecca9b9d0025a22 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Mon, 1 Dec 2014 20:26:21 +0800 Subject: [PATCH 033/130] =?UTF-8?q?=E5=85=AC=E5=85=B1=E9=A1=B5=E4=B8=AA?= =?UTF-8?q?=E6=80=A7=E7=AD=BE=E5=90=8D=E7=9A=84=E6=8F=90=E4=BA=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=98=BE=E7=A4=BA=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_users.html.erb | 7 +++++-- config/locales/zh.yml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 186166dc8..ba84abc68 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -189,7 +189,7 @@