From f35dd2a30d67c01b948600fbf6e7c4ec49c2d9b4 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 12 May 2014 15:06:34 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=8D=E5=90=88=E9=AA=8C=E8=AF=81=EF=BC=8C?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A1=B5=E9=9D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 3136c5838..b4309bf17 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -693,7 +693,10 @@ class BidsController < ApplicationController redirect_to respond_path(@bid) else @bid.safe_attributes = params[:bid] - render :action => 'new_bid' + @homework = @bid + @project = Project.find_by_id(params[:course_id]) + @project_id = @project.id + render file: 'projects/new_homework', layout: 'base_courses' end end From 297835e25be669612af746ccb9b66236abd88402 Mon Sep 17 00:00:00 2001 From: xianbo Date: Mon, 12 May 2014 17:40:37 +0800 Subject: [PATCH 02/22] fix --- app/views/welcome/contest.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index e32d375d0..19ef620f2 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -153,7 +153,7 @@ <%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> - (<%= link_to("含#{contest.projects.where('is_public=1').count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %>) + (<%= link_to("含#{contest.projects.where('is_public=1').count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% else %> (<%= link_to("含#{contest.contesting_softapplications.count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% end %> From a22e082cb5df2c1b6186db798d9764c1c32c1d7b Mon Sep 17 00:00:00 2001 From: xianbo Date: Wed, 14 May 2014 10:07:01 +0800 Subject: [PATCH 03/22] fix repository info --- app/views/repositories/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 493280647..09ab9738f 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -13,7 +13,6 @@ <%=h @repository.url %> <% end %> - <% if @repositories.size >1 %>

(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo| link_to h(repo.name), @@ -21,7 +20,6 @@ :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :class => 'repository' + (repo == @repository ? ' selected' : '') }.join(' | ').html_safe %>)

- <% else %>

项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码

建立版本库文件夹,打开命令行执行如下:

@@ -29,6 +27,7 @@

git add *

git commit -m "first commit"

git remote add origin <%= @repos_url%>

+

git config http.postBuffer 524288000 #设置本地post缓存为500MB

git push -u origin master:master

已经有本地库,还没有配置远程地址,打开命令行执行如下:

@@ -36,6 +35,7 @@

git remote add origin <%= @repos_url%>

git add .

git commit -m "first commit"

+

git config http.postBuffer 524288000 #设置本地post缓存为500MB

git push -u origin master:matser

@@ -44,10 +44,10 @@

git remote add trustie <%= @repos_url%>

git add .

git commit -m "first commit"

+

git config http.postBuffer 524288000 #设置本地post缓存为500MB

git push -u trustie master:matser

<%= link_to "李海提供", user_path(646)%>

- <% end %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> From cea01b4df5795da45bcf43a5e0a0e4823fe6c496 Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 14 May 2014 18:33:27 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?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/files/index.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 0d9a3a21f..08052f11e 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -296,7 +296,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } }); } @@ -312,7 +312,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } ; }); @@ -331,7 +331,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } ; }); @@ -350,7 +350,7 @@ type: "POST" }); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } }); } From 6086b25db7bd37f587b041357207ed5db91ffdee Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 09:19:59 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=80=92=E5=BA=8F=E5=8E=BB=E6=8E=89=E6=A5=BC=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/views/memos/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 20f0b45c4..b4de06fb6 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -94,7 +94,7 @@ class MemosController < ApplicationController @reply_pages = Paginator.new @reply_count, pre_count, page @replies = @memo.children. includes(:author, :attachments). - reorder("#{Memo.table_name}.created_at ASC"). + reorder("#{Memo.table_name}.created_at DESC"). limit(@reply_pages.per_page). offset(@reply_pages.offset). all diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 6ea5b17bc..a40ee631a 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -65,7 +65,7 @@ <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
"> -

<%= pages_count += 1 %>楼 :

+

<%= pages_count += 1 %>楼 :

<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%> -温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~ + <%= watch_projects @state %> <% unless @memberships.empty? %>
diff --git a/app/views/users/watch_projects.html.erb b/app/views/users/watch_projects.html.erb index 7842e6d52..42047d4ea 100644 --- a/app/views/users/watch_projects.html.erb +++ b/app/views/users/watch_projects.html.erb @@ -1,5 +1,5 @@ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%> -温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~ + <%= watch_projects @state%> <% if @watch_projects.count > 0 %> <% for watch_project in @watch_projects %> From c48b850cf7a3a78752ed2642f28d80f9da8532e9 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 10:50:46 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=9E=8B=E4=BD=9C=E4=B8=9A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 11 ++++++++++- app/models/biding_project.rb | 2 +- app/views/bids/_list_projects.html.erb | 7 ++++++- config/routes.rb | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 0c0b71ffa..6a9fb5c29 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -7,7 +7,7 @@ class BidsController < ApplicationController menu_item :homework_respond, :only => :homework_respond menu_item :homework_statistics, :only => :homework_statistics #Ended by young - before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, + before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:delete,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, :show_course, :show_bid_project, :show_bid_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings] # added by fq before_filter :require_login, :only => [:join_in_contest, :unjoin_in_contest] @@ -500,6 +500,15 @@ class BidsController < ApplicationController end end + #删除已提交的项目作业(不删项目) + def delete + binding_project = params[:binding_project] + if BidingProject.delete(binding_project) + redirect_to project_for_bid_path + else + redirect_to 403; + end + end ## 新建留言 def create diff --git a/app/models/biding_project.rb b/app/models/biding_project.rb index cc9c1fba2..0b7b3718e 100644 --- a/app/models/biding_project.rb +++ b/app/models/biding_project.rb @@ -19,7 +19,7 @@ class BidingProject < ActiveRecord::Base self.create(:user_id => User.current.id, :bid_id => bid_id, :project_id => project_id, :description => description) end - + # used to update the reward ,the value varies from 0,1,2,3,4,5 # added by william def update_reward(which) diff --git a/app/views/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb index ecbf5dfc3..e51314c48 100644 --- a/app/views/bids/_list_projects.html.erb +++ b/app/views/bids/_list_projects.html.erb @@ -153,7 +153,12 @@ 迟交 <% end %> - <%= link_to image_tag('delete.png') %> + + <% if b_project.user.id == User.current.id || User.current.id == b_project.bid.author.id + %> + <%= link_to image_tag('delete.png'),{ :action => "delete", :binding_project => b_project}, :confirm => "Are you sure?" %> + <% end %> + diff --git a/config/routes.rb b/config/routes.rb index 7d7cb2bbf..a856deaf1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -550,6 +550,7 @@ RedmineApp::Application.routes.draw do match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid' match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang match 'calls/:id/add', :controller => 'bids', :action => 'add' + match 'calls/:id/delete', :controller => 'bids', :action => 'delete' match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework' match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' From dcc2789aae9f9ffb8bc70f2e3746f3a275d2640c Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 11:14:44 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=9E=8B=E4=BD=9C=E4=B8=9A=E5=B7=B2=E6=8F=90=E4=BA=A4=E6=95=B0?= =?UTF-8?q?=E9=87=8F=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/bids/_bid_homework_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 9237b2aa8..3ef55c567 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -45,7 +45,7 @@ end %> <% if bid.homework_type == 1%> - <%= l(:label_x_homework_project, :count => @temp.count) %>(<%= link_to @temp.count, project_for_bid_path(bid.id) %>) + <%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %>) <% else %> <%= l(:label_x_homework_project, :count => @temp.count) %>(<%= link_to @temp.count, project_for_bid_path(bid.id) %>) <% end %> From 13a5aa988a69a86a7afb7ada41bd90b881fc41d6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 11:45:49 +0800 Subject: [PATCH 09/22] issues#623 --- app/controllers/school_controller.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index fdcdb8e8a..f0f5dd70f 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -46,15 +46,17 @@ class SchoolController < ApplicationController @provinces.each do |p| options << "" end - @school = School.all - - + + # 查询已添加用户的学校 + schools_arr = UserExtensions.where("school_id IS NOT NULL").pluck(:school_id).uniq + # 取id取学校名 + school = School.where(id: schools_arr).select("id, name") + options_s = "" - - @school.each do |s| - #options << "" + school.each do |s| options_s << "
  • #{s.name}
  • " end + res = Hash.new res[:text] = options res[:text_s] = options_s From 8ef716b920caf1ad5c254761302b4d39e20bc8fb Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:37:24 +0800 Subject: [PATCH 10/22] =?UTF-8?q?1.=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=95=99=E8=A8=80=E6=98=BE=E7=A4=BA=E5=87=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E4=BA=BA=202.=E7=95=99=E8=A8=80=E6=B7=BB=E5=8A=A0=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 9 ++++++--- config/locales/en.yml | 3 +++ config/locales/zh.yml | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index dd912cfe6..2774ea4d4 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -33,14 +33,17 @@ <% when 'JournalsForMessage' %> <% if User.current.login == @user.login %> <%# if e.user_id == act.jour.id %> - <%= link_to("#{e.user.name}", user_path(e.user_id)) %> 有了<%= link_to("#{e.act.user.name}", user_path(e.user.id))%>的留言 + <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <%# else %> <%# end %> <% else %> - <%= link_to("#{@user.name}", user_path(e.user_id)) %> 有了新的动态 + <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <% end %> -

    <%=textilizable act.notes %>

    +

    <%=textilizable act.notes %> + <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>

    <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f995d794..9e7e49013 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1306,6 +1306,7 @@ en: label_have_respond: had a respond label_welcome: Welcome + label_goto: Go to>> label_join: join Trustie! label_repository_new: link to existing SVN repository label_repository_path: path of repository @@ -1411,6 +1412,8 @@ en: label_user_activity_myself: About me label_user_all_respond: All replies label_layouts_feedback: Messages + label_have_feedback: Have + label_of_feedback: Of label_welcome_participate: participates #modify by men label_x_welcome_participate: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 6b4a925c8..c39bd7c2d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1495,6 +1495,7 @@ zh: label_issue_praise_over: 我刚才顶过了~ label_issue_tread_over: 我刚才踩过了~ #end + label_goto: 前往>> label_issue_appraise_over: 只能评价一次哦! label_welcome_my_respond: 请在此留下你的意见和建议! label_no_current_fans: 该用户暂无粉丝 @@ -1575,6 +1576,8 @@ zh: label_my_honework_no_homework: 暂无任何作业! label_user_all_respond: 所有反馈 label_layouts_feedback: 留言 + label_have_feedback: 有了 + label_of_feedback: 的 label_welcome_participate: 参与了 #modify by men label_x_welcome_participate: From 0c302c7aea1c122d7e54f54b6cbbcf3fcd16e48a Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 13:53:06 +0800 Subject: [PATCH 11/22] 1s ===> 0.005s --- app/controllers/school_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index f0f5dd70f..ec14ba5c8 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -47,10 +47,14 @@ class SchoolController < ApplicationController options << "" end - # 查询已添加用户的学校 - schools_arr = UserExtensions.where("school_id IS NOT NULL").pluck(:school_id).uniq # 取id取学校名 - school = School.where(id: schools_arr).select("id, name") + # 连接子表: 查询已添加用户的学校 + school = School.select("id, name"). + joins("RIGHT JOIN ( + SELECT DISTINCT school_id + FROM #{UserExtensions.table_name} + WHERE school_id IS NOT NULL) AS sids ON schools.id = sids.school_id"). + where("#{School.table_name}.id IS NOT NULL") options_s = "" school.each do |s| From 4b064f3c2ad82be0add4f3d18e1761530d385e59 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:53:45 +0800 Subject: [PATCH 12/22] =?UTF-8?q?1.=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=AB=9E=E8=B5=9B=E7=B1=BB=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=202.=E4=BC=98=E5=8C=96=E8=B7=B3=E8=BD=AC=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/users/show.html.erb | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2774ea4d4..997ff1728 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -42,9 +42,15 @@ <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <% end %> -

    <%=textilizable act.notes %> - <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>

    - + +

    <%= textilizable act.notes %>

    +
    <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> +
    + + + + +
    <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
    @@ -174,9 +180,26 @@
    <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
    -
    <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count)%>
    +
    <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count)%>
    +<% when 'Contest' %> + + <% if e.user == User.current%> + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + <% else %> + <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + <% end %> + +

    <%= h act.description %>

    + + +
    + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> +
    + +<% else %> + <% f=1 %> <% end %> From be73a232e8bc1230c5737e28143bafa6a60a2f24 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:58:54 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e03f3e1df..d521d59f5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -33,7 +33,7 @@ <% when 'JournalsForMessage' %> <% if User.current.login == @user.login %> <%# if e.user_id == act.jour.id %> - <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <%# else %> From f1b086ef90bdfb323e9988bfe5cb2de93fc72a0b Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 14:32:23 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9ppt=E6=96=87=E6=A1=A3=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/attachmentstype.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/attachmentstype.rb b/app/models/attachmentstype.rb index 6a37cc51f..fb774836f 100644 --- a/app/models/attachmentstype.rb +++ b/app/models/attachmentstype.rb @@ -3,7 +3,7 @@ class Attachmentstype < ActiveRecord::Base has_many :attachments, :foreign_key => "attachtype",:primary_key => "id" # 当前使用的文件内容分类列表 - @@SuffixArr = ['pdf','zip','doc','docx','rar','txt','jpg','bmp','xls','xlsx'] + @@SuffixArr = ['pdf','zip','doc','docx','ppt','pptx','rar','txt','jpg','bmp','xls','xlsx'] def suffixArr @@SuffixArr From 4db228f88e26ed957e9827d07dba2aa07b1f66c9 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 15:52:25 +0800 Subject: [PATCH 15/22] =?UTF-8?q?=E8=B0=83=E6=95=B4tag=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E5=95=A5=E8=A6=81=E4=BF=AE=E6=94=B9=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=E6=88=91=E8=87=AA=E5=B7=B1=E4=B9=9F=E5=BF=98?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E6=94=B9=E5=A4=A9=E5=86=8D=E8=AF=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/index.html.erb | 2 +- public/stylesheets/nyan.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 02268746d..a4f63e4b2 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -82,7 +82,7 @@ var $tags = $td_tags_area.find('#tags') var $icona = $td_tags_area.find('.tags_icona') - var slideHeight = 5; //px + var slideHeight = 13; //px var defHeight = $tags.height(); var curHeight = $tags_area.height(); diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 24fffd20f..e1088c8c0 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -950,7 +950,7 @@ div.issue { /* project 文件列表 资源库 *******************************************************************************/ .tags_area { - height: 5px; + height: 13px; } #ver-zebra, .file_table_des { From a794d612afe07a4332a1e5e76b3e9667b0cd6454 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 15:53:28 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E4=BB=8E=E4=B8=BB=E9=A1=B5=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 769214d65..039080dad 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - rescue AuthSourceException => e - logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - render_error :message => e.message + #rescue AuthSourceException => e + # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + # render_error :message => e.message end # Log out current user and redirect to welcome page @@ -261,9 +261,18 @@ class AccountController < ApplicationController end call_hook(:controller_account_success_authentication_after, {:user => user }) #by young -# redirect_back_or_default my_page_path - redirect_back_or_default User.current -# redirect_to User.current + code = // + #根据home_url生产正则表达式 + class_eval("code = " + "/" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index)?\/") + if code.match(params[:back_url]) + redirect_to user_activities_path(user) + else + #redirect_back_or_default my_page_path + redirect_back_or_default User.current + #redirect_to User.current + end + + end def set_autologin_cookie(user) From 06706b577da09742f49ae552242512fab9617dca Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 16:27:56 +0800 Subject: [PATCH 17/22] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E3=80=81=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E5=9B=9E=E5=A4=8D=E7=9A=84=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/views/memos/show.html.erb | 4 ++-- app/views/messages/show.html.erb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index a40ee631a..642d71649 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -65,7 +65,7 @@ <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
    "> -

    <%= pages_count += 1 %>楼 :

    +

    + <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
    <%= link_to( @@ -150,7 +151,7 @@
    - <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %> +
    <%= textilizable message, :content, :attachments => message.attachments %> From f218b873382bfb6853a305016368f745c742c5dd Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 16:59:15 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E7=BC=BA=E9=99=B7=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E9=94=99=E8=AF=AF=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/models/issue.rb | 7 ++++++- app/models/journal.rb | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index b69ac246c..d2332350a 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -57,7 +57,7 @@ class Issue < ActiveRecord::Base :include => [:project, :visible_journals], # sort by id so that limited eager loading doesn't break with postgresql :order_column => "#{table_name}.id" - acts_as_event :title => Proc.new {|o| + acts_as_event :title => Proc.new {|o| #"#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}" "#{o.tracker.name} #{o.source_from} (#{o.status}): #{o.subject}" }, @@ -991,6 +991,11 @@ class Issue < ActiveRecord::Base "#{tracker} ##{id}: #{subject}" end + # 缺陷在项目中的序号 + def inProjectIndex + (self.project.issues.index(self).to_i + 1).to_s + end + # Returns a string of css classes that apply to the issue def css_classes s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}" diff --git a/app/models/journal.rb b/app/models/journal.rb index 02d313731..0997640d8 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -29,8 +29,8 @@ class Journal < ActiveRecord::Base # end attr_accessor :indice - acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" }, - :description => :notes, + acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.inProjectIndex}#{status}: #{o.issue.subject}" }, + :description =>:notes, :author => :user, :group => :issue, :type => Proc.new {|o| (s = o.new_status) ? (s.is_closed? ? 'issue-closed' : 'issue-edit') : 'issue-note' }, From 03dbcb116879dcda1b8f51cfafa316534e4c3c98 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 17:33:01 +0800 Subject: [PATCH 19/22] acount --- app/controllers/account_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 039080dad..5e9a0bc40 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - #rescue AuthSourceException => e - # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - # render_error :message => e.message + rescue AuthSourceException => e + logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + render_error :message => e.message end # Log out current user and redirect to welcome page From 4f7087f9aea3a9bcb7a1d46ddd101f2a37ad8ba5 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 17:36:39 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=BA=E5=8F=AA=E6=9C=89=E7=9A=84=E6=95=99=E5=B8=88=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E6=9F=A5=E7=9C=8B=E5=AD=A6=E7=94=9F=E5=AD=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 11 +++++++++++ app/views/projects/_member_list.html.erb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 01021cb57..116ccd5d7 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -812,6 +812,8 @@ class ProjectsController < ApplicationController @render_file = 'member_list' # 判断是否课程 if @project.project_type == Project::ProjectType_course + @teachers= searchTeacherAndAssistant(@project) + @canShowCode = isCourseTeacher(User.current.id) case params[:role] when '1' @subPage_title = l :label_teacher_list @@ -833,6 +835,15 @@ class ProjectsController < ApplicationController render :layout => 'base_courses' if @project.project_type == 1 end + #判断指定用户是否为课程教师 + def isCourseTeacher(id) + result = false + if @teachers.find_by_user_id(id) != nil + result = true + end + result + end + def sort_project_members project, members #userGrade = UserGrade.where(:project_id => project.id) users = UserGrade.where(:project_id => project.id). diff --git a/app/views/projects/_member_list.html.erb b/app/views/projects/_member_list.html.erb index ce5dfc694..6fe6b55f0 100644 --- a/app/views/projects/_member_list.html.erb +++ b/app/views/projects/_member_list.html.erb @@ -12,7 +12,7 @@ <% if @project.project_type == 1 %> <% unless member.user.user_extensions.identity ==0 %> - <% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil?) %> + <%if @canShowCode# if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil?) %> <%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> <% end %> <% end %> From 53a9d2929241dfe4884af4ed6f295bcdfce1b4d6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 17:41:45 +0800 Subject: [PATCH 21/22] Revert "acount" This reverts commit 03dbcb116879dcda1b8f51cfafa316534e4c3c98. --- app/controllers/account_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 38afb7a28..5f20ec912 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - rescue AuthSourceException => e - logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - render_error :message => e.message + #rescue AuthSourceException => e + # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + # render_error :message => e.message end # Log out current user and redirect to welcome page From be87e02e4c5c89d88e528a0c45236238ae2fb762 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 17:41:53 +0800 Subject: [PATCH 22/22] =?UTF-8?q?Revert=20"=E4=BB=8E=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=99=BB=E9=99=86=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a794d612afe07a4332a1e5e76b3e9667b0cd6454. --- app/controllers/account_controller.rb | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 5f20ec912..cf39898fe 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - #rescue AuthSourceException => e - # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - # render_error :message => e.message + rescue AuthSourceException => e + logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + render_error :message => e.message end # Log out current user and redirect to welcome page @@ -277,18 +277,9 @@ class AccountController < ApplicationController end call_hook(:controller_account_success_authentication_after, {:user => user }) #by young - code = // - #根据home_url生产正则表达式 - class_eval("code = " + "/" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index)?\/") - if code.match(params[:back_url]) - redirect_to user_activities_path(user) - else - #redirect_back_or_default my_page_path - redirect_back_or_default User.current - #redirect_to User.current - end - - +# redirect_back_or_default my_page_path + redirect_back_or_default User.current +# redirect_to User.current end def set_autologin_cookie(user)