From 3f1852985ebe466d08d09403769a5dc18603813d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:00:08 +0800 Subject: [PATCH 001/146] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 4b655cf31..3fbd7940e 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -40,9 +40,9 @@ class HomeworkCommonController < ApplicationController # @homework_detail_programing = HomeworkDetailPrograming.new # @homework.homework_detail_programing = @homework_detail_programing # end - # respond_to do |format| - # format.html - # end + respond_to do |format| + format.html + end end #新建作业下一步 From cf58ea8a9f9a9ff8591962d2cc0c4b6831d26c8f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:31:08 +0800 Subject: [PATCH 002/146] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 57c3712f9..0d8159c89 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -540,7 +540,7 @@ $('#my_account_form_btn').click(); }); $('#my_password_form_link').click(function(){ - alert("密码修改成功,请重新登录!"); +// alert("密码修改成功,请重新登录!"); $('#my_password_form_btn').click(); }); }); From 4a781ea6b23cde56f39e4b72ce4f2774640a0f25 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:36:53 +0800 Subject: [PATCH 003/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=8A=A9=E6=95=99=E4=B8=8D=E5=8F=AF=E4=BB=A5=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E8=AF=BE=E7=A8=8B=E3=80=82=E4=BF=AE=E6=94=B9=E5=BC=A0?= =?UTF-8?q?=E7=94=9F=E4=BB=A3=E7=A0=81?= 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 a1c7ae875..1623979f0 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -604,7 +604,7 @@ class CoursesController < ApplicationController def toggleCourse @course_prefs = Course.find_by_extra(@course.extra) - unless (@course_prefs.student != User.current || User.current.admin?) + unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?) render_403 end end From 4f8170700e7702e87d3a7daeb8a8b2fae3d9214d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 15:19:01 +0800 Subject: [PATCH 004/146] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=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_common/index.html.erb | 26 +++++++++++++++++------- app/views/student_work/index.html.erb | 22 +++++++++++++++++++- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 2de96bca1..c0f716ed7 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -71,18 +71,30 @@ <% end%> - <% end%> -
+
-
- <% unless homework.attachments.empty?%> +
+ 开发语言: +
+ <% if homework.homework_detail_programing.language.to_i == 1%> + C + <% elsif homework.homework_detail_programing.language.to_i == 2%> + C++ + <% end%> +
+
+
+ <% end%> + + <% unless homework.attachments.empty?%> +
附件:
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
- <% end%> -
-
+
+
+ <% end%>
扣分标准: diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index fc82aea1e..92f6f93e0 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -139,6 +139,14 @@ <% if @homework.homework_type == 2 && @homework.homework_detail_programing%> + "> + + + <% @homework.homework_tests.each do |test|%> ">
+ 输入 + + 输出 +
@@ -151,8 +159,20 @@ <% end%>
+
+ +
+ 开发语言: +
+ <% if @homework.homework_detail_programing.language.to_i == 1%> + C + <% elsif @homework.homework_detail_programing.language.to_i == 2%> + C++ + <% end%> +
+
+
<% end%> -
<% unless @homework.attachments.empty?%> From 6c894e63eeade3c1c7e57b588cbea32b33d75fa4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 15:54:09 +0800 Subject: [PATCH 005/146] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=86=E7=8F=AD=E7=9A=84=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=AE=9A=E4=B8=BA20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_new_groups_name.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_new_groups_name.html.erb b/app/views/courses/_new_groups_name.html.erb index 39fa33677..fc2c5a62d 100644 --- a/app/views/courses/_new_groups_name.html.erb +++ b/app/views/courses/_new_groups_name.html.erb @@ -31,7 +31,7 @@ <% if @canShowCode%> <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %> <% end %> @@ -47,7 +47,7 @@
  • From 19e60f753fb71ca1faba2f59c4e7a42621d133bd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 17:14:55 +0800 Subject: [PATCH 006/146] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 44 +++++++++---------- app/views/homework_common/new.html.erb | 28 ++++-------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 34e97e4dd..5324a0d38 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -18,28 +18,28 @@ class HomeworkCommonController < ApplicationController end def new - # @homework_type = "1" - # - # @homework = HomeworkCommon.new - # @homework.safe_attributes = params[:homework_common] - # @homework.late_penalty = 0 - # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.publish_time = Time.now.strftime('%Y-%m-%d') - # - # if @homework_type == "1" - # #匿评作业相关属性 - # @homework_detail_manual = HomeworkDetailManual.new - # @homework_detail_manual.ta_proportion = 0.6 - # @homework_detail_manual.absence_penalty = 0 - # @homework_detail_manual.evaluation_num = 3 - # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') - # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.homework_detail_manual = @homework_detail_manual - # elsif @homework_type == "2" - # #编程作业相关属性 - # @homework_detail_programing = HomeworkDetailPrograming.new - # @homework.homework_detail_programing = @homework_detail_programing - # end + @homework_type = "1" + + @homework = HomeworkCommon.new + @homework.safe_attributes = params[:homework_common] + @homework.late_penalty = 0 + @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.publish_time = Time.now.strftime('%Y-%m-%d') + + if @homework_type == "1" + #匿评作业相关属性 + @homework_detail_manual = HomeworkDetailManual.new + @homework_detail_manual.ta_proportion = 0.6 + @homework_detail_manual.absence_penalty = 0 + @homework_detail_manual.evaluation_num = 3 + @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') + @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.homework_detail_manual = @homework_detail_manual + elsif @homework_type == "2" + #编程作业相关属性 + @homework_detail_programing = HomeworkDetailPrograming.new + @homework.homework_detail_programing = @homework_detail_programing + end respond_to do |format| format.html end diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb index cdc2ceca0..6fc0fff0e 100644 --- a/app/views/homework_common/new.html.erb +++ b/app/views/homework_common/new.html.erb @@ -1,27 +1,17 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +<%= error_messages_for 'homework_common' %>

    <%= l(:label_course_homework_new)%>

    -
    - <%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%> - -

    - 请选择将要发布的作业类型 -

    - - - 人工评分的作业(支持匿名互评、灵活设置评分比例) - -
    - - - 自动评测的编程作业(支持C/C++程序的自动评分) - -
    - - 下一步 - +
    + <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> + <%= hidden_field_tag "course",@course.id%> + <%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %> + 提交 + <%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%> + <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%> <% end%>
    From 9a9658baf3f0d14188d5b4241f7733a59e3834c9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 17:28:46 +0800 Subject: [PATCH 007/146] =?UTF-8?q?l=E7=95=99=E8=A8=80=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 16fa44c73..c4f61d73c 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -34,7 +34,7 @@
  • <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', - { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user }, + {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, {:class => 'my-message'} if User.current.logged?%>
  • From f37cbd3e0d6b137431044ae04422e077cbcd9eb3 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 14:35:41 +0800 Subject: [PATCH 008/146] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++-- config/locales/zh.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 303e4a213..752df72ee 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -658,7 +658,7 @@ update ) graph.add_data( :data => commits_data, - :title => l(:label_revision_plural) + :title => l(:label_revision_commit_count) ) graph.burn end @@ -694,7 +694,7 @@ update ) graph.add_data( :data => commits_data, - :title => l(:label_revision_plural) + :title => l(:label_revision_commit_count) ) graph.burn end diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 78e8379dc..83ccebbe9 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -670,6 +670,7 @@ zh: label_revision: 修订 label_revision_plural: 修订 lable_revision_code_count: 代码量 + label_revision_commit_count: 提交次数 label_revision_id: 修订 %{value} label_associated_revisions: 相关修订版本 label_added: 已添加 From 26166abc44a7a945578fbef2d5979ea9fe49349b Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 07:08:37 +0800 Subject: [PATCH 009/146] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=86=97=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 -- app/views/repositories/stats.html.erb | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 752df72ee..208a8bdb0 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -463,8 +463,6 @@ update data = graph_author_commits_per_month(@repository) when "author_commits_six_month" data = author_commits_six_month(@repository) - when "author_qoc_per_author" - data = graph_author_qoc_per_author(@repository) when "author_code_six_months" data = author_code_six_month(@repository) end diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index ba14e18b1..b5283629c 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -13,25 +13,13 @@

    <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %>

    -

    - <%# 用户每月提交代码量 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_qoc_per_author")) %> -

    <%# 用户最近六个月的提交次数 %> <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %>

    -

    - <%# 用户最近一年的提交次数 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_qoc_per_author")) %> -

    <%# 用户最近六个月的代码量 %> <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %>

    -

    - <%# 用户最近一年的代码量 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_year")) %> -

    <%= link_to l(:button_back), :action => 'show', :id => @project %>

    <% html_title(l(:label_repository), l(:label_statistics)) -%> From e74ca78b0e25bf3b686a9a74a376b12971f2f233 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 27 Jul 2015 10:03:45 +0800 Subject: [PATCH 010/146] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E5=9C=A8debug=E7=8E=AF=E5=A2=83=E4=B8=8B=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BAdebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/environments/development.rb | 1 + db/schema.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 2aca152cb..a3e7dff99 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -7,6 +7,7 @@ RedmineApp::Application.configure do # Log error messages when you accidentally call methods on nil. config.whiny_nils = true + config.log_level =:debug config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly # Show full error reports and disable caching config.consider_all_requests_local = true diff --git a/db/schema.rb b/db/schema.rb index 912b4e8b4..9f9bbc33c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -737,6 +737,16 @@ ActiveRecord::Schema.define(:version => 20150722015428) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" From b94f5a54cc7efe2b497f55a9f275f54a0c4ee09f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 27 Jul 2015 10:43:39 +0800 Subject: [PATCH 011/146] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=9B=86=E5=8F=AA=E8=A6=81=E8=80=81=E5=B8=88?= =?UTF-8?q?=E6=89=8D=E5=8F=AF=E4=BB=A5=E7=9C=8B=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 2 +- .../_programing_work_show.html.erb | 69 +++++++++---------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index c0f716ed7..6847da2c7 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -48,7 +48,7 @@
    - <% if homework.homework_type == 2 && homework.homework_detail_programing%> + <% if homework.homework_type == 2 && homework.homework_detail_programing && @is_teacher%> "> diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 7081dea8c..b259e20a5 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -24,42 +24,41 @@
    -
  • 测试结果: -
  • - - - - - - - <%@homework.homework_tests.each do |test|%> - "> - - - <% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%> - - - - <% end%> - <% student_work_test = @work.student_work_test.first%> - <% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%> - - - - <% end%> - - -
    输入输出测试结果
    <%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%>
    - <%= student_work_test.error_msg%> -
    -
    - - <% if @is_teacher%> +
  • 测试结果: + + + + + + + + <%@homework.homework_tests.each do |test|%> + "> + + + <% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%> + + + + <% end%> + <% student_work_test = @work.student_work_test.first%> + <% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%> + + + + <% end%> + + +
    输入输出测试结果
    <%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%>
    + <%= student_work_test.error_msg%> +
    +
    +
  • <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> From 81c942a7926ff79f021b6a0c5b80bf1adf9e242c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 27 Jul 2015 15:06:00 +0800 Subject: [PATCH 012/146] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/welcome_controller.rb | 38 --------------------------- app/views/welcome/course.html.erb | 13 +-------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 9ce107f8b..6b14db9bb 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -100,44 +100,6 @@ class WelcomeController < ApplicationController @course_page = FirstPage.find_by_page_type('course') @school_id = params[:school_id] || User.current.user_extensions.school.try(:id) || 117 @logoLink ||= logolink() - - ##3-8月份为查找春季课程,9-2月份为查找秋季课程 - #month_now = Time.now.strftime("%m").to_i - #year_now = Time.new.strftime("%Y").to_i - #(month_now >= 3 && month_now < 9) ? course_term = l(:label_spring) : course_term = l(:label_autumn) - ##year_now -= 1 if year_now < 3 - #@school_id.nil? ? @cur_school_course = [] : @cur_school_course = find_miracle_course(10,7,@school_id, year_now, course_term) - ##未登录或者当前学校未开设课程 - #if @cur_school_course.empty? - # @has_course = false - # User.current.logged? ? course_count = 9 : course_count = 10 - # @cur_school_course += find_all_new_hot_course(course_count, @school_id, year_now, course_term) - # while @cur_school_course.count < 9 do - # if course_term == l(:label_spring) - # course_term = l(:label_autumn) - # year_now -= 1 - # else - # course_term = l(:label_spring) - # end - # @cur_school_course += find_all_new_hot_course((10-@cur_school_course.count), nil, year_now, course_term) - # end - #else - # if @cur_school_course.count < 9 - # @has_course = false - # @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, @school_id, year_now, course_term) - # if @cur_school_course.count < 9 - # if course_term == l(:label_spring) - # course_term = l(:label_autumn) - # year_now -= 1 - # else - # course_term = l(:label_spring) - # end - # @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, nil, year_now, course_term) - # end - # else - # @has_course = true - # end - #end end def logolink() diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 143c32dbe..4edec2202 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -56,21 +56,11 @@ <% end %> - - <%= l(:label_welcome_trustie_course) %> + <%= l(:label_welcome_trustie_course) %> <% else %> <% unless @course_page.nil? %> - <%= l(:label_welcome_trustie_course) %> , @@ -112,7 +102,6 @@ course_term = "春季学期" end %> - <%# (month_now >= 3 && month_now < 9) ? course_term = "春季学期" : course_term = "秋季学期" %> <% cur_school_course = @school_id.nil? ? [] : find_miracle_course(10,7,@school_id, year_now, course_term) %> <% if cur_school_course.count == 0 %> From 0d31536c6e065436b3810387ef402abd86577a8c Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 15:21:31 +0800 Subject: [PATCH 013/146] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BB=9F=E8=AE=A1=E7=BB=93=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 + app/views/repositories/stats.html.erb | 49 ++++++++++++---------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 208a8bdb0..e0aea0c2e 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -449,6 +449,8 @@ update def stats @project_id = params[:id] @repository_id = @repository.identifier + # 提交次数统计 + @status_commit_count = Changeset.count(:conditions => ["#{Changeset.table_name}.repository_id = ?", @repository.id]) render :layout => 'base_projects' end diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index b5283629c..0bce15069 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -1,25 +1,30 @@

    <%= l(:label_statistics) %>

    -
    修订 是版本库的提交次数, 显示为橘红色。

    -
    变更 是对版本库中文件的修改次数, 显示为蓝色。
    -

    - <%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %> -

    -

    - <%# 用户每月提交代码次数 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %> -

    -

    - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %> -

    -

    - <%# 用户最近六个月的提交次数 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %> -

    -

    - <%# 用户最近六个月的代码量 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %> -

    -

    <%= link_to l(:button_back), :action => 'show', :id => @project %>

    -<% html_title(l(:label_repository), l(:label_statistics)) -%> +<% if @status_commit_count ==0 %> +
    该项目目前还没有提交过代码!
    +<% else %> +
    修订 是版本库的提交次数, 显示为橘红色。

    +
    变更 是对版本库中文件的修改次数, 显示为蓝色。
    + +

    + <%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %> +

    +

    + <%# 用户每月提交代码次数 %> + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %> +

    +

    + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %> +

    +

    + <%# 用户最近六个月的提交次数 %> + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %> +

    +

    + <%# 用户最近六个月的代码量 %> + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %> +

    +

    <%= link_to l(:button_back), :action => 'show', :id => @project %>

    + <% html_title(l(:label_repository), l(:label_statistics)) -%> +<% end %> \ No newline at end of file From ed27b6e30f2672e57a9fdd3d8de93e2dbf79e49a Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 16:03:03 +0800 Subject: [PATCH 014/146] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5ae9df001..a25aff6bb 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -388,7 +388,8 @@ class Mailer < ActionMailer::Base @user = applied.user recipients = @project.manager_recipients s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) - @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members') + @token = Token.get_token_from_user(@user, 'autologin') + @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value) mail :to => recipients, :subject => s end From 7c818ce59ac3cbfdcf6c6d996899c95796ad43db Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 27 Jul 2015 16:07:29 +0800 Subject: [PATCH 015/146] =?UTF-8?q?admin=E7=95=8C=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=A6=E6=A0=A1=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=8C=89=E5=90=8D=E7=A7=B0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 13 +++++++++ app/views/admin/schools.html.erb | 44 +++++++++++++++++++++++++++++ config/locales/zh.yml | 1 + config/routes.rb | 1 + lib/redmine.rb | 1 + public/stylesheets/courses.css | 1 - 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/schools.html.erb diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 086ecfb7f..d2c94f5de 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -337,6 +337,19 @@ class AdminController < ApplicationController format.html end end + + #学校列表 + def schools + @q = params[:school_name] + if @q + @schools = School.where("name like '%#{@q}%'") + else + @schools = School.all + end + respond_to do |format| + format.html + end + end #移动端版本管理 def mobile_version @versions = PhoneAppVersion.reorder('created_at desc') diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb new file mode 100644 index 000000000..760a0c5a4 --- /dev/null +++ b/app/views/admin/schools.html.erb @@ -0,0 +1,44 @@ +

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

    +<%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %> + <%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%> + +<% end %> +
    + +
    + + + + + + + + + + <% @schools.each do |school|%> + "> + + + + + <% end%> + +
    + LOGO + + 学校名称 +
    + <%= image_tag(school.logo_link,width:46,height:46) %> + + + <%= link_to school.name,"http://#{Setting.host_course}/?school_id=#{school.id}" %> + + + <%= link_to("上传logo", edit_organization_path(school.id), :class => 'icon icon-copy') %> + <%#= link_to(l(:button_delete), organization_path(school.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> +
    +
    + +<% html_title(l(:label_project_plural)) -%> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 83ccebbe9..1018a213a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -381,6 +381,7 @@ zh: label_organization_choose: --请选择组织-- label_organization_name: 组织名称 label_organization_list: 组织列表 + label_school_plural: 学校列表 label_organization_new: 新建组织 label_organization_edit: 修改组织 label_project_plural: 项目列表 diff --git a/config/routes.rb b/config/routes.rb index 1ae607eb7..d353c60ff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -670,6 +670,7 @@ RedmineApp::Application.routes.draw do match 'admin/test_email', :via => :get match 'admin/default_configuration', :via => :post get 'admin/organization' + get 'admin/schools' resources :auth_sources do member do diff --git a/lib/redmine.rb b/lib/redmine.rb index 3043cfe5d..0f6c14b8a 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -369,6 +369,7 @@ Redmine::MenuManager.map :admin_menu do |menu| menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural + menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 778a474cd..00a2f0034 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -665,7 +665,6 @@ a:hover.ping_pic{border:1px solid #64bdd9;} .ping_back_tit{ float:left; width:523px; margin-left:10px; } a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;} a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} -.fr{ float:right;} .min_search{ width:140px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; } .li_min_search{ float:right; margin-right:-10px;} .info_ni_download{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} From 19c515e11ed210611170cccd37bca61ac2a81e31 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 27 Jul 2015 16:15:04 +0800 Subject: [PATCH 016/146] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/schools.html.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb index 760a0c5a4..b5e649dd0 100644 --- a/app/views/admin/schools.html.erb +++ b/app/views/admin/schools.html.erb @@ -11,20 +11,26 @@ - + - + <% @schools.each do |school|%> "> + diff --git a/app/views/school/upload_logo.html.erb b/app/views/school/upload_logo.html.erb index 97a3f171c..26da7e081 100644 --- a/app/views/school/upload_logo.html.erb +++ b/app/views/school/upload_logo.html.erb @@ -1,5 +1,28 @@ -<%= form_tag({action: :upload},method: "post", multipart: true) do %> - <%= text_field_tag 'school'%> - <%= file_field_tag 'logo' %> - <%= submit_tag('Upload') %> + + +<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true) do %> + <%#= text_field_tag 'school'%> +
    + + <%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%> + 上传图片 + <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%> +
    +
    + <%= submit_tag('上传') %> + <%= submit_tag('取消') %> +
    +
    <% end %> + diff --git a/config/routes.rb b/config/routes.rb index d353c60ff..280053f60 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,17 @@ RedmineApp::Application.routes.draw do end + resources :school do + collection do + + end + + member do + get 'upload_logo' + post 'upload' + end + end + resources :homework_attach do collection do get 'get_homework_member_list' @@ -809,9 +820,6 @@ RedmineApp::Application.routes.draw do post 'school/search_school/', :to => 'school#search_school' get 'school/search_school/', :to => 'school#search_school' - post 'school/upload', :to => 'school#upload' - get 'school/upload_logo', :to => 'school#upload_logo' - ######added by nie match 'tags/show_projects_tags' ########### added by liuping diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d4d309181..3e01d68ff 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2796,4 +2796,15 @@ div.repos_explain{ .upload_img img{max-width: 100%;} #activity .upload_img img{max-width: 580px;} -img,embed{max-width: 100%;} \ No newline at end of file +img,embed{max-width: 100%;} + +img.school_avatar { + background: rgb(245, 245, 245); + padding: 4px; + border: 1px solid #e5dfc7; + float: left; + display: block; + width: 100px; + height: 100px; + max-width: none; +} \ No newline at end of file From 45d5972a93d98b576c57a8a78ed82a283949ccad Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 28 Jul 2015 10:27:45 +0800 Subject: [PATCH 020/146] =?UTF-8?q?=E5=9C=A8=E5=8F=91=E5=B8=83=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=AD=E9=97=B4=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=8F=92=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 16 +- app/views/poll/_new_MC.html.erb | 1 + app/views/poll/_poll_form.html.erb | 186 ++++++++++++++++++++- app/views/poll/_show_MC.html.erb | 18 +- app/views/poll/_show_MCQ.html.erb | 14 +- app/views/poll/_show_mulit.html.erb | 14 +- app/views/poll/_show_single.html.erb | 14 +- app/views/poll/create_poll_question.js.erb | 6 +- public/stylesheets/polls.css | 5 +- 9 files changed, 261 insertions(+), 13 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 758747e02..8f81bc2c6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -137,11 +137,19 @@ class PollController < ApplicationController @poll_questions.poll_answers.new question_option end end - if @poll_questions.save - respond_to do |format| - format.js - end + # 如果是插入的话,那么从插入的这个id以后的question_num都将要+1 + if params[:quest_id] + @is_insert = true + @poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1") + @poll_question_num = params[:quest_num].to_i + @poll_questions.question_number = params[:quest_num].to_i + 1 end + if @poll_questions.save + respond_to do |format| + format.js + end + end + end #修改题目 diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index 8c47baa01..e5f2a6b82 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -1,5 +1,6 @@ <%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> + <% insert_begin = insert_begin %>
    diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 74ca9fb32..0a15143fb 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -6,23 +6,203 @@ function edit_head(){ $("#polls_description").val($("#polls_description_div").html()); } - function add_MC(){ +function chooseQuestionType(quest_type,quest_id){ + $("#div_"+quest_type+"_"+quest_id).css("position", "absolute"); + + $("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30); + + $("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10); + if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') { + $("#div_"+quest_type+"_"+quest_id).css('display', 'none'); + } + else{ + $("#div_"+quest_type+"_"+quest_id).css('display', 'block'); + } +} + +function add_MC(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>"); $("#poll_questions_title").focus(); - } - function add_MCQ(){ +} + + function insert_MC(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
    '+ + '
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
    '+ + '
    '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '<% end%>' + ); + $("#poll_questions_title").focus(); +} + +function add_MCQ(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>"); $("#poll_questions_title").focus(); +} + +function insert_MCQ(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
    '+ + '
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
    '+ + '
    '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    • '+ + ''+ + ''+ + ''+ + ''+ + '
    • '+ + '
      '+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '<% end%>' + ); + $("#poll_questions_title").focus(); } + function add_single(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>"); $("#poll_questions_title").focus(); } + + function insert_SINGLE(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
    '+ + '
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '<% end%>' + ); + $("#poll_questions_title").focus(); + } function add_mulit(){ $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>"); $("#poll_questions_title").focus(); } + function insert_MULIT(quest_type,quest_num,quest_id){ + $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( + '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+ + '
    '+ + '
    '+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
    '+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '<% end%>' + ); + $("#poll_questions_title").focus(); + } + //添加标题时确定按钮 function add_poll_question(doc) { diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb index ff8e52f25..9c47894dc 100644 --- a/app/views/poll/_show_MC.html.erb +++ b/app/views/poll/_show_MC.html.erb @@ -1,3 +1,6 @@ +
    @@ -9,9 +12,11 @@ * <%end%>
    + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
    + + 序号 + LOGO 学校名称
    + <%= school.id %> + - <%= image_tag(school.logo_link,width:46,height:46) %> + <%= image_tag(school.logo_link,width:40,height:40) %> From 9beb8acb991ad24d34e686d92fa9f70202d2c03d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 16:49:21 +0800 Subject: [PATCH 017/146] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=EF=BC=9A1=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=87=A0=E6=9D=A1=E8=AE=B0=E5=BD=95=E5=90=8E=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E5=8D=81=E6=9D=A1=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=202=E3=80=81=E6=96=87=E6=A1=A3=E8=AE=B0=E5=BD=95=E4=B8=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2efaf591a..d578fe586 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -280,11 +280,11 @@ class ProjectsController < ApplicationController # 根据私密性,取出符合条件的所有数据 if User.current.member_of?(@project) || User.current.admin? - @events_pages = ForgeActivity.where("project_id = ?",@project).order("created_at desc").page(params['page'|| 1]).per(20); + @events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20); #events = @activity.events(@date_from, @date_to) else @events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public - = ?",@project,1).order("created_at desc") + = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc") .page(params['page'|| 1]).per(10); # @events = @activity.events(@date_from, @date_to, :is_public => 1) end From 0f82bbf79739794b1ce160c06e00e875b7b0199c Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 18:15:05 +0800 Subject: [PATCH 018/146] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 18 +++++++++++++----- app/views/projects/show.html.erb | 14 -------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d578fe586..09ae5ad79 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -150,11 +150,15 @@ class ProjectsController < ApplicationController end def new - @issue_custom_fields = IssueCustomField.sorted.all - @trackers = Tracker.sorted.all - @project = Project.new - @project.safe_attributes = params[:project] - render :layout => 'base' + if User.current.login? + @issue_custom_fields = IssueCustomField.sorted.all + @trackers = Tracker.sorted.all + @project = Project.new + @project.safe_attributes = params[:project] + render :layout => 'base' + else + redirect_to signin_url + end end def share @@ -167,6 +171,10 @@ class ProjectsController < ApplicationController end def create + unless User.current.login? + redirect_to signin_url + return + end @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @project = Project.new diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index ca7bb6159..f1b3d9b7b 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -93,21 +93,7 @@
    - - <% elsif e.forge_act_type == "Document" %> -
    - <%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %> -
    - - <%= h(e.project) if @project.nil? || @project.id != e.project_id %> - <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : - <%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %>
    -

    <%= textAreailizable act,:description %>
    - <%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

    -
    -
    -
    <% elsif e.forge_act_type == "Attachment" %>
    From 6091369e02b33042749218e39a401eace43da23c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 27 Jul 2015 18:20:20 +0800 Subject: [PATCH 019/146] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E6=A0=A1log?= =?UTF-8?q?o=E7=9A=84=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=AE=9E=E6=97=B6=E9=A2=84=E8=A7=88=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 +++--- app/controllers/school_controller.rb | 17 +++++---------- app/views/admin/schools.html.erb | 4 ++-- app/views/school/upload_logo.html.erb | 31 +++++++++++++++++++++++---- config/routes.rb | 14 +++++++++--- public/stylesheets/application.css | 13 ++++++++++- 6 files changed, 60 insertions(+), 25 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d2c94f5de..a44b58789 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -340,9 +340,9 @@ class AdminController < ApplicationController #学校列表 def schools - @q = params[:school_name] - if @q - @schools = School.where("name like '%#{@q}%'") + @school_name = params[:school_name] + if @school_name + @schools = School.where("name like '%#{@school_name}%'") else @schools = School.all end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index 008fe00fc..3e0c280ac 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -4,28 +4,21 @@ class SchoolController < ApplicationController def upload uploaded_io = params[:logo] - school_id = 0 - schools = School.where("name = ?", params[:school]) - - schools.each do |s| - school_id = s.id - end - + school_id ||= params[:id] unless uploaded_io.nil? File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file| file.write(uploaded_io.read) end - s1 = School.find(school_id) s1.logo_link = '/images/school/'+school_id.to_s+'.png' s1.save - - - end + end + redirect_to admin_schools_url(:school_name => params[:school_name]) end def upload_logo - + @school = School.find params[:id] + @school_name = params[:school_name] end #获取制定学校开设的课程数 diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb index b5e649dd0..0956981e8 100644 --- a/app/views/admin/schools.html.erb +++ b/app/views/admin/schools.html.erb @@ -3,7 +3,7 @@ <%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %> <%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%> - + <% end %>
    @@ -38,7 +38,7 @@
    - <%= link_to("上传logo", edit_organization_path(school.id), :class => 'icon icon-copy') %> + <%= link_to("修改", upload_logo_school_path(school.id,:school_name => @school_name), :class => 'icon icon-copy') %> <%#= link_to(l(:button_delete), organization_path(school.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
    @@ -29,4 +34,15 @@
    -
    \ No newline at end of file + + +
    +
    + \ No newline at end of file diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb index 63b9d1c1f..fb2c03080 100644 --- a/app/views/poll/_show_MCQ.html.erb +++ b/app/views/poll/_show_MCQ.html.erb @@ -12,6 +12,7 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
    @@ -29,4 +30,15 @@
    - \ No newline at end of file + + +
    +
    + \ No newline at end of file diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb index 2d52fffb5..ad01d0a3e 100644 --- a/app/views/poll/_show_mulit.html.erb +++ b/app/views/poll/_show_mulit.html.erb @@ -13,9 +13,21 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
    - \ No newline at end of file + + +
    +
    + \ No newline at end of file diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index 8caa7b1a5..f5846b6b7 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -12,8 +12,20 @@ <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
    - \ No newline at end of file + + +
    +
    + \ No newline at end of file diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb index ac44ebb4c..8a597514e 100644 --- a/app/views/poll/create_poll_question.js.erb +++ b/app/views/poll/create_poll_question.js.erb @@ -1,4 +1,8 @@ +<% if @is_insert %> + $("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>'); +<% else %> $("#new_poll_question").html(""); + $("#poll_content").append("
    " + "
    " + "<% if @poll_questions.question_type == 1%>" + @@ -23,4 +27,4 @@ $("#poll_content").append("
    " + "<% end%>" + "
    " + "
    "); - +<% end %> diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 353ec3937..83fa5089b 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -28,7 +28,7 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} #polls div{word-break: break-all;word-wrap: break-word;} .ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; } .ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;} -.ur_title{ padding:20px 0px ; float:left; width:604px; } +.ur_title{ padding:20px 0px ; float:left; width:564px; } .ur_required{ font-weight: bold; color:red;} .ur_inputs{ color:#666;} .ur_table{border-top:1px solid #dcdcdc; background:#fff;} @@ -101,10 +101,13 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .ur_editor02{width:648px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;} a.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; } a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;} + a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;} .ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;} +.ur_icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} +a:hover.ur_icon_add{background:url(images/icons.png) -20px -310px no-repeat;} /***弹框***/ .popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} From 6b45702f8c403a7f5b37393ae26b9cb8cbf664d0 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 28 Jul 2015 11:20:21 +0800 Subject: [PATCH 021/146] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=E5=8F=AF=E4=BB=A5=E8=AE=A9=E5=BC=B9=E5=87=BA=E6=A1=86?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 0a15143fb..b081f4d18 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -2,11 +2,24 @@ - diff --git a/public/javascripts/user.js b/public/javascripts/user.js new file mode 100644 index 000000000..7c7189066 --- /dev/null +++ b/public/javascripts/user.js @@ -0,0 +1,238 @@ +$(function(){ + if($(".top_new").length==0){ + $("#RSide").css("min-height",$("#LSide").height()-30); + } + else{ + $("#RSide").css("min-height",$("#LSide").height()-87); + } + +}); + +//个人动态 +$(function(){ + + function init_editor(params){ + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:"100%",height:"80px", + items:['emoticons'], + afterChange:function(){//按键事件 + nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + }, + afterCreate:function(){ + var toolbar = $("div[class='ke-toolbar']",params.div_form); + $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); + params.toolbar_container.append(toolbar); + } + }).loadPlugin('paste'); + return editor; + } + + function nh_check_field(params){ + var result=true; + if(params.content!=undefined){ + if(params.content.isEmpty()){ + result=false; + } + if(params.content.html()!=params.textarea.html() || params.issubmit==true){ + params.textarea.html(params.content.html()); + params.content.sync(); + if(params.content.isEmpty()){ + params.contentmsg.html('内容不能为空'); + params.contentmsg.css({color:'#ff0000'}); + }else{ + params.contentmsg.html('填写正确'); + params.contentmsg.css({color:'#008000'}); + } + params.contentmsg.show(); + } + } + return result; + } + function init_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = nh_check_field({ + issubmit:true, + content:params.editor, + contentmsg:params.contentmsg, + textarea:params.textarea + }); + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); + } + function nh_reset_form(params){ + params.form[0].reset(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + params.contentmsg.hide(); + } + + KindEditor.ready(function(K){ + $("a[nhname='reply_btn']").live('click',function(){ + var params = {}; + params.kindutil = K; + params.container = $(this).parent('div'); + params.div_form = $("div[nhname='div_form']",params.container); + params.form = $("form",params.div_form); + params.textarea = $("textarea[name='user_notes']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form); + params.submit_btn = $("a[nhname='submit_btn']",params.div_form); + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + toggleAndSettingWordsVal(params.div_form, params.textarea); + }); + params.submit_btn.click(function(){ + params.form.submit(); + }); + params.textarea.data('init',1); + } + params.cancel_btn.click(); + setTimeout(function(){ + if(!params.div_form.is(':hidden')){ + params.textarea.show(); + params.textarea.focus(); + params.textarea.hide(); + } + },300); + + }); + + $("div[nhname='new_message']").each(function(){ + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form",params.div_form); + if(params.form==undefined || params.form.length==0){ + return; + } + params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.cancel_btn = $("#new_message_cancel_btn"); + params.submit_btn = $("#new_message_submit_btn"); + + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + }); + params.submit_btn.click(function(){ + params.form.submit(); + }); + params.textarea.data('init',1); + $(this).show(); + } + }); + }); +}); +function init_list_more_div(params){ + var p=params; + p.exbtn.click(function(){ + var isclose = p.container.data('isclose'); + var hasmore = p.container.data('hasmore'); + if(isclose == '1'){ + $("div[nhname='rec']",p.container).show(); + p.container.data('isclose','0'); + change_status_4_list_more_div(params); + return; + } + if(hasmore == '0'){ + change_status_4_list_more_div(params,'get'); + return; + } + var url = p.container.data('url'); + if($("div[nhname='rec']",p.container).length > 0){ + var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id'); + url += "?lastid="+lastid; + var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time'); + if(lasttime != undefined){ + url += "&lasttime="+lasttime; + } + } + $.ajax( {url:url,dataType:'text',success:function(data){ + var html = $("
    "+data+"
    "); + var lens = $("div[nhname='rec']",html).length; + if(lens < p.size){ + p.container.data('hasmore','0'); + } + if(lens>0){ + var currpage = parseInt(p.container.data('currpage'))+1; + p.container.data('currpage',currpage); + p.container.append(html.html()) + } + change_status_4_list_more_div(params,'get'); + p.div.show(); + }} ); + }); + p.clbtn.click(function(){ + var i=0; + $("div[nhname='rec']",p.container).each(function(){ + i++; + if(i> p.size){ + $(this).hide(); + } + }); + p.container.data('isclose','1'); + change_status_4_list_more_div(params); + }); + p.exbtn.click(); +} +function change_status_4_list_more_div(params,opt){ + var p=params; + if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){ + p.exbtn.click(); + return; + } + var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length; + if( show_lens > p.size ){ + p.clbtn.show(); + }else{ + p.clbtn.hide(); + } + if($("div[nhname='rec']",p.container).length == 0){ + p.exbtn.html(p.nodatamsg); + }else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){ + p.exbtn.html('点击展开更多'); + }else{ + p.exbtn.html('没有更多了'); + } +} +function init_list_more_div_params(div){ + var params = {}; + params.div = div; + params.container = $("div[nhname='container']",div); + params.exbtn = $("a[nhname='expand']",div); + params.clbtn = $("a[nhname='close']",div); + params.size = params.container.data('pagesize'); + params.nodatamsg = params.container.data('nodatamsg'); + if( params.size == undefined ){ + params.size = 13; + } + return params; +} +$(function(){ + $("div[nhname='list_more_div']").each(function(){ + var params = init_list_more_div_params($(this)); + init_list_more_div(params) + }); +}); +//个人动态 end \ No newline at end of file diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 30e6594f5..7c3dad383 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -8,7 +8,7 @@ .icon_female{ background:url(../images/pic_uersall.png) 0 -24px no-repeat; width:15px; height:15px;} .pf_intro{ width:222px; margin-top:5px; color:#696969;word-break: break-all; } .leftbox{ width:230px; padding:10px; padding-right:0px; padding-bottom:5px;background:#fff; margin-bottom:10px; margin-right:10px;} -.pic_members{ background:url(../images/pic_users.jpg) 0 0 no-repeat; display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;} +.pic_members{ display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;} .pic_members:hover{border:1px solid #c9c9c9;} /*新建*/ .top_new{ height:26px; border-bottom:10px solid #eaebed; padding:10px; background:#fff; float:left; margin-left:10px; width:730px; } @@ -89,7 +89,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;} .users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;} .users_ctt input,.users_ctt select,.users_ctt option{ height:26px;} .users_ctt input,.users_ctt textarea{ margin-left:2px;} -.users_ctt textarea{ margin-bottom:none;} +/*.users_ctt textarea{ margin-bottom:nor;}*/ .w450{ width:450px;} .w210{ width:200px;} .w70{ width:70px;} @@ -124,4 +124,12 @@ a:hover.c_lgrey{ color:#3ca5c6;} .newhwork_div textarea{border:1px solid #CCC;} .w460{ width:460px;} -a.hidepic>img{display:none;} \ No newline at end of file +a.hidepic>img{display:none;} + +div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} +span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;} +span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )} +div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} +span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} +span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} +div.ke-toolbar .ke-outline{border:none;} \ No newline at end of file From 6a9cb0db5d51ca5c996f13849a1d94291267b867 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 28 Jul 2015 17:17:52 +0800 Subject: [PATCH 032/146] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E7=94=A8=E6=88=B7=E8=87=AA=E5=B7=B1=E6=9C=AC?= =?UTF-8?q?=E8=BA=AB=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/_project_file_links.html.erb | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index b6d934c64..b644fb9fa 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -29,32 +29,32 @@ <% is_float ||= false %> <% for attachment in attachments %>
    -

    - <%if is_float%> -

    - <% end%> - +

    + <%if is_float%> +

    + <% end%> + <% if options[:length] %> <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%> + <% end %> - <%if is_float%> -
    - <% end%> + <%if is_float%> +
    + <% end%> - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :filename => attachment.filename%> - <% end %> + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename%> + <% end %>
    - <%= h(" - #{attachment.description}") unless attachment.description.blank? %> -
    + <%= h(" - #{attachment.description}") unless attachment.description.blank? %> +
    ( <%= number_to_human_size attachment.filesize %>) @@ -66,6 +66,16 @@ :class => 'delete delete-homework-icon', :remote => true, :title => l(:button_delete) %> + <% elsif attachment.container_type == 'Issue' %> + <% if User.current == attachment.author %> + <%= link_to image_tag('delete.png'), attachment_path(attachment), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :class => 'delete', + #:remote => true, + #:id => "attachments_" + attachment.id.to_s, + :title => l(:button_delete) %> + <% end %> <% else %> <%= link_to image_tag('delete.png'), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, @@ -89,13 +99,13 @@

    <% end %>
    - <% if defined?(thumbnails) && thumbnails %> - <% images = attachments.select(&:thumbnailable?) %> - <% if images.any? %> + <% if defined?(thumbnails) && thumbnails %> + <% images = attachments.select(&:thumbnailable?) %> + <% if images.any? %> <% images.each do |attachment| %>
    <%= thumbnail_issue_tag(attachment) %>
    <% end %> - <% end %> - <% end %> + <% end %> + <% end %>
    From a0a5f3410847752d2c28c535a801976558046546 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 29 Jul 2015 10:07:00 +0800 Subject: [PATCH 033/146] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BB=A5=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 31 +++++++++++++++++++++ app/views/poll/_poll_form.html.erb | 43 +++++++++++++++++++++++++++++- app/views/poll/_show_head.html.erb | 3 +++ 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 8f81bc2c6..dda5b81b2 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -336,6 +336,37 @@ class PollController < ApplicationController end end + + def import_poll + @poll = Poll.find(params[:to_id]) + question_num = @poll.poll_questions.select("max(question_number) question_number").first.question_number + import_poll = Poll.find(params[:import_id]) + import_poll.poll_questions.each_with_index do |question,index| + option = { + :is_necessary => question.is_necessary, + :question_title => question.question_title, + :question_type => question.question_type, + :question_number => question_num + index+1 + } + poll_questions = @poll.poll_questions.new option + for i in 1..question.poll_answers.count + answer = question.poll_answers[i-1][:answer_text] + question_option = { + :answer_position => i, + :answer_text => answer + } + poll_questions.poll_answers.new question_option + end + @poll.poll_questions << poll_questions + end + if @poll.save + @poll = Poll.find(params[:to_id]) + respond_to do |format| + format.js + end + end + end + #重新发布问卷 def republish_poll @poll.poll_questions.each do |poll_question| diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index d784edab3..c5c016583 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -3,6 +3,7 @@ diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 98c148372..c7a615ba3 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -491,3 +491,8 @@ function judgeprojectname(){ } }); } + +//用户反馈 +function submitProjectFeedback() { + $("#project_feedback_form").submit(); +} \ No newline at end of file From e4e99df1135f721da79932e481098af835b687d8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 17:41:10 +0800 Subject: [PATCH 040/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=95=99=E8=A8=80=E7=9A=84=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jours_new.html.erb | 53 +++++++++++++ app/views/users/user_newfeedback.html.erb | 91 +++++------------------ app/views/words/destroy.js.erb | 7 +- public/javascripts/user.js | 1 - public/stylesheets/public.css | 1 + public/stylesheets/users.css | 17 +++-- 6 files changed, 86 insertions(+), 84 deletions(-) create mode 100644 app/views/users/_user_jours_new.html.erb diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb new file mode 100644 index 000000000..81bbce319 --- /dev/null +++ b/app/views/users/_user_jours_new.html.erb @@ -0,0 +1,53 @@ +
    +
    + <%= link_to image_tag(url_to_avatar(jour.user),:width => '46',:height => '46'), user_path(jour.user),:class => "users_pic fl" %> +
    +
    + <%= link_to "#{jour.user.login} : ".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%> +
    +
    +
    + <%= jour.notes.html_safe %> +
    +
    + + <%= time_tag(jour.created_on).html_safe %> + +
    + <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || jour.user == User.current%> + <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %> + <% end %> +
    +
    +
    + + <% fetch_user_leaveWord_reply(jour).each do |reply|%> +
    + <% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %> +
    + <%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %> +
    + <%= link_to "#{reply.user.login} : ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> +  回复:  + <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%> +
    + <%= reply.notes.html_safe %> +
    +
    + + <%= time_tag(reply.created_on).html_safe%> + +
    + <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || reply.user == User.current%> + <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %> + <% end %> +
    +
    +
    +
    + <% end %> +
    \ No newline at end of file diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index de0bfbd60..52fc0aaa2 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,82 +1,27 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>

    用户留言

    - - 表情 - 取消 - 发布 +
    +
    + +

    +
    + 取消 + 留言 +
    +
    +
    -
    - 头像 -
    - 黄井泉 :  -

    上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复删除

    -
    - 50分钟前 -
    -
    - - 表情 - 取消 - 发布 -
    -
    -
    - 头像 -
    - 尹刚尹刚尹刚 -  回复:  - 黄井泉 -

    非常好!删除

    -
    - 30分钟前 -
    -
    -
    -
    - 头像 -
    - 白羽 :  -

    什么时候放暑假啊?回复删除

    -
    - 50分钟前 -
    -
    -
    - 头像 -
    - 黄井泉 :  -

    上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复删除

    -
    - 50分钟前 -
    -
    - 头像 -
    - 尹刚尹刚尹刚 -  回复:  - 黄井泉 -

    非常好!删除

    -
    - 30分钟前 -
    -
    -
    -
    - 头像 -
    - 白羽 :  -

    什么时候放暑假啊?回复删除

    -
    - 50分钟前 -
    -
    - - - -
    + <%if @jour%> + <% @jour.each do |jour|%> + <%= render :partial => 'user_jours_new', :locals => {:jour => jour} %> + <%end%> + <% end%> +
    +
    \ No newline at end of file diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 92e15ab93..c138a7ea7 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -2,9 +2,10 @@ alert('<%=l(:notice_failed_delete)%>'); <% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%> <% if @is_user%> - $("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove(); - var params = init_list_more_div_params($("#nh_messages")); - change_status_4_list_more_div(params); + var destroyedItem = $('#<%=@journal_destroyed.id%>'); + destroyedItem.fadeOut(600,function(){ + destroyedItem.remove(); + }); <% else %> <% if @bid && @jours_count %> $('#jours_count').html("<%= @jours_count %>"); diff --git a/public/javascripts/user.js b/public/javascripts/user.js index 7c7189066..9ad3d1588 100644 --- a/public/javascripts/user.js +++ b/public/javascripts/user.js @@ -10,7 +10,6 @@ $(function(){ //个人动态 $(function(){ - function init_editor(params){ var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"100%",height:"80px", diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d0893ca3d..c1e47c787 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -87,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mt10{ margin-top:10px;} .mt30{ margin-top: 30px;} .mb5{ margin-bottom:5px;} +.mb8{ margin-bottom:8px;} .mb10{ margin-bottom:10px;} .mb20{ margin-bottom:20px;} .pl15{ padding-left:15px;} diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 3e17f1f7b..bdc6db47c 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -24,12 +24,14 @@ a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; dis a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; } .inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;} .inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; } -.message_list_box{ background:#f5f5f5; padding:10px;} -.users_pic{ width:27px; height:27px; border:1px solid #e3e3e3;} +.message_list_box{ background:#f5f5f5; padding:10px;margin-top: 10px;} +.users_pic{ width:46px; height:46px; border:1px solid #e3e3e3;} .users_pic:hover{ border:1px solid #a5a5a5;} +.users_pic_sub{width:32px; height:32px; border:1px solid #e3e3e3;} +.users_pic_sub:hover{ border:1px solid #a5a5a5;} .massage_txt{ max-width:360px; color: #666;word-break:break-all;} .massage_time{ color:#8d8d8d; margin-top:5px;} -.message_list{ border-bottom:1px dashed #c9c9c9; padding-bottom:10px; margin-bottom:10px;} +.message_list{ border-bottom:1px dashed #c9c9c9; margin-bottom:10px;color: #5f5f5f;} .message_list_more{ text-align:center; width:720px;} /*课程动态*/ .line_box{ width:728px; border:1px solid #d9d9d9; padding-bottom:10px;} @@ -124,9 +126,9 @@ a:hover.c_lgrey{ color:#3ca5c6;} .newhwork_div textarea{border:1px solid #CCC;} .w460{ width:460px;} /* 留言新增*/ -.mes_box{ width:600px;} -.mes_box02{ margin-left:80px; border-top:1px dashed #c9c9c9; padding-top:10px;} -.mes_box02_info{ width:500px; margin-left:5px;} +.mes_box{ width:590px;} +.mes_box02{ margin-left:50px; border-top:1px dashed #c9c9c9; padding-top:10px;margin-bottom: 10px;} +.mes_box02_info{ width:540px; margin-left:5px;} .users_r_top{ width:730px; height:40px; background:#eaeaea; margin-bottom:10px;} .users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} @@ -139,4 +141,5 @@ span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )} div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} -div.ke-toolbar .ke-outline{border:none;} \ No newline at end of file +div.ke-toolbar .ke-outline{border:none;} +.cr{clear: right;} \ No newline at end of file From 9bcc633d19c34f0497c64f5467bcdef4d0995388 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 29 Jul 2015 17:56:40 +0800 Subject: [PATCH 041/146] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0tag?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BC=BA=E9=99=B7=201=E3=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0ajax=E8=87=AA=E8=BA=AB=E5=88=B7=E6=96=B0=202=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_project_tag.html.erb | 17 +++-------- app/views/tags/_tag_project_new_name.html.erb | 30 +++++++++++++++++++ app/views/tags/remove_tag.js.erb | 3 ++ app/views/tags/tag_save.js.erb | 4 +++ 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 app/views/tags/_tag_project_new_name.html.erb diff --git a/app/views/tags/_project_tag.html.erb b/app/views/tags/_project_tag.html.erb index ce80e36ab..408f3ba1d 100644 --- a/app/views/tags/_project_tag.html.erb +++ b/app/views/tags/_project_tag.html.erb @@ -1,15 +1,6 @@ -
    - <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> +
    +
    + <%= render :partial => "tags/tag_project_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> +
    -<% if User.current.logged?%> - <%= l(:label_add_tag)%> - -<% end%> diff --git a/app/views/tags/_tag_project_new_name.html.erb b/app/views/tags/_tag_project_new_name.html.erb new file mode 100644 index 000000000..e657071bc --- /dev/null +++ b/app/views/tags/_tag_project_new_name.html.erb @@ -0,0 +1,30 @@ +<% @tags = obj.reload.tag_list %> +<% if non_list_all && @tags.size > 0 %> + +<% else %> + + <% if @tags.size > 0 %> + <% @tags.each do |tag| %> + + <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %> + + <%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %> + + + <% end %> + <% end %> +<% end %> + +<% if User.current.logged?%> + <%= l(:label_add_tag)%> + +<% end%> + + diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb index b8c65c13e..cd56fef1a 100644 --- a/app/views/tags/remove_tag.js.erb +++ b/app/views/tags/remove_tag.js.erb @@ -2,6 +2,9 @@ <% if @object_flag == '3'%> $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% elsif @object_flag == '2'%> +$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); <% elsif @object_flag == '6'%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name', diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb index 74a38c99d..992c472ed 100644 --- a/app/views/tags/tag_save.js.erb +++ b/app/views/tags/tag_save.js.erb @@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); //$('#put-tag-form-issue').hide(); $('#name-issue').val(""); +<% elsif @obj_flag == '2'%> +$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); +$('#tags_name2').val(""); <% elsif @obj_flag == '6'%> <%if @course%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); From d790fb31e497198d906dab090a59eb2a797dfdae Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 18:00:35 +0800 Subject: [PATCH 042/146] =?UTF-8?q?=E5=8C=BF=E5=90=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=9C=A8=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 161791954..4b99224ca 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -4,7 +4,7 @@ class WordsController < ApplicationController include ApplicationHelper before_filter :find_user, :only => [:new, :create, :destroy, :more, :back] def create - if params[:new_form][:user_message].size>0 + if params[:new_form][:user_message].size>0 && User.current.logged? unless params[:user_id].nil? if params[:reference_content] message = params[:new_form][:user_message] + "\n" + params[:reference_content] @@ -31,9 +31,7 @@ class WordsController < ApplicationController # @jour = paginateHelper @jours,10 respond_to do |format| - # format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}} format.js - #format.api { render_api_ok } end end From ce89c7d1191dcc79b8ef6f49fa7af60b8c40f8f6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 18:26:04 +0800 Subject: [PATCH 043/146] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=90=8E=E7=95=8C=E9=9D=A2=E7=9A=84=E5=88=B7=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E7=95=99=E8=A8=80=E7=9A=84=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 20 ++++++++++---------- app/views/users/_user_jours_new.html.erb | 1 + app/views/users/user_newfeedback.html.erb | 21 +++++++++++++-------- config/routes.rb | 1 + 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 4b99224ca..fc723d5d5 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -18,17 +18,10 @@ class WordsController < ApplicationController list = User.find(refer_user_id).add_jour(User.current, message, refer_user_id) end @jour = list.last - # @user.count_new_jour - # if a_message.size > 5 - # @message = a_message[-5, 5] - # else - # @message = a_message - # end - # @message_count = a_message.count end end - # @jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse - # @jour = paginateHelper @jours,10 + jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @jour = paginateHelper jours,10 respond_to do |format| format.js @@ -91,7 +84,6 @@ class WordsController < ApplicationController end respond_to do |format| format.js - #format.api { render_api_ok } end end @@ -204,7 +196,15 @@ class WordsController < ApplicationController flash[:error] = feedback.errors.full_messages[0] redirect_to project_feedback_url(params[:id]) end + end + #给用户留言 + def leave_user_message + @user = User.find(params[:id]) + if params[:new_form][:user_message].size>0 && User.current.logged? && @user + @user.add_jour(User.current, params[:new_form][:user_message]) + end + redirect_to feedback_path(@user) end # add by nwb diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb index 81bbce319..7aa9d97ff 100644 --- a/app/views/users/_user_jours_new.html.erb +++ b/app/views/users/_user_jours_new.html.erb @@ -15,6 +15,7 @@
    <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || jour.user == User.current%> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %> diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 52fc0aaa2..d594e47e4 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -5,22 +5,27 @@
    -
    - -

    -
    - 取消 - 留言 -
    + <%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%> + +

    +
    + 取消 + 留言 + <% end%>
    -
    +
    <%if @jour%> <% @jour.each do |jour|%> <%= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <%end%> <% end%> + +
      + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
    +
    diff --git a/config/routes.rb b/config/routes.rb index 7c1096303..1536340da 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -791,6 +791,7 @@ RedmineApp::Application.routes.draw do match 'words/:id/leave_project_message', :to => 'words#leave_project_message' match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share + post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message" post 'join_in/join', :to => 'courses#join', :as => 'join' delete 'join_in/join', :to => 'courses#unjoin' From 206d1a38f7484d50a0273da56001902643679948 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 30 Jul 2015 09:07:11 +0800 Subject: [PATCH 044/146] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BC=BA=E9=99=B7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/project.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index fa1bec754..621e0c556 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -74,7 +74,11 @@ a:hover.problem_pic{border:1px solid #64bdd9;} .issues_icon{ background:url(../images/public_icon.png) 0 -342px no-repeat; width:16px; height:21px;} .problem_txt{ width:600px; margin-left:10px; color:#777777; } .pro_txt_w{width:610px;} -a.problem_name{ color:#ff5722; } +a.problem_name{ color:#ff5722;max-width: 80px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} a:hover.problem_name{ color:#d33503;} a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;} From 023f51260a2cee67fa1e4bc83e7f5fe74d4d7eb1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 30 Jul 2015 09:12:43 +0800 Subject: [PATCH 045/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2js=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=97=B6=E5=80=99=E7=BB=99=E5=87=BA?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users_new.html.erb | 3 +++ public/stylesheets/users.css | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index ec2c18602..70106e4a3 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -269,6 +269,9 @@ <%= render :partial => 'layouts/new_feedback' %> +