From 580e4d7327e1453bf1adcb2e953b9cb4622dd1b1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 18:55:17 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20160108021447_change_attachment_history.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/migrate/20160108021447_change_attachment_history.rb b/db/migrate/20160108021447_change_attachment_history.rb index f217e595a..daeff9e3d 100644 --- a/db/migrate/20160108021447_change_attachment_history.rb +++ b/db/migrate/20160108021447_change_attachment_history.rb @@ -1,9 +1,9 @@ class ChangeAttachmentHistory < ActiveRecord::Migration def up - attachments = Attachment.where("container_type =?", "Version") - attachments.each do |am| - am.update_attribute(:container_type, "Project") unless am.nil? - end + # attachments = Attachment.where("container_type =?", "Version") + # attachments.each do |am| + # am.update_attribute(:container_type, "Project") unless am.nil? + # end end def down From 5dbad5a672bd218e7bd54663762710c8344c6311 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 19:04:22 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=B7=B2=E5=85=B3=E8=81=94=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 4 ++-- app/views/users/_user_homework_detail.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index e415c42f1..564b27b35 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -148,7 +148,7 @@ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% projects = activity.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 2e492911a..793f5ba39 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -148,7 +148,7 @@ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% projects = activity.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
@@ -300,4 +300,4 @@
+ diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index d2420491c..05077eb26 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -150,7 +150,7 @@ <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<% projects = homework_common.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
From 7c376ed60bad3ae1cd69b954fe4a5fe5f855836f Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 19:15:47 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index e816d1d6e..2f9378dea 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160108093752) do +ActiveRecord::Schema.define(:version => 20160108024752) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -982,8 +982,8 @@ ActiveRecord::Schema.define(:version => 20160108093752) do t.text "notes" t.integer "status" t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false t.string "m_parent_id" t.boolean "is_readed" t.integer "m_reply_count" @@ -1225,9 +1225,8 @@ ActiveRecord::Schema.define(:version => 20160108093752) do t.integer "message_id" t.integer "viewed" t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "org_projects", :force => true do |t| @@ -1693,10 +1692,6 @@ ActiveRecord::Schema.define(:version => 20160108093752) do t.string "extra" end - create_table "temp", :id => false, :force => true do |t| - t.integer "id", :default => 0, :null => false - end - create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false From ef441d3bcad2f6709ee682fe26870eb74ac4d6b0 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 19:43:37 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_user_homework_detail.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 658fa82e6..18277fece 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -147,7 +147,7 @@ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% projects = activity.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 99315d5af..7a357b11c 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -147,7 +147,7 @@ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% projects = activity.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index d2420491c..05077eb26 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -150,7 +150,7 @@ <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<% projects = homework_common.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
From 0ac99571ded9953c7a8a8d426d281412f4e53001 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 19:50:17 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_detail_info.html.erb | 2 +- public/stylesheets/share.css | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/users/_show_detail_info.html.erb b/app/views/users/_show_detail_info.html.erb index ca2bc67db..3849b304c 100644 --- a/app/views/users/_show_detail_info.html.erb +++ b/app/views/users/_show_detail_info.html.erb @@ -5,7 +5,7 @@
-

<%= user %>

+

<%= user %>

diff --git a/public/stylesheets/share.css b/public/stylesheets/share.css index 59b3b63f9..ea45a8b41 100644 --- a/public/stylesheets/share.css +++ b/public/stylesheets/share.css @@ -27,5 +27,4 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg .upload_box{ width:430px; margin:15px auto;} a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center; margin-left:10px; margin-bottom:10px; padding:2px 10px;} a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} -.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} -.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;} \ No newline at end of file +.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} \ No newline at end of file From 5d819625c00f5fa8ec42267c33c59eedc8ed99b5 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 20:09:57 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E4=BD=BF=E7=94=A8=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E4=B8=8A=E4=BC=A0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 +- app/views/files/upload_files_menu.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c6773ef57..bca9de22b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -826,6 +826,6 @@ class FilesController < ApplicationController end def upload_files_menu - p 1 + end end diff --git a/app/views/files/upload_files_menu.js.erb b/app/views/files/upload_files_menu.js.erb index 3e44f5644..e083fac85 100644 --- a/app/views/files/upload_files_menu.js.erb +++ b/app/views/files/upload_files_menu.js.erb @@ -1,5 +1,5 @@ <% if @project %> - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project,:project_attachment_type => 1}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); From 64889fd14a9d548fa5bdc6ef28038d27faa89467 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 20:10:43 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=96=B0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 1 + app/views/files/_course_file.html.erb | 2 +- app/views/files/_project_list.html.erb | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c6773ef57..06ea15357 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -230,6 +230,7 @@ class FilesController < ApplicationController @order = "" @is_remote = false if params[:project_id] + @page = params[:page] ? params[:page].to_i + 1 : 2 @container_type = 0 if params[:sort] params[:sort].split(",").each do |sort_type| diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 5a6ce69ce..9513baab0 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -123,7 +123,7 @@

- <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments, :page=>2} %> + <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/files/_project_list.html.erb b/app/views/files/_project_list.html.erb index d84c1cada..0d4b0f35e 100644 --- a/app/views/files/_project_list.html.erb +++ b/app/views/files/_project_list.html.erb @@ -45,8 +45,17 @@ <% end %> <% end %> -
    - <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%> -
+<% if project_attachments.count == 10%> + <% if params[:action] == 'search_project' %> + + + + <%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%else%> + + <%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%end%> +<% end%> + From 75e2eecc3709fea14b97de121f181816e952196e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 20:23:27 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E7=82=B9=E5=87=BB=E5=BC=80=E8=AF=BE=E5=AD=A6=E6=9C=9F?= =?UTF-8?q?=E6=88=96=E7=BB=93=E6=9D=9F=E5=AD=A6=E6=9C=9F=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E2=80=9C=E5=A4=8D=E5=88=B6=E5=AD=A6=E6=9C=9F?= =?UTF-8?q?=E2=80=9D=E5=85=A5=E5=8F=A3=E8=A6=81=E5=BC=80=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_term_select.html.erb | 5 +++-- app/views/courses/copy_course.js.erb | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_term_select.html.erb b/app/views/courses/_term_select.html.erb index e295e7c94..0bada4c11 100644 --- a/app/views/courses/_term_select.html.erb +++ b/app/views/courses/_term_select.html.erb @@ -12,13 +12,14 @@
+ <%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "term_btn fl" %> -
+ 复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。
diff --git a/app/views/courses/copy_course.js.erb b/app/views/courses/copy_course.js.erb index e31e423ba..ca9e3c1f2 100644 --- a/app/views/courses/copy_course.js.erb +++ b/app/views/courses/copy_course.js.erb @@ -1,3 +1,6 @@ +if(document.getElementById("popbox02")) { + hideModal("#popbox02"); +} $('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>'); showModal('ajax-modal', '730px'); $('#ajax-modal').css('height','530px').css('width','730px'); From 9368e3875cb62e23005a046b68255ff278dcc272 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 20:35:05 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=85=B3=E8=81=94?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=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/views/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_user_homework_detail.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 564b27b35..4f2a7b662 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -173,7 +173,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now time %>  <%=changesets_num project %>提交

+

<%=time_from_now time %>

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 793f5ba39..7c6959935 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -173,7 +173,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now time %>  <%=changesets_num project %>提交

+

<%=time_from_now time %>

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 05077eb26..85e426e92 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -174,7 +174,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now time %>  <%=changesets_num project %>提交

+

<%=time_from_now time %>

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
From a206a1d7f10285967c94fb315fddf9aa6a78acac Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 20:43:33 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/public.css | 46 ++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index dcb1a34f2..51e2ffe67 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -66,16 +66,22 @@ h4{ font-size:14px; color:#3b3b3b;} .ml15{ margin-left:15px;} .ml16{ margin-left: 16px;} .ml20{ margin-left:20px;} +.ml30{margin-left:30px !important;} .ml35{margin-left: 35px;} .ml40{ margin-left:40px;} .ml45{ margin-left:45px;} +.ml48{ margin-left:48px;} +.ml53{margin-left:53px;} .ml55{ margin-left:55px;} +.ml58{margin-left:58px;} .ml30{ margin-left:30px;} .ml38{ margin-left:38px;} .ml60{ margin-left:60px;} .ml160 {margin-left:160px;} .ml80{ margin-left:80px;} +.ml85{margin-left:85px;} .ml90{ margin-left:90px;} +.ml95{margin-left:95px;} .ml100{ margin-left:100px;} .ml110{ margin-left:110px;} .ml125 { margin-left:125px;} @@ -161,6 +167,7 @@ h4{ font-size:14px; color:#3b3b3b;} .h70{ height:70px;} .h150{ height:150px;} .p10 {padding-left:10px; padding-right:10px;} +.mw400 {max-width: 400px;} /* Font & background Color */ a.b_grey{ background: #F5F5F5;} @@ -295,6 +302,7 @@ a:hover.bgreen_n_btn{background:#08a384;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} +.grey_border{border:1px solid #dddddd !important; } /* commonpic */ .pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;} .pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;} @@ -427,8 +435,6 @@ a:hover.search_btn{ background: #0fa9bb;} .searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) 5px -394px no-repeat; display:inline-block; float:left; cursor: pointer;} .searchIconPopup:hover {background:url(../images/homepage_icon.png) 5px -420px no-repeat;} -.searchIcon2{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -273px no-repeat; display:inline-block; float:left; cursor: pointer;} -.searchIcon2:hover {background:url(../images/homepage_icon2.png) -180px -314px no-repeat;} .courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} .sendCourseName {font-size:12px; color:#5f6060;display:inline-block} @@ -497,7 +503,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- .homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} .homepageEditProfile {width:16px; height:16px; border-radius:2px; background-color:#888888; position:absolute; right:5px; bottom:5px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} .homepageEditProfileIcon {background:url(../images/homepage_icon.png) -14px -37px no-repeat; width:16px; height:16px; display:block;} -.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:25px; float:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:25px; float:left;} .homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} .homepageImageSex2 {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -150px no-repeat; float:left;} .homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} @@ -665,6 +671,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} +/*复制课程弹窗*/ +.copyCoursePopup {width:750px !important; height:auto !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} + /*底部*/ #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} .footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} @@ -959,12 +968,31 @@ span.at a{color:#269ac9;text-decoration: none;} .sectionContent li:hover {background-color:#cccccc;} .sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;} .orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;} -/*新课程、项目资源库*/ -.reCon{ margin:5px; width:710px;} -.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} -.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} -.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} -.blueBtn:hover {background-color:#298fbd;} +.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;} + /*文本描述展开高度*/ .maxh360 {max-height: 810px;} .lh18 { line-height: 18px;} + +/*151228样式更新*/ +.menuSetting {background:url(../images/hwork_icon.png) -5px -132px no-repeat; display:inline-block; width:20px; height:20px;} +.boxShadow {box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} +a.greyBtn{ display:inline-block; background:#f2f3f3; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#888888; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.greyBtn{border:1px solid #888888; } +a.blueBtn{ display:inline-block; background:#269ac9; padding:0px 5px; height:20px; border:1px solid #269ac9; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a.blueBtn:hover {background-color:#298fbd;} +a.cancelBtn{ display:inline-block; background:#c1c1c1; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a.cancelBtn:hover {background:#888888;} +a.userFollow{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.userFollow{border:1px solid #888888; } +a.userCancel{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.userCancel{border:1px solid #888888; } +.pAbsolute {position:absolute; z-index:999;} +.userAvatarWrap {width:50px; height:50px; position:relative; border:1px solid #cbcbcb; padding: 2px;} +.userAvatarWrap:hover {border:1px solid #269ac9;} +.mr27 {margin-right:27px;} +.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;} +.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;} +.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;} +.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;} +.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;} \ No newline at end of file From f9bc1efd7cdd9f9b7083bb8b47c50959b5d1cfdf Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 21:18:08 +0800 Subject: [PATCH 11/22] =?UTF-8?q?issue=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99ajax=E5=88=B7=E6=96=B0=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 1 + app/views/issues/add_journal.js.erb | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 91a0bc902..4aa959e81 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -412,6 +412,7 @@ class IssuesController < ApplicationController if params[:issue_id] @issue_id = params[:issue_id] end + @priorities = IssuePriority.active respond_to do |format| format.js end diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index edc8d257b..eca7685cb 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,6 +1,21 @@ <% if @issue_id %> //issue详情中回复 $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); + $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') + sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); + issue_desc_editor = KindEditor.create('#issue_description', + {"width":"85%", + "resizeType":0, + "no_label":true, + "at_id":<%= @issue.project_id%>, + "at_type":"Project", + "autoHeightMode":true, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, + "allowFileManager":true, + "uploadJson":"/kindeditor/upload", + "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); From eab8cc723188db97cc873d095c2b9dc18787be1e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 21:22:36 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=AD=A6=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_copy_course.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/courses/_copy_course.html.erb b/app/views/courses/_copy_course.html.erb index d4debb601..a759946f6 100644 --- a/app/views/courses/_copy_course.html.erb +++ b/app/views/courses/_copy_course.html.erb @@ -37,7 +37,10 @@
    <%=labelled_form_for @new_course do |f| %> -
  • 上传图片 +
  • + + <%= image_tag(url_to_avatar(@new_course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> +
  • From 5d68d185d5c3929a57b4b9a357d5fc409b9a9854 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 21:24:25 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/public.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 51e2ffe67..d39e2600d 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -435,6 +435,8 @@ a:hover.search_btn{ background: #0fa9bb;} .searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) 5px -394px no-repeat; display:inline-block; float:left; cursor: pointer;} .searchIconPopup:hover {background:url(../images/homepage_icon.png) 5px -420px no-repeat;} +.searchIcon2{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -273px no-repeat; display:inline-block; float:left; cursor: pointer;} +.searchIcon2:hover {background:url(../images/homepage_icon2.png) -180px -314px no-repeat;} .courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} .sendCourseName {font-size:12px; color:#5f6060;display:inline-block} @@ -969,6 +971,12 @@ span.at a{color:#269ac9;text-decoration: none;} .sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;} .orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;} .orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;} +/*新课程、项目资源库*/ +.reCon{ margin:5px; width:710px;} +.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} +.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} +.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} +.blueBtn:hover {background-color:#298fbd;} /*文本描述展开高度*/ .maxh360 {max-height: 810px;} From a3370b693c99072d3cf4e66666871d21a3372ec0 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 21:46:10 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 70794fa71..5c7e8dfc3 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -39,17 +39,17 @@ class CoursesController < ApplicationController end limit = 15 course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id) - @orgs_not_in_course = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit) - @org_count = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).count - # if course_org_ids.empty? - # @orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit) - # @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count - # else - # course_org_ids = "(" + course_org_ids.join(',') + ")" - # @orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit) - # @org_count = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count - # end - # @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count + #@orgs_not_in_course = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit) + #@org_count = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).count + if course_org_ids.empty? + @orgs_not_in_course = User.current.organizations.where("name like ?",condition).page((params[:page].to_i || 1)).per(limit) + @org_count = @orgs_not_in_course.count + else + course_org_ids = "(" + course_org_ids.join(',') + ")" + @orgs_not_in_course = User.current.organizations.where("id not in #{course_org_ids} and name like ?", condition).page((params[:page].to_i || 1)).per(limit) + @org_count = @orgs_not_in_course.count + end + @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count @orgs_page = Paginator.new @org_count, limit,params[:page] @hint_flag = params[:hint_flag] #render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json From 8c10ce6feeddc455622447c51fbd2ec2afd6459f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 21:47:42 +0800 Subject: [PATCH 15/22] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87500?= =?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/helpers/application_helper.rb | 13 +++++++++++++ .../organizations/_org_left_subfield_list.html.erb | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 56ef460a0..9b7888bf2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -59,6 +59,19 @@ module ApplicationHelper end end + # 判断组织左侧展开或者隐藏 + def is_hide_org_left obj + if obj.nil? + return true + else + if obj.hide == 0 + return true + else + return false + end + end + end + # Time 2015-03-24 16:38:05 # Author lizanle # Description after save后需要进行资源记录的更新 diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 8280a2be7..31d6925db 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -37,10 +37,10 @@ <% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %> <% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %> <% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %> -
    +
    <%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
    -
    +
    项目 <% if User.current.logged? and User.current.admin_of_org?(organization) %> @@ -54,7 +54,7 @@
-
+
课程 <% if User.current.logged? and User.current.admin_of_org?(organization) %> From bb0a03b3093ae496da29c496b9bf47b8d0d017df Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 22:02:35 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E8=8B=A5=E6=97=A0=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80=EF=BC=8C=E6=88=96=E8=80=85?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E6=97=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E4=BB=BB=E4=BD=95=E4=B8=AA=E4=BA=BA=E7=95=99?= =?UTF-8?q?=E8=A8=80=EF=BC=8C=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA=E7=99=BD?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/destroy.js.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 7194a16a4..6a56249a3 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -6,6 +6,9 @@ destroyedItem.fadeOut(600,function(){ destroyedItem.remove(); }); + <% if @jours_count && @jours_count == 0 %> + $("#user_jour_list").css("padding","0px"); + <% end %> <% else %> <% if @bid && @jours_count %> $('#jours_count').html("<%= @jours_count %>"); From c719fd96a3951167f3e27efe6813b9ea83382c87 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 22:29:57 +0800 Subject: [PATCH 17/22] 0 --- app/controllers/avatar_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index a7c0e7b95..b5c174b0c 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -10,7 +10,7 @@ class AvatarController < ApplicationController unless request.content_type == 'application/octet-stream' @source_type = params[:source_type] @source_id = params[:source_id] - @temp_file = params[:avatar][:image] + @temp_file = params[:avatar][:image] @image_file = @temp_file.original_filename else unless request.raw_post.nil? @@ -23,7 +23,7 @@ class AvatarController < ApplicationController #image_file.force_encoding("UTF-8") if filename.respond_to?(:force_encoding) else @image_file=params[:filename] - end + end @temp_file = StringIO.new(@temp_file) end end From 66c3cee3f88d02837dbcc28af2a709848edb901b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 22:30:04 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5c7e8dfc3..279975c77 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -46,8 +46,8 @@ class CoursesController < ApplicationController @org_count = @orgs_not_in_course.count else course_org_ids = "(" + course_org_ids.join(',') + ")" - @orgs_not_in_course = User.current.organizations.where("id not in #{course_org_ids} and name like ?", condition).page((params[:page].to_i || 1)).per(limit) - @org_count = @orgs_not_in_course.count + @orgs_not_in_course = User.current.organizations.where("organizations.id not in #{course_org_ids} and organizations.name like ?", condition).page((params[:page].to_i || 1)).per(limit) + @org_count = @orgs_not_in_course.empty? ? 0 : @orgs_not_in_course.count end @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count @orgs_page = Paginator.new @org_count, limit,params[:page] From e96496ddcde78ddecabac6557489fa2366df9d65 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Jan 2016 23:01:16 +0800 Subject: [PATCH 19/22] =?UTF-8?q?avatar.js=E5=92=8Cattachments.js=E5=86=B2?= =?UTF-8?q?=E7=AA=81,=E5=AF=BC=E8=87=B4=E5=A4=B4=E5=83=8F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/avatars.js | 395 +++++++++++++++++----------------- 1 file changed, 201 insertions(+), 194 deletions(-) diff --git a/public/javascripts/avatars.js b/public/javascripts/avatars.js index 571ea4982..05b0df2fe 100644 --- a/public/javascripts/avatars.js +++ b/public/javascripts/avatars.js @@ -2,210 +2,217 @@ Copyright (C) 2006-2013 Jean-Philippe Lang Modified by Jianfeng Tao, to upload one avatar for user*/ -function addFile(inputEl, file, eagerUpload) { - - var fileSpan = $('#avatar_file'); - //fileSpan.append( - // $('', { type: 'text', 'class': 'filename readonly', name: 'avatar[filename]', readonly: 'readonly'} ).val(file.name), - // $(' ').attr({ href: "#", 'class': 'remove-upload' }).click(removeFile).toggle(!eagerUpload) - //).appendTo('#avatar_fields'); +(function(){ - if(eagerUpload) { - ajaxUpload(file, fileSpan, inputEl); + function addFile(inputEl, file, eagerUpload) { + + var fileSpan = $('#avatar_file'); + + //fileSpan.append( + // $('', { type: 'text', 'class': 'filename readonly', name: 'avatar[filename]', readonly: 'readonly'} ).val(file.name), + // $(' ').attr({ href: "#", 'class': 'remove-upload' }).click(removeFile).toggle(!eagerUpload) + //).appendTo('#avatar_fields'); + + if(eagerUpload) { + ajaxUpload(file, fileSpan, inputEl); + } + + return 1; } - return 1; -} + function ajaxUpload(file, fileSpan, inputEl) { + + function onLoadstart(e) { + fileSpan.removeClass('ajax-waiting'); + fileSpan.addClass('ajax-loading'); + $('input:submit', $(this).parents('form')).attr('disabled', 'disabled'); + } + + function onProgress(e) { + if(e.lengthComputable) { + this.progressbar( 'value', e.loaded * 100 / e.total ); + } + } + + function actualUpload(file, fileSpan, inputEl) { + + ajaxUpload.uploading++; + + uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),{ + loadstartEventHandler: onLoadstart.bind(progressSpan), + progressEventHandler: onProgress.bind(progressSpan) + }) + .done(function(result) { + progressSpan.progressbar( 'value', 100 ); + progressSpan.progressbar( 'destroy'); + fileSpan.find('input.description, a').css('display', 'inline-block'); + }) + .fail(function(result) { + progressSpan.text(result.statusText); + }).always(function() { + ajaxUpload.uploading--; + fileSpan.removeClass('ajax-loading'); + var form = fileSpan.parents('form'); + + // if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { + // $('input:submit', form).removeAttr('disabled'); + // } + // form.dequeue('upload'); + }); + } + + + var progressSpan = $('#upload_progressbar'); + progressSpan.progressbar(); + fileSpan.addClass('ajax-waiting'); + + var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); + + if(maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload) + actualUpload(file, fileSpan, inputEl); + else + $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, fileSpan, inputEl)); + } -function ajaxUpload(file, fileSpan, inputEl) { + ajaxUpload.uploading = 0; - function onLoadstart(e) { - fileSpan.removeClass('ajax-waiting'); - fileSpan.addClass('ajax-loading'); - $('input:submit', $(this).parents('form')).attr('disabled', 'disabled'); - } + function removeFile() { + $(this).parent('span').remove(); + return false; + } - function onProgress(e) { - if(e.lengthComputable) { - this.progressbar( 'value', e.loaded * 100 / e.total ); + function uploadBlob(blob, uploadUrl, source_type,source_id, options) { + + var actualOptions = $.extend({ + loadstartEventHandler: $.noop, + progressEventHandler: $.noop + }, options); + + uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id; + if (blob instanceof window.File) { + uploadUrl += '&filename=' + encodeURIComponent(blob.name); + } + + return $.ajax(uploadUrl, { + type: 'POST', + contentType: 'application/octet-stream', + beforeSend: function(jqXhr) { + jqXhr.setRequestHeader('Accept', 'application/js'); + }, + xhr: function() { + var xhr = $.ajaxSettings.xhr(); + xhr.upload.onloadstart = actualOptions.loadstartEventHandler; + xhr.upload.onprogress = actualOptions.progressEventHandler; + return xhr; + }, + data: blob, + cache: false, + processData: false + }); } - } - - function actualUpload(file, fileSpan, inputEl) { - - ajaxUpload.uploading++; - - uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),{ - loadstartEventHandler: onLoadstart.bind(progressSpan), - progressEventHandler: onProgress.bind(progressSpan) - }) - .done(function(result) { - progressSpan.progressbar( 'value', 100 ); - progressSpan.progressbar( 'destroy'); - fileSpan.find('input.description, a').css('display', 'inline-block'); - }) - .fail(function(result) { - progressSpan.text(result.statusText); - }).always(function() { - ajaxUpload.uploading--; - fileSpan.removeClass('ajax-loading'); - var form = fileSpan.parents('form'); - - // if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { - // $('input:submit', form).removeAttr('disabled'); - // } - // form.dequeue('upload'); - }); - } - - - var progressSpan = $('#upload_progressbar'); - progressSpan.progressbar(); - fileSpan.addClass('ajax-waiting'); - - var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); - - if(maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload) - actualUpload(file, fileSpan, inputEl); - else - $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, fileSpan, inputEl)); -} - -ajaxUpload.uploading = 0; - -function removeFile() { - $(this).parent('span').remove(); - return false; -} - -function uploadBlob(blob, uploadUrl, source_type,source_id, options) { - - var actualOptions = $.extend({ - loadstartEventHandler: $.noop, - progressEventHandler: $.noop - }, options); - - uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id; - if (blob instanceof window.File) { - uploadUrl += '&filename=' + encodeURIComponent(blob.name); - } - - return $.ajax(uploadUrl, { - type: 'POST', - contentType: 'application/octet-stream', - beforeSend: function(jqXhr) { - jqXhr.setRequestHeader('Accept', 'application/js'); - }, - xhr: function() { - var xhr = $.ajaxSettings.xhr(); - xhr.upload.onloadstart = actualOptions.loadstartEventHandler; - xhr.upload.onprogress = actualOptions.progressEventHandler; - return xhr; - }, - data: blob, - cache: false, - processData: false - }); -} - -function addInputAvatar(inputEl) { + + window.addInputAvatar = function(inputEl) { // var clearedFileInput = $(inputEl).clone().val(''); - if (inputEl.files) { - // upload files using ajax - uploadAndAttachFiles(inputEl.files, inputEl); - // $(inputEl).remove(); - } else { - // browser not supporting the file API, upload on form submission - var avatarId; - var aFilename = inputEl.value.split(/\/|\\/); - avatarId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); - if (avatarId) { - $(inputEl).attr({ name: 'avatar[file]', style: 'display:none;' }).appendTo('#avatar_image'); + if (inputEl.files) { + // upload files using ajax + uploadAndAttachFiles(inputEl.files, inputEl); + // $(inputEl).remove(); + } else { + // browser not supporting the file API, upload on form submission + var avatarId; + var aFilename = inputEl.value.split(/\/|\\/); + avatarId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); + if (avatarId) { + $(inputEl).attr({ name: 'avatar[file]', style: 'display:none;' }).appendTo('#avatar_image'); + } + } + + //clearedFileInput.insertAfter('#avatars_fields'); } - } - - //clearedFileInput.insertAfter('#avatars_fields'); -} - - -function uploadAndAttachFiles(files, inputEl) { - - var maxFileSize = $(inputEl).data('max-file-size'); - var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); - - var sizeExceeded = false; - $.each(files, function() { - if (this.size && maxFileSize && this.size > parseInt(maxFileSize)) {sizeExceeded=true;} - }); - if (sizeExceeded) { - window.alert(maxFileSizeExceeded); - } else { - uploadAndTypeFiles(files,inputEl); - //$.each(files, function() {addFile(inputEl, this, true);}); - } -} - -function uploadAndTypeFiles(files, inputEl) { - - var enableType = $(inputEl).data('file-type'); - var typeSupportrdMessage = $(inputEl).data('type-support-message'); - if (enableType == null || enableType.trim() == "") - { - $.each(files, function() {addFile(inputEl, this, true);}); - return; + + function uploadAndAttachFiles(files, inputEl) { + + var maxFileSize = $(inputEl).data('max-file-size'); + var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); + + var sizeExceeded = false; + $.each(files, function() { + if (this.size && maxFileSize && this.size > parseInt(maxFileSize)) {sizeExceeded=true;} + }); + if (sizeExceeded) { + window.alert(maxFileSizeExceeded); + } else { + uploadAndTypeFiles(files,inputEl); + //$.each(files, function() {addFile(inputEl, this, true);}); + } } - var typeSupported = false; - $.each(files, function() { - var a = this.name.split('.'); - var type = a[a.length-1]; - var rs = enableType.indexOf(type); - if(rs >= 0) {typeSupported = true } - }); - if (typeSupported) { - $.each(files, function() {addFile(inputEl, this, true);}); - } else { - window.alert(typeSupportrdMessage + enableType); + + function uploadAndTypeFiles(files, inputEl) { + + var enableType = $(inputEl).data('file-type'); + var typeSupportrdMessage = $(inputEl).data('type-support-message'); + if (enableType == null || enableType.trim() == "") + { + $.each(files, function() {addFile(inputEl, this, true);}); + return; + } + var typeSupported = false; + $.each(files, function() { + var a = this.name.split('.'); + var type = a[a.length-1]; + var rs = enableType.indexOf(type); + if(rs >= 0) {typeSupported = true } + }); + if (typeSupported) { + $.each(files, function() {addFile(inputEl, this, true);}); + } else { + window.alert(typeSupportrdMessage + enableType); + } } -} - -function handleFileDropEvent(e) { - - $(this).removeClass('fileover'); - blockEventPropagation(e); - - if ($.inArray('Files', e.dataTransfer.types) > -1) { - uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector')); - } -} - -function dragOverHandler(e) { - $(this).addClass('fileover'); - blockEventPropagation(e); -} - -function dragOutHandler(e) { - $(this).removeClass('fileover'); - blockEventPropagation(e); -} - -function setupFileDrop() { - $('#avatar_image').on('click', function(){ - console.log("click"); - }); - if (window.File && window.FileList && window.ProgressEvent && window.FormData) { - - $.event.fixHooks.drop = { props: [ 'dataTransfer' ] }; - - $('form div.box').has('input:file').each(function() { - $(this).on({ - dragover: dragOverHandler, - dragleave: dragOutHandler, - drop: handleFileDropEvent - }); - }); - } -} - -$(document).ready(setupFileDrop); + + + + + function handleFileDropEvent(e) { + $(this).removeClass('fileover'); + blockEventPropagation(e); + + if ($.inArray('Files', e.dataTransfer.types) > -1) { + uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector')); + } + } + + function dragOverHandler(e) { + $(this).addClass('fileover'); + blockEventPropagation(e); + } + + function dragOutHandler(e) { + $(this).removeClass('fileover'); + blockEventPropagation(e); + } + + function setupFileDrop() { + console.log("setupFileDrop"); + $('#avatar_image').on('click', function(){ + console.log("click"); + }); + if (window.File && window.FileList && window.ProgressEvent && window.FormData) { + + $.event.fixHooks.drop = { props: [ 'dataTransfer' ] }; + + $('form div.box').has('input:file').each(function() { + $(this).on({ + dragover: dragOverHandler, + dragleave: dragOutHandler, + drop: handleFileDropEvent + }); + }); + } + } + + $(document).ready(setupFileDrop); +})(); + From 525d1544c2c2a137e907e3e2d4d143d921f5fea1 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 11 Jan 2016 10:43:48 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_resource_share_for_project_popup.html.erb | 8 +++----- app/views/users/search_user_project.js.erb | 9 +-------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb index 2dba25e56..f15c29e90 100644 --- a/app/views/users/_resource_share_for_project_popup.html.erb +++ b/app/views/users/_resource_share_for_project_popup.html.erb @@ -1,10 +1,8 @@ - -
发送到
- @@ -20,13 +18,13 @@ <%= hidden_field_tag(:send_ids, send_ids) %> <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> <% end %>
- <%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %> + <%= form_tag add_exist_file_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
<%= hidden_field_tag(:send_id, send_id) %> diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb index 0632ebb98..5218c22ab 100644 --- a/app/views/users/search_user_project.js.erb +++ b/app/views/users/search_user_project.js.erb @@ -1,11 +1,4 @@ - -//var popupHeight = $(".resourceSharePopup").outerHeight(true); -//$(".resourceSharePopup").css("marginTop",-popupHeight/2); -// -//$("#upload_box").css('left','').css('top',''); -//$("#upload_box").html('<%#= escape_javascript( render :partial => "resource_share_for_project_popup" ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -//$("#upload_box").css('display','block'); -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup' ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); From 500527a12d4386033ab140fcad19de6be0c1912b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 12 Jan 2016 10:42:25 +0800 Subject: [PATCH 21/22] =?UTF-8?q?gitlab=E5=90=8C=E6=AD=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trustie/gitlab/manage_member.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/trustie/gitlab/manage_member.rb b/lib/trustie/gitlab/manage_member.rb index 433b101f5..5c75d9d6e 100644 --- a/lib/trustie/gitlab/manage_member.rb +++ b/lib/trustie/gitlab/manage_member.rb @@ -5,6 +5,8 @@ module Trustie module Gitlab module ManageMember + attr :g + include Helper def self.included(base) base.class_eval { before_create :add_gitlab_member From 83881766b2546217a26213c85f3b1d289e28b78b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 12 Jan 2016 11:01:58 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=80=BB=E6=95=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=8E=B7=E5=8F=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- app/helpers/application_helper.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 1674055ac..0f3724d6f 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -357,7 +357,7 @@ update @changesets = g.commits(@project.gpid, :ref_name => @rev) # @changesets = @repository.latest_changesets(@path, @rev) # @changesets_count = @repository.latest_changesets(@path, @rev).count - @changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count + @changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count @changesets_latest_coimmit = @changesets[0] @properties = @repository.properties(@path, @rev) @repositories = @project.repositories diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9b7888bf2..4fcb43172 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2784,8 +2784,7 @@ int main(int argc, char** argv){ #代码提交数量 def changesets_num project g = Gitlab.client - project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count - # # commits_total_count(project.gpid) + project.gpid.nil? ? 0 : g.project(project.gpid).commit_count # project.changesets.count end end